Skip to content

Commit 5f9e570

Browse files
author
Jihye Hong
committed
[css-round-display] Move 'contain' into offset-path
1 parent 4e35c05 commit 5f9e570

File tree

1 file changed

+41
-38
lines changed

1 file changed

+41
-38
lines changed

css-round-display/Overview.bs

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ A path can be defined with 'offset-path' and 'offset-position'. The position of
400400
<pre class='propdef'>
401401
Name: offset-path
402402
Applies to: All elements. In SVG, it applies to <a>container elements</a> excluding the <{defs}> element and all <a>graphics elements</a>
403-
Value: <<url>> | <<angle>> | [ <<basic-shape>> | <<path()>> ] || <<geometry-box>> | none
403+
Value: <<url>> | <<angle>> && contain? | [ <<basic-shape>> | <<path()>> ] || <<geometry-box>> | none
404404
Initial: 0deg for <<angle>>, otherwise no
405405
Media: visual
406406
Inherited: no
@@ -416,6 +416,13 @@ Values have the following meanings:
416416
<dt><<angle>></dt>
417417
<dd>
418418
The path is a straight line that starts from the current position of the element and has the degree of the angle as specified in <<angle>> from the Y-axis. The path ends at the edge of the containing block.
419+
420+
<dl>
421+
<dt><dfn>contain</dfn></dt>
422+
<dd>
423+
Adjust the value of 'offset-distance' when the element goes out of the path. When overflowing occurs, the distance value is reduced, until the end point of the path is on the edge of the element.
424+
</dd>
425+
</dl>
419426

420427
<p class="note">Note: Defining the path with <<angle>>, the element can be positioned in the polar coordinate system. In polar coordinates, a pole is the reference point and points are described as been a certain distance from it, as also a certain angle from the polar axis. In mathematical theory, the polar axis is commonly defined as the positive direction of the x-axis, but we consider the polar axis as the positive direction of the y-axis position as other CSS specifications usually do. Therefore, when the <<angle>> value of 'offset-path' is 0, the element is positioned on the y-axis. If the <<angle>> value increases in the positive direction from 0, the element moves clockwise. The method to determine a direction using the <<angle>> value for 'offset-path' works the same way in [[!CSS3VAL]], <<angle>> value.</p>
421428
</dd>
@@ -454,6 +461,38 @@ For SVG elements without associated CSS layout box, the <a>used value</a> for <a
454461

455462
For elements with associated CSS layout box, the <a>used value</a> for <a value for=clip-path>fill-box</a>, <a value for=clip-path>stroke-box</a> and <a value for=clip-path>view-box</a> is <a value for=mask-clip>border-box</a>.
456463

464+
<div class='example'>
465+
Here are some examples. The first example shows some parts of elements are outside of the path.
466+
467+
<pre class="lang-html">
468+
&lt;body>
469+
&lt;div style="offset-path: 45deg; offset-distance: 100%">&lt;/div>
470+
&lt;div style="offset-path: 180deg; offset-distance: 100%">&lt;/div>
471+
&lt;/body>
472+
</pre>
473+
<div class=figure>
474+
<img alt="An image of elements positioned without contain" src="images/offset_distance_without_contain.png" style="width: 300px;"/>
475+
<figcaption>
476+
'offset-path' without 'contain'
477+
</figcaption>
478+
</div>
479+
480+
In the second example, contain, the extent keyword value is added to the 'offset-path' value of each element to avoid overflowing.
481+
482+
<pre class="lang-html">
483+
&lt;body>
484+
&lt;div style="offset-path: 45deg contain; offset-distance: 100%">&lt;/div>
485+
&lt;div style="offset-path: 180deg contain; offset-distance: 100%">&lt;/div>
486+
&lt;/body>
487+
</pre>
488+
<div class=figure>
489+
<img alt="An image of elements positioned without contain" src="images/offset_distance_with_contain.png" style="width: 300px;"/>
490+
<figcaption>
491+
'offset-path' with 'contain'
492+
</figcaption>
493+
</div>
494+
</div>
495+
457496
<h3 id="offset-position-property">Define the initial position of the path: The 'offset-position' property</h3>
458497
<pre class='propdef'>
459498
Name: offset-position
@@ -523,7 +562,7 @@ Values are defined as follows:
523562
<pre class='propdef'>
524563
Name: offset-distance
525564
Applies to: All elements
526-
Value: [ <<length>> | <<percentage>> <<size>>? ] && contain?
565+
Value: [ <<length>> | <<percentage>> <<size>>? ]
527566
Initial: 0
528567
Media: visual
529568
Inherited: no
@@ -570,10 +609,6 @@ Values are defined as follows:
570609
</dl>
571610
<p class='note'>Note: When the initial position is at one of the corners of the containing block, the closest side takes the edge where the initial position is on. Even if the offset given by <<length>> or <<percentage>> changes, the position of the element specified with closest-side is the same.</p>
572611
</dd>
573-
<dt><dfn>contain</dfn></dt>
574-
<dd>
575-
Adjust the value of 'offset-distance' when the element goes out of the path. When overflowing occurs, the distance value is reduced, until there is a contact point between the path and content block of the element.
576-
</dd>
577612
</dl>
578613

579614
See the section Motion processing for how to process a motion position.
@@ -610,38 +645,6 @@ See the section Motion processing for how to process a motion position.
610645
</div>
611646
</div>
612647

613-
<div class='example'>
614-
Here are some examples. The first example shows some parts of elements are outside of the path.
615-
616-
<pre class="lang-html">
617-
&lt;body>
618-
&lt;div style="offset-path: 45deg; offset-distance: 100%">&lt;/div>
619-
&lt;div style="offset-path: 180deg; offset-distance: 100%">&lt;/div>
620-
&lt;/body>
621-
</pre>
622-
<div class=figure>
623-
<img alt="An image of elements positioned without contain" src="images/offset_distance_without_contain.png" style="width: 300px;"/>
624-
<figcaption>
625-
'offset-distance' without 'contain'
626-
</figcaption>
627-
</div>
628-
629-
In the second example, contain, the extent keyword value is added to the 'offset-distance' value of each element to avoid overflowing.
630-
631-
<pre class="lang-html">
632-
&lt;body>
633-
&lt;div style="offset-path: 45deg; offset-distance: 100% contain">&lt;/div>
634-
&lt;div style="offset-path: 180deg; offset-distance: 100% contain">&lt;/div>
635-
&lt;/body>
636-
</pre>
637-
<div class=figure>
638-
<img alt="An image of elements positioned without contain" src="images/offset_distance_with_contain.png" style="width: 300px;"/>
639-
<figcaption>
640-
'offset-distance' with 'contain'
641-
</figcaption>
642-
</div>
643-
</div>
644-
645648
<h3 id="offset-anchor-property">The anchor of the element: The 'offset-anchor' property</h3>
646649
<pre class='propdef'>
647650
Name: offset-anchor

0 commit comments

Comments
 (0)