aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-07-02 22:29:43 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-07-04 18:29:17 +0200
commitc9e8cdd7ad4bdff4a25d5eb5dce5c056fc93de66 (patch)
tree02899e08872ab14db45eb2aff380b7a2e8e87a03
parent7e663301ff9461f3a4abc06c3ee80651504bfbe5 (diff)
downloadnextcloud-server-c9e8cdd7ad4bdff4a25d5eb5dce5c056fc93de66.tar.gz
nextcloud-server-c9e8cdd7ad4bdff4a25d5eb5dce5c056fc93de66.zip
feat(theming): Provide `body-container-` variables through theming
* Provide the body container height, radius and margin as theming variables. * Remove unused old variables (`header-menu-profile-item-height` and `list-max-width`) * Fix comment about breakpoint JS location Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
-rw-r--r--apps/theming/css/default.css14
-rw-r--r--apps/theming/lib/Themes/DefaultTheme.php18
-rw-r--r--core/css/apps.scss15
3 files changed, 24 insertions, 23 deletions
diff --git a/apps/theming/css/default.css b/apps/theming/css/default.css
index 3a3e0770118..0ce34bc7a02 100644
--- a/apps/theming/css/default.css
+++ b/apps/theming/css/default.css
@@ -49,6 +49,8 @@
--color-border-maxcontrast: #7d7d7d;
--font-face: system-ui, -apple-system, 'Segoe UI', Roboto, Oxygen-Sans, Cantarell, Ubuntu, 'Helvetica Neue', 'Noto Sans', 'Liberation Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--default-font-size: 15px;
+ /* 1.5 x font-size for accessibility */
+ --default-line-height: 24px;
--animation-quick: 100ms;
--animation-slow: 300ms;
/** Border width for input elements such as text fields and selects */
@@ -63,16 +65,18 @@
--default-clickable-area: 34px;
--clickable-area-large: 48px;
--clickable-area-small: 24px;
- --default-line-height: 24px;
--default-grid-baseline: 4px;
--header-height: 50px;
+ --header-menu-item-height: 44px;
--navigation-width: 300px;
--sidebar-min-width: 300px;
--sidebar-max-width: 500px;
- --list-min-width: 200px;
- --list-max-width: 300px;
- --header-menu-item-height: 44px;
- --header-menu-profile-item-height: 66px;
+ /* Border radius of the body container */
+ --body-container-radius: calc(var(--default-grid-baseline) * 3);
+ /* 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 */
+ --body-height: calc(100% - env(safe-area-inset-bottom) - var(--header-height) - var(--body-container-margin));
--breakpoint-mobile: 1024px;
--background-invert-if-dark: no;
--background-invert-if-bright: invert(100%);
diff --git a/apps/theming/lib/Themes/DefaultTheme.php b/apps/theming/lib/Themes/DefaultTheme.php
index e81c01f1f83..9c093969e76 100644
--- a/apps/theming/lib/Themes/DefaultTheme.php
+++ b/apps/theming/lib/Themes/DefaultTheme.php
@@ -160,6 +160,8 @@ class DefaultTheme implements ITheme {
'--font-face' => "system-ui, -apple-system, 'Segoe UI', Roboto, Oxygen-Sans, Cantarell, Ubuntu, 'Helvetica Neue', 'Noto Sans', 'Liberation Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'",
'--default-font-size' => '15px',
+ // 1.5 * font-size for accessibility
+ '--default-line-height' => '24px',
// TODO: support "(prefers-reduced-motion)"
'--animation-quick' => '100ms',
@@ -179,20 +181,24 @@ class DefaultTheme implements ITheme {
'--default-clickable-area' => '34px',
'--clickable-area-large' => '48px',
'--clickable-area-small' => '24px',
- '--default-line-height' => '24px',
+
'--default-grid-baseline' => '4px',
// various structure data
'--header-height' => '50px',
+ '--header-menu-item-height' => '44px',
'--navigation-width' => '300px',
'--sidebar-min-width' => '300px',
'--sidebar-max-width' => '500px',
- '--list-min-width' => '200px',
- '--list-max-width' => '300px',
- '--header-menu-item-height' => '44px',
- '--header-menu-profile-item-height' => '66px',
- // mobile. Keep in sync with core/js/js.js
+ // Border radius of the body container
+ '--body-container-radius' => 'calc(var(--default-grid-baseline) * 3)',
+ // 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
+ '--body-height' => 'calc(100% - env(safe-area-inset-bottom) - var(--header-height) - var(--body-container-margin))',
+
+ // mobile. Keep in sync with core/src/init.js
'--breakpoint-mobile' => '1024px',
'--background-invert-if-dark' => 'no',
'--background-invert-if-bright' => 'invert(100%)',
diff --git a/core/css/apps.scss b/core/css/apps.scss
index a52d6e5c97d..a75e23441ed 100644
--- a/core/css/apps.scss
+++ b/core/css/apps.scss
@@ -7,20 +7,11 @@
@use 'sass:math';
@import 'functions';
-
-:root {
- /* - 2px is required for making it look nice */
- --border-radius-rounded: calc(var(--default-clickable-area) / 2 + var(--default-grid-baseline) * 2 - 2px);
-
- --body-container-radius: calc(var(--default-grid-baseline) * 3);
- --body-container-margin: calc(var(--default-grid-baseline) * 2);
- --body-height: calc(100% - env(safe-area-inset-bottom) - 50px - var(--body-container-margin));
-}
-
@media screen and (max-width: variables.$breakpoint-mobile) {
+ // Make the body full width on mobile
:root {
- --body-container-margin: 0px;
- --body-container-radius: 0px;
+ --body-container-margin: 0px !important;
+ --body-container-radius: 0px !important;
}
}