Skip to content

Commit 101c3a0

Browse files
fix: preserve default background on form inputs in preflight
1 parent d7fc281 commit 101c3a0

File tree

4 files changed

+49
-49
lines changed

4 files changed

+49
-49
lines changed

integrations/cli/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2419,7 +2419,6 @@ test(
24192419
letter-spacing: inherit;
24202420
color: inherit;
24212421
border-radius: 0;
2422-
background-color: transparent;
24232422
opacity: 1;
24242423
}
24252424
:where(select:is([multiple], [size])) optgroup {
@@ -2468,6 +2467,7 @@ test(
24682467
box-shadow: none;
24692468
}
24702469
button, input:where([type='button'], [type='reset'], [type='submit']), ::file-selector-button {
2470+
background-color: transparent;
24712471
appearance: button;
24722472
}
24732473
::-webkit-inner-spin-button, ::-webkit-outer-spin-button {

packages/tailwindcss/preflight.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,7 @@ video {
231231
/*
232232
1. Inherit font styles in all browsers.
233233
2. Remove border radius in all browsers.
234-
3. Remove background color in all browsers.
235-
4. Ensure consistent opacity for disabled states in all browsers.
234+
3. Ensure consistent opacity for disabled states in all browsers.
236235
*/
237236

238237
button,
@@ -247,8 +246,7 @@ textarea,
247246
letter-spacing: inherit; /* 1 */
248247
color: inherit; /* 1 */
249248
border-radius: 0; /* 2 */
250-
background-color: transparent; /* 3 */
251-
opacity: 1; /* 4 */
249+
opacity: 1; /* 3 */
252250
}
253251

254252
/*
@@ -366,13 +364,15 @@ textarea {
366364
}
367365

368366
/*
369-
Correct the inability to style the border radius in iOS Safari.
367+
1. Remove the default background color of buttons.
368+
2. Correct the inability to style the border radius in iOS Safari.
370369
*/
371370

372371
button,
373372
input:where([type='button'], [type='reset'], [type='submit']),
374373
::file-selector-button {
375-
appearance: button;
374+
background-color: transparent; /* 1 */
375+
appearance: button; /* 2 */
376376
}
377377

378378
/*

packages/tailwindcss/src/__snapshots__/index.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ exports[`compiling CSS > prefix all CSS variables inside preflight 1`] = `
256256
letter-spacing: inherit;
257257
color: inherit;
258258
opacity: 1;
259-
background-color: #0000;
260259
border-radius: 0;
261260
}
262261
@@ -267,7 +266,6 @@ exports[`compiling CSS > prefix all CSS variables inside preflight 1`] = `
267266
letter-spacing: inherit;
268267
color: inherit;
269268
opacity: 1;
270-
background-color: #0000;
271269
border-radius: 0;
272270
}
273271
@@ -366,10 +364,12 @@ exports[`compiling CSS > prefix all CSS variables inside preflight 1`] = `
366364
367365
button, input:where([type="button"], [type="reset"], [type="submit"]) {
368366
appearance: button;
367+
background-color: #0000;
369368
}
370369
371370
::file-selector-button {
372371
appearance: button;
372+
background-color: #0000;
373373
}
374374
375375
::-webkit-inner-spin-button {

packages/tailwindcss/src/source-maps/source-map.test.ts

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -244,46 +244,46 @@ test('source maps trace back to @import location', async ({ expect }) => {
244244
'preflight.css: 91:2-13 <- 225:0-226:6',
245245
'preflight.css: 92:4-19 <- 227:2-17',
246246
'preflight.css: 93:4-16 <- 228:2-14',
247-
'preflight.css: 95:2-68 <- 238:0-243:23',
248-
'preflight.css: 96:4-17 <- 244:2-15',
249-
'preflight.css: 97:4-34 <- 245:2-32',
250-
'preflight.css: 98:4-36 <- 246:2-34',
251-
'preflight.css: 99:4-27 <- 247:2-25',
252-
'preflight.css: 100:4-18 <- 248:2-16',
253-
'preflight.css: 101:4-20 <- 249:2-18',
254-
'preflight.css: 102:4-33 <- 250:2-31',
255-
'preflight.css: 103:4-14 <- 251:2-12',
256-
'preflight.css: 105:2-49 <- 258:0-47',
257-
'preflight.css: 106:4-23 <- 259:2-21',
258-
'preflight.css: 108:2-56 <- 266:0-54',
259-
'preflight.css: 109:4-30 <- 267:2-28',
260-
'preflight.css: 111:2-25 <- 274:0-23',
261-
'preflight.css: 112:4-26 <- 275:2-24',
262-
'preflight.css: 114:2-16 <- 282:0-14',
263-
'preflight.css: 115:4-14 <- 283:2-12',
264-
'preflight.css: 117:2-92 <- 291:0-292:49',
265-
'preflight.css: 118:4-18 <- 293:2-16',
266-
'preflight.css: 119:6-25 <- 294:4-61',
267-
'preflight.css: 120:6-53 <- 294:4-61',
268-
'preflight.css: 121:8-65 <- 294:4-61',
269-
'preflight.css: 125:2-11 <- 302:0-9',
270-
'preflight.css: 126:4-20 <- 303:2-18',
271-
'preflight.css: 128:2-30 <- 310:0-28',
272-
'preflight.css: 129:4-28 <- 311:2-26',
273-
'preflight.css: 131:2-32 <- 319:0-30',
274-
'preflight.css: 132:4-19 <- 320:2-17',
275-
'preflight.css: 133:4-23 <- 321:2-21',
276-
'preflight.css: 135:2-26 <- 328:0-24',
277-
'preflight.css: 136:4-24 <- 329:2-22',
278-
'preflight.css: 138:2-41 <- 336:0-39',
279-
'preflight.css: 139:4-14 <- 337:2-12',
280-
'preflight.css: 141:2-329 <- 340:0-348:39',
281-
'preflight.css: 142:4-20 <- 349:2-18',
282-
'preflight.css: 144:2-38 <- 356:0-36',
283-
'preflight.css: 145:4-18 <- 357:2-16',
284-
'preflight.css: 147:2-19 <- 364:0-17',
285-
'preflight.css: 148:4-20 <- 365:2-18',
286-
'preflight.css: 150:2-96 <- 372:0-374:23',
247+
'preflight.css: 95:2-68 <- 237:0-242:23',
248+
'preflight.css: 96:4-17 <- 243:2-15',
249+
'preflight.css: 97:4-34 <- 244:2-32',
250+
'preflight.css: 98:4-36 <- 245:2-34',
251+
'preflight.css: 99:4-27 <- 246:2-25',
252+
'preflight.css: 100:4-18 <- 247:2-16',
253+
'preflight.css: 101:4-20 <- 248:2-18',
254+
'preflight.css: 102:4-14 <- 249:2-12',
255+
'preflight.css: 104:2-49 <- 256:0-47',
256+
'preflight.css: 105:4-23 <- 257:2-21',
257+
'preflight.css: 107:2-56 <- 264:0-54',
258+
'preflight.css: 108:4-30 <- 265:2-28',
259+
'preflight.css: 110:2-25 <- 272:0-23',
260+
'preflight.css: 111:4-26 <- 273:2-24',
261+
'preflight.css: 113:2-16 <- 280:0-14',
262+
'preflight.css: 114:4-14 <- 281:2-12',
263+
'preflight.css: 116:2-92 <- 289:0-290:49',
264+
'preflight.css: 117:4-18 <- 291:2-16',
265+
'preflight.css: 118:6-25 <- 292:4-61',
266+
'preflight.css: 119:6-53 <- 292:4-61',
267+
'preflight.css: 120:8-65 <- 292:4-61',
268+
'preflight.css: 124:2-11 <- 300:0-9',
269+
'preflight.css: 125:4-20 <- 301:2-18',
270+
'preflight.css: 127:2-30 <- 308:0-28',
271+
'preflight.css: 128:4-28 <- 309:2-26',
272+
'preflight.css: 130:2-32 <- 317:0-30',
273+
'preflight.css: 131:4-19 <- 318:2-17',
274+
'preflight.css: 132:4-23 <- 319:2-21',
275+
'preflight.css: 134:2-26 <- 326:0-24',
276+
'preflight.css: 135:4-24 <- 327:2-22',
277+
'preflight.css: 137:2-41 <- 334:0-39',
278+
'preflight.css: 138:4-14 <- 335:2-12',
279+
'preflight.css: 140:2-329 <- 338:0-346:39',
280+
'preflight.css: 141:4-20 <- 347:2-18',
281+
'preflight.css: 143:2-38 <- 354:0-36',
282+
'preflight.css: 144:4-18 <- 355:2-16',
283+
'preflight.css: 146:2-19 <- 362:0-17',
284+
'preflight.css: 147:4-20 <- 363:2-18',
285+
'preflight.css: 149:2-96 <- 371:0-373:23',
286+
'preflight.css: 150:4-33 <- 374:2-31',
287287
'preflight.css: 151:4-22 <- 375:2-20',
288288
'preflight.css: 153:2-59 <- 382:0-383:28',
289289
'preflight.css: 154:4-16 <- 384:2-14',

0 commit comments

Comments
 (0)