Skip to content

Commit 1855d68

Browse files
crswllRobinMalfait
andauthored
Add --border-color to divide theme keys (#18704)
## Summary In Tailwind 3 the border colors were able to be used with `divide` utilities. I made it so that's true for Tailwind 4. ## Test plan Just used `pnpm run tdd` and making it fails then making sure it passes. --------- Co-authored-by: Robin Malfait <[email protected]>
1 parent 42d2433 commit 1855d68

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2626
- Add option to disable url rewriting in `@tailwindcss/postcss` ([#18321](https://github.com/tailwindlabs/tailwindcss/pull/18321))
2727
- Fix false-positive migrations in `addEventListener` and JavaScript variable names ([#18718](https://github.com/tailwindlabs/tailwindcss/pull/18718))
2828
- Fix Standalone CLI when run via symlink on Windows ([#18723](https://github.com/tailwindlabs/tailwindcss/pull/18723))
29+
- Read from `--border-color-*` theme keys in `divide-*` utilities for backwards compatibility ([#18704](https://github.com/tailwindlabs/tailwindcss/pull/18704/))
2930

3031
## [4.1.11] - 2025-06-26
3132

packages/tailwindcss/src/utilities.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8843,6 +8843,7 @@ test('divide-color', async () => {
88438843
css`
88448844
@theme {
88458845
--color-red-500: #ef4444;
8846+
--border-color-best-blue: #6495ED;
88468847
}
88478848
@tailwind utilities;
88488849
`,
@@ -8854,6 +8855,7 @@ test('divide-color', async () => {
88548855
'divide-red-500/2.75',
88558856
'divide-red-500/[0.5]',
88568857
'divide-red-500/[50%]',
8858+
'divide-best-blue',
88578859
'divide-current',
88588860
'divide-current/50',
88598861
'divide-current/[0.5]',
@@ -8869,6 +8871,7 @@ test('divide-color', async () => {
88698871
).toMatchInlineSnapshot(`
88708872
":root, :host {
88718873
--color-red-500: #ef4444;
8874+
--border-color-best-blue: #6495ed;
88728875
}
88738876

88748877
:where(.divide-\\[\\#0088cc\\] > :not(:last-child)) {
@@ -8879,6 +8882,10 @@ test('divide-color', async () => {
88798882
border-color: oklab(59.9824% -.067 -.124 / .5);
88808883
}
88818884

8885+
:where(.divide-best-blue > :not(:last-child)) {
8886+
border-color: var(--border-color-best-blue);
8887+
}
8888+
88828889
:where(.divide-current > :not(:last-child)), :where(.divide-current\\/50 > :not(:last-child)) {
88838890
border-color: currentColor;
88848891
}

packages/tailwindcss/src/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2007,7 +2007,7 @@ export function createUtilities(theme: Theme) {
20072007
})
20082008

20092009
colorUtility('divide', {
2010-
themeKeys: ['--divide-color', '--color'],
2010+
themeKeys: ['--divide-color', '--border-color', '--color'],
20112011
handle: (value) => [
20122012
styleRule(':where(& > :not(:last-child))', [
20132013
decl('--tw-sort', 'divide-color'),

0 commit comments

Comments
 (0)