You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to access more TailwindCSS utilities and I set up my Hugo installation accordingly by following the Building the theme CSS from source guide. It works great until I try to use color-related utilities (e.g. bg-red-100), which do not get transpiled into the final css.
I learned from this discussion this is due to the default ./themes/congo/tailwind.config.js, in which the colors declarations under theme seem to block the built-in TailwindCSS color utilities. The solution is to move the colors declarations under theme.extend, which works fine.
Now, I obviously do not want to edit ./themes/congo/tailwind.config.js, so I
created a custom ./tailwind.config.js,
changed the scripts.dev/scripts.build path in ./package.json accordingly.
Also, I
changed the custom tailwind config to point to the typography module in the ./congo/themes/node_modules location (i.e. plugins: [require("./themes/congo/node_modules/@tailwindcss/typography")()]).
Is this recommended ? Or should I have a duplicate typography plugin by installing it in ./node_modules as well? More generally, is this the best way to run a custom tailwind.config.js?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to access more TailwindCSS utilities and I set up my Hugo installation accordingly by following the Building the theme CSS from source guide. It works great until I try to use color-related utilities (e.g.
bg-red-100
), which do not get transpiled into the final css.I learned from this discussion this is due to the default
./themes/congo/tailwind.config.js
, in which the colors declarations undertheme
seem to block the built-in TailwindCSS color utilities. The solution is to move the colors declarations undertheme.extend
, which works fine.Now, I obviously do not want to edit
./themes/congo/tailwind.config.js
, so I./tailwind.config.js
,scripts.dev
/scripts.build
path in./package.json
accordingly.Also, I
./congo/themes/node_modules
location (i.e.plugins: [require("./themes/congo/node_modules/@tailwindcss/typography")()]
).Is this recommended ? Or should I have a duplicate typography plugin by installing it in
./node_modules
as well? More generally, is this the best way to run a customtailwind.config.js
?Beta Was this translation helpful? Give feedback.
All reactions