Skip to content

Commit 4fff2d4

Browse files
committed
[css-properties-values-api] Also move the dependency-cycles subsection to the general behavior section.
1 parent 0eeca05 commit 4fff2d4

File tree

1 file changed

+48
-48
lines changed

1 file changed

+48
-48
lines changed

css-properties-values-api/Overview.bs

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,54 @@ and [[css-syntax-3#tokenization|tokenizing]] the resulting string.
400400
</div>
401401

402402

403+
Dependency Cycles Via Relative Units {#dependency-cycles}
404+
---------------------------------------------------------
405+
406+
Registered custom properties follow the same rules for dependency cycle
407+
resolution as unregistered custom properties, with the following additional
408+
constraints:
409+
410+
For any registered custom property with a <<length>> or <<length-percentage>> syntax
411+
component:
412+
413+
* If the property contains any of the following units:
414+
''em'', ''ex'', ''cap'', ''ch'', ''ic'', ''lh'';
415+
then add an edge between the property and the ''font-size'' of the current
416+
element.
417+
* If the property contains the ''lh'' unit,
418+
add an edge between the property and the ''line-height'' of the current
419+
element.
420+
* If the property contains any of the following units: ''rem'', ''rlh'';
421+
then add an edge between the property
422+
and the 'font-size'' of the root element.
423+
* If the property contains the ''rlh'' unit, add an edge between the property
424+
and the 'line-height'' of the root element.
425+
426+
<div class='example'>
427+
For example, given this registration:
428+
429+
<pre class='lang-javascript'>
430+
CSS.registerProperty({
431+
name: "--my-font-size",
432+
syntax: "&lt;length>",
433+
initialValue: "0px",
434+
inherits: false
435+
});
436+
</pre>
437+
438+
the following will produce a dependency cycle:
439+
440+
<pre class='lang-css'>
441+
div {
442+
--my-font-size: 10em;
443+
font-size: var(--my-font-size);
444+
}
445+
</pre>
446+
447+
and ''font-size'' will behave as if the value ''unset'' was specified.
448+
</div>
449+
450+
403451

404452
<!--
405453
███████ ████████ ████████ ███████ ████████ ████████ ████████ ████████ ██ ██
@@ -747,54 +795,6 @@ following members:
747795
:: The initial value of this custom property.
748796

749797

750-
Dependency Cycles Via Relative Units {#dependency-cycles}
751-
---------------------------------------------------------
752-
753-
Registered custom properties follow the same rules for dependency cycle
754-
resolution as unregistered custom properties, with the following additional
755-
constraints:
756-
757-
For any registered custom property with a <<length>> or <<length-percentage>> syntax
758-
component:
759-
760-
* If the property contains any of the following units:
761-
''em'', ''ex'', ''cap'', ''ch'', ''ic'', ''lh'';
762-
then add an edge between the property and the ''font-size'' of the current
763-
element.
764-
* If the property contains the ''lh'' unit,
765-
add an edge between the property and the ''line-height'' of the current
766-
element.
767-
* If the property contains any of the following units: ''rem'', ''rlh'';
768-
then add an edge between the property
769-
and the 'font-size'' of the root element.
770-
* If the property contains the ''rlh'' unit, add an edge between the property
771-
and the 'line-height'' of the root element.
772-
773-
<div class='example'>
774-
For example, given this registration:
775-
776-
<pre class='lang-javascript'>
777-
CSS.registerProperty({
778-
name: "--my-font-size",
779-
syntax: "&lt;length>",
780-
initialValue: "0px",
781-
inherits: false
782-
});
783-
</pre>
784-
785-
the following will produce a dependency cycle:
786-
787-
<pre class='lang-css'>
788-
div {
789-
--my-font-size: 10em;
790-
font-size: var(--my-font-size);
791-
}
792-
</pre>
793-
794-
and ''font-size'' will behave as if the value ''unset'' was specified.
795-
</div>
796-
797-
798798
<!--
799799
██████ ██ ██ ██ ██ ████████ ███ ██ ██
800800
██ ██ ██ ██ ███ ██ ██ ██ ██ ██ ██

0 commit comments

Comments
 (0)