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 🙏

© 2024 – Pkg Stats / Ryan Hefner

sass-simple-grids

v1.2.2

Published

A simple, mobile-first SASS Grids System inspired by Susy 3.

Downloads

2

Readme

SASS Simple Grids

A simple, mobile-first SASS Grids System inspired by Susy 3. This is tailored to the common grid system I use in my projects.

You may want to use Susy 3 instead, if you want to:

  • prepare yourself for CSS Grid Layout, 'cause that's why Susy 3.
  • require asymmetric grid layout.
  • build a more advanced grid system of your own.

Why not just use Susy 3 instead?

Two reasons:

  1. Susy 3 dropped off all of mixins from 2, all it offers are functions. This requires you to build wrapper mixins and functions to fully tailor it for your needs. So rather than creating these wrappers on top of Susy 3, I dug deep into it's source code, learned how it works, and tailor it's logic to match only the stuff I need.
  2. I love creating a system of my own, where every aspect is fully relevant to what I need, rather than using an existing library bloated of stuff I don't need. This doesn't mean libraries are overkill in general, it's just part of my own learning goal.

If you like to just use a straight-forward, symmetic, mobile-first grid system, then you're welcome!

Installation

Simple Grids is available as an npm module.

npm install sass-simple-grids --save-dev

Usage

@import 'path-to-node-modules/sass-simple-grids/simple-grids';

What SSG has to offer

One-stop breakpoint-specific settings

Just include all your grid settings for multiple breakpoints in one go:

@include register-grids((
  
  /*
   * This will be default setting,
   * if grid functions/mixins are used outside of grid-breakpoint().
   */
  base: (
    columns: 8,
    gutters: 1/4, // or .25
  ),

  /**
   * Succeeding breakpoints require a 'breakpoint' key,
   * which will be used as the min-width media query.
   * It can be a unitless number, which will be suffixed with `px`.
   */
  medium: (
    breakpoint: 768,
    columns: 12,
    gutters: .15,
  ),

  /**
   * Static gutters are accepted,
   * `calc` will be used here for span calculations
   */
  large: (
    breakpoint: 1280,
    columns: 16,
    gutters: 16px,
  ),
  
));

Breakpoint mixin to make use of your breakpoint-specific settings

@include grid-breakpoint($setting-name) {
  @content
}

This is similar to that of Susy 2's susy-breakpoint mixin. The difference is that you don't have to pass a raw media query together with a layout map, just the name of your registered grid setting:

.column {
  width: span(1); /* This will be calculated from the 'base' setting (8 columns) */
  margin-right: gutter(); // Will compute the 'base' gutter
  
  /* Just pass the setting name to the mixin */
  @include grid-breakpoint('medium') {
    width: span(1); /* This will be calculated from the 'medium' setting (12 columns) */
    margin-right: gutter(); /* Will compute the 'medium' gutter */
  }

  @include grid-breakpoint('large') {
    width: span(1); /* This will be calculated from the 'large' setting (16 columns) */
    margin-right: gutter(); /* Will compute the 'large' gutter */
  }

}

In case you haven't notice, you don't need to pass a new grid context to the span. grid-breakpoint will make use of the named setting, making it available inside its block scope. Just make sure that the setting name matches one of your registered grid settings. Else, an error will be thrown out.

Demo

The npm package includes demo files.

  • Go to the node_modules/sass-simple-grids folder.
  • Run npm install.
  • Run npm run demo. This will compile demo assets and boot up a server at localhost:3131 for the demo page.

Available Mixins and Functions

To follow :)