Problem/Motivation
On Artisan there are two folder which contains many .txt files with a lot of utility classes. Their purpose is to have Tailwind CSS Three Shaking to not clean these utilities, as these files are part of the @source directive.
This is because the might be some utility classes added on the content level, like for example, classes added vía Menu Link Attributes modules, so Tailwind is not aware of them.
The problem is that its increasing the CSS file size a lot, and probably most of these utilities will not be used in the same project.
We should remove these files and update the documentation informing about the Tailwind Three-Shaking, so developers are aware and can manually add the need classes.
Proposed resolution
Remove utilities-safelist folder.
Update documentation.
Issue fork artisan-3571000
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
frouco commentedThe Tailwind utilities safe list has been moved to utilities-safelist-disabled. These are not available in the default CSS provided by the theme, but can easily be recovered if needed.
Comment #7
alejandro cabarcos commentedWhen removing the safelist, several components from Artisan (contrib, not the starterkit) looks broken, since they might have utility classes that are not present on the starterkit.
Comment #8
alejandro cabarcos commentedTailwind + DaisyUI safelist
dist/main.css | 354.61 kB │ gzip: 44.78 kBDaisyUI safelist
dist/main.css |120.31 kB │ gzip: 17.77 kBComment #10
alejandro cabarcos commentedAdded a @source referencing the Artisan contrib components to address the problem on #7 and have a nice starting experience.
However I think that contrib components should be copied to the subtheme generated. This will allow devs to adapt their components to their needs and us to evolve these components without making breaking changes to current installations.
Im marking this as fixed and probably open up a new issue to discuss this.
Comment #12
alejandro cabarcos commentedAfter removing DaisyUI safelist, several components break since their utility classes are calculated and not string.
Example:
'btn-' ~ color,.Comment #17
sandeshyadav commented+ 1 for removing the
safelistas it is increasing the CSS filesize a lot. 360 KB is more than that of Bootstrap, which defeats the purpose of using TailwindCSS.Comment #18
alejandro cabarcos commented