Using tailwind css in custom css? #77
-
Is there a way to use tailwindcss at the site level alongside the tailwind in the theme? In the docs it describes using
I'm using the go modules way of using the theme. I guess one way would be to manually copy the theme in so postcss/tailwind processes the site and theme together, but I'm hoping for a more elegant solution. P.S. Thanks for providing such a good theme with great attention to detail and docs. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
I actually require custom Tailwind for my own site that uses Congo and so the theme is designed with this in mind but as you say, you do need to include the theme in your project separately to go modules. As long as you have your site set up with the theme in a subfolder, you can then simply issue this command at the site level and it will generate a new ./themes/congo/node_modules/tailwindcss/lib/cli.js -c ./themes/congo/tailwind.config.js -i ./themes/congo/assets/css/main.css -o ./assets/css/compiled/main.css --jit The CSS generated using this command will include any Tailwind that is required for the theme, as well as any Tailwind you are using in your site level layouts or content files. As Hugo assets at the site level take precedence over the theme this new file will automatically override the theme's If you really want to keep using modules, in theory you could use the path to the Hugo cache directory and issue a similar command using the modules version of the theme but I think that's probably a less elegant solution than this. |
Beta Was this translation helpful? Give feedback.
I actually require custom Tailwind for my own site that uses Congo and so the theme is designed with this in mind but as you say, you do need to include the theme in your project separately to go modules.
As long as you have your site set up with the theme in a subfolder, you can then simply issue this command at the site level and it will generate a new
main.css
file at the site levelassets/css/compiled/
directory:The CSS generated using this command will include any Tailwind that is required for the theme, as well as any …