Skip to content

Commit

Permalink
add color-scheme utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
dcastil committed Jan 24, 2025
1 parent 1134b3e commit 0dba016
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/lib/default-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1606,6 +1606,18 @@ export const getDefaultConfig = () => {
* @see https://tailwindcss.com/docs/appearance
*/
appearance: [{ appearance: ['none', 'auto'] }],
/**
* Caret Color
* @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
*/
'caret-color': [{ caret: [colors] }],
/**
* Color Scheme
* @see https://tailwindcss.com/docs/color-scheme
*/
'color-scheme': [
{ scheme: ['normal', 'dark', 'light', 'light-dark', 'only-dark', 'only-light'] },
],
/**
* Cursor
* @see https://tailwindcss.com/docs/cursor
Expand Down Expand Up @@ -1653,11 +1665,6 @@ export const getDefaultConfig = () => {
],
},
],
/**
* Caret Color
* @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
*/
'caret-color': [{ caret: [colors] }],
/**
* Field Sizing
* @see https://tailwindcss.com/docs/field-sizing
Expand Down
1 change: 1 addition & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ export type DefaultClassGroupIds =
| 'col-end'
| 'col-start-end'
| 'col-start'
| 'color-scheme'
| 'columns'
| 'container'
| 'content'
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 @@ -215,6 +215,7 @@ test('class map has correct class groups at first part', () => {
row: ['row-end', 'row-start', 'row-start-end'],
saturate: ['saturate'],
scale: ['scale', 'scale-x', 'scale-y'],
scheme: ['color-scheme'],
scroll: [
'scroll-behavior',
'scroll-m',
Expand Down
1 change: 1 addition & 0 deletions tests/tailwind-css-versions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ test('supports Tailwind CSS v4.0 features', () => {
'ring-4 ring-orange inset-ring-3 inset-ring-blue',
)
expect(twMerge('field-sizing-content field-sizing-fixed')).toBe('field-sizing-fixed')
expect(twMerge('scheme-normal scheme-dark')).toBe('scheme-dark')

// TODO: Remove proto
expect(twMerge('')).toBe('')
Expand Down

0 comments on commit 0dba016

Please sign in to comment.