I’m creating a t-shirt shop using tailwindcss, and I have some weird problems:
When I render the ejs file (a type of file that allows for dynamic generation of html in Node.js, but is basically a HTML file),
with the tailwind css classes, some of them work, some not, I thought it may be with the order of them (eg. py-5 text-white, instead of text-white py-5), but it wasn’t that. even though I tried editing the paths to the files that are using the Tailwind css classes (in the tailwind.config.js file) shown below, and when that didn’t work, upon trying for hours, I have no idea what to do.
This is the tailwind.config.js
file:
/** @type {import('tailwindcss').Config} */
module.exports = {
content: {
relative: true,
files: [
"./src/**/*.{html,js}",
"./src/js/*.{html,js}"
]
},
theme: {
extend: {
colors: {
white: "#ffffff",
mainRed: "#AA0000ff",
darkRed: "#710000ff",
},
gridTemplateColumns: {
itemsGridSm: "325pt",
itemsGridMd: "repeat(2, 4fr)",
itemsGridLg: "repeat(3, 4fr)",
},
},
},
plugins: [],
};
I even tried POSTcss:
module.exports = {
plugins: [
require('tailwindcss'),
require('@tailwindcss/deprecation-warnings'),
require('autoprefixer'),
],
}
To no avail.
Screenshots for illustration:
The same code, but on tailwind css playground
Thanks.
2
Answers
This is how my tailwin.config.js file looks like now! After running the rebuild on tailwind, every style works, thanks very much! :)