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

jigsass-objects-grid

v2.0.1

Published

A simple flexbox-based grid system

Downloads

22

Readme

NPM version Dependency Status

A simple flexbox-based grid system

JigSass Grid is a responsive Sass (SCSS) flexbox-based grid system, with a display: inline-block fallback backed in, where possible.

It is intended to be both flexible (pun intended) and easy to use. As part of the JigSass ecosystem, JigSass Grid integrates with its other modules, relying on some of them for consistent resposive breakpoints, sizing and more.

Installation

Using npm:

npm i -S jigsass-objects-grid

Features

Availeable classes

For classes and modifiers (including responsive modifiers) to be generated in CSS output, they must be explicitly enabled in the configuration maps (see usage below).

Grid containers: .o-grid

  • --start, --center, --end, --rev, --space-between, --space-around
  • --top, --middle, --bottom, --equal-height
  • --gutter-X (gutter width, See here).

Grid items: .o-grid__item

  • --col, --center,
  • --top, --middle, --bottom, --equal-height
  • --gutter-X (gutter width, See here).
  • --gutter-gutter-rule-X (See here).
  • --X-of-Y
  • --offset-X-of-Y

Usage

First, import JigSass Grid into your main stylesheet:

@import 'path/to/jigsass-objects-grid/scss/index'

And optionally reconfigure the defaults to your liking.

To create a grid context, simply attach the .o-grid class to an element, Any element, which will serve as a grid container. You can now add grid items to it (with a class of .o-grid__item). Grid containers' only legitimate children are grid items, and those, in turn, may only reside within a grid container.

Like all other JigSass modules, JigSass Grid does not automatically generate any CSS output when imported. In order to use its classes, you would have to first explicitly indicate your intention to use them by enabling their generation in the associated configurations map, Leaving us only with CSS we need.

All JigSass Grid classes are responsive-enabled, using JigSass MQ and the breakpoints defined in the $jigsass-breakpoints variable.

Based on enabled selectors in the configuration map, responsive modifiers are generated according to the following logic:

.o-grid[--modifier][-[-from-{breakpoint-name}][-until-{breakpoint-name}][-misc-{breakpoint-name}]]
.o-grid__item[--modifier][-[-from-{breakpoint-name}][-until-{breakpoint-name}][-misc-{breakpoint-name}]]

So, assuming the medium, large and landscape breakpoints are defined in $jigsass-breakpoints as 600px, 1024px and (orientation: landscape) respectively,

$jigsass-grid-conf: (
  no-breakpoint: (
    no-modifier: true,
    end: true,
  ),
  until-medium: (
    end: true,
  ),
  from-large-when-landscape: (
    end: true,
  ),
)

will generate the following classes:

  • .o-grid, which is not limited to any media-query.
  • .o-grid--end, which is not limited to any media-query.
  • .o-grid--end--until-medium, which will be in effect at (max-width: 37.49em) and will override styles in the default class until that point.
  • .o-grid--end--from-large-when-landscape, which will go into effect at (min-width: 64em) and (orientation: landscape) and will override styles in the default class under these conditions.

Documentation

The full documentation is available here.

Contributing

It is a best practice for JigSass modules to not automatically generate css on @import, but rather have to user explicitly enable the generation of specific styles from the module.

Contributions in the form of pull-requests, issues, bug reports, etc. are welcome. Please feel free to fork, hack or modify JigSass Object Grid in any way you see fit.

Writing documentation

Good documentation is crucial for usability, scalability and maintainability. When contributing, please do make sure that both its Sass functionality (functions, mixins, variables and placeholder selectors), as well as the CSS it generates (selectors, concepts, usage exmples, etc.) are well documented.

Jigsass Grid uses Jonathan Neal's mdcss.

When styles and documentation comments are not automatically generated by your module on @import, please use the sgSrc/sg.scss file to enable their generation.

In addition, any file in sgSrc/assets will be available for use in the style guide.

File structure

┬ ./
│
├─┬ scss/ 
│ └─ index.scss # The module's importable file.
│
├─┬ sgSrc/      # Style guide sources
│ │
│ ├── sg.scc    # It is a best practice for JigSass 
│ │             # modules to not automatically generate 
│ │             # css and documentation on `@import.` 
│ │             # Please use this file to enable css
│ │             # and documentation comments) generation.
│ │
│ └── assets/   # Files in `sgSrc/assets` will be 
│               # available for use in the style guide
│
└── styleguide/ # Generated documentation 
                # of the module's CSS

License: MIT