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 🙏

© 2026 – Pkg Stats / Ryan Hefner

whiteboard-media

v0.1.5

Published

Responsive helper mixins for Whiteboard

Readme

whiteboard-media

A node-sass importer for a set of SASS mixins that make your life a little bit easier when it comes to developing responsive styles. It allows creating breakpoints and defining styles for each breakpoint in a simple way.

Installation

npm install --save-dev whiteboard-media

Usage

You can use this importer in node-sass or any project that depends on node-sass. The only thing you need to do to make this work is add the importer to the options and include the required variables or mixins.

node-sass

var sass = require('node-sass');
var wbMediaImporter = require('whiteboard-media');

sass.render({
  file: './scss/styles.scss',
  importer: wbMediaImporter
});

gulp-sass

var gulp = require('gulp');
var sass = require('gulp-sass');
var wbMediaImporter = require('whiteboard-media');

gulp.task('sass', function() {
  return gulp.src('scss/**/*.scss')
    .pipe(sass({
      importer: wbMediaImporter
    })
    .pipe(gulp.dest('./css'));
});

grunt-sass

module.exports = function(grunt) {
  var wbMediaImporter = require('whiteboard-media');

  grunt.initConfig({
    sass:{
      options: {
        importer: wbMediaImporter
      },
      ...        
    }
  });
}

Once the importer is setup, you can import the variables and mixins to start using them in your code.

@import 'wb/media'

Breakpoints

Responsive breakpoints are stored in the SASS variable $wb-breakpoints. By default, the following breakpoints are defined:

$wb-breakpoints: (
  xs: null,
  sm: 544px,
  md: 768px,
  lg: 992px,
  xl: 1200px
)

You can add a new breakpoint using wb-add-breakpoint($breakpoint-name, $breakpoint-value), for example:

$wb-breakpoints: wb-add-breakpoint(mobile, 640px)

// $wb-breakpoints: (
//  xs: null,
//  sm: 544px,
//  md: 768px,
//  lg: 992px,
//  xl: 1200px,
//  mobile: 640px
// )

In the same manner, you can remove a breakpoint using wb-remove-breakpoint($breakpoint-name), for example:

$wb-breakpoints: wb-remove-breakpoint(xl)

// $wb-breakpoints: (
//  xs: null,
//  sm: 544px,
//  md: 768px,
//  lg: 992px
// )

Mixins

A set of useful mixins are provided to help you with developing your responsive styles.

wb-media($min-value, $max-value)

Prints a media query based on given values for minimum and maximum widths.

@include wb-media(320px, 640px) {
  body {
    background: black
  }
}

/*
prints the following:

@media screen and (min-width: 320px) and (max-width: 639px) {
  body {
    background: black
  }
}
 */

To exclude one of the constricts, set its value to null.

@include wb-media(320px, null) {
  body {
    background: black
  }
}

/*
Prints the following:

@media screen and (min-width: 320px) {
  body {
    background: black
  }
}
 */

wb-media-only($breakpoint)

Prints the provided styles specifically and only for the given breakpoint.

@include wb-media-only(md) {
  body {
    background: black
  }
}

/*
Prints the following:

@media screen and (min-width: 768px) and (max-width: 991px) {
  body {
    background: black
  }
}
 */

wb-media-and-larger($breakpoint)

Prints the provided styles for the given breakpoint and larger breakpoints.

@include wb-media-and-larger(md) {
  body {
    background: black
  }
}

/*
Prints the following:

@media screen and (min-width: 768px) {
  body {
    background: black
  }
}
 */

wb-media-and-smaller($breakpoint)

Prints the provided styles for the given breakpoint and smaller breakpoints.

@include wb-media-and-smaller(md) {
  body {
    background: black
  }
}

/*
Prints the following:

@media screen and (max-width: 991px) {
  body {
    background: black
  }
}
 */

wb-media-through($breakpoint-a, $breakpoint-b)

Prints the provided styles through the given breakpoints.

@include wb-media-through(md, lg) {
  body {
    background: black
  }
}

/*
Prints the following:

@media screen and (min-width: 768px) and (max-width: 1199px) {
  body {
    background: black
  }
}
 */

wb-make-responsive()

Iterates over the breakpoints stack ($wb-breakpoints) and sets 3 global variables which may be used when writing responsive styles.

The three global variables are:

$wb-breakpoint:
The breakpoint name.

$wb-breakpoint-prefix:
The breakpoint name followed by a dash.

$wb-breakpoint-suffix:
The breakpoint name preceded by a dash.

@include wb-make-responsive {
  .text-center#{$wb-breakpoint-suffix} {
    text-align: center
  }
}

/*
Prints the following:

.text-center-xs {
  text-align: center
}

@media screen and (min-width: 544px) {
  .text-center-sm {
    text-align: center
  }
}

@media screen and (min-width: 768px) {
  .text-center-md {
    text-align: center
  }
}

@media screen and (min-width: 992px) {
  .text-center-lg {
    text-align: center
  }
}

@media screen and (min-width: 1200px) {
  .text-center-xl {
    text-align: center
  }
}
 */