Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Commit 00ef631

Browse files
committed
Update documentation
1 parent ec00e0f commit 00ef631

File tree

2 files changed

+43
-14
lines changed

2 files changed

+43
-14
lines changed

README.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
[![Windows Build Status][win-img]][win-url]
66
[![Gitter Chat][git-img]][git-url]
77

8-
[PostCSS Logical Properties] lets you use nearly 60 new [logical properties]
9-
and a half dozen flow-relative values in CSS.
8+
[PostCSS Logical Properties] lets you use Logical Properties and Values in
9+
CSS, following the [CSS Logical Properties and Values Level 1] specification.
1010

1111
```css
1212
.banner {
@@ -34,6 +34,15 @@ and a half dozen flow-relative values in CSS.
3434
.banner {
3535
resize: vertical;
3636
}
37+
38+
/* used with { dir: 'ltr' } option */
39+
40+
.banner {
41+
color: #222222;
42+
top: 0; left: 5px; bottom: 10px; right: 5px;
43+
padding-left: 20px; padding-right: 40px;
44+
resize: vertical;
45+
}
3746
```
3847

3948
These shorthand properties set values for physical properties by default.
@@ -85,15 +94,25 @@ properties:
8594

8695
---
8796

88-
[PostCSS Logical Properties] changes the selector weight of flow-relative
89-
declarations and requires at least one [dir] attribute in your HTML. If you
90-
don’t have any [dir] attributes, consider using the following JavaScript:
97+
By default, [PostCSS Logical Properties] changes the selector weight of
98+
flow-relative declarations and requires at least one [dir] attribute in your
99+
HTML. If you don’t have any [dir] attributes, consider using the following
100+
JavaScript:
91101

92102
```js
93103
// force at least one dir attribute (this can run at any time)
94104
document.documentElement.dir=document.documentElement.dir||'ltr';
95105
```
96106

107+
Otherwise, consider using the `dir` option to transform all logical properties
108+
and values to a specific direction.
109+
110+
```js
111+
require('postcss-logical')({
112+
dir: 'ltr'
113+
});
114+
```
115+
97116
## Usage
98117

99118
Add [PostCSS Logical Properties] to your build tool:
@@ -122,7 +141,7 @@ Use [PostCSS Logical Properties] as a plugin:
122141

123142
```js
124143
postcss([
125-
require('postcss-logical')()
144+
require('postcss-logical')(/* options */)
126145
]).process(YOUR_CSS);
127146
```
128147

@@ -142,7 +161,7 @@ var postcss = require('gulp-postcss');
142161
gulp.task('css', function () {
143162
return gulp.src('./src/*.css').pipe(
144163
postcss([
145-
require('postcss-logical')()
164+
require('postcss-logical')(/* options */)
146165
])
147166
).pipe(
148167
gulp.dest('.')
@@ -167,7 +186,7 @@ grunt.initConfig({
167186
postcss: {
168187
options: {
169188
use: [
170-
require('postcss-logical')()
189+
require('postcss-logical')(/* options */)
171190
]
172191
},
173192
dist: {
@@ -187,7 +206,7 @@ grunt.initConfig({
187206
[git-img]: https://img.shields.io/badge/chat-gitter-blue.svg
188207

189208
[PostCSS Logical Properties]: https://github.com/jonathantneal/postcss-logical-properties
190-
[logical properties]: https://drafts.csswg.org/css-logical/
209+
[CSS Logical Properties and Values Level 1]: https://drafts.csswg.org/css-logical/
191210
[PostCSS]: https://github.com/postcss/postcss
192211
[Gulp PostCSS]: https://github.com/postcss/gulp-postcss
193212
[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss

package.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "postcss-logical",
33
"version": "1.0.2",
4-
"description": "Use logical properties and flow-relative values in CSS",
4+
"description": "Use logical properties and values in CSS",
55
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
66
"license": "CC0-1.0",
77
"repository": "jonathantneal/postcss-logical-properties",
@@ -41,15 +41,25 @@
4141
"logical",
4242
"flow",
4343
"relative",
44-
"ltr",
45-
"rtl",
44+
"property",
4645
"properties",
4746
"values",
47+
"ltr",
48+
"rtl",
49+
"dir",
4850
"directions",
49-
"dirs",
51+
"directional",
5052
"inline",
5153
"block",
5254
"start",
53-
"end"
55+
"end",
56+
"align",
57+
"border",
58+
"clear",
59+
"float",
60+
"margin",
61+
"padding",
62+
"size",
63+
"text"
5464
]
5565
}

0 commit comments

Comments
 (0)