facebook / stylex

StyleX is the styling system for ambitious user interfaces.
https://stylexjs.com
MIT License
8.21k stars 304 forks source link

Document the requirement for a CSS file in a Next.js Project #548

Open cogell opened 2 months ago

cogell commented 2 months ago

Describe the issue

If you have a vanilla nextjs app setup WITHOUT import './anything.css' then the stylex CSS will not be created (tho the className strings will).

As soon as you make a blank anything.css file and import it in app/layout.tsx the stylex CSS will start working.

Expected behavior

Ideally, stylex would work without the need to have a .css file imported somewhere in your app.

Steps to reproduce

reproduction https://stackblitz.com/edit/stylex-next-poaqpu?file=app%2Flayout.tsx forked from the StyleX + Next stackblitz that is linked on https://stylexjs.com/playground/

Test case

No response

Additional comments

No response

nmn commented 2 months ago

This is expected. We're working to update the docs to make this clear.