Skip to content

Commit

Permalink
add forced-color-adjust utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
dcastil committed Dec 21, 2023
1 parent 96f03ec commit 3b770bc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/default-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1754,6 +1754,11 @@ export function getDefaultConfig() {
* @see https://tailwindcss.com/docs/screen-readers
*/
sr: ['sr-only', 'not-sr-only'],
/**
* Forced Color Adjust
* @see https://tailwindcss.com/docs/forced-color-adjust
*/
'forced-color-adjust': [{ 'forced-color-adjust': ['auto', 'none'] }],
},
conflictingClassGroups: {
overflow: ['overflow-x', 'overflow-y'],
Expand Down
1 change: 1 addition & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ export type DefaultClassGroupIds =
| 'font-smoothing'
| 'font-style'
| 'font-weight'
| 'forced-color-adjust'
| 'fvn-figure'
| 'fvn-fraction'
| 'fvn-normal'
Expand Down
1 change: 1 addition & 0 deletions tests/class-map.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ test('class map has correct class groups at first part', () => {
float: ['float'],
flow: ['display'],
font: ['font-family', 'font-weight'],
forced: ['forced-color-adjust'],
from: ['gradient-from', 'gradient-from-pos'],
gap: ['gap', 'gap-x', 'gap-y'],
grayscale: ['grayscale'],
Expand Down
3 changes: 3 additions & 0 deletions tests/tailwind-css-versions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@ test('supports Tailwind CSS v3.4 features', () => {
'grid-cols-subgrid grid-rows-subgrid',
)
expect(twMerge('min-w-0 min-w-50 min-w-px max-w-0 max-w-50 max-w-px')).toBe('min-w-px max-w-px')
expect(twMerge('forced-color-adjust-none forced-color-adjust-auto')).toBe(
'forced-color-adjust-auto',
)
})

0 comments on commit 3b770bc

Please sign in to comment.