Skip to content

Commit 5cc55b1

Browse files
committed
[css-logical-1] Add code example to the introduction
1 parent a96f7ca commit 5cc55b1

2 files changed

Lines changed: 30 additions & 3 deletions

File tree

css-logical-1/Overview.bs

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,36 @@ Introduction</h2>
5656
lists, headings, and paragraphs are typically left-aligned in English;
5757
but actually they are start-aligned, because in Arabic the same constructs are right-aligned,
5858
and a multilingual document will need to accommodate both writing systems accordingly.
59-
However the drop shadows on buttons on a page must remain consistent throughout,
60-
so their offset will be chosen based on visual considerations and physical directions,
61-
and not vary by writing system.
59+
60+
The following code examplify how using logical syntax can help you write code
61+
that works across different writing systems:
62+
63+
<figure>
64+
<img src="./images/example01.png" width="300" height="109" />
65+
<figcaption>Rendering of the below code in a compatible browser</figcaption>
66+
</figure>
67+
68+
<xmp highlight="html">
69+
<blockquote dir="auto">Quotation in English</blockquote>
70+
<blockquote dir="auto">اقتباس في العربية</blockquote>
71+
</xmp>
72+
73+
<xmp highlight="css">
74+
75+
blockquote {
76+
text-align: start; /* left in latin, right in arabic */
77+
margin-inline-start: 0px; /* margin-left in latin, margin-right in arabic */
78+
border-inline-start: 5px solid gray; /* border-left in latin, border-right in arabic */
79+
padding-inline-start: 5px; /* padding-left in latin, padding-right in arabic */
80+
}
81+
82+
</xmp>
83+
84+
Documents might need both logical and physical properties. For instance
85+
the drop shadows on buttons on a page must remain consistent throughout,
86+
so their offset will be chosen based on visual considerations and physical directions,
87+
and not vary by writing system.
88+
6289
</div>
6390

6491
Since CSS was originally designed with only physical coordinates in its controls,

css-logical-1/images/example01.png

4.08 KB
Loading

0 commit comments

Comments
 (0)