Skip to content

Commit c67912a

Browse files
committed
Add test to document checking the user's !important preference
1 parent 2feac44 commit c67912a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

__tests__/processPlugins.test.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,3 +470,28 @@ test("leading '.' is optional when creating utilities via `utility`", () => {
470470
}
471471
`)
472472
})
473+
474+
test("plugins can choose to make declarations !important", () => {
475+
const [, utilities] = processPlugins({
476+
plugins: [
477+
function({ rule, addUtilities, config }) {
478+
addUtilities([
479+
rule('.skew-12deg', {
480+
transform: `skewY(-12deg)${config('options.important') ? ' !important' : ''}`,
481+
}),
482+
])
483+
},
484+
],
485+
options: {
486+
important: true,
487+
},
488+
})
489+
490+
expect(css(utilities)).toMatchCss(`
491+
@variants {
492+
.skew-12deg {
493+
transform: skewY(-12deg) !important
494+
}
495+
}
496+
`)
497+
})

0 commit comments

Comments
 (0)