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: accordions #2259

Merged
merged 2 commits into from
Sep 26, 2023
Merged

Conversation

louismaximepiton
Copy link
Member

@louismaximepiton louismaximepiton commented Sep 20, 2023

Note: Please transform - [ ] into - (NA) in the description when things are not applicable

Related issues

#2223.

Description

Adding the accordion as dark variant

I didn't mention any migration note or w/ever, maybe we should think about a section or something to put everything related to dark mode ?

Motivation & Context

Moving forward on dark theme components.

Types of change

  • New feature (non-breaking change which adds functionality)

Live previews

@louismaximepiton louismaximepiton added v5 docs Improvements or additions to documentation css color mode Temporary label to highlight color mode issues labels Sep 20, 2023
@netlify
Copy link

netlify bot commented Sep 20, 2023

Deploy Preview for boosted ready!

Name Link
🔨 Latest commit ed5bf75
🔍 Latest deploy log https://app.netlify.com/sites/boosted/deploys/65127811d876840008fec964
😎 Deploy Preview https://deploy-preview-2259--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.

@louismaximepiton louismaximepiton force-pushed the main-lmp-dark-mode-accordions branch from 15f46ad to 2ead11f Compare September 20, 2023 08:57
@louismaximepiton louismaximepiton changed the base branch from main to main-jd-dark-mode September 20, 2023 08:58
@louismaximepiton louismaximepiton marked this pull request as ready for review September 20, 2023 08:59
@julien-deramond julien-deramond changed the title Main lmp dark mode accordions Dark mode: accordions Sep 20, 2023
@julien-deramond julien-deramond force-pushed the main-lmp-dark-mode-accordions branch from 2ead11f to 69b1020 Compare September 21, 2023 05:30
@julien-deramond julien-deramond marked this pull request as draft September 21, 2023 05:33
@louismaximepiton
Copy link
Member Author

louismaximepiton commented Sep 22, 2023

Dark variant seems to be as before, however, the text color inside for the code sample isn't the right one. It's because we removed the *-dark rule. We can have a pretty similar look as bafore if we had data-bs-theme="dark" to the example but I tried to avoid it in this PR. Maybe it's not feasible anymore and we should keep to what Bootstrap done and try to enhance it.

Maybe we should drop the dark variants as Bs and maintain only the local dark mode.

@louismaximepiton louismaximepiton marked this pull request as ready for review September 22, 2023 09:50
@MewenLeHo
Copy link
Contributor

MewenLeHo commented Sep 25, 2023

screenshot-deploy-preview-2259--boosted netlify app-2023 09 25-11_17_02

This section of the page is a bit confusing to me 🤔

First, having both tags Added in x.x.x and Deprecated in x.x.x may puzzled some of our users. Should we keep only one tag, i.e. the most recent one?

Then it's written that .accordion-dark has been deprecated, will be removed in v6 and finally there is a paragraph asking you to add this class to your code. There is even a code example using this deprecated class.

It sounds understandable when you know the subject and the way we work on color modes but from a simple user perspective it may look a bit weird and confusing. Especially for people with attention disorder for instance.

@MewenLeHo
Copy link
Contributor

screenshot-deploy-preview-2259--boosted netlify app-2023 09 25-12_01_18
#666 on #000 will cause a contrast issue.

@julien-deramond julien-deramond force-pushed the main-lmp-dark-mode-accordions branch from a24aa8f to 0fc537b Compare September 26, 2023 05:43
@julien-deramond
Copy link
Contributor

I tried something in ed5bf75.

Dark variant retro compatibility

I've reintroduced our root rules for dark variants in _root.scss:

:not([data-bs-theme="dark"]) {
  [class*="bg-black"],
  [class*="-dark"]:not(.border-dark):not(.text-dark):not(.btn-dark):not(.focus-ring-dark):not(.link-underline-dark):not(.link-dark),
  [class*="bg-secondary"] {
  }
}

but it's now scoped with a :not([data-bs-theme="dark"]) so that only dark variants execute them.

It should allow the following mapping:

IDK TBH if it's going to be feasible for all our components but maybe but can try it.

Dark variant deprecation

  • As pointed out by @MewenLeHo, having "deprecated" and "added" is difficult to understand so I've dropped out the "added" mention
  • I've changed a little bit the wording to be more generic. Note that this is not yet a reusable message but could be with the right class as a parameter if this generic message is enough for a good understanding.

@julien-deramond julien-deramond merged commit 98097dd into main-jd-dark-mode Sep 26, 2023
10 of 11 checks passed
@julien-deramond julien-deramond deleted the main-lmp-dark-mode-accordions branch September 26, 2023 07:29
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 css docs Improvements or additions to documentation v5
Projects
Development

Successfully merging this pull request may close these issues.

3 participants