awcodes / filament-plugin-purge

A purge tool to keep your Filament plugin from bloating / duplicating Filament's default styles.
MIT License
9 stars 2 forks source link

Several classes aren't purged #5

Closed mariomka closed 5 months ago

mariomka commented 5 months ago

Hey, I'm developing a package for Filament, and I'm trying to purge the styles. It works well, but several classes aren't purged even when identical to Filament CSS ones. Also, there are several that I don't know why they aren't identical for the same version of Tailwind.

Example of the first type:

[multiple],[type=date],[type=datetime-local],[type=email],[type=month],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=time],[type=url],[type=week],input:where(:not([type])),select,textarea

Example of the second type: I get *,::backdrop,:after,:before but in Filament CSS there are *,:after,:before and ::backdrop.

Here is my plugin CSS: https://raw.githubusercontent.com/mariomka/advanced-dashboards-for-filament/v0.2.0/resources/dist/advanced-dashboards-for-filament.css

And here the filament CSS: https://raw.githubusercontent.com/filamentphp/filament/3.x/packages/panels/dist/theme.css

mariomka commented 5 months ago

Disabling the Tailwind plugins, I don't need them. I've managed to remove many styles, including the one in the first example, but there are still duplicated styles, for example, the last one in the file: input:focus-visible+.dark\:\

Here is the new CSS without plugins: https://raw.githubusercontent.com/mariomka/advanced-dashboards-for-filament/v0.3.0/resources/dist/advanced-dashboards-for-filament.css

awcodes commented 5 months ago

Please submit a PR if you can optimize it, but with the v3 theming of Filament the purging shouldn't even be necessary. Users should include your plugin's css in their theme where purging would happen natively with tailwind.

mariomka commented 5 months ago

If I find a way to optimize it, I will open a PR. Thank you.