Tailwind Safelist Generator
Description
Tailwind plugin to generate purge-safe.txt files
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
Tailwind plugin to generate safelist.txt files
[](https://npmjs.com/package/tailwind-safelist-generator)
With `tailwind-safelist-generator`, you can generate a `safelist.txt` file for your theme based on a set of patterns.
module.exports = {
mode: 'jit',
content: [
'./**/*.html',
'./safelist.txt',
],
plugins: [
require('tailwind-safelist-generator')({
path: 'safelist.txt',
patterns: [
'text-{colors}',
'border-{borderWidth}',
'{screens}:gap-{gap}',
],
}),
],
};
Before you consider this plugin, we recommend reading Tailwind's [purgeable HTML docs](https://tailwindcss.com/docs/optimizing-for-production#writing-purgeable-html). If this isn't an option—like when you need to generate Tailwind classes with dynamic data from a CMS—this is for you.
Tailwind's JIT mode scans your codebase for class names, and generates CSS based on what it finds. If a class name is not listed explicitly, like `text-${error ? 'red' : 'green'}-500`, Tailwind won't discover it. To ensure these utilities are generated, you can maintain a file that lists them explicitly, like a `safelist.txt` file in the root of your project.
text-red-100
text-red-200
module.exports = {
mode: 'jit',
content: [
'./**/*.html',
'./safelist.txt',
],
};
Maintaining this list can become cumbersome, because whenever you update your theme you need to update the safelist. That's why we created `tailwind-safelist-generator`, so you can declare a set of classes you don't want to purge that stay in sync with your theme.
Support us
[
](https://spatie.be/github-ad-click/tailwind-safelist-generator)
We invest a lot of resources into creating [best in class open source packages](https://spati
Related Skills
Algorithmic Art
Create generative art using p5.js with seeded randomness, flow fields, and particle systems
Design Brand Guidelines
Apply Anthropic's official brand colors and typography to artifacts
Design Canvas Design
Create beautiful visual art in PNG and PDF documents using design philosophy
Design Frontend Design
Create distinctive, production-grade frontend interfaces with high design quality
Design Slack Gif Creator
Create animated GIFs optimized for Slack's size constraints
Design Theme Factory
Style artifacts with professional themes including 10 pre-set color/font combinations
Design Related Agents
Codemod Runner
Writes and runs codemod scripts that replace hardcoded visual values with token references in ui/src/index.css
Designguru
Expert Design Guidance & Analysis Specialist who provides professional UI/UX insights, design system guidance,
Html Css
| Web standards for semantic markup, maintainable styling, and accessibility. | - | [wshobson/agents](https://