[go: nahoru, domu]

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

chore(merge): fc3f4b6 #1757

Merged
merged 32 commits into from
Jan 12, 2023
Merged

chore(merge): fc3f4b6 #1757

merged 32 commits into from
Jan 12, 2023

Conversation

julien-deramond
Copy link
Member
@julien-deramond julien-deramond commented Jan 3, 2023

This PR integrates the first huge colors mode commit from Bootstrap: twbs/bootstrap@fc3f4b6.

Live preview

How to test this PR

  • Dear reviewer, please double-check that I haven't forgotten any modifications from this commit.
  • Double-check that there is no regression compared to the main branch (meaning that our dark variants should still be rendered the same way)

⚠️ There are a lot of commits in Bootstrap after this one with a lot of fixes. I'll let you review the thing, and depending on the comments, I'll give you the references of the things that are already listed as enhancements/bugs.

Approach

Let me try to summarize the changes and what I've done...

  • .bundlewatch.config.json
  • scss/_accordion.scss: nothing to do here since we don't have any dark mode for accordions
  • scss/_alert.scss
    • Introduced the content as is + introduced the icon bg image specific to Boosted
  • scss/_carousel.scss: nothing to do here since we don't have any dark mode for carousels nor dark variants
  • scss/_close.scss: nothing to do here since we don’t have any dark mode for button close
  • scss/_dropdown.scss
  • scss/_list-group.scss
    • Introduced —bs-list-group-action-hover-bg which uses $list-group-hover-bg added in _variables.scss and set background-color to use this custom prop
    • Integrated the Sass loop but by gathering the same system as before in Boosted
  • scss/_maps.scss: exact same changes as Bootstrap. All these maps are used to create utilities and we want the same in Boosted.
  • scss/_mixins.scss: integrated as is
  • scss/_navbar.scss: nothing to do here since we don't have any dark mode for navbars
  • scss/_pagination.scss: nothing to do, was already done in a previous PR
  • scss/_reboot.scss: reintroduced everything as is
  • scss/_root.scss
    • Introduced the same modifications as Bootstrap
    • Replaced all --*-dark with --*-inverted in the dark variant selector
      • This modification very impactful must be in the migration guide note
    • Introduced —bs-link-color-rgb and —bs-link-hover-color-rgb in dark variant otherwise don’t work for alerts
  • scss/_utilities.scss
  • Introduced “subtle-border-color"
  • Had to modify scss/_utilities.scss to avoid Sass compilation errors when colors where defined with CSS vars
  • Integrated body-secondary, body-tertiary and body-emphasis for text colors as is
  • Integrated background body-secondary, body-tertiary and body-emphasis for text colors as is + removed body and white which are already generated from $utilities-bg-colors
  • Integrated background color subtle via subtle-background-color
  • Integrated “text-color” based on $utilities-text-emphasis-colors as is
  • scss_variables_dark.scss
    • Boosted moded $form-* and $accordion-* vars since we won't need to handle these specificities without dark mode in Boosted
    • All the other variables are introduced as is compared to Bootstrap. The dark mode being usable only in dev mode, the values are not that important so we can keep Bootstrap's ones here for now.
  • scss/_variables.scss
    • Introduced ${color}-text but by respecting the text colors already existing in Boosted (so no colors for danger, warning, etc.)
    • Introduced ${color}-bg-subtle but replaced all the values by the same as non-subtle values
    • Introduced ${color}-border-subtle but replaced all the values by the same as non-subtle values
      • Can’t probably be dropped since used by alerts loop!
    • $enable-dark-mode and $color-mode-type have been introduced
    • $enable-dark-mode should be false by default + explanation of why in the description of this PR + check that dist/* generated files are not impacted (not growing)
    • $*-dark variables have been renamed to $*-inverted for dark variant.
      • ⚠️ Very impactful. Must be explained in the migration guide
    • $body-color and $body-bg have been moved (kept the same values)
    • $body-emphasis and $emphasis-color introduced as is
    • Introduced $body-tertiary-color and $body-tertiary-bg as is
    • $body-secondary-bg changes its value to $gray-300 because used by disabled form controls which had this value
    • $text-muted now has —bs-secondary-color as value so it means that $body-secondary-color must take the old value of $text-muted -> $gray-700
    • $box-shadow* stay null
    • $input-bg can use —bs-form-control-bg since it’s defined by —bs-body-bg and that $input-bg was previously defined by $body-bg which hasn’t changed in this PR
    • $input-disabled-bg can use —bs-form-control-disabled-bg because it depends on $body-secondary-bg value which now takes the same value as $input-disabled-bg before
    • $input-border-color now uses —bs-color-translucent as other components with non-black borders. That’s why we don’t use —bs-border-color which is black in Boosted by default
    • $input-placeholder-color can safely by transformed to —bs-secondary-color which depends on $body-secondary-color which is $gray-700
    • $form-range-thumb-disabled-bg must remain $gray-500. Could $gray-500 define —bs-tertiary-bg?
    • No need to fusv $alert-bg-scale, $alert-border-scale and $alert-color-scale since never present in Boosted
    • Modified $list-group-color, $list-group-bg, $list-group-border-color, $list-group-border-width, $list-group-border-radius
    • Dropped comments about $list-group-item-bg-scale and $list-group-item-color-scale since they are fusv
    • Integrated $list-group-hover-bg
    • $gray-500 would deserve a custom property for disabled-colour ; maybe $gray-500 could be —bs-tertiary-bg -> $body-tertiary-color
  • scss/bootstrap-grid.scss: reintroduced as is
  • scss/bootstrap-reboot.scss: reintroduced as is
  • scss/bootstrap-utilities.scss: reintroduced as is
  • scss/bootstrap.scss: reintroduced as is
  • scss/forms/_form-check.scss
    • Included as is
  • scss/forms/_form-select.scss
    Introduced exactly the same modification except the @if $enable-dark-mode part at the end
  • scss/mixins/_alert.scss: integrated as is
  • scss/mixins/_color-mode.scss
  • scss/mixins/_forms.scss
    • Introduced the modification with the add of --#{$prefix}form-select-bg-icon: #{escape-svg($icon)}; and remove of background-image
    • Introduced the new $border-color parameter used as is
  • scss/mixins/_list-group.scss: same modification
  • site/assets/js/color-modes/index.js
  • site/assets/scss/_ads.scss: nothing to do here, we don't have this file
  • site/assets/scss/_brand.scss: nothing to do since we don’t have any .bd-brand-item in Boosted docs
  • site/assets/scss/_buttons.scss: nothing to do in this file but since .btn-bd-light wasn’t defined anywhere, I’ve removed its usage from site/layouts/_default/docs.html
  • site/assets/scss/_callouts.scss: Introduced the same architecture and changed some colors so that there's no regression on light mode and so that it works a bit more on dark mode
  • site/assets/scss/_clipboard-js.scss
    • Used the same color: var(--bs-body-color);
    • Used background: transparent and removed bg-transparent from the markup for consistency and easy maintenance with Bootstrap
    • Used color: var(--bs-link-hover-color); instead of color: var(--bs-link-color); since it is probably an error in Bootstrap. Otherwise, it won't work in our case. (see Docs: fix .btn-clipboard and .btn-edit link hover color twbs/bootstrap#37823)
  • site/assets/scss/_component-examples.scss
    • Keep most of the modifications as is
    • Keep $gray-400 border colors of 3 first modifs since there’s no corresponding custom prop
    • Modified as is .bd-example-row [class^="col"], +.bd-example-cols [class^="col"] > *, .bd-example-cssgrid [class*="grid"] > * { selector
  • site/assets/scss/_content.scss: introduced most of it as is + some Boosted mod or removed stuff
    • Introduced as is [data-bs-theme="blue”]
    • Didn’t integrate bd-summary-link since not useful in getting-started/introduction.md page
  • site/assets/scss/_footer.scss: just enhanced the comment to precise that we already use our footer component and not a specific style
  • site/assets/scss/_masthead.scss: integrated mostly as is
  • site/assets/scss/_navbar.scss: Mostly handled the changes by adding Boosted mods since we use our Orange navbar component
  • site/assets/scss/_sidebar.scss: gathered mostly the same modifications
  • site/assets/scss/_syntax.scss
    • Handled the light/dark mode. Dark mode values are copied stupidly without even checking them.
  • site/assets/scss/_toc.scss: integrated the .bd-toc-collapse since the other modification is based on a block which doesn’t exist in Boosted
  • site/assets/scss/_variables.scss: Integrated the structure, removed $dropdown-active-icon and mostly Boosted moded elements unused in Boosted
  • site/content/docs/5.2/about/brand.md: Boosted has a different content so this change cannot be applied
  • site/content/docs/5.2/components/accordion.md: nothing to do here because we don't have flush accordions in Boosted
  • site/content/docs/5.2/components/alerts.md: integrated as is
  • site/content/docs/5.2/components/carousel.md: nothing to do here because we don't have any dark variant for carousels
  • site/content/docs/5.2/components/close-button.md: nothing to do here because we will keep our dark variant close button
  • site/content/docs/5.2/components/dropdowns.md
    • Nothing to do regarding the deprecation of the dark variant since we're going to keep it
    • Info callout has been integrated as is
  • site/content/docs/5.2/components/list-group.md: integrated as is except message to change $theme-colors to $background-colors used by Boosted contrary to Bootstrap
  • site/content/docs/5.2/components/modal.md: integrated as is
  • site/content/docs/5.2/components/navbar.md
    No need to change .bg-light to .bg-body-tertiary since we didn’t use .bg-light in the first place
    No need to add a warning callout about the depreciation of .navbar-dark since it will still be effective in Boosted
  • site/content/docs/5.2/components/offcanvas.md: integrated as is
  • site/content/docs/5.2/components/scrollspy.md: nothing to do here since we prefer to keep a white bg instead of a grayish bg in this case
  • site/content/docs/5.2/components/toasts.md: integrated as is
  • site/content/docs/5.2/content/reboot.md
    By checking the values, added some Boosted mods in scss/_variables.scss for $spacer and $headings-margin-bottom
    Integrated the content as is except for the margin-bottom value mentioned in the Headings description which is slightly different by default in Boosted
  • site/content/docs/5.2/content/tables.md: chose not to integrate this message since the dark mode is not yet available in Boosted so IMO the doc can stay as is for now without this information
  • site/content/docs/5.2/customize/color-modes.md
    • Introduced as is for now
    • Need global review to see if compatible with Boosted
    • Replace Bootstrap with Boosted
  • site/content/docs/5.2/customize/color.md
    • Introduced as is for now
    • Need to check how to modify the content to be compatible with Boosted without losing Bootstrap info
  • site/content/docs/5.2/customize/css-variables.md: introduced as is
  • site/content/docs/5.2/customize/options.md
  • site/content/docs/5.2/customize/sass.md
    • Included as is (by modifying Bootstrap by Boosted of course)
    • Check how we can make understand the developers that _variables-dark.scss is optional in Bootstrap/Boosted
    • Check how we can make understand the Orange developers that _variables-dark.scss is not necessary for now. But does it matter? If the bundle size doesn’t change, that’s not really an issue isn’t it?
  • site/content/docs/5.2/forms/form-control.md: introduced as is
  • site/content/docs/5.2/getting-started/introduction.md: nothing to do here since we probably want to keep the same rendering. Meaning that .bd-summary-link is useless and doesn’t need to be integrated in site/assets/scss/_content.scss
  • site/content/docs/5.2/helpers/stacks.md: integrated as is; changed all .bg-light to .bg-body-tertiary
  • site/content/docs/5.2/helpers/stretched-link.md: integrated as is
  • site/content/docs/5.2/helpers/vertical-rule.md: replaced .bg-light with .bg-tertiary
    • Check among all examples where we have .bg-tertiary + border for consistency
  • site/content/docs/5.2/layout/columns.md: introduced exactly as is
  • site/content/docs/5.2/layout/gutters.md: introduced exactly as is
  • site/content/docs/5.2/migration.md
    • Integrated the modifications as comments in the file. Need to merge it at the end of all this process to describe ALL the changes
    • Describe ALL the changes of this PR in more details compared to Bootstrap
  • site/content/docs/5.2/utilities/background.md:
    • adapted the content to display .bg-body-secondary and .bg-body-tertiary
    • Check with the designers if .bg-body-secondary and .bg-body-tertiary are allowed. Otherwise either change their color or don't display them and mention them in the callout
    • Warning! .bg-light has been changed into .bg-body-tertiary rather everywhere in the docs!
    • added a callout to mention that subtle versions exist and have the same color as other "normal backgrounds"
  • site/content/docs/5.2/utilities/borders.md
    Instead of diplaying the renderings, made the choice to display an info callout. Otherwise developers won’t know which utility to use
  • site/content/docs/5.2/utilities/colors.md
    • Displayed .text-body-emphasis, .text-body-secondary and .text-body-tertiary
    • Check if .text-body-emphasis, .text-body-secondary and .text-body-tertiary are compliant with ODS. Otherwise, we need no to display them in the list
    • Normally, .text-muted should have the same color as .text-secondary. Let's see with other commits after.
    • Instead of displaying text-{{name}}-emphasis elements, displayed an info callout to say that these classes have the same rendering as normal ones
    • Integrated the warning callout about the depreaction of .text-muted
  • site/content/docs/5.2/utilities/overflow.md: didn’t change anything cause there was no background colors but borders in Boosted
  • site/content/docs/5.2/utilities/position.md: integrated the content almost as is, tweaking some tiny things so that it could correspond to our brand
  • site/content/docs/5.2/utilities/shadows.md: integrated the new bgs as is
  • site/content/docs/5.2/utilities/sizing.md
    • Introduced the same modifications as is. If the rendering is not OK, let's modify directly .bd-example-flex
  • site/content/docs/5.2/utilities/spacing.md
    • Introduced the same modifications as is. If the rendering is not OK, let's modify directly .bd-example-cssgrid
  • site/content/docs/5.2/utilities/text.md: changed .bg-light to .bg-body-secondary
  • site/data/sidebar.yml
  • site/data/theme-colors.yml
  • site/layouts/_default/baseof.html
  • site/layouts/_default/docs.html: integrated the change of .text-* utility but didn’t need to change link-dark which wasn’t there
  • site/layouts/partials/docs-navbar.html
    • Added the dropdown as is just to be able to switch color modes. Of course will need some work
    • We could add a {{ if eq. Layout "docs" }} like to display or not the selector. Same thing for the script in site/layouts/partials/docs-versions.html + $enable-dark-mode: true + npm specific command option
      Completely adapted this new dropdown so that it uses the same structure as our version dropdown (particularly an <a> instead of a <button>)
      Removed the vertical/horizontal separator
  • site/layouts/partials/docs-versions.html: integrated as is
  • site/layouts/partials/footer.html: nothing to do here since we use our own Footer component
  • site/layouts/partials/header.html
    • Added as is for now since for tests we will need this script. Don't know yet if we'll let it or not
  • site/layouts/partials/home/masthead.html: .lh-1 is already set with the title in Boosted
  • site/layouts/partials/icons.html
    Introduced the 3 icons from Bootstrap as is but we might need to use Solaris icons in the future when the dark mode will be implemented
  • site/layouts/shortcodes/added-in.html: nothing to modify in Boosted cause we use tags within added-in shortcake
  • site/layouts/shortcodes/callout-deprecated-dark-variants.html: this file is useless since we chose to keep our .*-dark for now for our dark variants
  • site/layouts/shortcodes/deprecated-in.html
  • site/layouts/shortcodes/example.html: just removed the comment in our code because we already removed .bg-light in the past

@julien-deramond julien-deramond added v5 merge Sync with Bootstrap skip:ci labels Jan 3, 2023
@julien-deramond julien-deramond force-pushed the main-jd-chore-merge-7cb376a-and-db60ae0 branch from c21f67b to 4ef9b9a Compare January 4, 2023 13:52
Base automatically changed from main-jd-chore-merge-7cb376a-and-db60ae0 to main January 4, 2023 16:00
@netlify
Copy link
netlify bot commented Jan 4, 2023

Deploy Preview for boosted ready!

Name Link
🔨 Latest commit ff9df99
🔍 Latest deploy log https://app.netlify.com/sites/boosted/deploys/63bff038cab21b0009d8a243
😎 Deploy Preview https://deploy-preview-1757--boosted.netlify.app/docs/5.2/migration
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@julien-deramond julien-deramond force-pushed the main-jd-chore-merge-fc3f4b6 branch 2 times, most recently from 81c73bd to 795a5f9 Compare January 8, 2023 10:07
@julien-deramond julien-deramond marked this pull request as ready for review January 8, 2023 10:13
scss/_alert.scss Outdated Show resolved Hide resolved
@@ -135,7 +135,7 @@ hr {
font-style: $headings-font-style;
font-weight: $headings-font-weight;
line-height: $headings-line-height;
color: $headings-color;
color: var(--#{$prefix}heading-color, inherit);
Copy link
Member
@louismaximepiton louismaximepiton Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Bootstrap side] Couldn't we initialize this variable to inherit instead of null? Bs side ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -336,11 +336,11 @@ sup { top: -.5em; }
// Links

a {
color: var(--#{$prefix}link-color);
color: rgba(var(--#{$prefix}link-color-rgb), var(--#{$prefix}link-opacity, 1));
Copy link
Member
@louismaximepiton louismaximepiton Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Bootstrap side] Same question for link-opacity, BS side

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -163,6 +163,11 @@ $utilities: map-merge(
),
values: $utilities-border-colors
),
"subtle-border-color": (
property: border-color,
class: border,
Copy link
Member
@louismaximepiton louismaximepiton Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Bootstrap side] No opacity as in "border-color" same for text-color.
Why not merge both maps ?

Copy link
Member
@louismaximepiton louismaximepiton Jan 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comes from the fact that this map is hexa code and the one above is rgb. Rethinking of this, I wonder if should propose it or not 🤷

@@ -36,6 +69,17 @@ $utilities-text: (
"body": to-rgb($body-color),
) !default;
$utilities-text-colors: map-loop($utilities-text, rgba-css-var, "$key", "text") !default;

$utilities-text-emphasis-colors: (
"primary-emphasis": var(--#{$prefix}primary-text),
Copy link
Member
@louismaximepiton louismaximepiton Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Bootstrap side] Why no emphasis inside the variable name ? Bs side, change variables, variables-dark, doc, maps, root

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member
@louismaximepiton louismaximepiton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We must not forget what'd be reintegrated into Boosted until we add the dark mode support.
Don't forget the migration guide.
[Bootstrap side] Need to check on Bs for $body-bg, $body-color, $border-radius, etc...

scss/_variables.scss Outdated Show resolved Hide resolved
scss/_variables.scss Outdated Show resolved Hide resolved
scss/_variables.scss Outdated Show resolved Hide resolved
@sonarcloud
Copy link
sonarcloud bot commented Jan 12, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@julien-deramond julien-deramond merged commit 5cd224a into main Jan 12, 2023
@julien-deramond julien-deramond deleted the main-jd-chore-merge-fc3f4b6 branch January 12, 2023 11:50
@julien-deramond julien-deramond mentioned this pull request Jan 12, 2023
19 tasks
@julien-deramond julien-deramond mentioned this pull request Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge Sync with Bootstrap v5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants