Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Include gradient color properties in color transitions
  • Loading branch information
adamwathan committed Sep 21, 2024
commit 0465aea840a357f4cf866af49b9ac5784557ab11
32 changes: 16 additions & 16 deletions packages/tailwindcss/src/utilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9925,9 +9925,9 @@ test('from', async () => {
@layer base {
*, :before, :after, ::backdrop {
--tw-gradient-position: initial;
--tw-gradient-from: #0000;
--tw-gradient-to: #0000;
--tw-gradient-from: transparent;
--tw-gradient-via: transparent;
--tw-gradient-to: transparent;
--tw-gradient-stops: initial;
--tw-gradient-via-stops: initial;
--tw-gradient-from-position: 0%;
Expand All @@ -9948,13 +9948,13 @@ test('from', async () => {
initial-value: #0000;
}

@property --tw-gradient-to {
@property --tw-gradient-via {
syntax: "<color>";
inherits: false;
initial-value: #0000;
}

@property --tw-gradient-via {
@property --tw-gradient-to {
syntax: "<color>";
inherits: false;
initial-value: #0000;
Expand Down Expand Up @@ -10170,9 +10170,9 @@ test('via', async () => {
@layer base {
*, :before, :after, ::backdrop {
--tw-gradient-position: initial;
--tw-gradient-from: #0000;
--tw-gradient-to: #0000;
--tw-gradient-from: transparent;
--tw-gradient-via: transparent;
--tw-gradient-to: transparent;
--tw-gradient-stops: initial;
--tw-gradient-via-stops: initial;
--tw-gradient-from-position: 0%;
Expand All @@ -10193,13 +10193,13 @@ test('via', async () => {
initial-value: #0000;
}

@property --tw-gradient-to {
@property --tw-gradient-via {
syntax: "<color>";
inherits: false;
initial-value: #0000;
}

@property --tw-gradient-via {
@property --tw-gradient-to {
syntax: "<color>";
inherits: false;
initial-value: #0000;
Expand Down Expand Up @@ -10403,9 +10403,9 @@ test('to', async () => {
@layer base {
*, :before, :after, ::backdrop {
--tw-gradient-position: initial;
--tw-gradient-from: #0000;
--tw-gradient-to: #0000;
--tw-gradient-from: transparent;
--tw-gradient-via: transparent;
--tw-gradient-to: transparent;
--tw-gradient-stops: initial;
--tw-gradient-via-stops: initial;
--tw-gradient-from-position: 0%;
Expand All @@ -10426,13 +10426,13 @@ test('to', async () => {
initial-value: #0000;
}

@property --tw-gradient-to {
@property --tw-gradient-via {
syntax: "<color>";
inherits: false;
initial-value: #0000;
}

@property --tw-gradient-via {
@property --tw-gradient-to {
syntax: "<color>";
inherits: false;
initial-value: #0000;
Expand Down Expand Up @@ -12897,7 +12897,7 @@ test('transition', async () => {
}

.transition {
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, -webkit-backdrop-filter, backdrop-filter;
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, -webkit-backdrop-filter, backdrop-filter;
transition-timing-function: var(--default-transition-timing-function, ease);
transition-duration: var(--default-transition-duration, .1s);
}
Expand All @@ -12915,7 +12915,7 @@ test('transition', async () => {
}

.transition-colors {
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
transition-timing-function: var(--default-transition-timing-function, ease);
transition-duration: var(--default-transition-duration, .1s);
}
Expand Down Expand Up @@ -12964,7 +12964,7 @@ test('transition', async () => {
}

.transition {
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, -webkit-backdrop-filter, backdrop-filter;
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, -webkit-backdrop-filter, backdrop-filter;
transition-duration: .1s;
transition-timing-function: ease;
}
Expand All @@ -12976,7 +12976,7 @@ test('transition', async () => {
}

.transition-colors {
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
transition-duration: .1s;
transition-timing-function: ease;
}"
Expand Down
6 changes: 2 additions & 4 deletions packages/tailwindcss/src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2676,8 +2676,6 @@ export function createUtilities(theme: Theme) {
let gradientStopProperties = () => {
return atRoot([
property('--tw-gradient-position'),
property('--tw-gradient-from', '#0000', '<color>'),
property('--tw-gradient-to', '#0000', '<color>'),
property('--tw-gradient-from', 'transparent', '<color>'),
property('--tw-gradient-via', 'transparent', '<color>'),
property('--tw-gradient-to', 'transparent', '<color>'),
Expand Down Expand Up @@ -3716,7 +3714,7 @@ export function createUtilities(theme: Theme) {
staticUtility('transition-colors', [
[
'transition-property',
'color, background-color, border-color, text-decoration-color, fill, stroke',
'color, background-color, border-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to',
],
['transition-timing-function', defaultTimingFunction],
['transition-duration', defaultDuration],
Expand All @@ -3739,7 +3737,7 @@ export function createUtilities(theme: Theme) {

functionalUtility('transition', {
defaultValue:
'color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter',
'color, background-color, border-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter',
themeKeys: ['--transition-property'],
handle: (value) => [
decl('transition-property', value),
Expand Down