From 6d331ad7edffda8ade54047c3e6222e936c67aab Mon Sep 17 00:00:00 2001 From: Rebeka Dekany <50901361+rebekadekany@users.noreply.github.com> Date: Wed, 27 Mar 2024 11:56:17 +0100 Subject: [PATCH] Merge pull request #17560 from overleaf/rd-boostrap-files [web] Update Sass folder structure GitOrigin-RevId: 03ac5835e46a3a464f31fba386e2f81f4bf25c99 --- .../bootstrap-5/abstracts/all.scss | 2 ++ .../buttons.scss => abstracts/mixins.scss} | 2 ++ .../abstracts/variable-overrides.scss | 21 +++++++++++++++++++ .../bootstrap-5/{scss => }/bootstrap.scss | 6 +++++- .../bootstrap-5/components/all.scss | 3 +++ .../{scss => }/components/button.scss | 0 .../{scss => }/components/dropdown-menu.scss | 0 .../{scss => }/components/split-button.scss | 0 .../bootstrap-5/css-variables/themes/ieee.css | 1 - .../css-variables/themes/light.css | 1 - .../bootstrap-5/foundations/all.scss | 5 +++++ .../bootstrap-5/main-ieee-style.scss | 3 --- .../bootstrap-5/main-light-style.scss | 1 - .../stylesheets/bootstrap-5/main-style.scss | 14 ++----------- .../scss/bootstrap-rule-overrides.scss | 3 --- .../scss/bootstrap-variable-overrides.scss | 8 ------- .../bootstrap-variable-overrides/buttons.scss | 9 -------- .../bootstrap-variable-overrides/fonts.scss | 11 ---------- 18 files changed, 40 insertions(+), 50 deletions(-) create mode 100644 services/web/frontend/stylesheets/bootstrap-5/abstracts/all.scss rename services/web/frontend/stylesheets/bootstrap-5/{scss/bootstrap-rule-overrides/buttons.scss => abstracts/mixins.scss} (99%) create mode 100644 services/web/frontend/stylesheets/bootstrap-5/abstracts/variable-overrides.scss rename services/web/frontend/stylesheets/bootstrap-5/{scss => }/bootstrap.scss (92%) create mode 100644 services/web/frontend/stylesheets/bootstrap-5/components/all.scss rename services/web/frontend/stylesheets/bootstrap-5/{scss => }/components/button.scss (100%) rename services/web/frontend/stylesheets/bootstrap-5/{scss => }/components/dropdown-menu.scss (100%) rename services/web/frontend/stylesheets/bootstrap-5/{scss => }/components/split-button.scss (100%) delete mode 100644 services/web/frontend/stylesheets/bootstrap-5/css-variables/themes/ieee.css delete mode 100644 services/web/frontend/stylesheets/bootstrap-5/css-variables/themes/light.css create mode 100644 services/web/frontend/stylesheets/bootstrap-5/foundations/all.scss delete mode 100644 services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-rule-overrides.scss delete mode 100644 services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-variable-overrides.scss delete mode 100644 services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-variable-overrides/buttons.scss delete mode 100644 services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-variable-overrides/fonts.scss diff --git a/services/web/frontend/stylesheets/bootstrap-5/abstracts/all.scss b/services/web/frontend/stylesheets/bootstrap-5/abstracts/all.scss new file mode 100644 index 0000000000..2906efe1aa --- /dev/null +++ b/services/web/frontend/stylesheets/bootstrap-5/abstracts/all.scss @@ -0,0 +1,2 @@ +@import 'mixins'; +@import 'variable-overrides'; diff --git a/services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-rule-overrides/buttons.scss b/services/web/frontend/stylesheets/bootstrap-5/abstracts/mixins.scss similarity index 99% rename from services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-rule-overrides/buttons.scss rename to services/web/frontend/stylesheets/bootstrap-5/abstracts/mixins.scss index 13ead4ad98..adc531d47c 100644 --- a/services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-rule-overrides/buttons.scss +++ b/services/web/frontend/stylesheets/bootstrap-5/abstracts/mixins.scss @@ -1,3 +1,5 @@ +// Button + @mixin ol-button-size( $font-size, $line-height, diff --git a/services/web/frontend/stylesheets/bootstrap-5/abstracts/variable-overrides.scss b/services/web/frontend/stylesheets/bootstrap-5/abstracts/variable-overrides.scss new file mode 100644 index 0000000000..9f460e2025 --- /dev/null +++ b/services/web/frontend/stylesheets/bootstrap-5/abstracts/variable-overrides.scss @@ -0,0 +1,21 @@ +// Overrides for Bootstrap 5's default Sass variables + +// Fonts +$font-family-sans-serif: 'Noto Sans', sans-serif; +$font-family-serif: 'Merriweather', serif; +$font-family-monospace: 'DM Mono', monospace; +$font-size-base: $default-font-size; +$line-height-base: $default-line-height; + +// Buttons +$btn-font-family: $font-family-sans-serif; +$btn-font-weight: 700; +$btn-padding-x: $spacing-06; +$btn-padding-y: $spacing-02; +$btn-border-radius: $border-radius-full; +$btn-border-radius-lg: $border-radius-full; +$btn-border-radius-sm: $border-radius-full; + +// Colors +$primary: $bg-accent-01; +$secondary: $bg-light-primary; diff --git a/services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap.scss b/services/web/frontend/stylesheets/bootstrap-5/bootstrap.scss similarity index 92% rename from services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap.scss rename to services/web/frontend/stylesheets/bootstrap-5/bootstrap.scss index b1d8bab869..354d9b891c 100644 --- a/services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap.scss +++ b/services/web/frontend/stylesheets/bootstrap-5/bootstrap.scss @@ -7,7 +7,8 @@ // Bootstrap itself because Bootstrap uses them to create the CSS variables it // uses, and in calculations to determine, for example, what color text to use // on a button based on contrast. -@import 'bootstrap-variable-overrides'; +@import 'abstracts/all'; +@import 'foundations/all'; // Include remainder of required Bootstrap stylesheets (including any separate color mode stylesheets) @import 'bootstrap-5/scss/variables'; @@ -31,3 +32,6 @@ @import 'bootstrap-5/scss/modal'; @import 'bootstrap-5/scss/utilities/api'; @import 'bootstrap-5/scss/spinners'; + +// Components custom style +@import 'components/all'; diff --git a/services/web/frontend/stylesheets/bootstrap-5/components/all.scss b/services/web/frontend/stylesheets/bootstrap-5/components/all.scss new file mode 100644 index 0000000000..09ed41b29a --- /dev/null +++ b/services/web/frontend/stylesheets/bootstrap-5/components/all.scss @@ -0,0 +1,3 @@ +@import 'button'; +@import 'dropdown-menu'; +@import 'split-button'; diff --git a/services/web/frontend/stylesheets/bootstrap-5/scss/components/button.scss b/services/web/frontend/stylesheets/bootstrap-5/components/button.scss similarity index 100% rename from services/web/frontend/stylesheets/bootstrap-5/scss/components/button.scss rename to services/web/frontend/stylesheets/bootstrap-5/components/button.scss diff --git a/services/web/frontend/stylesheets/bootstrap-5/scss/components/dropdown-menu.scss b/services/web/frontend/stylesheets/bootstrap-5/components/dropdown-menu.scss similarity index 100% rename from services/web/frontend/stylesheets/bootstrap-5/scss/components/dropdown-menu.scss rename to services/web/frontend/stylesheets/bootstrap-5/components/dropdown-menu.scss diff --git a/services/web/frontend/stylesheets/bootstrap-5/scss/components/split-button.scss b/services/web/frontend/stylesheets/bootstrap-5/components/split-button.scss similarity index 100% rename from services/web/frontend/stylesheets/bootstrap-5/scss/components/split-button.scss rename to services/web/frontend/stylesheets/bootstrap-5/components/split-button.scss diff --git a/services/web/frontend/stylesheets/bootstrap-5/css-variables/themes/ieee.css b/services/web/frontend/stylesheets/bootstrap-5/css-variables/themes/ieee.css deleted file mode 100644 index f7b314d329..0000000000 --- a/services/web/frontend/stylesheets/bootstrap-5/css-variables/themes/ieee.css +++ /dev/null @@ -1 +0,0 @@ -/* IEEE CSS variable overrides go in here */ diff --git a/services/web/frontend/stylesheets/bootstrap-5/css-variables/themes/light.css b/services/web/frontend/stylesheets/bootstrap-5/css-variables/themes/light.css deleted file mode 100644 index 52c423e1a4..0000000000 --- a/services/web/frontend/stylesheets/bootstrap-5/css-variables/themes/light.css +++ /dev/null @@ -1 +0,0 @@ -/* Light theme CSS variable overrides go in here */ diff --git a/services/web/frontend/stylesheets/bootstrap-5/foundations/all.scss b/services/web/frontend/stylesheets/bootstrap-5/foundations/all.scss new file mode 100644 index 0000000000..9151901f5e --- /dev/null +++ b/services/web/frontend/stylesheets/bootstrap-5/foundations/all.scss @@ -0,0 +1,5 @@ +@import 'border-radius'; +@import 'colors'; +@import 'elevation'; +@import 'spacing'; +@import 'typography'; diff --git a/services/web/frontend/stylesheets/bootstrap-5/main-ieee-style.scss b/services/web/frontend/stylesheets/bootstrap-5/main-ieee-style.scss index 7d2b585e49..0c2708007b 100644 --- a/services/web/frontend/stylesheets/bootstrap-5/main-ieee-style.scss +++ b/services/web/frontend/stylesheets/bootstrap-5/main-ieee-style.scss @@ -1,7 +1,4 @@ @import 'main-style'; -// IEEE-specific theme overrides -@import 'css-variables/themes/ieee'; - // IEEE-specific rules $ieee-wedge: 30px; diff --git a/services/web/frontend/stylesheets/bootstrap-5/main-light-style.scss b/services/web/frontend/stylesheets/bootstrap-5/main-light-style.scss index 294c73bdad..2463ed9611 100644 --- a/services/web/frontend/stylesheets/bootstrap-5/main-light-style.scss +++ b/services/web/frontend/stylesheets/bootstrap-5/main-light-style.scss @@ -1,4 +1,3 @@ @import 'main-style'; -@import 'css-variables/themes/light'; $is-overleaf-light: true; diff --git a/services/web/frontend/stylesheets/bootstrap-5/main-style.scss b/services/web/frontend/stylesheets/bootstrap-5/main-style.scss index b259356282..8bd523b597 100644 --- a/services/web/frontend/stylesheets/bootstrap-5/main-style.scss +++ b/services/web/frontend/stylesheets/bootstrap-5/main-style.scss @@ -27,15 +27,5 @@ $is-overleaf-light: false; // Bootstrap's Sass variable must use @import rather than @use because // Bootstrap relies on its variables, mixins etc. all being global. -// Include Bootstrap 5 itself, plus overrides of its Sass variable -@import 'scss/bootstrap'; - -// Override and extend Bootstrap styles. This can include overriding CSS -// variables in the usual CSS way, and can also refer to (but not override) -// Bootstrap Sass variables. -@import 'scss/bootstrap-rule-overrides'; - -// Components -@import 'scss/components/button'; -@import 'scss/components/dropdown-menu'; -@import 'scss/components/split-button'; +// Include Bootstrap 5 itself, plus overrides and extend Bootstrap styles. +@import 'bootstrap'; diff --git a/services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-rule-overrides.scss b/services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-rule-overrides.scss deleted file mode 100644 index 73a9da1c6e..0000000000 --- a/services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-rule-overrides.scss +++ /dev/null @@ -1,3 +0,0 @@ -// This file is included after Bootstrap and is used to override non-default -// Bootstrap variables and styles -@import 'bootstrap-rule-overrides/buttons'; diff --git a/services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-variable-overrides.scss b/services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-variable-overrides.scss deleted file mode 100644 index 1325779962..0000000000 --- a/services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-variable-overrides.scss +++ /dev/null @@ -1,8 +0,0 @@ -// This file is included before Bootstrap and is used to override Bootstrap -// default variables and styles -@import 'bootstrap-variable-overrides/fonts'; -@import 'bootstrap-variable-overrides/buttons'; - -// This isn't great but is necessary to persuade Bootstrap to render white text -// on our green buttons -$min-contrast-ratio: 3; diff --git a/services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-variable-overrides/buttons.scss b/services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-variable-overrides/buttons.scss deleted file mode 100644 index fd870a7bd5..0000000000 --- a/services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-variable-overrides/buttons.scss +++ /dev/null @@ -1,9 +0,0 @@ -// This file provides overrides for Bootstrap 5's default button-related Sass variables - -$btn-font-family: $font-family-sans-serif; -$btn-font-weight: 700; -$btn-padding-x: $spacing-06; -$btn-padding-y: $spacing-02; -$btn-border-radius: $border-radius-full; -$btn-border-radius-lg: $border-radius-full; -$btn-border-radius-sm: $border-radius-full; diff --git a/services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-variable-overrides/fonts.scss b/services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-variable-overrides/fonts.scss deleted file mode 100644 index aa63595afd..0000000000 --- a/services/web/frontend/stylesheets/bootstrap-5/scss/bootstrap-variable-overrides/fonts.scss +++ /dev/null @@ -1,11 +0,0 @@ -// This file provides overrides for Bootstrap 5's default font-related Sass variables - -$font-family-sans-serif: 'Noto Sans', sans-serif; -$font-family-serif: 'Merriweather', serif; -$font-family-monospace: 'DM Mono', monospace; -$font-size-base: $default-font-size; -$line-height-base: $default-line-height; - -// Colors -$primary: $bg-accent-01; -$secondary: $bg-light-primary;