From b9f7f7f9613fdd7e9a53c0202d1f26ac9a9abf81 Mon Sep 17 00:00:00 2001 From: Brandon McConnell Date: Tue, 9 May 2023 16:13:13 -0700 Subject: [PATCH 1/4] Extend current preflight `html` styles to support other root/host scopes Supports SVG root scope, ShadowDOM, and presumably other root scopes --- src/css/preflight.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/css/preflight.css b/src/css/preflight.css index c2835c71e60a..e2e96908d19a 100644 --- a/src/css/preflight.css +++ b/src/css/preflight.css @@ -26,7 +26,7 @@ 6. Use the user's configured `sans` font-variation-settings by default. */ -html { +:root, :host { line-height: 1.5; /* 1 */ -webkit-text-size-adjust: 100%; /* 2 */ -moz-tab-size: 4; /* 3 */ From 86401849dd8d75adf84b08a74ec46f38c7dcb2cf Mon Sep 17 00:00:00 2001 From: Jonathan Reinink Date: Fri, 8 Sep 2023 09:52:38 -0400 Subject: [PATCH 2/4] Replace `:root` with `html` --- src/css/preflight.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/css/preflight.css b/src/css/preflight.css index e2e96908d19a..bebba4dd2af4 100644 --- a/src/css/preflight.css +++ b/src/css/preflight.css @@ -26,7 +26,8 @@ 6. Use the user's configured `sans` font-variation-settings by default. */ -:root, :host { +html, +:host { line-height: 1.5; /* 1 */ -webkit-text-size-adjust: 100%; /* 2 */ -moz-tab-size: 4; /* 3 */ From e0591c0169eab2887ec39a9be8097e8979b924e2 Mon Sep 17 00:00:00 2001 From: Jonathan Reinink Date: Fri, 8 Sep 2023 10:33:34 -0400 Subject: [PATCH 3/4] Update tests --- tests/plugins/__snapshots__/preflight.test.js.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/plugins/__snapshots__/preflight.test.js.snap b/tests/plugins/__snapshots__/preflight.test.js.snap index 45cae8b697d4..fa02b05eaad1 100644 --- a/tests/plugins/__snapshots__/preflight.test.js.snap +++ b/tests/plugins/__snapshots__/preflight.test.js.snap @@ -11,7 +11,7 @@ exports[`should test the 'preflight' plugin 1`] = ` --tw-content: ""; } -html { +html, :host { -webkit-text-size-adjust: 100%; tab-size: 4; font-feature-settings: normal; @@ -208,7 +208,7 @@ exports[`should test the 'preflight' plugin 2`] = ` --tw-content: ""; } -html { +html, :host { -webkit-text-size-adjust: 100%; tab-size: 4; font-feature-settings: normal; From a4b555512e610c24e9ec3e3716933a0f47975a9c Mon Sep 17 00:00:00 2001 From: Jonathan Reinink Date: Fri, 8 Sep 2023 11:26:18 -0400 Subject: [PATCH 4/4] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf840ade85bd..692533c2e0f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `text-wrap` utilities including `text-balance` ([#11320](https://github.com/tailwindlabs/tailwindcss/pull/11320)) - Explicitly configure Lightning CSS features, and prefer user browserslist over default browserslist ([#11402](https://github.com/tailwindlabs/tailwindcss/pull/11402), [#11412](https://github.com/tailwindlabs/tailwindcss/pull/11412)) - Extend default `opacity` scale to include all steps of 5 ([#11832](https://github.com/tailwindlabs/tailwindcss/pull/11832)) +- Update Preflight `html` styles to include shadow DOM `:host` pseudo-class ([#11200](https://github.com/tailwindlabs/tailwindcss/pull/11200)) ### Changed