Add test to document checking the user's !important preference
This commit is contained in:
parent
2feac441e7
commit
c67912af66
1 changed files with 25 additions and 0 deletions
|
|
@ -470,3 +470,28 @@ test("leading '.' is optional when creating utilities via `utility`", () => {
|
|||
}
|
||||
`)
|
||||
})
|
||||
|
||||
test("plugins can choose to make declarations !important", () => {
|
||||
const [, utilities] = processPlugins({
|
||||
plugins: [
|
||||
function({ rule, addUtilities, config }) {
|
||||
addUtilities([
|
||||
rule('.skew-12deg', {
|
||||
transform: `skewY(-12deg)${config('options.important') ? ' !important' : ''}`,
|
||||
}),
|
||||
])
|
||||
},
|
||||
],
|
||||
options: {
|
||||
important: true,
|
||||
},
|
||||
})
|
||||
|
||||
expect(css(utilities)).toMatchCss(`
|
||||
@variants {
|
||||
.skew-12deg {
|
||||
transform: skewY(-12deg) !important
|
||||
}
|
||||
}
|
||||
`)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue