frankstallone / astro-cube-boilerplate

30 stars 3 forks source link

None used classes generated in css output #4

Open rol4nd909 opened 8 months ago

rol4nd909 commented 8 months ago

When instal and build the boilerplate there are classes generated that are not set in the html

I'n my example:

.flex {
    display: flex
}

.transition {
    transition-property: color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;
    transition-property: color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;
    transition-property: color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;
    transition-timing-function: cubic-bezier(.4,0,.2,1);
    transition-duration: .15s
}

If you look at (https://github.com/rol4nd909/fm-accordion) then there are a lot more you can check in the browser here:

demo

frankstallone commented 8 months ago

First thing I tried was removing src/components/Card.astro, and the .flex and .transition class are removed from the boilerplate build CSS. This is interesting and I am not sure why. The words flex and transition exist in that file but it's in a style tag, they are the properties, not prefixed with a period.

Then, If I do a little test on my personal website I see some interesting things. For one, my CSS file includes the .transform class in it. On the surface I don't use that class anywhere. If I take the RegEx used for the content property in this tailwind.config.mjs, and use that in the files to include VSCode search for "transform" I see it finds my publishDate from my src/content/config.ts. Technically, Tailwind is not wrong here! It scanned the files I told it to and matched .transform. This alone seems rather insignificant, to me, but I surely could figure out a way to manipulate the content property in the TW config to ignore this file or folder.

I'll have to do more digging when I have time here.

rol4nd909 commented 8 months ago

Ah nice so you also saw what I ment ;) Hope you can find a solution, if I find something I'll let you know.

kristianfrost commented 6 months ago

First, great job with the boilerplate. I am also seeing this issue. I am getting .flex in my final build, also. It's not used in any .astro files.

frankstallone commented 6 months ago

First, great job with the boilerplate. I am also seeing this issue. I am getting .flex in my final build, also. It's not used in any .astro files.

Thanks amigo. Appreciate it. Did you try and search the same files/folders as tailwind.config.mjs is looking at to see if the word flex shows up at all?