Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

sassy-beam

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sassy-beam

A Sass mixin to deal with a “BEM-like” notation and a simplified HTML markup

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

〒 Sassy Beam

A Sass mixin to deal with a “BEM-like” notation and a simplified HTML markup

stability-stable NPM version License Build Status Commitizen friendly Conventional Commits

Beam (or sassy-beam) allows the use of a BEM-like notation but with a lighter HTML markup.

It is a combo based on BEM, Nicolas Gallagher's thoughs and Harry Roberts's adaptations … while adding my personal touch!

The Sassy Beam goals

  • Using a BEM method like .block__element--modifier

  • Keeping a light HTML markup!

    <div class="block block--mod1 block--mod2 block--mod3">
    

    becomes:

    <div class="block--mod1--mod2--mod3">
    
  • Maintaining the integrity of class names (no dynamic concatenation [#{$block}__element] nor nesting [&__element])

  • Allowing nesting for readability … or not!

Installation

via npm

npm install sassy-beam

Usage

.html

<div class="foo">
  <div class="foo__baz"></div>
  <div class="foo__baz--qux--quux"></div>
</div>
<div class="foo--bar"></div>

.scss

@import 'sassy-beam';

@include beam('foo') {
  property: value;
}

@include beam('foo--bar') {
  property: value;
}

@include beam('foo__baz') {
  property: value;
}

@include beam('foo__baz--qux--quux') {
  property: value;
}

.css (output)

.foo, [class*="foo--"] {
  property: value;
}
[class*="foo--"][class*="--bar"] {
  property: value;
}
.foo__baz, [class*="foo__baz--"] {
  property: value;
}
[class*="foo__baz--"][class*="--qux"][class*="--quux"] {
  property: value;
}

Extra

Feel free to improve, comment, share, …

Keywords

bem

FAQs

Package last updated on 01 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts