Skip to content

Add variable fallback to fix Chrome issue #15003

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

Merged
merged 4 commits into from
Nov 14, 2024
Merged
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 @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Bump versions for security vulnerabilities ([#14697](https://github.com/tailwindlabs/tailwindcss/pull/14697))
- Ensure the TypeScript types for the `boxShadow` theme configuration allows arrays ([#14856](https://github.com/tailwindlabs/tailwindcss/pull/14856))
- Set fallback for opacity variables to ensure setting colors with the `selection:*` variant works in Chrome 131 ([#15003](https://github.com/tailwindlabs/tailwindcss/pull/15003))

## [3.4.14] - 2024-10-15

Expand Down
10 changes: 5 additions & 5 deletions integrations/parcel/tests/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('static build', () => {
expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
.bg-primary {
--tw-bg-opacity: 1;
background-color: rgb(0 0 0 / var(--tw-bg-opacity));
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
}
`)
})
Expand Down Expand Up @@ -124,7 +124,7 @@ describe('static build', () => {
expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
.bg-primary {
--tw-bg-opacity: 1;
background-color: rgb(0 0 0 / var(--tw-bg-opacity));
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
}
`)
})
Expand Down Expand Up @@ -170,7 +170,7 @@ describe('watcher', () => {
expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
}
.font-bold {
font-weight: 700;
Expand Down Expand Up @@ -218,7 +218,7 @@ describe('watcher', () => {
expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
}
.font-bold {
font-weight: 700;
Expand Down Expand Up @@ -361,7 +361,7 @@ describe('watcher', () => {
expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(css`
.btn {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
border-radius: 0.25rem;
padding: 0.25rem 0.5rem;
}
Expand Down
6 changes: 3 additions & 3 deletions integrations/postcss-cli/tests/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('watcher', () => {
css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
}
.font-bold {
font-weight: 700;
Expand Down Expand Up @@ -113,7 +113,7 @@ describe('watcher', () => {
css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
}
.font-bold {
font-weight: 700;
Expand Down Expand Up @@ -252,7 +252,7 @@ describe('watcher', () => {
.btn {
border-radius: 0.25rem;
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
padding-left: 0.5rem;
padding-right: 0.5rem;
padding-top: 0.25rem;
Expand Down
8 changes: 4 additions & 4 deletions integrations/rollup-sass/tests/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('watcher', () => {
css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
}
.font-bold {
font-weight: 700;
Expand Down Expand Up @@ -113,7 +113,7 @@ describe('watcher', () => {
css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
}
.font-bold {
font-weight: 700;
Expand Down Expand Up @@ -249,7 +249,7 @@ describe('watcher', () => {
css`
.btn {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
border-radius: 0.25rem;
padding: 0.25rem 0.5rem;
}
Expand Down Expand Up @@ -329,7 +329,7 @@ describe('watcher', () => {
css`
.btn {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
border-radius: 0.25rem;
padding: 0.25rem 0.5rem;
}
Expand Down
10 changes: 5 additions & 5 deletions integrations/rollup/tests/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('static build', () => {
css`
.bg-primary {
--tw-bg-opacity: 1;
background-color: rgb(0 0 0 / var(--tw-bg-opacity));
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
}
`
)
Expand Down Expand Up @@ -111,7 +111,7 @@ describe('static build', () => {
css`
.bg-primary {
--tw-bg-opacity: 1;
background-color: rgb(0 0 0 / var(--tw-bg-opacity));
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
}
`
)
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('watcher', () => {
css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
}
.font-bold {
font-weight: 700;
Expand Down Expand Up @@ -203,7 +203,7 @@ describe('watcher', () => {
css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
}
.font-bold {
font-weight: 700;
Expand Down Expand Up @@ -340,7 +340,7 @@ describe('watcher', () => {
.btn {
border-radius: 0.25rem;
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
padding-left: 0.5rem;
padding-right: 0.5rem;
padding-top: 0.25rem;
Expand Down
4 changes: 2 additions & 2 deletions integrations/tailwindcss-cli/tests/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ describe('Build command', () => {

.btn-after {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
padding-left: 0.5rem;
padding-right: 0.5rem;
padding-top: 0.25rem;
Expand Down Expand Up @@ -313,7 +313,7 @@ describe('Build command', () => {

.btn-after {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
padding-left: 0.5rem;
padding-right: 0.5rem;
padding-top: 0.25rem;
Expand Down
26 changes: 13 additions & 13 deletions integrations/tailwindcss-cli/tests/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ describe('static build', () => {
css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
}

.bg-red-600 {
--tw-bg-opacity: 1;
background-color: rgb(220 38 38 / var(--tw-bg-opacity));
background-color: rgb(220 38 38 / var(--tw-bg-opacity, 1));
}

.font-bold {
Expand Down Expand Up @@ -128,7 +128,7 @@ describe('static build', () => {
css`
.bg-primary {
--tw-bg-opacity: 1;
background-color: rgb(0 0 0 / var(--tw-bg-opacity));
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
}
`
)
Expand Down Expand Up @@ -176,7 +176,7 @@ describe('static build', () => {
css`
.bg-primary {
--tw-bg-opacity: 1;
background-color: rgb(0 0 0 / var(--tw-bg-opacity));
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
}
`
)
Expand Down Expand Up @@ -224,7 +224,7 @@ describe('static build', () => {
css`
.bg-yellow {
--tw-bg-opacity: 1;
background-color: rgb(255 255 0 / var(--tw-bg-opacity));
background-color: rgb(255 255 0 / var(--tw-bg-opacity, 1));
}
`
)
Expand Down Expand Up @@ -279,7 +279,7 @@ describe('static build', () => {
css`
.bg-yellow {
--tw-bg-opacity: 1;
background-color: rgb(255 255 0 / var(--tw-bg-opacity));
background-color: rgb(255 255 0 / var(--tw-bg-opacity, 1));
}
`
)
Expand Down Expand Up @@ -313,7 +313,7 @@ describe('static build', () => {
css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
}
`
)
Expand Down Expand Up @@ -356,7 +356,7 @@ describe('watcher', () => {
css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
}
.font-bold {
font-weight: 700;
Expand Down Expand Up @@ -405,7 +405,7 @@ describe('watcher', () => {
css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
}
.font-bold {
font-weight: 700;
Expand Down Expand Up @@ -594,7 +594,7 @@ describe('watcher', () => {
.btn {
border-radius: 0.25rem;
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
padding-left: 0.5rem;
padding-right: 0.5rem;
padding-top: 0.25rem;
Expand Down Expand Up @@ -670,7 +670,7 @@ describe('watcher', () => {
css`
.bg-yellow {
--tw-bg-opacity: 1;
background-color: rgb(255 255 0 / var(--tw-bg-opacity));
background-color: rgb(255 255 0 / var(--tw-bg-opacity, 1));
}
`
)
Expand All @@ -690,7 +690,7 @@ describe('watcher', () => {
css`
.bg-yellow {
--tw-bg-opacity: 1;
background-color: rgb(255 255 119 / var(--tw-bg-opacity));
background-color: rgb(255 255 119 / var(--tw-bg-opacity, 1));
}
`
)
Expand Down Expand Up @@ -722,7 +722,7 @@ describe('watcher', () => {
css`
.bg-yellow {
--tw-bg-opacity: 1;
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
}
`
)
Expand Down
10 changes: 5 additions & 5 deletions integrations/vite/tests/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('static build', () => {
css`
.bg-primary {
--tw-bg-opacity: 1;
background-color: rgb(0 0 0 / var(--tw-bg-opacity));
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
}
`
)
Expand Down Expand Up @@ -122,7 +122,7 @@ describe('static build', () => {
css`
.bg-primary {
--tw-bg-opacity: 1;
background-color: rgb(0 0 0 / var(--tw-bg-opacity));
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
}
`
)
Expand Down Expand Up @@ -173,7 +173,7 @@ describe('watcher', () => {
css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
}
.font-bold {
font-weight: 700;
Expand Down Expand Up @@ -226,7 +226,7 @@ describe('watcher', () => {
css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
}
.font-bold {
font-weight: 700;
Expand Down Expand Up @@ -379,7 +379,7 @@ describe('watcher', () => {
.btn {
border-radius: 0.25rem;
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
padding-left: 0.5rem;
padding-right: 0.5rem;
padding-top: 0.25rem;
Expand Down
10 changes: 5 additions & 5 deletions integrations/webpack-4/tests/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('static build', () => {
css`
.bg-primary {
--tw-bg-opacity: 1;
background-color: rgb(0 0 0 / var(--tw-bg-opacity));
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
}
`
)
Expand Down Expand Up @@ -105,7 +105,7 @@ describe('static build', () => {
css`
.bg-primary {
--tw-bg-opacity: 1;
background-color: rgb(0 0 0 / var(--tw-bg-opacity));
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
}
`
)
Expand Down Expand Up @@ -151,7 +151,7 @@ describe('watcher', () => {
css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
}
.font-bold {
font-weight: 700;
Expand Down Expand Up @@ -203,7 +203,7 @@ describe('watcher', () => {
css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
}
.font-bold {
font-weight: 700;
Expand Down Expand Up @@ -345,7 +345,7 @@ describe('watcher', () => {
.btn {
border-radius: 0.25rem;
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
padding-left: 0.5rem;
padding-right: 0.5rem;
padding-top: 0.25rem;
Expand Down
Loading
Loading