Skip to content
This repository was archived by the owner on Aug 19, 2019. It is now read-only.

Commit 6b7b3a4

Browse files
author
deepsweet
committed
💄
1 parent aa07ca7 commit 6b7b3a4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1+
'use strict';
2+
13
var postcss = require('postcss');
24

35
var modDelim = '_';
46
var elemDelim = '__';
57

6-
module.exports = postcss.plugin('bemcss', function() {
8+
module.exports = postcss.plugin('rebem-css', function() {
79
return function(css) {
810
css.walkRules(function(rule) {
911
rule.selector = rule.selector
12+
// :block(block) → .block
1013
.replace(/:block\(([\w-]+)\)/g, '.$1')
14+
// :elem(elem) → __elem
1115
.replace(/:elem\(([\w-]+)\)/g, elemDelim + '$1')
16+
// :mod(mod) → _mod
17+
// :mod(mod val) → _mod_val
1218
.replace(/:mod\(([\w-]+)\s?([\w-]+)?\)/g, function(match, mod, val) {
1319
if (val) {
1420
return modDelim + mod + modDelim + val;

0 commit comments

Comments
 (0)