Skip to content

Commit d38782a

Browse files
committed
update examples in readme
1 parent eb5a33d commit d38782a

1 file changed

Lines changed: 25 additions & 13 deletions

File tree

plugins/postcss-logical/README.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,19 @@ physical, direction and dimension mappings in CSS, following the
2323
/* becomes */
2424
2525
.banner:dir(ltr) {
26-
padding-left: 20px; padding-right: 40px;
26+
padding-left: 20px;
27+
padding-right: 40px;
2728
}
28-
2929
.banner:dir(rtl) {
30-
padding-right: 20px; padding-left: 40px;
30+
padding-right: 20px;
31+
padding-left: 40px;
3132
}
32-
3333
.banner {
34+
color: #222222;
35+
top: 0;
36+
left: 5px;
37+
bottom: 10px;
38+
right: 5px;
3439
resize: vertical;
3540
transition: color 200ms;
3641
}
@@ -39,29 +44,36 @@ physical, direction and dimension mappings in CSS, following the
3944
4045
.banner {
4146
color: #222222;
42-
top: 0; left: 5px; bottom: 10px; right: 5px;
43-
padding-left: 20px; padding-right: 40px;
47+
top: 0;
48+
left: 5px;
49+
bottom: 10px;
50+
right: 5px;
51+
padding-left: 20px;
52+
padding-right: 40px;
4453
resize: vertical;
4554
transition: color 200ms;
4655
}
4756
4857
/* or, when used with { preserve: true } */
4958
5059
.banner:dir(ltr) {
51-
padding-left: 20px; padding-right: 40px;
60+
padding-left: 20px;
61+
padding-right: 40px;
5262
}
53-
5463
.banner:dir(rtl) {
55-
padding-right: 20px; padding-left: 40px;
64+
padding-right: 20px;
65+
padding-left: 40px;
5666
}
57-
5867
.banner {
5968
color: #222222;
60-
top: 0; left: 5px; bottom: 10px; right: 5px;
69+
top: 0;
70+
left: 5px;
71+
bottom: 10px;
72+
right: 5px;
6173
inset: logical 0 5px 10px;
6274
padding-inline: 20px 40px;
63-
resize: block;
6475
resize: vertical;
76+
resize: block;
6577
transition: color 200ms;
6678
}
6779
```
@@ -122,7 +134,7 @@ any `[dir]` attributes, consider using the following JavaScript:
122134

123135
```js
124136
// force at least one dir attribute (this can run at any time)
125-
document.documentElement.dir=document.documentElement.dir||'ltr';
137+
document.documentElement.dir = document.documentElement.dir || 'ltr';
126138
```
127139

128140
Otherwise, consider using the `dir` option to transform all logical properties

0 commit comments

Comments
 (0)