Skip to content

Commit 7e15490

Browse files
committed
add plugin css-reset、utils
1 parent 3fbb43a commit 7e15490

File tree

7 files changed

+142
-1
lines changed

7 files changed

+142
-1
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postcss-salad",
3-
"version": "0.0.1",
3+
"version": "1.0.0",
44
"description": "沙拉是一个能够帮助你更加写出更加简洁、优雅的CSS的样式解决方案。",
55
"main": "lib/index.js",
66
"scripts": {
@@ -17,13 +17,15 @@
1717
"postcss": "^5.0.4",
1818
"postcss-bem": "^0.4.1",
1919
"postcss-calc": "^5.0.0",
20+
"postcss-css-reset": "^1.0.0",
2021
"postcss-initial": "^1.3.1",
2122
"postcss-inline-svg": "^1.4.0",
2223
"postcss-neat": "^2.5.2",
2324
"postcss-pseudo-class-any-link": "^1.0.0",
2425
"postcss-scss": "^0.1.7",
2526
"postcss-shape": "^0.0.1",
2627
"postcss-short": "^1.4.0",
28+
"postcss-utils": "^1.0.0",
2729
"precss": "^1.4.0"
2830
},
2931
"devDependencies": {

src/features.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ export default {
66
* ******************
77
*/
88

9+
// https://npmjs.com/package/postcss-utils
10+
utils: (options) => require("postcss-utils")(options),
11+
12+
// https://npmjs.com/package/postcss-css-reset
13+
reset: (options) => require("postcss-css-reset")(options),
14+
915
// https://npmjs.com/package/postcss-neat
1016
neat: (options) => require("postcss-neat")(options),
1117

src/test/features/neat.expected.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.cnt {
2+
max-width: 64em;
3+
margin-left: auto;
4+
margin-right: auto;
5+
*zoom: 1;
6+
}
7+
.cnt:before, .cnt:after {
8+
content: " ";
9+
display: table;
10+
}
11+
.cnt:after {
12+
clear: both;
13+
}
14+
.col2 {
15+
display: block;
16+
float: left;
17+
margin-right: 2.35765160%;
18+
width: 6.17215270%;
19+
}
20+
.col2:last-child {
21+
margin-right: 0;
22+
}

src/test/features/reset.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.table {
2+
@reset-nested tabel;
3+
color: #fff;
4+
}
5+
6+
td, th {
7+
background-color: #fff;
8+
@reset-nested tabel-cell;
9+
}
10+
11+
ul, ol {
12+
@reset-nested list;
13+
}
14+
15+
.regular-font {
16+
@reset-nested font;
17+
}

src/test/features/reset.expected.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.table {
2+
border-collapse: collapse;
3+
border-spacing: 0;
4+
vertical-align: middle;
5+
color: #fff;
6+
}
7+
8+
td, th {
9+
background-color: #fff;
10+
text-align: left;
11+
font-weight: normal;
12+
vertical-align: middle;
13+
margin: 0;
14+
padding: 0;
15+
}
16+
17+
ul, ol {
18+
list-style: none;
19+
margin: 0;
20+
padding: 0;
21+
}
22+
23+
.regular-font {
24+
font-family: inherit;
25+
font-size: inherit;
26+
font-weight: inherit;
27+
}

src/test/features/utils.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.ellipsis {
2+
@utils-ellipsis;
3+
}
4+
.ellipsis2 {
5+
@utils-ellipsis 3;
6+
}
7+
.clearfix {
8+
@utils-clearfix;
9+
}
10+
.irt {
11+
@utils-irt;
12+
}
13+
.usn {
14+
@utils-user-select none;
15+
}
16+
.disabled {
17+
@utils-disabled #ccc #f00 #333;
18+
}
19+
.vam-box {
20+
@utils-vertical-center;
21+
}

src/test/features/utils.expected.css

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
.ellipsis {
2+
overflow: hidden;
3+
text-overflow: ellipsis;
4+
white-space: nowrap;
5+
}
6+
.ellipsis2 {
7+
overflow: hidden;
8+
text-overflow: ellipsis;
9+
display: -webkit-box;
10+
-webkit-box-orient: vertical;
11+
-webkit-line-clamp: 3;
12+
}
13+
.clearfix {
14+
}
15+
.clearfix:before, .clearfix:after {
16+
display: table;
17+
content: ;
18+
}
19+
.clearfix:after {
20+
clear: both;
21+
}
22+
.irt {
23+
font: 0/0 none;
24+
text-shadow: none;
25+
color: transparent;
26+
}
27+
.usn {
28+
-moz-user-select: none;
29+
-webkit-user-select: none;
30+
-ms-user-select: none;
31+
}
32+
.disabled {
33+
background-color: #ccc;
34+
border-color: #f00;
35+
color: #333;
36+
cursor: default;
37+
pointer-events: none;
38+
}
39+
.vam-box {
40+
}
41+
.vam-box:after {
42+
display: inline-block;
43+
content: ;
44+
height: 100%;
45+
vertical-align: middle;
46+
}

0 commit comments

Comments
 (0)