You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-pseudo-4/Overview.bs
+39-9
Original file line number
Diff line number
Diff line change
@@ -1140,13 +1140,39 @@ Security and Privacy Considerations</h3>
1140
1140
the styling of such highlighted segments.
1141
1141
1142
1142
<h2 id="treelike">
1143
-
Tree-Abiding Pseudo-elements</h2>
1143
+
Tree-Abiding and Part-Like Pseudo-elements</h2>
1144
1144
1145
1145
<dfn export lt="tree-abiding|tree-abiding pseudo-element">Tree-abiding pseudo-elements</dfn> always fit within the box tree.
1146
1146
They <a lt="inheritance">inherit</a> any inheritable properties from their <a>originating element</a>;
1147
1147
non-inheritable properties take their <a>initial values</a> as usual.
1148
1148
[[CSS-CASCADE-4]]
1149
1149
1150
+
A subset of [=tree-abiding pseudo-elements=],
1151
+
the <dfn>part-like pseudo-elements</dfn>,
1152
+
have slightly stronger requirements:
1153
+
they act as if they have a well-defined location in the document tree.
1154
+
This enables them to interact with some other platform features
1155
+
as if they were real elements.
1156
+
1157
+
<div class=example>
1158
+
For example, a [=part-like pseudo-element=]
1159
+
can be used in the <{html-global/exportparts}> attribute,
1160
+
to masquerade as a ''::part()''
1161
+
for the component it's in:
1162
+
1163
+
<xmp class=html>
1164
+
<template id=custom-element-template>
1165
+
<p exportparts="::before : preceding-text">
1166
+
You can style my ::before pseudo-element
1167
+
by using ::part(preceding-text), too!
1168
+
</template>
1169
+
</xmp>
1170
+
</div>
1171
+
1172
+
Unless otherwise specified,
1173
+
any CSS property that applies to elements
1174
+
applies to [=part-like pseudo-elements=].
1175
+
1150
1176
<h3 id="generated-content">
1151
1177
Generated Content Pseudo-elements: ''::before'' and ''::after''</h3>
1152
1178
@@ -1165,10 +1191,9 @@ Generated Content Pseudo-elements: ''::before'' and ''::after''</h3>
1165
1191
immediately after the <a>originating element</a>'s actual content.
1166
1192
</dl>
1167
1193
1168
-
These pseudo-elements can be styled
1169
-
exactly like any normal document-sourced element in the document tree;
1170
-
all properties that apply to a normal element
1171
-
likewise apply to ''::before'' and ''::after''.
1194
+
Both ''::before'' and ''::after''
1195
+
are [=part-like pseudo-elements=];
1196
+
there is no restriction on what properties apply to them.
1172
1197
1173
1198
<div class="example">
1174
1199
For example, the following rule inserts the string “Note: ”
@@ -1206,7 +1231,9 @@ List Markers: the ''::marker'' pseudo-element</h3>
1206
1231
1207
1232
ISSUE: Interaction of ''::marker'' and ''::first-line'' is currently under discussion in <a href='https://github.com/w3c/csswg-drafts/issues/4506'>Issue 4506</a>.
1208
1233
1209
-
Only a limited set of properties can be used on the ''::marker'' pseudo-element.
1234
+
''::marker'' is a [=tree-abiding pseudo-element=],
1235
+
but not [=part-like pseudo-element|part-like=];
1236
+
only a limited set of properties can be used on the ''::marker'' pseudo-element.
1210
1237
This list is defined in [[css-lists-3#marker-properties]].
1211
1238
1212
1239
The ''::before::marker'' or ''::after::marker'' selectors
@@ -1229,6 +1256,7 @@ Placeholder Input: the ''::placeholder'' pseudo-element</h3>
1229
1256
For example, a date-input field
1230
1257
might have the placeholder text “YYYY/MM/DD”
1231
1258
to clarify that numeric dates are to be entered in year-month-day order.
1259
+
It is a [=tree-abiding pseudo-element=].
1232
1260
1233
1261
<div class="example">
1234
1262
For example, according to the semantics of [[HTML]]
@@ -1266,9 +1294,11 @@ Placeholder Input: the ''::placeholder'' pseudo-element</h3>
1266
1294
<h3 id="file-selector-button-pseudo">
1267
1295
File Selector Button: the ''::file-selector-button'' pseudo-element</h3>
1268
1296
1269
-
The <dfn>::file-selector-button</dfn> pseudo-element targets the ''<button>''
1270
-
inside an ''<input>'' element with <code>type=file</code>, if the UA
1271
-
renders such a button.
1297
+
The <dfn>::file-selector-button</dfn> pseudo-element
1298
+
targets the ''<button>''
1299
+
inside an ''<input>'' element with <code>type=file</code>,
1300
+
if the UA renders such a button.
1301
+
It is a [=part-like pseudo-element=].
1272
1302
1273
1303
There is no restriction on which properties apply to the
0 commit comments