postcss-modules
Advanced tools
Comparing version 1.1.0 to 1.2.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); |
# 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 @@ |
{ | ||
"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" |
@@ -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. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17309
123
274
5
+ Addedlodash.camelcase@^4.3.0
+ Addedlodash.camelcase@4.3.0(transitive)