From 70f673bd12b33915cefa63a385cf64c000fb7d42 Mon Sep 17 00:00:00 2001 From: Matt Rosenquist Date: Thu, 28 Nov 2024 10:59:50 +1100 Subject: [PATCH] Update server-side-rendering to include style[data-cmpld] **Changes** - Update examples to include `data-cmpld=true` as this may help readers deal with edge cases. - Add an additional selector to the Selector workarounds --- .../docs/src/pages/server-side-rendering.mdx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/website/packages/docs/src/pages/server-side-rendering.mdx b/website/packages/docs/src/pages/server-side-rendering.mdx index 312b7c981..4c9a96121 100644 --- a/website/packages/docs/src/pages/server-side-rendering.mdx +++ b/website/packages/docs/src/pages/server-side-rendering.mdx @@ -19,9 +19,9 @@ like so: ```html - +
- +
hello world
``` @@ -40,9 +40,9 @@ resulting in less styles rendered initially: ```html - +
- +
hello world
hello world
hello world
@@ -83,7 +83,10 @@ Here we target the `:first-child` element. But the text isn't red before the JavaScript has executed! To workaround this we can use a different selector, -either `:first-of-type` or explicitly marking the first child with a [data attribute](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes). +by using one of the following: + - `:first-of-type` + - explicitly marking the first child with a [data attribute](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes) + - explicitly excluding the inline `style` elements with `:not(style[data-cmpld])` ```jsx