Skip to content

NealST/postcss-bem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

This is a postcss plugin for supportting bem syntax in the process of writing css or pcss.

Usage

Install && use

If� you want to use this tool,the first step is installing it through npm.

npm i @mozheng-neal/postcss-bem --save-dev

After installing it,this plugin can be used in multiple ways, such as webpack, gulp and so on, you could acquire the detail information at how to use postcss

Example

�The supported css bem syntax contains mainly @component, @descendent @modifier @when. A usage example as follows:

html
<div class="container">
  <div class="container-child">
  </div>
  <div class="container--des">
  </div>
  <div class="container_state">
  </div>
</div>  

css/pcss
@component container {
  color: red;
  @descendent child {
    color: yellow
  }
  @modifier des {
    color: gray;
  }
  @when state {
    color: green;
  }
}

About

支持bem语法的postcss插件

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published