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

Commit 4fc5672

Browse files
committed
5.0.0 (switch to postcss 5.x)
1 parent 7c1c36a commit 4fc5672

File tree

4 files changed

+32
-20
lines changed

4 files changed

+32
-20
lines changed

.eslintrc

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
2-
ecmaFeatures:
3-
modules: true
2+
root: true
3+
extends: eslint:recommended
4+
5+
#ecmaFeatures:
6+
# modules: true
47

58
env:
6-
es6: true
9+
# es6: true
710
browser: true
811
node: true
912

@@ -17,16 +20,20 @@ rules:
1720
brace-style: [2, "stroustrup"]
1821
comma-dangle: [2, "always-multiline"]
1922
comma-style: [2, "last"]
20-
computed-property-spacing: [2, "never"]
2123
dot-location: [2, "property"]
2224

2325
one-var: [2, "never"]
26+
# no-var: [2]
27+
# prefer-const: [2]
2428
no-bitwise: [2]
2529

26-
object-shorthand: [2, "methods"]
30+
object-curly-spacing: [2, "never"]
31+
array-bracket-spacing: [2, "never"]
32+
computed-property-spacing: [2, "never"]
33+
34+
space-unary-ops: [2, {"words": true, "nonwords": false}]
2735
space-after-keywords: [2, "always"]
2836
space-before-blocks: [2, "always"]
2937
space-before-function-paren: [2, "never"]
30-
space-in-brackets: [2, "never"]
3138
space-in-parens: [2, "never"]
32-
spaced-line-comment: [2, "always"]
39+
spaced-comment: [2, "always"]

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 5.0.0 - 2015-08-25
2+
3+
- Removed: compatibility with postcss v4.x
4+
- Added: compatibility with postcss v5.x
5+
16
# 4.1.0 - 2015-06-30
27

38
- Added: Allow custom media to reference each other

index.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function customMedia(options) {
5151
var toRemove = []
5252

5353
// read custom media queries
54-
styles.eachAtRule(function(rule) {
54+
styles.walkAtRules(function(rule) {
5555
if (rule.name !== "custom-media") {
5656
return
5757
}
@@ -87,7 +87,7 @@ function customMedia(options) {
8787
})
8888

8989
// transform custom media query aliases
90-
styles.eachAtRule(function(rule) {
90+
styles.walkAtRules(function(rule) {
9191
if (rule.name !== "media") {
9292
return
9393
}
@@ -123,19 +123,21 @@ function customMedia(options) {
123123
}
124124
var atRule = postcss.atRule({
125125
name: "custom-media",
126-
afterName: " ",
127126
params: name + " " + map[name].value,
127+
raws: {
128+
afterName: " ",
129+
},
128130
})
129131
styles.append(atRule)
130132
})
131-
styles.semicolon = true
132-
styles.after = "\n"
133+
styles.raws.semicolon = true
134+
styles.raws.after = "\n"
133135
}
134136
}
135137

136138
// remove @custom-media
137139
toRemove.forEach(function(rule) {
138-
rule.removeSelf()
140+
rule.remove()
139141
})
140142
}
141143
}

package.json

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "postcss-custom-media",
3-
"version": "4.1.0",
4-
"description": " PostCSS plugin to transform W3C CSS Custom Media Queries to more compatible CSS",
3+
"version": "5.0.0",
4+
"description": "PostCSS plugin to transform W3C CSS Custom Media Queries to more compatible CSS",
55
"keywords": [
66
"css",
77
"postcss",
8-
"postcss-plugins",
8+
"postcss-plugin",
99
"media queries",
1010
"custom-media"
1111
],
@@ -16,15 +16,13 @@
1616
"url": "https://github.com/postcss/postcss-custom-media.git"
1717
},
1818
"files": [
19-
"CHANGELOG.md",
20-
"LICENSE",
2119
"index.js"
2220
],
2321
"dependencies": {
24-
"postcss": "^4.1.4"
22+
"postcss": "^5.0.0"
2523
},
2624
"devDependencies": {
27-
"eslint": "^0.23.0",
25+
"eslint": "^1.0.0",
2826
"tape": "^4.0.0"
2927
},
3028
"scripts": {

0 commit comments

Comments
 (0)