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

consensass

v0.0.2

Published

Configurable UI Elements with Sass

Downloads

2

Readme

Consensass

Configurable UI Components with Sass

Configuration and Theming

Normalize

This project uses Normalize to reset all styles. It's imported at the top of your consensass.scss file. Don't forget to npm install before using this.

Breakpoints

$_breakpoints: (
    m:  481px,
    l:  769px,
    xl: 1025px
);

@include breakpoints($_breakpoints);

SASS doesn't allow to dynamically set variable names, so I'll stick with 3 breakpoints right now: Grid uses s, m, l and xl. Those last three have defined breakpoints, s is basically min-width: 0px. You can set custom breakpoints in $_breakpoints or pass a different variable with a breakpoints map. If you're feeling extra adventurous, you can set the map straight in the @include.

If none are set, there's always the fallback breakpoint defaults.

Theming

Coming soon

Grid

.grid{
    @include grid("col", 12, 1.5rem);
}

Grid comes with defaults: a grid of 8 childs named "col", each with a gutter of 16px. This is the equivalent of: @include grid("col", 8, 16px);

If you want to set the breakpoints in one go, just pass the variable or map as the fourth variable, but you'll still have to set the rest as well. So set up your breakpoints like this: @include grid("col", 8, 16px, $_breakpoints);

I'm still weighing the pro/con for using a map as an alternative.

Usage

If your grid is set up like above, then using it could look like this:

<div class="grid">
    <div class="col-s-12-m-6-l-4">
        <h1>Tron</h1>
    </div>
    <div class="col-s-12-m-6-l-4">
        <h1>Tron: Legacy</h1>
    </div>
    <div class="col-s-12-m-12-l-4">
        <h1>Tron: Uprising</h1>
    </div>
</div>

The div with "grid" functions as the container for your columns "col". Each breakpoint has a maximum width of 12, but you can use anything in between. This example shows you the Tron movies and TV-show in their respective columns. They're sorted underneath eachother on mobile, the movies next to eachother (and the TV-show underneath) on tablets and all next to eachother on laptops and extra-large screens.

Using the suffixes -s-#, -m-#, -l-#,-xl-# you can set each breakpoint for a width # of 12. Only using -s-# will default the width to all breakpoints. Skipping s-# will sort your columns underneath eachother on mobile phones, so we can optimize our example like this:

<div class="grid">
    <div class="col-m-6-l-4">
        <h1>Tron</h1>
    </div>
    <div class="col-m-6-l-4">
        <h1>Tron: Legacy</h1>
    </div>
    <div class="col-l-4">
        <h1>Tron: Uprising</h1>
    </div>
</div>

Skipping a breakpoint will use a small breakpoint when available. If you want to sort the movies next to eachother on both phones and tablets, you could do this:

<div class="grid">
    <div class="col-s-6-l-4">
        <h1>Tron</h1>
    </div>
    <div class="col-s-6-l-4">
        <h1>Tron: Legacy</h1>
    </div>
    <div class="col-l-4">
        <h1>Tron: Uprising</h1>
    </div>
</div>