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

Use vanilla extract #22

Merged
merged 4 commits into from
Jul 26, 2024
Merged

Use vanilla extract #22

merged 4 commits into from
Jul 26, 2024

Conversation

philschatz
Copy link
Collaborator

Try vanilla-extract because it does not need a custom babel config and seems like it's very similar to styleX.

With StyleX

I was curious about the sourcemaps-point-to-typescript claim in StyleX but I couldn't find it. I added a red background to a link and got this:

image

the source seems to point to layout.css (see debugger):

image
image






With Vanilla-extract

I get pretty much the same... not a great sourcemap experience but the styles have some typechecking

image
image
image

Copy link
Collaborator

@chrisbendel chrisbendel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks nice and simple - love it! Bonus points for the failed check actually showing up in the changed files diff too - thats a neat feature

@nathanstitt
Copy link
Member

yes, I've used vanilla extract previously and liked it, the only thing I liked better about stylex is that stylex lets you define styles in the same file as the components, vanilla requires them to be in a *.styles.ts file. But I also suspect the same-file allowance is why you also have to tweak babel, so that it can extract them.

@philschatz
Copy link
Collaborator Author

RE Failed checks showing up in the diff: Yeah, there's a format for writing to stdout in CI jobs that GitHub will listen to and make those messages! https://github.com/openstax/ce/issues/2214#issuecomment-2085722332

@philschatz philschatz merged commit 87608a0 into main Jul 26, 2024
1 check passed
@philschatz philschatz deleted the use-vanilla-extract branch July 26, 2024 23:28
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

Successfully merging this pull request may close these issues.

3 participants