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

@pixelherz/sassbox

v2.0.0

Published

Sass utils we frequently use in our projects.

Readme

sassbox

Sass utils we frequently use in our projects.

Contents

Getting Started

Installing

Install using npm:

npm i @pixelherz/sassbox

Usage

Import the toolbox in your project.

@use '@pixelherz/sassbox' [with (<my-config>) ];

Configuration

Typically you'll want to @use a configured @forward of the library. Here's a sample:

// e.g. /styles/_sassbox.scss – configured @forward of the library
@forward '@pixelherz/sassbox' with (
    $font-sizes: (
      's': 16px,
      'm': 24px,
      'l': 36px,
    ),
    $line-heights: (
      's': 20px,
      'm': 30px,
      'l': 45px,
    ),
    // ... custom configuration
  );
// e.g. /component/component.styles.scss
@use '../styles/sassbox';
@include sassbox.normalize();

Have a look at the Docs for a complete list of configuration options.

Documentation

Documentation is available online included in the npm packages (./docs) or can be built from source code.

CSS grid vs. relative grid

Sassbox includes a bunch of mixins and functions that help you build grid layouts. Be aware that the library supports two flavours of layout grids:

  • Relative grid (rel-grid)
  • CSS grid (css-grid)

Variable, function and mixin names indicate their purpose (rel-grid for relative grids, css-grid for CSS grid).

Write docs

We use SassDoc for documentation.

Build docs

npm run docs

Upgrade Guide

Upgrade from v0.11.1 to v1.x

1. Import

Update your @forward, @use or @import statement (with clause is optional). Usage of @import is discouraged. We recommend to replace it with a configured @forward. If you prefere, you can also use @use.

// v0.x
@forward '@pixelherz/sassbox/sassbox' [with (...) ];
@use '@pixelherz/sassbox/sassbox' [with (...) ];
@import '@pixelherz/sassbox/sassbox';

Use a single configured @forward to import the library. Then @use this forward. Note that the import path has changed.

// Configured @forward
// e.g. styles/lib/_sassbox.scss
@forward '@pixelherz/sassbox' with (
    $breakpoints: (
      foo: 576px,
      bar: 768px,
    ),
    $layout-max-width: 1360px,
    [...]
  );
// Consume the configured forward in your app/components
// e.g. my-app/my-component/my-component.scss
@use '../../styles/lib/sassbox';

2. Configuration

  • Move configuration to the with() statement in your configured forward (s. section import).
  • Remove all prefixes from configuration variables (ph- and mq-).
  • Remove $ph-font-family--default as it's no longer required.
  • Rename the following configuration property

| v0.x | v1.x | | -------------- | ---------------- | | $grid-offset | $layout-offset |

3. Use namespace

// prior 1.x
@include offset-text();
// v1.x
@include sassbox.offset-text();

4. Update deprecations

The names of some variables, functions and mixins have changed. Their signature has not changed. Update these with the new names.

| v0.x |  v1.x | | --------------------- | ------------------------- | | un-button() | reset-button() | | pxToRem() | px-to-rem() | | remToPx() | rem-to-px() | | font-size() | use-type() | | inject-css-grid() | use-css-grid() | | grid-offset | layout-offset | | grid-width() | get-rel-grid-width() | | grid-max-offset | get-layout-max-offset() | | apply-grid-offset() | use-layout-offset() |

5. Normalize

In 0.x versions, normalize was applied by default. With 1.x, normalize has moved to a mixin to give you more control. When upgrading from 0.x you have to apply sassbox.normalize() manually which is typically done in your root stylesheet.

// e.g. styles.scss
@use './styles/lib/sassbox';
@include sassbox.normalize();

6. Replace sass-mq with sassbox.mq

Remove sass-mq as it's now part of this library.

// Remove imports
@import '~sass-mq/mq'; // <-- delete

// prior v1.x
@include mq($from: 'my-breakpoint') {
}
// v1.x
@include sassbox.mq($from: 'my-breakpoint') {
}

7. Test your app

That's it. Time to run and check your app!

  • Check the console for errors or warnings.
  • Make sure to double-check all parts of your app carefully.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the ISC License - see the LICENSE.md file for details.

Contact

Pixelherz
Design und Code für Digitales

[email protected]

Pixelherz GmbH
Allmendstrasse 61
CH-8041 Zürich

pixelherz.com