npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

watson-scss

v1.0.6

Published

A practical set of Sass mixins for BEMer

Downloads

157

Readme

Intro

  • Mainly to simplify the way writing Nested BEM
  • Tools which are most of use

Supporting facilities

  1. react-bem-classname for generating BEM classNames easily.
  2. watson-snippet vscode extension for coding faster.

Installation

npm i watson-scss -D
@import '~watson-scss';

What Watson got

Watson is devote itself to help write BEM fastly and furiously

Nested B__E--M

@include block(human) {
  @include element(finger) {
    @include modifier(little) {
    }
  }

  @include modifier(male) {
    @include element(leg) {
    }
  }

  @include when(hurt) {
    @include element(hand) {
    }
  }
}

It's defaultly equal to:

.human {
  &__finger {
    &--little {
    }
  }

  &--male {
    .human__leg {
    }
  }

  &.is-hurt {
    .human__head {
    }
  }
}

AHA, here you may think the number of words you write however was increased ! Indeed but hang on my dude, that's why I introduce Webstorm for you, take a look of this

Watson support more complicated nest rule like:

@include element(arm) {
  @include pseudo(focus) {
    @include custom-selector('+') {
      @include modifier(left) {
      }
    }

    @include custom-selector('~', hand, right) {
    }
  }
}

which'll convert to

.human {
  &__arm {
    &:focus {
      & + .hum__arm--left {
      }

      & ~ .human__hand--right {
      }
    }
  }
}

with-attr

@include with-attr(disabled) {
}
// equals to
&[disabled] {
}

See other tools below 😋

Custom configuration

@import '~watson-scss';

/* cover default config after import watson */
$block-modifier: '_' !global;
$sm: 720px !global;

/* enable namespace */
$namespace: 'ele' !global;
...

Look up more configuration here

▸ media query

@include meadia-query(sm) {
}
// equals to
@media only screen and (min-width: 768px) {
}

See more breakpoints

▸ font-face

@include font-face(name, '//path/name', bold, italic);
// equals to
@font-face {
  font-family: name;
  font-style: italic;
  font-weight: bold;
  src: local($name), url('//path/name.woff2') format('woff2'), url('//path/name.woff') format('woff'), url('//path/name.ttf') format('truetype');
}

if you want to specify format, insert format-list as 3rd argument

@include font-face(name, '//path/name', ttf otf, bold, italic);

▸ shapes

// circle of 30px diameter
@include circle(20px, #111);

@include square(10px);

// directions can be on of 'up' 'up-right' 'right' 'down-right'
// 'down' 'down-left' 'left' 'up-left'
@include triangle(up, 20px, 10px, #111);

▸ transform

@include perfect-transition;
// convert to
transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
transition: ts(0.2s, 1s);
// convert to
transition: 0.2s 1s cubic-bezier(0.4, 0, 0.2, 1);
transform: tx(3px) ty(3px) txy(2px, 3px);
// convert to
transform: translateX(3px) translateY(3px) translate(2px, 3px);

▸ basic CN fonts

// 黑体 sans
@include font-hei;
// 楷体 serif
@include font-kai;
// 宋体
@include font-song;
// 仿宋
@include font-fang-song;

details here

▸ webkit

// thumb-color track-background width
@include scroll-bar(#333, #fff, 3px);
@include placeholder {
  color: #eee;
}

▸ ellipsis

@include ellipsis;

▸ share-rule

@include share-rule(rule) {
  width: 1px;
}

.a {
  @include extend-rule(rule);
}

.b {
  @include extend-rule(rule);
}

// equals to
.a,
.b {
  width: 1px;
}

▸ others

color: transparent(#000, 60);
// convert to
color: rgba(0, 0, 0, 0.6);

Feel free to add your marvelous tools to Watson