From 687f18d78ed811055960ff7005ffc7e599053381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Queiruga?= Date: Thu, 25 Jun 2020 17:48:24 +0200 Subject: [PATCH] Consolidate CSS theming values in a single file --- war/src/main/js/widgets/add/addform.less | 2 +- war/src/main/js/widgets/config/tabbar.less | 2 +- war/src/main/less/abstracts/font.less | 12 ------------ .../main/less/abstracts/{colors.less => theme.less} | 12 ++++++++++++ war/src/main/less/base/layout-commons.less | 2 +- war/src/main/less/base/style.less | 4 +--- war/src/main/less/base/typography.less | 3 +-- war/src/main/less/modules/buttons.less | 3 +-- war/src/main/less/modules/icons.less | 2 +- war/src/main/less/modules/page-footer.less | 3 +-- war/src/main/less/modules/page-header.less | 3 +-- war/src/main/less/modules/side-panel-tasks.less | 3 +-- war/src/main/less/modules/side-panel-widgets.less | 3 +-- war/src/main/less/ui-refresh-overrides.less | 3 +-- 14 files changed, 24 insertions(+), 33 deletions(-) delete mode 100644 war/src/main/less/abstracts/font.less rename war/src/main/less/abstracts/{colors.less => theme.less} (92%) diff --git a/war/src/main/js/widgets/add/addform.less b/war/src/main/js/widgets/add/addform.less index 1244ad9d8ad3..0106b3a993bc 100644 --- a/war/src/main/js/widgets/add/addform.less +++ b/war/src/main/js/widgets/add/addform.less @@ -1,4 +1,4 @@ -@import '../../../less/abstracts/font.less'; +@import '../../../less/abstracts/theme.less'; #add-item-panel { diff --git a/war/src/main/js/widgets/config/tabbar.less b/war/src/main/js/widgets/config/tabbar.less index 0eacf4842196..a396d968fa4b 100644 --- a/war/src/main/js/widgets/config/tabbar.less +++ b/war/src/main/js/widgets/config/tabbar.less @@ -2,7 +2,7 @@ * Tab bar specific rules. */ -@import '../../../less/abstracts/font.less'; +@import '../../../less/abstracts/theme.less'; .jenkins-config-widgets { position: relative; diff --git a/war/src/main/less/abstracts/font.less b/war/src/main/less/abstracts/font.less deleted file mode 100644 index c9b4ca0c3e19..000000000000 --- a/war/src/main/less/abstracts/font.less +++ /dev/null @@ -1,12 +0,0 @@ -:root { - // Font related properties - --font-family-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; - --font-size-base: 1rem; // 16px - --font-size-sm: 0.875rem; // 14px - --font-size-xs: 0.75rem; // 12px - --font-size-monospace: 0.95em; - - // Line height - --line-height-base: 1.5; - --line-height-heading: 1.2; -} diff --git a/war/src/main/less/abstracts/colors.less b/war/src/main/less/abstracts/theme.less similarity index 92% rename from war/src/main/less/abstracts/colors.less rename to war/src/main/less/abstracts/theme.less index 1b34425b008d..a58d3c7168db 100644 --- a/war/src/main/less/abstracts/colors.less +++ b/war/src/main/less/abstracts/theme.less @@ -1,4 +1,16 @@ :root { + // Font related properties + --font-family-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + --font-size-base: 1rem; // 16px + --font-size-sm: 0.875rem; // 14px + --font-size-xs: 0.75rem; // 12px + --font-size-monospace: 0.95em; + + // Line height + --line-height-base: 1.5; + --line-height-heading: 1.2; + + // Color palette --white: #fff; --very-light-grey: #f0f0f0; --black: #333; diff --git a/war/src/main/less/base/layout-commons.less b/war/src/main/less/base/layout-commons.less index 8195b82d1df4..8f85da0e91e8 100644 --- a/war/src/main/less/base/layout-commons.less +++ b/war/src/main/less/base/layout-commons.less @@ -1,4 +1,4 @@ -@import '../abstracts/font.less'; +@import '../abstracts/theme.less'; html { position: relative; diff --git a/war/src/main/less/base/style.less b/war/src/main/less/base/style.less index 138f146ad7bf..1135a38b492f 100644 --- a/war/src/main/less/base/style.less +++ b/war/src/main/less/base/style.less @@ -22,9 +22,7 @@ * THE SOFTWARE. */ -@import '../abstracts/font.less'; -@import '../abstracts/colors.less'; - +@import '../abstracts/theme.less'; /* Panel */ diff --git a/war/src/main/less/base/typography.less b/war/src/main/less/base/typography.less index a94ee88d1acb..cede26a6254a 100644 --- a/war/src/main/less/base/typography.less +++ b/war/src/main/less/base/typography.less @@ -1,5 +1,4 @@ -@import '../abstracts/font.less'; -@import '../abstracts/colors.less'; +@import '../abstracts/theme.less'; body, p { diff --git a/war/src/main/less/modules/buttons.less b/war/src/main/less/modules/buttons.less index f5520e2daad9..a292fcc27d67 100644 --- a/war/src/main/less/modules/buttons.less +++ b/war/src/main/less/modules/buttons.less @@ -1,5 +1,4 @@ -@import '../abstracts/colors.less'; -@import '../abstracts/font.less'; +@import '../abstracts/theme.less'; // Button: variant mixins diff --git a/war/src/main/less/modules/icons.less b/war/src/main/less/modules/icons.less index df5388990dd9..dc9e4fa949d6 100644 --- a/war/src/main/less/modules/icons.less +++ b/war/src/main/less/modules/icons.less @@ -1,4 +1,4 @@ -@import '../abstracts/colors.less'; +@import '../abstracts/theme.less'; .icon-help { color: var(--primary); diff --git a/war/src/main/less/modules/page-footer.less b/war/src/main/less/modules/page-footer.less index 2c4ea8d53c66..e3a917f6680b 100644 --- a/war/src/main/less/modules/page-footer.less +++ b/war/src/main/less/modules/page-footer.less @@ -1,5 +1,4 @@ -@import '../abstracts/font.less'; -@import '../abstracts/colors.less'; +@import '../abstracts/theme.less'; .page-footer { background-color: var(--breadcrumbs-bg); diff --git a/war/src/main/less/modules/page-header.less b/war/src/main/less/modules/page-header.less index d69283ef949e..fcaaf4a1852f 100644 --- a/war/src/main/less/modules/page-header.less +++ b/war/src/main/less/modules/page-header.less @@ -1,5 +1,4 @@ -@import "../abstracts/font.less"; -@import "../abstracts/colors.less"; +@import "../abstracts/theme.less"; .page-header { display: block; diff --git a/war/src/main/less/modules/side-panel-tasks.less b/war/src/main/less/modules/side-panel-tasks.less index 7e92dc26853c..1ee2896c3176 100644 --- a/war/src/main/less/modules/side-panel-tasks.less +++ b/war/src/main/less/modules/side-panel-tasks.less @@ -1,5 +1,4 @@ -@import '../abstracts/colors.less'; -@import '../abstracts/font.less'; +@import '../abstracts/theme.less'; #tasks { margin-bottom: 20px; diff --git a/war/src/main/less/modules/side-panel-widgets.less b/war/src/main/less/modules/side-panel-widgets.less index acb40317fcd3..88f7d1ca3faf 100644 --- a/war/src/main/less/modules/side-panel-widgets.less +++ b/war/src/main/less/modules/side-panel-widgets.less @@ -1,5 +1,4 @@ -@import '../abstracts/colors.less'; -@import '../abstracts/font.less'; +@import '../abstracts/theme.less'; #side-panel .pane-frame { border-radius: 0; diff --git a/war/src/main/less/ui-refresh-overrides.less b/war/src/main/less/ui-refresh-overrides.less index d4be67d9fc5a..83436822ef59 100644 --- a/war/src/main/less/ui-refresh-overrides.less +++ b/war/src/main/less/ui-refresh-overrides.less @@ -1,5 +1,4 @@ -@import "./abstracts/colors.less"; -@import "./abstracts/font.less"; +@import "./abstracts/theme.less"; .ui-refresh { .page-header {