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

Prepare for theming and mode support #1727

Closed
23 tasks done
Febakke opened this issue Mar 21, 2024 · 2 comments · Fixed by #1849
Closed
23 tasks done

Prepare for theming and mode support #1727

Febakke opened this issue Mar 21, 2024 · 2 comments · Fixed by #1849
Labels
☂️ epic Issues ready 🧭 roadmap Used in roadmap

Comments

@Febakke
Copy link
Member

Febakke commented Mar 21, 2024

Prepare for theming and mode support

To support dark mode and contrast mode we should prepare our tokens structure before the V1 release, since this will change the underlying tokens structure and generate some breaking changes. Colors should be rearranged into "Light", "Dark", "Contrast" sets. Also, tokens should not have names containing "light" or "dark". We have to investigate which inverted colors that still has meaning, and which will be replace by dark mode support.

In what order should we do this?

  1. Update button and accordion with correct tokens (Remove inverted use in Button #1826 and Replace border-top: ..border-on_inverted.. with gap in Accordion #1827) @Barsnes
  2. Remove inverted tokens that should not exist anymore (see list below) (In a separate branch) @mrosvik @Febakke
  3. Rename dark tokens to strong (In a separate branch) @mrosvik @Febakke (feat(tokens): rename dark and light tokens to subtle and strong #1834)
    3.1 Update CSS to use the new strong tokens @Barsnes
  4. Create and test token structure and color system.
    4.1 Create success, warning, danger, accent and neutral(grey) scale. How many tokens should we include to cover our needs? @Febakke @Thuneer The solid colors will not be linear, will reference to brand colors. Use Digdir, Mattilsynet, Brreg, Arbeidstilsynet as test cases.
    4.3 The new color system should include everything in the same set. Example: "Success" should include background, surface, border, text on the same level.
    4.1 Test token structure
  5. Rename action color to accent.
  6. Rename first, second, third to brand1, brand2, brand3
  7. ~~Button should come with accent and neutral color. ~~
  8. Move base colors into two new sets "Light" and "Dark" in opposite directions. @mrosvik @Febakke (In a separate branch) 4.1 Test with flipping or if we need specific colors for Light and Dark. @mrosvik @Febakke
    4.2 Create test frames i Figma for dark and light modes with different component combinations. @Thuneer
    4.3 Update the script that generates CSS @Barsnes @mimarz
  9. Check if the components works as intended with the new colors and flipping between dark/light.
    5.1 Update existing tokens or add missing tokens.
  10. Delete branding sets. Move semantic colors into "Semantic". Move brand colors into "Theme" (In a separate branch) @mrosvik @Febakke
  11. Create a folder inside the Mono Repo that contains all different Brand sets, including Digdir, Altinn, Tilsynet, Brreg.
  12. Optimize the colors in Light and Dark mode
  13. Implement theme in React, decide how this should be done Darkmode switcher #755

How we should handle naming that includes "dark"

Following tokens with "dark" will be renamed:

  • surface-neutral-dark --> surface-neutral-strong
  • surface-neutral-dark-hover --> surface-neutral-strong-hover

  • border-action-dark --> border-action-strong
  • border-action-dark-hover --> border-action-strong-hover

  • surface-first/second/third-light --> surface-first/second/third-subtle
  • surface-first/second/third-light-hover --> surface-first/second/third-subtle-hover
  • surface-first/second/third-light-active --> surface-first/second/third-subtle-active
  • surface-first/second/third-dark --> surface-first/second/third-strong

How we should handle naming that includes "inverted"

Following inverted color tokens will be kept:

  • surface-neutral-inverted (used in tooltip)
  • text-on_inverted (used in tooltip)

Following inverted colors will be deleted as they are not in use, and will be replaced by dark-mode.

  • surface-on_inverted
  • surface-on_inverted-hover
  • surface-on_inverted-active
  • surface-on_inverted-no_fill
  • surface-on_inverted-no_fill-hover
  • surface-on_inverted-no_fill-active

Following inverted colors will be deleted as it is only in use to solve a Figma issue (white border between accordion items)

  • border-on_inverted-default

Tasks

Preview Give feedback
  1. $ tokens ⚙️ technical
    mimarz
  2. css react
    Barsnes
  3. css react
    mimarz
  4. $ tokens
    mrosvik
  5. $ tokens
  6. 🎨 figma
    mrosvik
  7. Febakke Thunear
  8. 🕵️ investigate
    Febakke Thunear
  9. $ tokens 🎨 figma
    mrosvik
  10. 🕵️ investigate
    Febakke mrosvik
  11. $ tokens documentation/code
    Febakke mrosvik
  12. $ tokens 🎨 figma
    mrosvik
  13. react
  14. 🕵️ investigate
    Barsnes Febakke
    Thunear mimarz mrosvik
  15. $ tokens 🎨 figma
  16. 5 of 5
    $ tokens
    mrosvik
  17. 🕵️ investigate
    Thunear
  18. $ tokens
    mimarz
  19. $ tokens
    Febakke mimarz
  20. $ tokens
  21. $ tokens css
  22. 39 of 39
    $ tokens 🎨 figma
    Febakke Thunear
    mrosvik
@Febakke Febakke converted this from a draft issue Mar 21, 2024
@mrosvik mrosvik changed the title Create color system that can handle dark mode Prepare for theming support Apr 11, 2024
@mrosvik mrosvik added ☂️ epic Issues ready 🧭 roadmap Used in roadmap labels Apr 11, 2024
@mrosvik mrosvik changed the title Prepare for theming support Prepare for theming and mode support Apr 11, 2024
@mrosvik mrosvik added this to the 4. Lansere versjon 1.0.0 milestone Apr 15, 2024
@Febakke
Copy link
Member Author

Febakke commented Apr 16, 2024

Meeting 16.04

  • Create a sketch on new semantic tokens structure
    • All categories have same values
  •  Create new color scales
    • Test with linear scale
    • Radixlike overview of colors and uses
  • Create new tokens
    • Rename action to accent
    • Define semantic rules on when to use accent colors
  • Remove action second variant of button
  • Change tokens on button and other components to use accent/action from semantic
  • Remove first and second action tokens

Form components

  • Default: Grey color (not changed by accent color)
  • Hover: light version of accent color
  • Active/selected: Accent color
  • Pressed (button only?)
  • Define system for how to set this up. For example when you have a dark accent color where hover will be harder to see if it is a darker version.

Link

  • Link should use accent colors

Focus

  •  Test with accent color or text color

Spinner

  • Use accent color

Helptext

  • Use accent color

Accordion

  • Use accent on default open

Darkmode

  • Test switching between light and dark mode on different accent colors

@mrosvik
Copy link
Member

mrosvik commented Jun 25, 2024

This was solved in #2130

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☂️ epic Issues ready 🧭 roadmap Used in roadmap
Projects
Status: Levert
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants