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

postcss-gridlover

v0.2.1

Published

Enables using Gridlover sx and gr units in your CSS

Downloads

11

Readme

postcss-gridlover

Enables using Gridlover sx and gr units in your CSS

Gridlover

Gridlover gives you a modular scale & vertical rhythm to work with. You can use values from the scale with sx units and grid row values with gr units. Play around with Gridlover to get a feel for how the units work.

Using this input.css:

html, .root {
  --base-font-size: 14px; /* Must be in pixels */
  --base-line-height: 1.3; /* Must be a decimal number */
  --base-scale-factor: 1.618; /* Must be a decimal number */
  --base-units: px; /* px, rem, em */
  font-size: var(--base-font-size); /* html/root font-size must be defined as the base font size when using em or rem, or the grid won't be pixel perfect */
}
body, .article {
  font-size: 0sx; /* Must be an integer */
  line-height: auto;
}
h1, .h1 {
  font-size: 3sx; /* Must be an integer */
  line-height: 4gr;
  margin: 2gr 0;
}

Will produce

html, .root {
  --base-font-size: 14px;
  --base-line-height: 1.3;
  --base-scale-factor: 1.618;
  --base-units: px;
  font-size: var(--base-font-size);
}
body, .article {
  font-size: 14px;
  line-height: 18px;
}
h1, .h1 {
  font-size: 59px;
  line-height: 72px;
  margin: 36px 0;
}

Take a look at test/input.css for the css file the Gridlover app uses.

  • An sx value must be an integer.
  • Values in gr units don't need to be integers, but if you want to maintain a vertical rhythm, you should keep them integers or make sure adding them up (like 1.5 + 0.5) becomes an integer.

Installation

npm install postcss-gridlover

Usage

var fs = require('fs');
var postcss = require('postcss');
var gridlover = require('postcss-gridlover');

var css = fs.readFileSync('input.css', 'utf8');

var output = postcss()
  .use(gridlover)
  .process(css)
  .css;

fs.writeFile("output.css", output);

If you have any questions, tweet to @gridlover or @sakamies.