Skip to content

Commit 9faf109

Browse files
Update Preflight html styles to include shadow DOM :host pseudo-class (#11200)
* Extend current preflight `html` styles to support other root/host scopes Supports SVG root scope, ShadowDOM, and presumably other root scopes * Replace `:root` with `html` * Update tests * Update changelog --------- Co-authored-by: Jonathan Reinink <[email protected]>
1 parent 7a86f3a commit 9faf109

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2929
- Add `text-wrap` utilities including `text-balance` ([#11320](https://github.com/tailwindlabs/tailwindcss/pull/11320))
3030
- 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))
3131
- Extend default `opacity` scale to include all steps of 5 ([#11832](https://github.com/tailwindlabs/tailwindcss/pull/11832))
32+
- Update Preflight `html` styles to include shadow DOM `:host` pseudo-class ([#11200](https://github.com/tailwindlabs/tailwindcss/pull/11200))
3233

3334
### Changed
3435

src/css/preflight.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
6. Use the user's configured `sans` font-variation-settings by default.
2727
*/
2828

29-
html {
29+
html,
30+
:host {
3031
line-height: 1.5; /* 1 */
3132
-webkit-text-size-adjust: 100%; /* 2 */
3233
-moz-tab-size: 4; /* 3 */

tests/plugins/__snapshots__/preflight.test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exports[`should test the 'preflight' plugin 1`] = `
1111
--tw-content: "";
1212
}
1313
14-
html {
14+
html, :host {
1515
-webkit-text-size-adjust: 100%;
1616
tab-size: 4;
1717
font-feature-settings: normal;
@@ -208,7 +208,7 @@ exports[`should test the 'preflight' plugin 2`] = `
208208
--tw-content: "";
209209
}
210210
211-
html {
211+
html, :host {
212212
-webkit-text-size-adjust: 100%;
213213
tab-size: 4;
214214
font-feature-settings: normal;

0 commit comments

Comments
 (0)