tailwindcss/src/lib/applyImportantConfiguration.js
Adam Wathan 38b4eeb288 Prettier likes parens a lot now
git blame is now broken forever.
2020-10-16 15:39:44 -04:00

19 lines
512 B
JavaScript

export default function applyImportantConfiguration(_config) {
return function (css) {
css.walkRules((rule) => {
const important = rule.__tailwind ? rule.__tailwind.important : false
if (!important) {
return
}
if (typeof important === 'string') {
rule.selectors = rule.selectors.map((selector) => {
return `${rule.__tailwind.important} ${selector}`
})
} else {
rule.walkDecls((decl) => (decl.important = true))
}
})
}
}