Skip to content

Add --border-color to divide theme keys #18704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improve error messages when encountering invalid functional utility names ([#18568](https://github.com/tailwindlabs/tailwindcss/pull/18568))
- Don’t output CSS objects with false or undefined in the AST ([#18571](https://github.com/tailwindlabs/tailwindcss/pull/18571))
- Add option to disable url rewriting in `@tailwindcss/postcss` ([#18321](https://github.com/tailwindlabs/tailwindcss/pull/18321))
- Add `--border-color` to `divide` theme keys. ([#18704](https://github.com/tailwindlabs/tailwindcss/pull/18704/))

## [4.1.11] - 2025-06-26

Expand Down
7 changes: 7 additions & 0 deletions packages/tailwindcss/src/utilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8843,6 +8843,7 @@ test('divide-color', async () => {
css`
@theme {
--color-red-500: #ef4444;
--border-color-best-blue: #6495ED;
}
@tailwind utilities;
`,
Expand All @@ -8854,6 +8855,7 @@ test('divide-color', async () => {
'divide-red-500/2.75',
'divide-red-500/[0.5]',
'divide-red-500/[50%]',
'divide-best-blue',
'divide-current',
'divide-current/50',
'divide-current/[0.5]',
Expand All @@ -8869,6 +8871,7 @@ test('divide-color', async () => {
).toMatchInlineSnapshot(`
":root, :host {
--color-red-500: #ef4444;
--border-color-best-blue: #6495ed;
}

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

:where(.divide-best-blue > :not(:last-child)) {
border-color: var(--border-color-best-blue);
}

:where(.divide-current > :not(:last-child)), :where(.divide-current\\/50 > :not(:last-child)) {
border-color: currentColor;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/tailwindcss/src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,7 @@ export function createUtilities(theme: Theme) {
})

colorUtility('divide', {
themeKeys: ['--divide-color', '--color'],
themeKeys: ['--divide-color', '--border-color', '--color'],
handle: (value) => [
styleRule(':where(& > :not(:last-child))', [
decl('--tw-sort', 'divide-color'),
Expand Down