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

Performance Issue: Consider shipping static styles instead of css-in-js #961

Closed
cseas opened this issue Jan 17, 2023 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@cseas
Copy link
Member

cseas commented Jan 17, 2023

Problem

Blade exclusively uses css-in-js using styled-components for styling all its components. This adds a runtime cost to every project that uses Blade which could be avoided if Blade used an alternate styling strategy.

Chakra UI has a similar approach and explicitly mentions this trade-off in their comparison docs:
https://chakra-ui.com/getting-started/comparison#the-runtime-trade-off-%EF%B8%8F

Refer below articles for a thorough analysis of this issue:

The most easily noticeable impact of this is the "Avoid long main-thread tasks" performance check in Lighthouse which often gets triggered by runtime css-in-js libraries in apps using client-side rendering.

Related: chakra-ui/chakra-ui#859

Solution

Consider zero-runtime alternatives for styling the components, e.g. css modules, vanilla-extract, stitches, linaria, sass, etc.

@cseas cseas added the enhancement New feature or request label Jan 17, 2023
@divyanshu013
Copy link
Contributor

Duplicate #432

Could you please post your comment on that issue? Good to have all discussion at one place.

@divyanshu013 divyanshu013 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants