Skip to content

Commit 7f93550

Browse files
Honor the hidden attribute on elements in preflight (#9174)
* Honor the `hidden` attribute on elements You’ll still be able to override this with utilities but this ensures that things like `<iframe hidden>` work as expected * Update changelog
1 parent cef02e2 commit 7f93550

File tree

3 files changed

+98
-88
lines changed

3 files changed

+98
-88
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020
- Fix ring color utility generation when using `respectDefaultRingColorOpacity` ([#9070](https://github.com/tailwindlabs/tailwindcss/pull/9070))
2121
- Sort tags before classes when `@applying` a selector with joined classes ([#9107](https://github.com/tailwindlabs/tailwindcss/pull/9107))
2222
- Remove invalid `outline-hidden` utility ([#9147](https://github.com/tailwindlabs/tailwindcss/pull/9147))
23+
- Honor the `hidden` attribute on elements in preflight ([#9174](https://github.com/tailwindlabs/tailwindcss/pull/9174))
2324

2425
## [3.1.8] - 2022-08-05
2526

src/css/preflight.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,8 @@ video {
358358
max-width: 100%;
359359
height: auto;
360360
}
361+
362+
/* Make elements with the HTML hidden attirubte stay hidden by default */
363+
[hidden] {
364+
display: none;
365+
}

tests/__snapshots__/source-maps.test.js.snap

Lines changed: 92 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -263,98 +263,102 @@ Array [
263263
"2:4-18 -> 360:2-17",
264264
"2:4-18 -> 361:2-14",
265265
"2:18 -> 362:0",
266-
"2:4 -> 364:0",
267-
"2:4-18 -> 365:2-26",
268-
"2:4-18 -> 366:2-26",
269-
"2:4-18 -> 367:2-21",
270-
"2:4-18 -> 368:2-21",
271-
"2:4-18 -> 369:2-16",
272-
"2:4-18 -> 370:2-16",
273-
"2:4-18 -> 371:2-16",
274-
"2:4-18 -> 372:2-17",
275-
"2:4-18 -> 373:2-17",
276-
"2:4-18 -> 374:2-15",
277-
"2:4-18 -> 375:2-15",
278-
"2:4-18 -> 376:2-20",
279-
"2:4-18 -> 377:2-40",
266+
"2:4-18 -> 364:0-72",
267+
"2:4 -> 365:0",
268+
"2:4-18 -> 366:2-15",
269+
"2:18 -> 367:0",
270+
"2:4 -> 369:0",
271+
"2:4-18 -> 370:2-26",
272+
"2:4-18 -> 371:2-26",
273+
"2:4-18 -> 372:2-21",
274+
"2:4-18 -> 373:2-21",
275+
"2:4-18 -> 374:2-16",
276+
"2:4-18 -> 375:2-16",
277+
"2:4-18 -> 376:2-16",
278+
"2:4-18 -> 377:2-17",
280279
"2:4-18 -> 378:2-17",
281-
"2:4-18 -> 379:2-22",
282-
"2:4-18 -> 380:2-24",
283-
"2:4-18 -> 381:2-25",
284-
"2:4-18 -> 382:2-26",
285-
"2:4-18 -> 383:2-20",
286-
"2:4-18 -> 384:2-29",
287-
"2:4-18 -> 385:2-30",
288-
"2:4-18 -> 386:2-40",
289-
"2:4-18 -> 387:2-36",
290-
"2:4-18 -> 388:2-29",
291-
"2:4-18 -> 389:2-24",
292-
"2:4-18 -> 390:2-32",
293-
"2:4-18 -> 391:2-14",
294-
"2:4-18 -> 392:2-20",
295-
"2:4-18 -> 393:2-18",
296-
"2:4-18 -> 394:2-19",
297-
"2:4-18 -> 395:2-20",
298-
"2:4-18 -> 396:2-16",
299-
"2:4-18 -> 397:2-18",
300-
"2:4-18 -> 398:2-15",
301-
"2:4-18 -> 399:2-21",
302-
"2:4-18 -> 400:2-23",
303-
"2:4-18 -> 401:2-29",
304-
"2:4-18 -> 402:2-27",
305-
"2:4-18 -> 403:2-28",
306-
"2:4-18 -> 404:2-29",
307-
"2:4-18 -> 405:2-25",
308-
"2:4-18 -> 406:2-26",
280+
"2:4-18 -> 379:2-15",
281+
"2:4-18 -> 380:2-15",
282+
"2:4-18 -> 381:2-20",
283+
"2:4-18 -> 382:2-40",
284+
"2:4-18 -> 383:2-17",
285+
"2:4-18 -> 384:2-22",
286+
"2:4-18 -> 385:2-24",
287+
"2:4-18 -> 386:2-25",
288+
"2:4-18 -> 387:2-26",
289+
"2:4-18 -> 388:2-20",
290+
"2:4-18 -> 389:2-29",
291+
"2:4-18 -> 390:2-30",
292+
"2:4-18 -> 391:2-40",
293+
"2:4-18 -> 392:2-36",
294+
"2:4-18 -> 393:2-29",
295+
"2:4-18 -> 394:2-24",
296+
"2:4-18 -> 395:2-32",
297+
"2:4-18 -> 396:2-14",
298+
"2:4-18 -> 397:2-20",
299+
"2:4-18 -> 398:2-18",
300+
"2:4-18 -> 399:2-19",
301+
"2:4-18 -> 400:2-20",
302+
"2:4-18 -> 401:2-16",
303+
"2:4-18 -> 402:2-18",
304+
"2:4-18 -> 403:2-15",
305+
"2:4-18 -> 404:2-21",
306+
"2:4-18 -> 405:2-23",
307+
"2:4-18 -> 406:2-29",
309308
"2:4-18 -> 407:2-27",
310-
"2:4 -> 408:2",
311-
"2:18 -> 409:0",
312-
"2:4 -> 411:0",
313-
"2:4-18 -> 412:2-26",
314-
"2:4-18 -> 413:2-26",
315-
"2:4-18 -> 414:2-21",
316-
"2:4-18 -> 415:2-21",
317-
"2:4-18 -> 416:2-16",
318-
"2:4-18 -> 417:2-16",
319-
"2:4-18 -> 418:2-16",
320-
"2:4-18 -> 419:2-17",
321-
"2:4-18 -> 420:2-17",
322-
"2:4-18 -> 421:2-15",
323-
"2:4-18 -> 422:2-15",
324-
"2:4-18 -> 423:2-20",
325-
"2:4-18 -> 424:2-40",
309+
"2:4-18 -> 408:2-28",
310+
"2:4-18 -> 409:2-29",
311+
"2:4-18 -> 410:2-25",
312+
"2:4-18 -> 411:2-26",
313+
"2:4-18 -> 412:2-27",
314+
"2:4 -> 413:2",
315+
"2:18 -> 414:0",
316+
"2:4 -> 416:0",
317+
"2:4-18 -> 417:2-26",
318+
"2:4-18 -> 418:2-26",
319+
"2:4-18 -> 419:2-21",
320+
"2:4-18 -> 420:2-21",
321+
"2:4-18 -> 421:2-16",
322+
"2:4-18 -> 422:2-16",
323+
"2:4-18 -> 423:2-16",
324+
"2:4-18 -> 424:2-17",
326325
"2:4-18 -> 425:2-17",
327-
"2:4-18 -> 426:2-22",
328-
"2:4-18 -> 427:2-24",
329-
"2:4-18 -> 428:2-25",
330-
"2:4-18 -> 429:2-26",
331-
"2:4-18 -> 430:2-20",
332-
"2:4-18 -> 431:2-29",
333-
"2:4-18 -> 432:2-30",
334-
"2:4-18 -> 433:2-40",
335-
"2:4-18 -> 434:2-36",
336-
"2:4-18 -> 435:2-29",
337-
"2:4-18 -> 436:2-24",
338-
"2:4-18 -> 437:2-32",
339-
"2:4-18 -> 438:2-14",
340-
"2:4-18 -> 439:2-20",
341-
"2:4-18 -> 440:2-18",
342-
"2:4-18 -> 441:2-19",
343-
"2:4-18 -> 442:2-20",
344-
"2:4-18 -> 443:2-16",
345-
"2:4-18 -> 444:2-18",
346-
"2:4-18 -> 445:2-15",
347-
"2:4-18 -> 446:2-21",
348-
"2:4-18 -> 447:2-23",
349-
"2:4-18 -> 448:2-29",
350-
"2:4-18 -> 449:2-27",
351-
"2:4-18 -> 450:2-28",
352-
"2:4-18 -> 451:2-29",
353-
"2:4-18 -> 452:2-25",
354-
"2:4-18 -> 453:2-26",
326+
"2:4-18 -> 426:2-15",
327+
"2:4-18 -> 427:2-15",
328+
"2:4-18 -> 428:2-20",
329+
"2:4-18 -> 429:2-40",
330+
"2:4-18 -> 430:2-17",
331+
"2:4-18 -> 431:2-22",
332+
"2:4-18 -> 432:2-24",
333+
"2:4-18 -> 433:2-25",
334+
"2:4-18 -> 434:2-26",
335+
"2:4-18 -> 435:2-20",
336+
"2:4-18 -> 436:2-29",
337+
"2:4-18 -> 437:2-30",
338+
"2:4-18 -> 438:2-40",
339+
"2:4-18 -> 439:2-36",
340+
"2:4-18 -> 440:2-29",
341+
"2:4-18 -> 441:2-24",
342+
"2:4-18 -> 442:2-32",
343+
"2:4-18 -> 443:2-14",
344+
"2:4-18 -> 444:2-20",
345+
"2:4-18 -> 445:2-18",
346+
"2:4-18 -> 446:2-19",
347+
"2:4-18 -> 447:2-20",
348+
"2:4-18 -> 448:2-16",
349+
"2:4-18 -> 449:2-18",
350+
"2:4-18 -> 450:2-15",
351+
"2:4-18 -> 451:2-21",
352+
"2:4-18 -> 452:2-23",
353+
"2:4-18 -> 453:2-29",
355354
"2:4-18 -> 454:2-27",
356-
"2:4 -> 455:2",
357-
"2:18 -> 456:0",
355+
"2:4-18 -> 455:2-28",
356+
"2:4-18 -> 456:2-29",
357+
"2:4-18 -> 457:2-25",
358+
"2:4-18 -> 458:2-26",
359+
"2:4-18 -> 459:2-27",
360+
"2:4 -> 460:2",
361+
"2:18 -> 461:0",
358362
]
359363
`;
360364

0 commit comments

Comments
 (0)