Repository navigation
using stylex.defineConsts and exposing raw values from theme - #16
Merged
Merged
Conversation
Member
|
There are two primary issues to using
2 is pretty critical for performance Will put something up that uses the |
3 tasks
cixzhang
added a commit
that referenced
this pull request
Apr 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uses stylex defineConsts as well as meta/stylex#1219 for setting up variables.
I did it this way because I've found that we often need to have access to the raw values for some 3rd party library features like data visualizations or lexical. Using
defineConstsallows us to have access to these raw values while still preserving the ability to use CSS variables at the cost of making those variables more publically accessible.Right now the default theme raw values are like
light-dark(A, B)but it's possible for us to parse our the specific values for each mode or handle other color types programmatically for 3P.This also simplifies token access and application to our components.
Observe that theming still works in storybook: