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

Baseline with a test of just the React tree #3

Open
jamiebuilds opened this issue Jun 15, 2021 · 2 comments
Open

Baseline with a test of just the React tree #3

jamiebuilds opened this issue Jun 15, 2021 · 2 comments

Comments

@jamiebuilds
Copy link

The benchmarks don't tell you much about what overhead stitches is adding, only that it's less than other libraries

@StephenHaney
Copy link
Contributor

Hey Jamie, good shout... at the moment this first version of our benches assume the user has chosen a CSS-in-JS strategy as that's the case for the majority of users.

We can add a comparison to plain CSS to make the trade-off information available for those who are interested. What would you be most interested in seeing, measure mounting the same React tree but just use CSS classes to achieve the same styling?

@jamiebuilds
Copy link
Author

Yeah, I would use a combination of className with a stylesheet and style with any dynamic styles. You could also make use of CSS vars to do stuff like:

.box:active {
  color: var(--box-active-color);
}
<div className="box" style={{ "--box-active-color": "dodgerblue" }}/>

For those dynamic styles you can't put directly in style (i.e. :hover, :active, etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants