Skip to content

[css-text-decor-3] [css-text-decor-4] Add example describing how decorating box interacts with text-shadow #7588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions css-text-decor-3/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,25 @@ Line Decoration: Underline, Overline, and Strike-Through</h2>
represents the span element, and the orange lines represent the
blocks.
</div>
<div class="example">
In the following style sheet and document fragment:
<pre>
div { color: black; font-size: 48px; text-decoration: underline; text-shadow: blue 0px 50px 0px; }
span { font-size: 20px; vertical-align: top; text-shadow: green 0px 100px 0px; }
</pre>
<pre>
&lt;div&gt;Help, help! &lt;span&gt;I am under a hat!&lt;/span&gt;&lt;/div&gt;
</pre>
...the &lt;div&gt; is the [=decorating box=] for its underline (in black),
which is rendered uninterrupted through both the &lt;div&gt; and the &lt;span&gt;.
Unlike line decorations, however,
`text-shadow` is inherited as a property;
therefore the green text shadow on the &lt;span&gt;
overrides the blue text shadow on the &lt;div&gt;.
As a result, when the shadows are painted,
the shadow of the &lt;div&gt;’s underline is disjoint across the two elements.
<img src="images/underline-example-2.png" alt="Sample rendering of the above underline example">
</div>

Note: Line decorations are propagated through the box tree,
not through inheritance,
Expand Down
Binary file added css-text-decor-3/images/underline-example-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions css-text-decor-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,25 @@ Line Decoration: Underline, Overline, and Strike-Through</h2>
represents the span element, and the orange lines represent the
blocks.
</div>
<div class="example">
In the following style sheet and document fragment:
<pre>
div { color: black; font-size: 48px; text-decoration: underline; text-shadow: blue 0px 50px 0px; }
span { font-size: 20px; vertical-align: top; text-shadow: green 0px 100px 0px; }
</pre>
<pre>
&lt;div&gt;Help, help! &lt;span&gt;I am under a hat!&lt;/span&gt;&lt;/div&gt;
</pre>
...the &lt;div&gt; is the [=decorating box=] for its underline (in black),
which is rendered uninterrupted through both the &lt;div&gt; and the &lt;span&gt;.
Unlike line decorations, however,
`text-shadow` is inherited as a property;
therefore the green text shadow on the &lt;span&gt;
overrides the blue text shadow on the &lt;div&gt;.
As a result, when the shadows are painted,
the shadow of the &lt;div&gt;’s underline is disjoint across the two elements.
<img src="images/underline-example-2.png" alt="Sample rendering of the above underline example">
</div>

Note: Line decorations are propagated through the box tree,
not through inheritance,
Expand Down
Binary file added css-text-decor-4/images/underline-example-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.