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

neat-class-generator

v1.0.0

Published

A generator for dynamically creating classes from Neat 2.0

Downloads

7

Readme

Neat class generator

Generates css classes from Neat grids.

Installation

NPM

  • npm install --save neat-class-generator

Bower

  • bower install neat-class-generator

Documentation

@include grid-generate-classes() will generate classes for a grid map that is passed in to it.

Classes will be generated using the class: property of the grid map. This property is required and will be appended to the generated classes for that grid. As an example defining the property as class: my-grid, this would result in a class name of .my-grid-column-2-of-12, etc. This property must be defined prior to the grid-generate-classes mixin being called.

example SCSS

@include grid-generate-classes($neat-grid);

example CSS


.grid-column-1-of-12 {
  width: calc(8.33333% - 21.66667px);
  float: left;
  margin-left: 20px; }

.grid-column-2-of-12 {
  width: calc(16.66667% - 23.33333px);
  float: left;
  margin-left: 20px; }

.grid-column-3-of-12 {
  width: calc(25% - 25px);
  float: left;
  margin-left: 20px; }

// etc…

example SCSS

$custom-neat-grid: (
  class: custom,
  columns: 12,
  gutter: 50px,
  media: 1000px,
);

@include grid-generate-classes($custom-neat-grid);

example CSS


@media only screen and (min-width: 1000px) {
  .custom-column-1-of-12 {
    width: calc(8.33333% - 54.16667px);
    float: left;
    margin-left: 50px; }
  .custom-column-2-of-12 {
    width: calc(16.66667% - 58.33333px);
    float: left;
    margin-left: 50px; }
  .custom-column-3-of-12 {
    width: calc(25% - 62.5px);
    float: left;
    margin-left: 50px; }

  // etc…
}

Generated classes

Neat class generator will create classes for each of Neat's mixin properties in the order in which they are generated. Since grid-container does not change it is only generated once, under the name .grid-container.

The following is a manifest of all generated classes, with {class} standing in for the grid map's class: property and {column} standing in for the grid map's column: property. If the grid contains a media: property, the generated classes will automatically be wrapped in the appropriate media query.

  1. .{class}-column-1-of-{column} to .{class}-column-{column}-of-{column}
  2. .{class}-push-neg-{column}-of-{column} (negative) to .{class}-push-{column}-of-{column}
  3. .{class}-shift-neg-{column}-of-{column} (negative) to .{class}-shift-{column}-of-{column}
  4. .{class}-visual
  5. .{class}-collapse
  6. .grid-container