Hex color #31171
Hex color
#31171
-
Console How do I get the hex color code? |
Beta Was this translation helpful? Give feedback.
Answered by
layershifter
Apr 24, 2024
Replies: 1 comment 7 replies
-
TL;DR https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle FYI That's not related to Griffel as it's just emits CSS and provides classes to apply. On Fluent side, it's expected to always use CSS variables i.e. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The proper solution would be to require something like
BridgeProvider
(example https://stackblitz.com/edit/jzxava-j8xopl) or create a custom React context and pass downtheme
through it.We intentionally removed all ways to access exact values to ensure that they are never referenced in styles and won't break theming (#21257).
Technically, you can still do
.getComputedStyle()
, but it's fragile as it won't react on theme changes, https://stackblitz.com/edit/jzxava-wzh5gr.