Skip to content

Commit b322b75

Browse files
knowlerkeithamus
andauthored
Apply suggestions
Co-authored-by: Keith Cirkel <[email protected]>
1 parent 4440737 commit b322b75

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

learn/components/styling.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ as the shadow host).
6767

6868
The `<article-meta>` custom element inherits its `color` from the `<article>` element where it is set to `deeppink`. The
6969
`<span>` element within the shadow tree inherits its `color` from the `<article-meta>` custom element which means the
70-
value will be `deeppink`.
70+
value will also be `deeppink`.
7171

7272
## Styling elements outside of a shadow tree
7373

74-
In order to be portable, Web Components can provide default styles for a couple types of elements which exist outside of
75-
its shadow tree: the custom element itself (also known as the shadow host) and slotted elements.
74+
In order to be portable, Web Components can provide default styles for the element itself (also known as the shadow host).
75+
They can also style slotted elements with some default styles.
7676

7777
### Writing default styles for the shadow host with `:host` and `:host()`
7878

@@ -92,8 +92,9 @@ action:
9292
</fancy-p>
9393
```
9494

95-
The second will select the shadow host if it matches a selector. For example, given the following default styles for the
96-
`<fancy-p>` component, only the second element in the subsequent code example will have the styles applied.
95+
The `:host()` selector will select the shadow host if it matches a given selector. For example, it can be used to
96+
select for hosts that have a given attribute. While `:host` may apply to `<fancy-p>` component, `:host([extra])` would
97+
apply only to `<fancy-p extra>` elements:
9798

9899
```css
99100
:host([extra]) {
@@ -126,12 +127,11 @@ it will select elements within the shadow tree.
126127
</fancy-p>
127128
```
128129

129-
You can `::slotted()` to style light DOM descendants of a shadow host.
130130

131131
### Writing default styles for slotted elements with `::slotted()`
132132

133-
The `::slotted()` pseudo-element selector allows you to write default styles for different kinds of elements which are
134-
slotted.
133+
The `::slotted()` pseudo-element selector allows you to write default styles for slotted elements that match the given
134+
selector. Specifying a selector can be useful for styling specific elements in particular ways.
135135

136136
```html
137137
<fancy-elements>

0 commit comments

Comments
 (0)