-
Notifications
You must be signed in to change notification settings - Fork 41
[Question] Safelisting classnames #32
Comments
I think you need to add it to the purge configuration in your tailwind.config.js file to work. purge: {
content: [
'./safelist.txt',
],
}, |
Ah, ok, thanks @beromir! And where would you specify the globs for files to be parsed, same section? So for NextJS, as an example, And with the Appreciate your help! |
On a project I currently have it setup as: purge: [
'./resources/**/*.js',
...
'./resources/assets/tailwindcss/purge-aware.txt',
], And the contents of bg-error-100
focus:ring-info-500
... I image that should still work |
@DmiPet I have the globs for the other files in the same section: purge: {
content: [
'./vendor/laravel/jetstream/**/*.blade.php',
'./storage/framework/views/*.php',
'./resources/views/**/*.blade.php',
'./safelist.txt',
],
}, There is no special syntax for the |
Thank you both! |
How can we use Regexes to match patterns ? |
Simple way to do this could be some kind of formatting in comments no? Just in between 2 indicators, grab all the classes. Throw that bish right in to the html.
Right now my quick and dirty solution to this is to just make a Maybe something like |
Amazing work on this, very excited to start using it!
One question that came up fairly quickly though, is, what is the best way to safelist class names that may be generated dynamically? The documentation mentions a
safelist.txt
file, but that doesn't seem to be doing the trick. Is it possible to have an example of what that file should look like, and whether any other configurations need to be set in order for it to take effect?Thanks!
The text was updated successfully, but these errors were encountered: