Skip to content

Commit 8d2b06f

Browse files
Use normal checkbox and radio appearance in forced-colors mode (#152)
* Switch control appearance in `forced-colors` mode * Update changelog
1 parent ad3f056 commit 8d2b06f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
- Nothing yet!
10+
### Fixed
11+
12+
- Use normal `checkbox` and `radio` appearance in `forced-colors` mode ([#152](https://github.com/tailwindlabs/tailwindcss-forms/pull/152))
1113

1214
## [0.5.6] - 2023-08-28
1315

src/index.js

+12
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ const forms = plugin.withOptions(function (options = { strategy: undefined }) {
251251
'background-image': `url("${svgToDataUri(
252252
`<svg viewBox="0 0 16 16" fill="white" xmlns="http://www.w3.org/2000/svg"><path d="M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z"/></svg>`
253253
)}")`,
254+
255+
'@media (forced-colors: active) ': {
256+
appearance: 'auto',
257+
},
254258
},
255259
},
256260
{
@@ -260,6 +264,10 @@ const forms = plugin.withOptions(function (options = { strategy: undefined }) {
260264
'background-image': `url("${svgToDataUri(
261265
`<svg viewBox="0 0 16 16" fill="white" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="3"/></svg>`
262266
)}")`,
267+
268+
'@media (forced-colors: active) ': {
269+
appearance: 'auto',
270+
},
263271
},
264272
},
265273
{
@@ -292,6 +300,10 @@ const forms = plugin.withOptions(function (options = { strategy: undefined }) {
292300
'background-size': `100% 100%`,
293301
'background-position': `center`,
294302
'background-repeat': `no-repeat`,
303+
304+
'@media (forced-colors: active) ': {
305+
appearance: 'auto',
306+
},
295307
},
296308
},
297309
{

0 commit comments

Comments
 (0)