Skip to content

Commit

Permalink
Add forced-colors-adjust utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewarlow authored and RobinMalfait committed Oct 9, 2023
1 parent 31a80b1 commit 37b5312
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/corePlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -2875,4 +2875,10 @@ export let corePlugins = {
content: createUtilityPlugin('content', [
['content', ['--tw-content', ['content', 'var(--tw-content)']]],
]),
forcedColorsAdjust: ({ addUtilities }) => {
addUtilities({
'.forced-colors-auto': { 'forced-colors-adjust': 'auto' },
'.forced-colors-none': { 'forced-colors-adjust': 'none' },
})
},
}
10 changes: 10 additions & 0 deletions tests/plugins/forcedColorsAdjust.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { css, quickPluginTest } from '../util/run'

quickPluginTest('forcedColorsAdjust').toMatchFormattedCss(css`
.forced-colors-auto {
forced-color-adjust: auto;
}
.forced-colors-none {
forced-color-adjust: none;
}
`)

0 comments on commit 37b5312

Please sign in to comment.