question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Customized theme tokens getting reset by inline-notifications mixin

See original GitHub issue

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Detailed description

Describe in detail the issue you’re having.

Theme tokens that I have specified a custom color for are being reset by the inline-notifications mixin. For example, say I set the base theme to Gray 10 and set $focus to red (#ff0000). When the inline-notifications mixin sets the __action-button class it uses the carbon--theme mixin to borrow $hover-secondary from the Gray 100 theme. Upon doing so, the current theme gets reset to the base Gray 10 theme, overriding the custom value for $focus in the process. Every subsequent component import in styles.scss then uses the base theme’s $focus rather than my custom value.

Is this issue related to a specific component?

Related to inline-notification component (__action-button class).

What did you expect to happen? What happened instead? What would you like to see changed?

I expected all of the components to use the $focus value I defined. Instead, my $focus value was used in all the components leading up to inline-notification and then was reset. I would like the per-token customizations to persist.

What browser are you working in?

Chrome, although the issue is happening during the scss compilation.

What version of the Carbon Design System are you using?

10.4.1, and @carbon/themes 10.4.0

Steps to reproduce the issue

  1. In the main scss file, import @carbon/themes/scss/theme (bug also present with themes package in vendors folder of carbon-components)
  2. Set $carbon--theme to $carbon--theme--g10
  3. Call carbon--theme mixin
  4. Import carbon-components/scss/globals/scss/styles
  5. Compile scss (I used debug statements to check the value of $focus at different stages)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
shixiedesigncommented, Jul 30, 2019

Values for $inverse-hover-ui token:

White Gray 10 Gray 90 Gray 100
Gray80 hover #4C4C4C Gray80 hover #4C4C4C Gray 10 hover #e5e5e5 Gray 10 hover #e5e5e5

I’ve created an $inverse-hover-ui token with what I think are working values. It needs a bit more thinking so we are not going to publish to the site right now. FYI @aagonzales Ideally we can fix inline theming to work correctly so we don’t have to create so many tokens with repeated values. We will see what @mattrosno thinks when he gets to give this a look.

1reaction
tw15egancommented, Jul 30, 2019

I agree I was under the assumption that those theme calls were scoped and could be used as “inline theming”. Adding a temporary theme variable for this situation will fix this, but it seems like there is a bug with these theme calls that need to be addressed as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mixin Design Tokens - Medium
Design tokens manage and store User Interface (UI) decisions such as spacing, color, typography, and motion. These decisions are stored in a config-like ......
Read more >
Guide - Carbon Design System
This guide helps you update your project to Carbon v11. It is broken into sections based on packages that you are using in...
Read more >
List reset | U.S. Web Design System (USWDS)
Consult the Design tokens section for more information on tokens and how to use them in USWDS. Utility, Mixin, Example .add-list-reset, add-list-reset ......
Read more >
Release Notes - Lightning Design System
Updated design token COLOR_BACKGROUND_DESTRUCTIVE_HOVER so that it is a different ... with button icons being the incorrect height if using custom elements.
Read more >
ReleaseNotes < Tasks < Foswiki
Item14643 UserRegistration can't be blocked by denying access to the topic. Waiting for Re... Item13103 INCLUDE breaks relative links in attachments Waiting for Fe... Item11263...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found