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

Research Vanilla-Extract as a CSS solution #1098

Open
3 of 7 tasks
Tracked by #1099
thrbnhrtmnn opened this issue May 6, 2024 · 1 comment
Open
3 of 7 tasks
Tracked by #1099

Research Vanilla-Extract as a CSS solution #1098

thrbnhrtmnn opened this issue May 6, 2024 · 1 comment
Labels
🚫 blocked This issue is blocked ⭕ core team issue This is for the core team and should not be done by contributors ⌨️ dev issue Task is for developers

Comments

@thrbnhrtmnn
Copy link
Contributor

Description / User story

We want to invest some more time too investigate if Vanilla-Extract is a potential CSS library to use, as recommended by #1081 .

The following key factors need to be considered:

  • Supports Server Side Rendering (SSR)
  • Supports code driven transformation of CSS (either at build-time or runtime)
  • Provides a satisfying developer experience which includes:
  • Syntax highlighting
  • Context aware editor auto-completion, code navigation and refactoring
  • CLI validation tools
  • Extensive documentation
  • Allow for targeted style overrides from outside the component
  • Allow for targeted style re-use from outside the component

Requirements / Prerequisites

Acceptance Criteria

  • Vanilla-Extract has been evaluated by the key factors we defined for a CSS solution
  • The outcome has been documented
  • We are able to decide on the CSS approach after further research of Vanilla Extract and SASS has been finished

Additional information

Current findings as researched via #1081

I only did a high-level investigation by looking at the docs. It has a few promising features but also a few shortcomings.

Pros

Extracts and injects static styles. Good fit for our current classMap approach and general lit compatibility.
Doesn't require an extra formatter or linter since it uses a typed object style API instead of tagged template literals. That means it integrates well with TypeScript, Prettier and ESLint.
Features a well designed API for incorporating dynamic styles through CSS variables.
Seems to support custom class names as well as auto generated ones so it can be adopted incrementally.
Seems to be well maintained.
Dynamic TokenIterator concept might be covered by add-function-serializer
Well documented.
Cons

Requires extra build tooling configuration (e.g. webpack plugin) to extract and inject styles.
We'd have to re-write our entire css to use style objects.
Might have the same problem with semi dynamic generation of styles through our TokenIterator concept as linaria.
The object style syntax can lead to poor readability.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@thrbnhrtmnn thrbnhrtmnn added ⌨️ dev issue Task is for developers 🚫 blocked This issue is blocked ⭕ core team issue This is for the core team and should not be done by contributors labels May 6, 2024
@thrbnhrtmnn thrbnhrtmnn added this to the CSS Improvements milestone May 6, 2024
@thrbnhrtmnn
Copy link
Contributor Author

Improving our current CSS approach with #922 and #1021 (and follow up tasks for all other components to remove class maps) seems to be the more safe next steps than to invest time in this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚫 blocked This issue is blocked ⭕ core team issue This is for the core team and should not be done by contributors ⌨️ dev issue Task is for developers
Projects
None yet
Development

No branches or pull requests

1 participant