chore: move component library from tailwind to sass #2140
Closed
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.
This PR migrates the component library and insights hub to Sass with css modules instead of tailwind.
For context, the main motivation for this is that we've found major limitations with Tailwind's tooling for systematizing a well tokenized the design system. For instance:
dark:
class every time a color shows up in code. It's possible to add custom color names in tailwind, but defining them such that they automatically change based on the mode involves clunky use of css variables and can be very hard to work with.After a lot of conversations with @partyparrotgreg we decided that the best solution is to move to sass, but use the Tailwind base theme configuration for things like spacing, the color spectrum, etc. So, in this PR, I've introduce a file in component-library called
theme.scss
which defines base tokens, and all component code is implemented in terms of those tokens. We believe this is nearly the best of all solutions: