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

gravy-sass

v2.1.4

Published

SASS foundation library.

Downloads

7

Readme

CircleCI

Gravy is a SCSS foundation library

Q: What is a foundation library?

A: Is a library that provides basic essential functions and mixins to solve some basic requirements for any project.

Q: Why Gravy?

A: Because it gives flavour to what you have on your plate without much effort...

Q: What does Gravy provide?

A: For now, typographical enhancements (suggestions and feature requests are always welcome).


Technical notes

Dependencies

This library depends on the following libraries:

  • Typi for responsive typography and vertical rhythm.

The dependencies are meant to aleviate the amount of effort to achieve a particular solution. If you feel like there's a reason to ditch a particular dependency in favour of a localised solution, please open a bug request.

Additional dependencies needs to be handled by your own project, you most likely want to have the following installed and configured before Gravy:

Installation

Install the library via npm, the usual way:

$ npm install @buildit/gravy

If you have Eyeglass or sass-module-importer installed, you can simply include the symbol Gravy exports to your main scss file:

@include "gravy";

Otherwise, if you don't want to customise anything, just include the whole path:

@include "node_modules/gravy/sass/gravy";

You can then configure it by creating the Gravy configuration map.

Once that's done, you need to call the initialisation mixin that will generate the necessary configuration maps and base CSS output:

@include gravy-init;

Configuration

The configuration comes simply by setting the required sub-maps in the main $gravy map, you can set one or more of the following keys in you project, gravy-init will fill in the rest with the following default values.

$gravy: (
  base-font-size: 16px,
  base-line-height: 1.4,
  breakpoints: (
    small: 600px,
    large: 1200px
  ),
  typefaces: (
    primary: (
      stack: ('Arial', sans-serif),
      weights: (
        regular: 'regular',
        bold: 'bold'
      )
    )
  ),
  typi: (
    base: (
      null: (16px, 1.4),
      small: (16px),
      large: (19px)
    )
  )
);

More technical documentation in HTML format can be found in the docs/ folder.

Generated and reserved variables

gravy-init will parse the $gravy config map, and generate some additional non-scoped variables that are going to be used by either the dependencies or some of the mixins available by the tool.

  • $base-font-size: handy variable for the size in pixels of the base font size.
  • $base-line-height: unitless variable for the size of the line height.
  • $breakpoints: will contain a list of named breakpoints. These will have to be used in the configuration map of typi that can be retrieved using the mixin gravy-breakpoint($name).
  • $typefaces: will contain a list of named font faces, e.g. 'primary', 'headings', ...; you can later output the correct font-family and font-weight using the mixin gravy-font($name, $weight: 'regular') each font face contains the following keys:
    • stack: a map containing the list of font families to use.
    • weights: a list of weights for the selected font, like 'regular', 'bold', ... .
  • $typi: the typi configuration map. Refer to typi documentation for information on how this works. You'll be then able to use the mixin typi($name) to generate the needed font-size and line-height at different breakpoints.

Functions

Mixins

  • gravy-init: does the initialisation of all the needed functions, needs to be called after all the needed maps have been configured and before calling any other function or mixin.
  • gravy-font($name): generates the font-family and font-weight based on the typefaces map (see Generated and reserved variables section).

Modularscale and typi font sizes

If you want to use to use Modularscale, you can do so by installing modularscale-sass via npm, and configure it before calling typi-init.

Contribute & support

You can contribute to the development of this library in many ways:

  • submitting bug reports,
  • opening PRs,
  • getting in touch with our core developers if none the above works (we'll try to answer all of your love letters!).

NOTE Be sure to enable stylelint in your preferred IDE/Editor, or run npm test before pushing and opening a PR: any PR submitted that doesn't lint correctly will be rejected.