From a3230307f33115e920beb8adf29c8854437d10d7 Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Fri, 2 Jul 2021 09:14:03 -0400 Subject: [PATCH] Ensure [hidden] works as expected (#4873) --- src/plugins/css/preflight.css | 8 ++++++++ tests/fixtures/tailwind-output-flagged.css | 8 ++++++++ tests/fixtures/tailwind-output-important.css | 8 ++++++++ tests/fixtures/tailwind-output-no-color-opacity.css | 8 ++++++++ tests/fixtures/tailwind-output.css | 8 ++++++++ 5 files changed, 40 insertions(+) diff --git a/src/plugins/css/preflight.css b/src/plugins/css/preflight.css index 2ae0914efa99..96b94ef79293 100644 --- a/src/plugins/css/preflight.css +++ b/src/plugins/css/preflight.css @@ -237,3 +237,11 @@ video { max-width: 100%; height: auto; } + +/** + * Ensure the default browser behavior of the `hidden` attribute. + */ + +[hidden] { + display: none; +} diff --git a/tests/fixtures/tailwind-output-flagged.css b/tests/fixtures/tailwind-output-flagged.css index a7eaab40c44b..5ad577a58a32 100644 --- a/tests/fixtures/tailwind-output-flagged.css +++ b/tests/fixtures/tailwind-output-flagged.css @@ -538,6 +538,14 @@ video { height: auto; } +/** + * Ensure the default browser behavior of the `hidden` attribute. + */ + +[hidden] { + display: none; +} + *, ::before, ::after { --tw-border-opacity: 1; border-color: rgba(229, 231, 235, var(--tw-border-opacity)); diff --git a/tests/fixtures/tailwind-output-important.css b/tests/fixtures/tailwind-output-important.css index 9ef807052a0b..91cd43de0d75 100644 --- a/tests/fixtures/tailwind-output-important.css +++ b/tests/fixtures/tailwind-output-important.css @@ -538,6 +538,14 @@ video { height: auto; } +/** + * Ensure the default browser behavior of the `hidden` attribute. + */ + +[hidden] { + display: none; +} + *, ::before, ::after { --tw-border-opacity: 1; border-color: rgba(229, 231, 235, var(--tw-border-opacity)); diff --git a/tests/fixtures/tailwind-output-no-color-opacity.css b/tests/fixtures/tailwind-output-no-color-opacity.css index 02470e89716a..996790f90540 100644 --- a/tests/fixtures/tailwind-output-no-color-opacity.css +++ b/tests/fixtures/tailwind-output-no-color-opacity.css @@ -538,6 +538,14 @@ video { height: auto; } +/** + * Ensure the default browser behavior of the `hidden` attribute. + */ + +[hidden] { + display: none; +} + *, ::before, ::after { border-color: #e5e7eb; } diff --git a/tests/fixtures/tailwind-output.css b/tests/fixtures/tailwind-output.css index a7eaab40c44b..5ad577a58a32 100644 --- a/tests/fixtures/tailwind-output.css +++ b/tests/fixtures/tailwind-output.css @@ -538,6 +538,14 @@ video { height: auto; } +/** + * Ensure the default browser behavior of the `hidden` attribute. + */ + +[hidden] { + display: none; +} + *, ::before, ::after { --tw-border-opacity: 1; border-color: rgba(229, 231, 235, var(--tw-border-opacity));