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

Commit cc35989

Browse files
author
Ҽ˿
committed
Because the default wrap, modify the document and test file.
1 parent dc46fbb commit cc35989

File tree

6 files changed

+65
-15
lines changed

6 files changed

+65
-15
lines changed

README-zh.md

+24-5
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ article --heading + p {
5353
你将得到:
5454

5555
```css
56-
article h1 + p, article h2 + p, article h3 + p, article h4 + p, article h5 + p, article h6 + p {
56+
article h1 + p,
57+
article h2 + p,
58+
article h3 + p,
59+
article h4 + p,
60+
article h5 + p,
61+
article h6 + p {
5762
margin-top: 0;
5863
}
5964
```
@@ -89,7 +94,8 @@ a:--any-link {
8994
output:
9095

9196
```css
92-
a:link, a:visited {
97+
a:link,
98+
a:visited {
9399
color: blue;
94100
}
95101
```
@@ -109,6 +115,17 @@ a:link, a:visited {
109115
```
110116
将会输出错误的 CSS 代码。
111117

118+
```css
119+
.demo h1,
120+
.demo h2,
121+
.demo h3,
122+
.demo h4,
123+
.demo h5,
124+
.demo h6,undefined {
125+
font-size: 32px;
126+
}
127+
```
128+
112129
### Node Watch
113130

114131
依赖 [chokidar](https://github.com/paulmillr/chokidar) 模块。
@@ -135,7 +152,6 @@ chokidar.watch(src, {
135152
fs.writeFileSync('output.css', output)
136153
})
137154
```
138-
index.css 文件中的改动保存后将转换到 output.css
139155

140156
### Grunt
141157

@@ -233,8 +249,11 @@ var output = postcss(selector(options))
233249
input.css
234250

235251
```css
236-
@custom-selector :--any .foo, .bar; /* 不会生效 */
237-
:--any h1 {
252+
/* 不会生效 */
253+
section h1,
254+
article h1,
255+
aside h1,
256+
nav h1 {
238257
margin-top: 16px;
239258
}
240259
```

README.md

+26-5
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ article --heading + p {
5353
You will get:
5454

5555
```css
56-
article h1 + p, article h2 + p, article h3 + p, article h4 + p, article h5 + p, article h6 + p {
56+
article h1 + p,
57+
article h2 + p,
58+
article h3 + p,
59+
article h4 + p,
60+
article h5 + p,
61+
article h6 + p {
5762
margin-top: 0;
5863
}
5964
```
@@ -63,7 +68,7 @@ article h1 + p, article h2 + p, article h3 + p, article h4 + p, article h5 + p,
6368
@custom-selector = @custom-selector <extension-name> <selector>;
6469

6570

66-
## How to use it
71+
## How to use
6772

6873
### Pseudo-element/Pseudo-class
6974

@@ -89,7 +94,8 @@ a:--any-link {
8994
output:
9095

9196
```css
92-
a:link, a:visited {
97+
a:link,
98+
a:visited {
9399
color: blue;
94100
}
95101
```
@@ -109,6 +115,17 @@ Example 3:
109115
```
110116
This will throw an error CSS code.
111117

118+
```css
119+
.demo h1,
120+
.demo h2,
121+
.demo h3,
122+
.demo h4,
123+
.demo h5,
124+
.demo h6,undefined {
125+
font-size: 32px;
126+
}
127+
```
128+
112129
### Node Watch
113130

114131
Dependence [chokidar](https://github.com/paulmillr/chokidar) module.
@@ -191,7 +208,7 @@ gulp.watch('src/*.css', ['default']);
191208

192209
#### 1. **`lineBreak`**(default: `true`)
193210

194-
Setting multiple selector whether wrap.
211+
Set whether multiple selector wrap.The default is turning on to be a newline.
195212

196213
Close the line breaks.
197214

@@ -241,7 +258,11 @@ input.css
241258
output:
242259

243260
```css
244-
section h1, article h1, aside h1, nav h1 {
261+
/* No effect */
262+
section h1,
263+
article h1,
264+
aside h1,
265+
nav h1 {
245266
margin-top: 16px;
246267
}
247268
```

test/fixtures/extension.expected.css

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
section h1, article h1, aside h1, nav h1 {
1+
section h1,
2+
article h1,
3+
aside h1,
4+
nav h1 {
25
margin-top: 16px;
36
}
47

5-
main input[type="text"] > section + p, main #nav .bar + p {
8+
main input[type="text"] > section + p,
9+
main #nav .bar + p {
610
margin-top: 16px;
711
}

test/fixtures/heading.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@custom-selector --heading h1, h2, h3, h4, h5, h6;
22

3-
article --heading + p{
3+
article --heading + p {
44
margin-top: 0;
55
}

test/fixtures/heading.expected.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
article h1 + p, article h2 + p, article h3 + p, article h4 + p, article h5 + p, article h6 + p{
1+
article h1 + p,
2+
article h2 + p,
3+
article h3 + p,
4+
article h4 + p,
5+
article h5 + p,
6+
article h6 + p {
27
margin-top: 0;
38
}

test/fixtures/pseudo.expected.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
.foo > a::before img, .foo > a::after img {
1+
.foo > a::before img,
2+
.foo > a::after img {
23
display: block;
34
}

0 commit comments

Comments
 (0)