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

Commit

Permalink
5.0.0 (switch to postcss 5.x)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoOx committed Aug 25, 2015
1 parent 7c1c36a commit 4fc5672
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 20 deletions.
21 changes: 14 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
---
ecmaFeatures:
modules: true
root: true
extends: eslint:recommended

#ecmaFeatures:
# modules: true

env:
es6: true
# es6: true
browser: true
node: true

Expand All @@ -17,16 +20,20 @@ rules:
brace-style: [2, "stroustrup"]
comma-dangle: [2, "always-multiline"]
comma-style: [2, "last"]
computed-property-spacing: [2, "never"]
dot-location: [2, "property"]

one-var: [2, "never"]
# no-var: [2]
# prefer-const: [2]
no-bitwise: [2]

object-shorthand: [2, "methods"]
object-curly-spacing: [2, "never"]
array-bracket-spacing: [2, "never"]
computed-property-spacing: [2, "never"]

space-unary-ops: [2, {"words": true, "nonwords": false}]
space-after-keywords: [2, "always"]
space-before-blocks: [2, "always"]
space-before-function-paren: [2, "never"]
space-in-brackets: [2, "never"]
space-in-parens: [2, "never"]
spaced-line-comment: [2, "always"]
spaced-comment: [2, "always"]
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 5.0.0 - 2015-08-25

- Removed: compatibility with postcss v4.x
- Added: compatibility with postcss v5.x

# 4.1.0 - 2015-06-30

- Added: Allow custom media to reference each other
Expand Down
14 changes: 8 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function customMedia(options) {
var toRemove = []

// read custom media queries
styles.eachAtRule(function(rule) {
styles.walkAtRules(function(rule) {
if (rule.name !== "custom-media") {
return
}
Expand Down Expand Up @@ -87,7 +87,7 @@ function customMedia(options) {
})

// transform custom media query aliases
styles.eachAtRule(function(rule) {
styles.walkAtRules(function(rule) {
if (rule.name !== "media") {
return
}
Expand Down Expand Up @@ -123,19 +123,21 @@ function customMedia(options) {
}
var atRule = postcss.atRule({
name: "custom-media",
afterName: " ",
params: name + " " + map[name].value,
raws: {
afterName: " ",
},
})
styles.append(atRule)
})
styles.semicolon = true
styles.after = "\n"
styles.raws.semicolon = true
styles.raws.after = "\n"
}
}

// remove @custom-media
toRemove.forEach(function(rule) {
rule.removeSelf()
rule.remove()
})
}
}
Expand Down
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "postcss-custom-media",
"version": "4.1.0",
"description": " PostCSS plugin to transform W3C CSS Custom Media Queries to more compatible CSS",
"version": "5.0.0",
"description": "PostCSS plugin to transform W3C CSS Custom Media Queries to more compatible CSS",
"keywords": [
"css",
"postcss",
"postcss-plugins",
"postcss-plugin",
"media queries",
"custom-media"
],
Expand All @@ -16,15 +16,13 @@
"url": "https://github.com/postcss/postcss-custom-media.git"
},
"files": [
"CHANGELOG.md",
"LICENSE",
"index.js"
],
"dependencies": {
"postcss": "^4.1.4"
"postcss": "^5.0.0"
},
"devDependencies": {
"eslint": "^0.23.0",
"eslint": "^1.0.0",
"tape": "^4.0.0"
},
"scripts": {
Expand Down

0 comments on commit 4fc5672

Please sign in to comment.