diff options
author | Marco <marcoambrosini@pm.me> | 2024-08-02 00:26:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-02 00:26:24 +0200 |
commit | d58fc0f64584b618d3f6778ae6ac358de1b63351 (patch) | |
tree | 1f00f0f27a9f08155522a3efe2f314212d9dd11b | |
parent | 251e686563aa509f5de21dbc15e7199ccb254e25 (diff) | |
parent | e10f0dc38b4539db1f8e222d69962a6040fd0e4d (diff) | |
download | nextcloud-server-d58fc0f64584b618d3f6778ae6ac358de1b63351.tar.gz nextcloud-server-d58fc0f64584b618d3f6778ae6ac358de1b63351.zip |
Merge pull request #46923 from nextcloud/feat/update-border-radius-variables
Feat: update border radius variables
-rw-r--r-- | apps/theming/css/default.css | 17 | ||||
-rw-r--r-- | apps/theming/lib/Themes/DefaultTheme.php | 16 | ||||
-rw-r--r-- | apps/theming/tests/Themes/DefaultThemeTest.php | 2 |
3 files changed, 25 insertions, 10 deletions
diff --git a/apps/theming/css/default.css b/apps/theming/css/default.css index 97d8a6e2eee..11041c5c4c7 100644 --- a/apps/theming/css/default.css +++ b/apps/theming/css/default.css @@ -57,12 +57,19 @@ /** Border width for input elements such as text fields and selects */ --border-width-input: 1px; --border-width-input-focused: 2px; - --border-radius: 3px; - --border-radius-large: 10px; + + /* Border radii (new values) */ + --border-radius-small: 4px; /* For smaller elements */ + --border-radius-element: 8px; /* For interactive elements such as buttons, input, navigation and list items */ + --border-radius-container: 12px; /* For smaller containers like action menus */ + --border-radius-container-large: 16px; /* For larger containers like body or modals */ + + /* Border radii (deprecated) */ + --border-radius: var(--border-radius-small); + --border-radius-large: var(--border-radius-element); --border-radius-rounded: 28px; - /* Border radius of interactive elements such as buttons, input, navigation and list items. Available since Nextcloud 30. */ - --border-radius-element: 8px; --border-radius-pill: 100px; + --default-clickable-area: 34px; --clickable-area-large: 48px; --clickable-area-small: 24px; @@ -73,7 +80,7 @@ --sidebar-min-width: 300px; --sidebar-max-width: 500px; /* Border radius of the body container */ - --body-container-radius: calc(var(--default-grid-baseline) * 3); + --body-container-radius: var(--border-radius-container-large); /* Margin of the body container */ --body-container-margin: calc(var(--default-grid-baseline) * 2); /* Height of the body container to fully fill the view port */ diff --git a/apps/theming/lib/Themes/DefaultTheme.php b/apps/theming/lib/Themes/DefaultTheme.php index ca4df747421..47a54eb0e1a 100644 --- a/apps/theming/lib/Themes/DefaultTheme.php +++ b/apps/theming/lib/Themes/DefaultTheme.php @@ -172,11 +172,17 @@ class DefaultTheme implements ITheme { // Border width for input elements such as text fields and selects '--border-width-input' => '1px', '--border-width-input-focused' => '2px', - '--border-radius' => '3px', - '--border-radius-large' => '10px', + + // Border radii (new values) + '--border-radius-small' => '4px', // For smaller elements + '--border-radius-element' => '8px', // For interactive elements such as buttons, input, navigation and list items + '--border-radius-container' => '12px', // For smaller containers like action menus + '--border-radius-container-large' => '16px', // For bigger containers like body or modals + + // Border radii (deprecated) + '--border-radius' => 'var(--border-radius-small)', + '--border-radius-large' => 'var(--border-radius-element)', '--border-radius-rounded' => '28px', - '--border-radius-element' => '8px', - // pill-style button, value is large so big buttons also have correct roundness '--border-radius-pill' => '100px', '--default-clickable-area' => '34px', @@ -193,7 +199,7 @@ class DefaultTheme implements ITheme { '--sidebar-max-width' => '500px', // Border radius of the body container - '--body-container-radius' => 'calc(var(--default-grid-baseline) * 3)', + '--body-container-radius' => 'var(--border-radius-container-large)', // Margin of the body container '--body-container-margin' => 'calc(var(--default-grid-baseline) * 2)', // Height of the body container to fully fill the view port diff --git a/apps/theming/tests/Themes/DefaultThemeTest.php b/apps/theming/tests/Themes/DefaultThemeTest.php index 91b7d8887d7..d11237e774c 100644 --- a/apps/theming/tests/Themes/DefaultThemeTest.php +++ b/apps/theming/tests/Themes/DefaultThemeTest.php @@ -152,6 +152,8 @@ class DefaultThemeTest extends AccessibleThemeTestCase { $fallbackCss = file_get_contents(__DIR__ . '/../../css/default.css'); // Remove comments $fallbackCss = preg_replace('/\s*\/\*[\s\S]*?\*\//m', '', $fallbackCss); + // Remove blank lines + $fallbackCss = preg_replace('/\s*\n\n/', "\n", $fallbackCss); $this->assertEquals($css, $fallbackCss); } |