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

[Bug]: $border-subtle is using previous step's value #14597

Closed
2 tasks done
janhassel opened this issue Sep 7, 2023 · 5 comments · Fixed by #15415
Closed
2 tasks done

[Bug]: $border-subtle is using previous step's value #14597

janhassel opened this issue Sep 7, 2023 · 5 comments · Fixed by #15415
Assignees
Labels
role: dev 🤖 severity: 2 https://ibm.biz/carbon-severity type: bug 🐛
Milestone

Comments

@janhassel
Copy link
Member

Package

@carbon/styles

Browser

No response

Package version

1.37.0

React version

No response

Description

It seems like the $border-subtle tokens are always one step behind compared to the rest of the layering tokens.

image

This means that a UI element with a $layer-02 background will be paired with a $border-subtle-01 border. In the dark themes, these two values are the same though, resulting in the border being invisible.

image image

Reproduction/example

https://stackblitz.com/edit/github-recj8l?file=src%2FApp.jsx

Steps to reproduce

see above

Suggested Severity

None

Application/PAL

No response

Code of Conduct

@guidari
Copy link
Contributor

guidari commented Sep 22, 2023

Hey @carbon-design-system/design can you guys help with that one? Please

Looks like the background is being paried with the wrong border-subtle.

In this file it's saying we should pair the layer-02 with border-subtle-02, but in the current example showed in Stackblitz we don't have that.

Here a PR to clarify the combination: #12355
We have also have this PR from @tw15egan
Something seem weird about the dark theme

@tw15egan
Copy link
Collaborator

It's definitely a weird issue, since border has 4 values, and all other layer tokens have 3. I recall some issues that came up when some of these elements that use a border-subtle were placed in a Modal.

@tay1orjones
Copy link
Member

Here's some next steps we discussed today as a team:

  1. Spin up a stackblitz with a dropdown on a background, dropdown on layer 1, layer 2, layer 3
  2. It's also super noticeable with Accordion
  3. Review the issue with design by showing them this example
  4. Determine next steps and how to fix

@tay1orjones tay1orjones added this to the 2023 Q4 milestone Nov 29, 2023
@janhassel
Copy link
Member Author

@tay1orjones Here's a stackblitz demo: https://stackblitz.com/edit/github-tysskn?file=src%2FApp.jsx

The demo element is using $layer as the background and has a 1px $border-subtle.

image

@alexandrutatarciuc
Copy link

The current implementation #15415, while functional, is a workaround that doesn't address the underlying issue. In fact, it creates a discrepancy between code and design and is problematic for those building upon the Carbon Design System, as it requires the implementation of a similar workaround.

The root cause appears to be that the $border-subtle contextual tokens point to the wrong layering tokens. Please compare the token definitions (g90 theme) in code to the documentation/Figma files:

Code:
image

Documentation/Figma:
image

What I believe needs to be done is to change the implementation of emit-layer-tokens mixin in the _layer-tokens.scss to account for the $border-subtle-00 use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
role: dev 🤖 severity: 2 https://ibm.biz/carbon-severity type: bug 🐛
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants