[BUG] Tailwind classes used in a theme {but not the default theme) do not get compiled in
Describe the bug
I've added classes like mt-auto and mb-16 to my theme, but the classes do not exist in the bundled css.
To Reproduce Steps to reproduce the behavior:
- Clone the test branch of my repo: https://github.com/kaysond/evetheme/tree/test
- Copy the theme into
/themesandtailwind.frontStore.config.jsinto/themes/..(e.g. project root) - Run the build
- See that the
mt-autoandmb-16classes I added to a div do not exist in the bundled css
Expected behavior Tailwind should get compiled correctly
Screenshots
Background (please complete the following information):
- NodeJS Version 20.3.1
- Postgres Version 15.4
- EverShop Version 1.0.0-rc7
- OS: [e.g. Window, Ubuntu, Mac-OS] Debian dockerized
- Browser [e.g. Chrome, Safari] Firefox
Additional context
I copied the default tailwind.frontStore.config.js and just added a 16: key in margin so it compiles the mb-16
Hi @kaysond ,
Sorry for the outdated document, the correct way is having a file named tailwind.config.js inside your theme folder
Let's say you have a theme named friday, then you should have a file here themes/friday/tailwind.config.js
Ps: The doc is updated
Thank you
@treoden - thanks. That fixed it. There's still a minor issue with mt-auto not compiling, but it's just because the default evershop tailwind config specifies margin without including an auto key. If you just don't include margin, tailwind by default uses whatever you specify in spacing (which in the case of evershop is identical to margin), and adds auto:
https://github.com/tailwindlabs/tailwindcss/blob/696810fd5a3d30ee8225913af268be1d2c9dbced/stubs/config.full.js#L603-L606
I think it would be very helpful to use the default tailwind config for the default theme.