Skip to content

Commit 6353450

Browse files
Add forced-color-adjust utilities (#11931)
* Add forced-colors-adjust utilities * Update forcedColorsAdjust.test.js * use `toMatchSnapshot` instead of `toMatchFormattedCss` More info: #12170 * rename `forced-colors-adjust` -> `forced-color-adjust` Dropped the `s` in `colors`. * update changelog * fix typo * use full `forced-color-adjust-auto` and `forced-color-adjust-none` names --------- Co-authored-by: Robin Malfait <[email protected]>
1 parent 2d6856c commit 6353450

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2929
- Add `size-*` utilities ([#12287](https://github.com/tailwindlabs/tailwindcss/pull/12287))
3030
- Add utilities for CSS subgrid ([#12298](https://github.com/tailwindlabs/tailwindcss/pull/12298))
3131
- Add spacing scale to `min-w-*`, `min-h-*`, and `max-w-*` utilities ([#12300](https://github.com/tailwindlabs/tailwindcss/pull/12300))
32+
- Add `forced-color-adjust` utilities ([#11931](https://github.com/tailwindlabs/tailwindcss/pull/11931))
3233
- [Oxide] New Rust template parsing engine ([#10252](https://github.com/tailwindlabs/tailwindcss/pull/10252))
3334
- [Oxide] Support `@import "tailwindcss"` using top-level `index.css` file ([#11205](https://github.com/tailwindlabs/tailwindcss/pull/11205), ([#11260](https://github.com/tailwindlabs/tailwindcss/pull/11260)))
3435
- [Oxide] Use `lightningcss` for nesting and vendor prefixes in PostCSS plugin ([#10399](https://github.com/tailwindlabs/tailwindcss/pull/10399))

src/corePlugins.js

+6
Original file line numberDiff line numberDiff line change
@@ -2877,4 +2877,10 @@ export let corePlugins = {
28772877
content: createUtilityPlugin('content', [
28782878
['content', ['--tw-content', ['content', 'var(--tw-content)']]],
28792879
]),
2880+
forcedColorAdjust: ({ addUtilities }) => {
2881+
addUtilities({
2882+
'.forced-color-adjust-auto': { 'forced-color-adjust': 'auto' },
2883+
'.forced-color-adjust-none': { 'forced-color-adjust': 'none' },
2884+
})
2885+
},
28802886
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`should test the 'forcedColorAdjust' plugin 1`] = `
4+
"
5+
.forced-color-adjust-auto {
6+
forced-color-adjust: auto;
7+
}
8+
9+
.forced-color-adjust-none {
10+
forced-color-adjust: none;
11+
}
12+
"
13+
`;
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { quickPluginTest } from '../util/run'
2+
3+
quickPluginTest('forcedColorAdjust').toMatchSnapshot()

0 commit comments

Comments
 (0)