Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: update border radius variables #46923

Merged
merged 2 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions apps/theming/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 */
Expand Down
16 changes: 11 additions & 5 deletions apps/theming/lib/Themes/DefaultTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,17 @@ public function getCSSVariables(): array {
// 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',
Expand All @@ -193,7 +199,7 @@ public function getCSSVariables(): array {
'--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
Expand Down
2 changes: 2 additions & 0 deletions apps/theming/tests/Themes/DefaultThemeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ public function testThemindDisabledFallbackCss() {
$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);
}
Expand Down
Loading