evershop icon indicating copy to clipboard operation
evershop copied to clipboard

[BUG] Tailwind classes used in a theme {but not the default theme) do not get compiled in

Open kaysond opened this issue 2 years ago • 3 comments

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:

  1. Clone the test branch of my repo: https://github.com/kaysond/evetheme/tree/test
  2. Copy the theme into /themes and tailwind.frontStore.config.js into /themes/.. (e.g. project root)
  3. Run the build
  4. See that the mt-auto and mb-16 classes I added to a div do not exist in the bundled css

Expected behavior Tailwind should get compiled correctly

Screenshots image

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

kaysond avatar Aug 28 '23 04:08 kaysond

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 avatar Aug 28 '23 16:08 treoden

@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.

kaysond avatar Aug 30 '23 21:08 kaysond