postcss-modules
Advanced tools
+12
-0
@@ -7,2 +7,6 @@ 'use strict'; | ||
| var _lodash = require('lodash.camelcase'); | ||
| var _lodash2 = _interopRequireDefault(_lodash); | ||
| var _parser = require('css-modules-loader-core/lib/parser'); | ||
@@ -93,2 +97,10 @@ | ||
| if (opts.camelCase === true) { | ||
| Object.keys(parser.exportTokens).forEach(function (token) { | ||
| const camelCaseToken = (0, _lodash2.default)(token); | ||
| parser.exportTokens[camelCaseToken] = parser.exportTokens[token]; | ||
| }); | ||
| } | ||
| // getJSON may return a promise | ||
@@ -95,0 +107,0 @@ return getJSON(css.source.input.file, parser.exportTokens, result.opts.to); |
+4
-0
| # Changelog | ||
| ## 1.2.0 | ||
| - Added option to transform classes to camelCase by Igor Ribeiro (@igor-ribeiro) <https://github.com/css-modules/postcss-modules/pull/82> | ||
| ## 1.1.0 | ||
@@ -4,0 +8,0 @@ |
+2
-1
| { | ||
| "name": "postcss-modules", | ||
| "version": "1.1.0", | ||
| "version": "1.2.0", | ||
| "description": "PostCSS plugin to use CSS Modules everywhere", | ||
@@ -23,2 +23,3 @@ "main": "build/index.js", | ||
| "generic-names": "^1.0.2", | ||
| "lodash.camelcase": "^4.3.0", | ||
| "postcss": "^6.0.1", | ||
@@ -25,0 +26,0 @@ "string-hash": "^1.1.1" |
+19
-0
@@ -173,3 +173,22 @@ # postcss-modules [![Build Status][ci-img]][ci] | ||
| ### Camel cased classes | ||
| If you need, you can pass the options `{ camelCase: true }` to transform classes: | ||
| CSS: | ||
| ```css | ||
| .post-title { | ||
| color: red; | ||
| } | ||
| ``` | ||
| JSON: | ||
| ```json | ||
| { | ||
| "post-title": "._post-title_116zl_1", | ||
| "postTitle": "._post-title_116zl_1" | ||
| } | ||
| ``` | ||
| ## Integration with templates | ||
@@ -176,0 +195,0 @@ The plugin only transforms CSS classes to CSS modules. |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
17309
4.83%123
6.96%274
7.45%5
25%+ Added
+ Added