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

basicgrid

v3.1.5

Published

A Foundation-like grid as a standalone module

Downloads

847

Readme

basicGrid

Donate via PayPal

A Foundation-like grid system based on the flex display property.

Contents

Demos

| Name | Description | Link | |:-----------|:------------|:------------| | Default | Includes all features and most column variations. | Try it on CodePen |

Setup

We recommend installing basicGrid using npm or yarn.

npm install basicgrid
yarn add basicgrid

Include the CSS files in the head tag …

<link rel="stylesheet" href="dist/basicGrid.min.css">

… or use basicGrid via jsDelivr CDN:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/basicgrid@3/dist/basicGrid.min.css">

Usage

Basics

  • basicGrid is mobile first. Smaller breakpoints will automatically apply on all larger sizes.
  • The outermost row has a max-width.
  • A nested row removes the left gutter of the first column and the right gutter of the last column inside the row.
  • Classes are generated from the names and sizes in the $sizes map.
  • You can fill a row with up to twelve columns. Columns without a specified size will fill an entire row.
  • Each column has a gutter on the left and right side.
  • Columns have the same height when not specified otherwise.
  • Columns wrap when they don't fit into one row.

Sizes and Breakpoints

Specify the widths of each column with small-, medium-, and large- or use -auto to fill the available space. Defaults to small-12.

<div class="row">
	<div class="column small-6 medium-6 large-4"></div>
	<div class="column small-3 medium-auto large-4"></div>
	<div class="column small-3 medium-auto large-4"></div>
</div>

Horizontal Alignment

left-on-, center-on- and right-on- change the horizontal alignment of all columns in a row. around-on- and between-on- allow you to distribute the columns. Defaults to left-on-.

<div class="row left-on-small center-on-medium right-on-large">
	<div class="column small-6"></div>
</div>
<div class="row around-on-small between-on-large">
	<div class="column small-4"></div>
	<div class="column small-4"></div>
</div>

Vertical Alignment

top-on-, middle-on- and bottom-on- change the vertical alignment of all columns in a row. Defaults to stretch-on-, which gives each column the same height.

<div class="row top-on-small middle-on-medium bottom-on-large">
	<div class="column small-6"></div>
	<div class="column small-6"></div>
</div>

Direction

Define the direction columns are placed in a row using ltr-on- and rtl-on-. Defaults to ltr-on-.

<div class="row ltr-on-small rtl-on-medium">
	<div class="column small-6"></div>
	<div class="column small-6"></div>
</div>

Order

Reorder columns with first-on-, last-on- and origin-on-. Defaults to origin-on-, which keeps the order as specified in the HTML.

<div class="row">
	<div class="column small-4 last-on-small"></div>
	<div class="column small-4"></div>
	<div class="column small-4 first-on-small origin-on-medium"></div>
</div>

Offset

Use offset classes to move columns to the right.

<div class="row">
	<div class="column small-2 small-offset-2"></div>
	<div class="column small-2 small-offset-4"></div>
	<div class="column small-2"></div>
</div>

Push and pull

Shift columns around between breakpoints using -push- and -pull-. Especially helpful if you want to modify the order of columns based on the size of the screen.

<div class="row">
	<div class="column small-10 small-push-2"></div>
	<div class="column small-2 small-pull-10"></div>
</div>

Show and hide

show-on- and hide-on- allow you to show and hide rows or individual columns.

<div class="row hide-on-small show-on-large">
	<div class="column"></div>
</div>
<div class="row">
	<div class="column hide-on-medium show-on-large"></div>
	<div class="column show-on-medium hide-on-large"></div>
</div>

Options

Import src/styles/main.scss directly to customize the grid:

$basicGrid__columns: 12; // Number of columns
$basicGrid__width: 1280px; // Maximum width of a row
$basicGrid__outer: 0; // Gutter of the outermost row
$basicGrid__gutter: 1.8rem; // Gutter size between columns

// Column-Breakpoints
$basicGrid__sizes: (
	'small': 0,
	'medium': 640px,
	'large': 1024px
);

@import 'src/styles/main';

Overwrite the SASS options with CSS variables to adjust the grid on the client:

html {

	--basicGrid-width: 1200px;
	--basicGrid-outer: 0;
	--basicGrid-gutter: 1.8rem;

}