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

Dark mode: colored buttons, outline, and change of rendering #2301

Merged

Conversation

julien-deramond
Copy link
Member

@julien-deramond julien-deramond commented Oct 11, 2023

Description

Warning button

Info Button

  • .btn-info rendering has changed from being forced from black to blue (functional color).
  • This variant is not to be used by folks.
  • In our documentation, it was used in:
    • Cookie management panel for the "Personalize" button which now uses .btn-secondary and the "alert big panel" has been forced to use data-bs-theme="dark".
    • Button group > Button toolbar last button which can use .btn-secondary too. The other previously .btn-secondary buttons in the middle (and in this page) will rather use .btn-outline-secondary anyway (which is closer to what Bootstrap does with outline primary buttons).
  • Task to add in the Dark Mode PR description:

Light Button

Dark Button

Secondary Button

  • .btn-secondary rendering has changed from being a black outline button to a black button
  • This variant can be used by folks, so this change of rendering can be breaking! ⚠️
  • In our documentation and code, it was used in:
    • /js/tests/integration/index.html: nothing to do
    • /js/tests/unit/carousel.spec.js: nothing to do (handled directly in main via fix(unit tests): drop .btn-secondary from carousel play/pause buttons #2306)
    • /js/tests/unit/quantity-selector.js: .btn-secondarys have been changed to .btn-outline-secondary to follow QS modifications
    • /js/tests/visual/alert.html: nothing to do
    • /js/tests/visual/dropdown.html: .btn-secondarys have been changed to .btn-outline-secondary only for split buttons
      • ⚠️ By doing that they become transparent!
    • /js/tests/visual/modal.html: .btn-secondarys have been changed to .btn-outline-secondary for close buttons
    • /js/tests/visual/popover.html: nothing to do
    • /js/tests/visual/tooltip.html: nothing to do
    • tac.js: comes from .btn-info -> .btn-secondary
    • site/content/docs/5.3/dark-mode.md: changed .btn-secondary to .btn-outline-secondary for split buttons
    • site/content/docs/5.3/components/back-to-top.md: changed .btn-secondary to .btn-outline-secondary
      • ⚠️ By doing that they become transparent!
      • Migration guide
    • site/content/docs/5.3/components/button-group.md: changed .btn-secondary to .btn-outline-secondary to keep the same rendering as before
      • Mention in the migration guide?
    • site/content/docs/5.3/components/buttons.md
      • Icon only now uses .btn-outline-secondary but comes transparent! ⚠️
      • Added btn outline secondary as a disabled example like in Bootstrap
    • site/content/docs/5.3/components/close-button.md: changed .btn-secondary to .btn-outline-secondary
      • No need to mention this modification in the migration guide since it relies on the regular button modification
    • site/content/docs/5.3/components/dropdown.md: changed .btn-secondary to .btn-outline-secondary only for split dropdowns
      • Mention in the migration guide
    • site/content/docs/5.3/components/modal.md: changed .btn-secondary to .btn-outline-secondary
      • Mention in the migration guide
    • site/content/docs/5.3/components/popover.md: nothing to change
    • site/content/docs/5.3/components/toast.md: nothing to change cause we don't have any design for that
    • site/content/docs/5.3/components/tooltips.md: nothing to change
    • site/content/docs/5.3/examples/download-app: changed .btn-secondary to .btn-outline-secondary
    • site/content/docs/5.3/forms/input-group.md: go back to .btn-outline-secondary like Bootstrap
    • site/content/docs/5.3/forms/quantity-selector.md: changed .btn-secondary to .btn-outline-secondary
      • Migration guide
    • site/content/docs/5.3/forms/validation.md: changed .btn-secondary to .btn-outline-secondary for the QS
    • site/content/docs/5.3/helpers/clearfix.md: nothing to change
    • site/content/docs/5.3/helpers/stacks.md: changed .btn-secondary to .btn-outline-secondary like Bootstrap
    • site/content/docs/5.3/utilities/position.md: nothing to change
    • site/layouts/_default/docs.html: changed .btn-secondary to .btn-outline-secondary to keep the same design
    • site/layouts/_default/single.html: nothing to change
    • site/layouts/partials/docs-subnav.html: changed .btn-secondary to .btn-outline-secondary to keep the same design
    • site/layouts/partials/footer.html: changed .btn-secondary to .btn-outline-secondary for the back to top
      • ⚠️ It becomes transparent!
    • site/layouts/shortcodes/card.html: changed .btn-secondary to .btn-outline-secondary to keep the same design
      • Migration guide
    • site/layouts/shortcodes/orange-footer.html: changed .btn-secondary to .btn-outline-secondary to keep the same design
      • Migration guide
  • Task to add in the Dark Mode PR description:
  • TODO: double-check with the designers the use cases like some dropdowns, back-to-top, etc. which are like .btn-outline-secondary but with a solid background; it would mean that maybe a variant is missing in their regular buttons?

This is the description of the previous PR

This PR reintroduces the colored versions of buttons and outlined buttons coming from Bootstrap instead of hiding them or overwriting their value.

First of all, it adds a little bit of extra CSS in the bundle due to the new outline classes. However, it's necessary for compatibility with Bootstrap when folks use external plugins, libraries, etc. based on Bootstrap with Boosted style.

For regular buttons, the changes are minimal since we modify only the rendering of .btn-warning and .btn-info so that they use ODS functional colors. They are not compatible with ODS design guidelines rules so a design callout has been added to mention that to the users.
The migration guide includes something about it since the rendering of these buttons will change whenever folks have wrongly used the concepts with .btn-warning and .btn-info; this can happen if they have used them only based on the rendering and not the meaning.

Please note that I tried to get back to the code from Bootstrap to create the "regular" buttons, but the rules are too precise and not generic enough to be able to do that (event if some success, danger, info, warning buttons rely on the same parameters).

For the outlined buttons, we already had only the secondary one.
Technically, I've used the same technique as Bootstrap by looping over the $theme-colors and calling the newly created button-outline-variant mixin (with extra parameters to differentiate the active from the hover state).
A special rendering has been introduced for outline secondary and dark buttons when rendered as dark variants.
The new variants and the new mixin are documented in the migration guide, and a design callout has been added to mention that only the secondary variant can be used on their website.

Sub-tasks

Live previews

@julien-deramond julien-deramond added v5 color mode Temporary label to highlight color mode issues labels Oct 11, 2023
@netlify
Copy link

netlify bot commented Oct 11, 2023

Deploy Preview for boosted ready!

Name Link
🔨 Latest commit ff805de
🔍 Latest deploy log https://app.netlify.com/sites/boosted/deploys/65266c4caf99d7000813c69d
😎 Deploy Preview https://deploy-preview-2301--boosted.netlify.app
📱 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 configuration.

@netlify
Copy link

netlify bot commented Oct 11, 2023

Deploy Preview for boosted ready!

Name Link
🔨 Latest commit 31fb973
🔍 Latest deploy log https://app.netlify.com/sites/boosted/deploys/652f9b29d3ed1c0008cc09c0
😎 Deploy Preview https://deploy-preview-2301--boosted.netlify.app/docs/5.3/components/buttons
📱 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 configuration.

@julien-deramond julien-deramond force-pushed the main-jd-dark-mode-colored-btns-outline branch 2 times, most recently from 950991f to cb7cdac Compare October 12, 2023 07:51
@julien-deramond julien-deramond force-pushed the main-jd-dark-mode-colored-btns-outline branch 2 times, most recently from e47281e to 1efd7ac Compare October 16, 2023 12:11
scss/_buttons.scss Outdated Show resolved Hide resolved
scss/_buttons.scss Show resolved Hide resolved
scss/mixins/_buttons.scss Show resolved Hide resolved
@@ -171,15 +190,34 @@ When using button classes on `<a>` elements that are used to trigger in-page fun

## Outline buttons

In need of a button with a transparent default background color? Replace the default modifier classes with the `.btn-outline-secondary` one to remove all background colors on buttons.
In need of a button, but not the hefty background colors they bring? Replace the default modifier classes with the `.btn-outline-*` ones to remove all background images and colors on any button.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
In need of a button, but not the hefty background colors they bring? Replace the default modifier classes with the `.btn-outline-*` ones to remove all background images and colors on any button.
In need of a button, but not the hefty background colors they bring? Replace the default modifier classes with the `.btn-outline-*` ones to remove all background colors and colors on any button.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry but I think the language level is a little too high to express something simple... I would prefer to have the mention of transparent background in these sentences.
LM what do you mean "all background colors and colors"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Things to try in Bootstrap:

  • Change "hefty" wording
  • "to remove all background images and colors on any button." > "to remove all background colors on any button."
    @louismaximepiton or @hannahiss I let you propose something

site/content/docs/5.3/dark-mode.md Outdated Show resolved Hide resolved
site/content/docs/5.3/dark-mode.md Outdated Show resolved Hide resolved
@julien-deramond julien-deramond force-pushed the main-jd-dark-mode-colored-btns-outline branch from 1efd7ac to 09d9abf Compare October 17, 2023 12:20
@julien-deramond julien-deramond mentioned this pull request Oct 17, 2023
@julien-deramond julien-deramond marked this pull request as ready for review October 17, 2023 13:48
@julien-deramond julien-deramond force-pushed the main-jd-dark-mode-colored-btns-outline branch from 25acc6f to dad7287 Compare October 18, 2023 06:15
@julien-deramond julien-deramond force-pushed the main-jd-dark-mode-colored-btns-outline branch from dad7287 to f7f0aec Compare October 18, 2023 07:18
@julien-deramond julien-deramond merged commit 8ae7abe into main-jd-dark-mode Oct 18, 2023
12 checks passed
@julien-deramond julien-deramond deleted the main-jd-dark-mode-colored-btns-outline branch October 18, 2023 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
color mode Temporary label to highlight color mode issues
Projects
Development

Successfully merging this pull request may close these issues.

3 participants