From 391ad5b41a539000099f5cfa85ae7dff6b519916 Mon Sep 17 00:00:00 2001 From: Semigradsky Date: Fri, 19 Aug 2016 17:52:02 +0300 Subject: [PATCH] Added new feature (attribute case insensitive) Specification: https://www.w3.org/TR/selectors4/#attribute-case Plugin documentation: https://github.com/Semigradsky/postcss-attribute-case-insensitive --- docs/content/features.md | 14 ++++++++++++++ docs/content/index.md | 3 +++ docs/content/playground.html | 5 +++++ package.json | 1 + .../features/attribute-case-insensitive.css | 3 +++ .../attribute-case-insensitive.expected.css | 3 +++ src/features.js | 3 +++ 7 files changed, 32 insertions(+) create mode 100644 src/__tests__/fixtures/features/attribute-case-insensitive.css create mode 100644 src/__tests__/fixtures/features/attribute-case-insensitive.expected.css diff --git a/docs/content/features.md b/docs/content/features.md index e6d384d..db4e9a3 100644 --- a/docs/content/features.md +++ b/docs/content/features.md @@ -428,6 +428,20 @@ body { | [Plugin documentation](https://github.com/MattDiMu/postcss-replace-overflow-wrap) +## attribute case insensitive + +Allows you to use case insensitive attributes. + +```css +[frame=hsides i] { + border-style: solid none; +} +``` + +[Specification](https://www.w3.org/TR/selectors4/#attribute-case) +| +[Plugin documentation](https://github.com/Semigradsky/postcss-attribute-case-insensitive) + ## @todo Any omissions of the CSS specifications (even in draft) that are subject to be diff --git a/docs/content/index.md b/docs/content/index.md index 88af42f..8672936 100644 --- a/docs/content/index.md +++ b/docs/content/index.md @@ -135,6 +135,9 @@ title: cssnext - Use tomorrow’s CSS syntax, today. (word-wrap fallback) +
  • + attribute case insensitive +
  • diff --git a/package.json b/package.json index e0f9450..99ece61 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "pleeease-filters": "^3.0.0", "postcss": "^5.0.4", "postcss-apply": "^0.3.0", + "postcss-attribute-case-insensitive": "^1.0.1", "postcss-calc": "^5.0.0", "postcss-color-function": "^2.0.0", "postcss-color-gray": "^3.0.0", diff --git a/src/__tests__/fixtures/features/attribute-case-insensitive.css b/src/__tests__/fixtures/features/attribute-case-insensitive.css new file mode 100644 index 0000000..7168428 --- /dev/null +++ b/src/__tests__/fixtures/features/attribute-case-insensitive.css @@ -0,0 +1,3 @@ +[data-foo=test i] { + display: block; +} diff --git a/src/__tests__/fixtures/features/attribute-case-insensitive.expected.css b/src/__tests__/fixtures/features/attribute-case-insensitive.expected.css new file mode 100644 index 0000000..c857cc7 --- /dev/null +++ b/src/__tests__/fixtures/features/attribute-case-insensitive.expected.css @@ -0,0 +1,3 @@ +[data-foo=test],[data-foo=Test],[data-foo=tEst],[data-foo=TEst],[data-foo=teSt],[data-foo=TeSt],[data-foo=tESt],[data-foo=TESt],[data-foo=tesT],[data-foo=TesT],[data-foo=tEsT],[data-foo=TEsT],[data-foo=teST],[data-foo=TeST],[data-foo=tEST],[data-foo=TEST] { + display: block; +} diff --git a/src/features.js b/src/features.js index 5074a8b..3c95aad 100644 --- a/src/features.js +++ b/src/features.js @@ -27,6 +27,9 @@ export default { // https://npmjs.com/package/postcss-custom-selectors customSelectors: (options) => require("postcss-custom-selectors")(options), + // https://npmjs.com/package/postcss-attribute-case-insensitive + attributeCaseInsensitive: (options) => require("postcss-attribute-case-insensitive")(options), + // https://npmjs.com/package/postcss-color-rebeccapurple colorRebeccapurple: (options) => require("postcss-color-rebeccapurple")(options),