auto-bem-scss-commenter

1.3.0 • Public • Published

auto-bem-scss-commenter Build Status NPM version

Automatically comment your BEM compliant SCSS files to add class name comments. (inpired by dpellier/bem-comment)

Installation

Auto-bem-scss-commenter can be installed using

$ npm install --save-dev auto-bem-scss-commenter 

Usage

// file.scss  
// 
 
.object {
  /* styles */
 
  &__child {
    /* styles */
 
    &--modifier {
      /* styles */
    }
  }
}
auto-bem-scss-commenter file.scss > file.scss 
// file.scss  
// 
 
// object 
.object {
  /* styles */
 
  // object__child 
  &__child {
    /* styles */
 
    // object__child--modifier 
    &--modifier {
      /* styles */
    }
  }
}

auto-bem-scss-commenter -h for more info

With Node

var bemComment = require('auto-bem-scss-commenter ');
gulp.task('helper:bem-comment', function () {
  return gulp.src(['**/{,*/}/*.scss'], {cwd: options.app})
    .pipe(bemComment({ force: true }))
    .pipe(gulp.dest(options.app));
});

The force option force rewrite all comments

License

Copyright © 2014 Douglas Duteil <douglasduteil@gmail.com>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the LICENCE file for more details.

Package Sidebar

Install

npm i auto-bem-scss-commenter

Weekly Downloads

2

Version

1.3.0

License

WTFPL

Last publish

Collaborators

  • douglasduteil