Skip to content

Instantly share code, notes, and snippets.

@kroell
Forked from thinkverse/tailwind-v1.config.js
Created January 30, 2023 18:28
Show Gist options
  • Save kroell/e7435407541e3d123847095049380408 to your computer and use it in GitHub Desktop.
Save kroell/e7435407541e3d123847095049380408 to your computer and use it in GitHub Desktop.
Useful TailwindCSS config that saves paddings and margins upon build
// https://v1.tailwindcss.com/docs/controlling-file-size#purge-css-options
module.exports = {
future: {
removeDeprecatedGapUtilities: true,
purgeLayersByDefault: true,
},
purge: {
content: ['./public/**/*.html'],
options: {
whitelistPatterns: [
/^\-?m(\w?)-/,
/^p(\w?)-/,
/^text-/,
/^bg-/,
]
}
},
theme: {
extend: {},
},
variants: {},
plugins: [],
}
// https://v2.tailwindcss.com/docs/optimizing-for-production#safelisting-specific-classes
module.exports = {
purge: {
content: ['./public/**/*.html'],
options: {
safelist: [
/^\-?m(\w?)-/,
/^p(\w?)-/,
/^text-/,
/^bg-/,
]
}
},
darkMode: false, // or 'media' or 'class'
theme: {
extend: {},
},
variants: {
extend: {},
},
plugins: [],
}
// https://tailwindcss.com/docs/content-configuration#safelisting-classes
module.exports = {
content: ['./public/**/*.html'],
safelist: [
'text-2xl',
'text-3xl',
{ pattern: /^\-?m(\w?)-/ },
{ pattern: /^p(\w?)-/ },
{ pattern: /^text-/ },
{ pattern: /^bg-/ },
],
theme: {
extend: {},
},
plugins: [],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment