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

euphoria-spacing

v0.4.1

Published

CSS-in-JS utils for margins and padding.

Downloads

1

Readme

euphoria-spacing

!!!!!!!!!!!!!!!!!!!!!!! MOVED TO Euphoria!!!!!!!!!!!!!!!!!

A Euphoria.css utility library to create margin and padding classes in your CSS-to-JS projects.

This module returns a string of class names you can then inject into a page, using something like glamor.

We automatically inject none classes for padding and spacing (eg .p-none { padding: 0; }) and auto classes for margins (eg .m-auto { margin: auto; }).

NOTE: Currently this only works with ES6 support using Babel or Node 7.x+.

Installation

# with yarn:
yarn add euphoria-spacing

# with npm
npm i -S euphoria-spacing

Usage

This module can be used in many ways. For example, using glamor, you would do the following:

import { css } from 'glamor'
import spacing from 'euphoria-spacing'

css.insert(
  spacing({
    sm: '0.5rem',
    md: '1rem',
    lg: '2rem',
  })
)

Now you will have the following classes available to you:

// Padding
.p-none { padding: 0; }
.p-sm { padding: 0.5rem; }
.p-md { padding: 1rem; }
.p-lg { padding: 2rem; }

.pb-none { padding-bottom: 0; }
.pb-sm { padding-bottom: 0.5rem; }
.pb-md { padding-bottom: 1rem; }
.pb-lg { padding-bottom: 2rem; }

.pl-none { padding-left: 0; }
.pl-sm { padding-left: 0.5rem; }
.pl-md { padding-left: 1rem; }
.pl-lg { padding-left: 2rem; }

.pr-none { padding-right: 0; }
.pr-sm { padding-right: 0.5rem; }
.pr-md { padding-right: 1rem; }
.pr-lg { padding-right: 2rem; }

.pt-none { padding-top: 0; }
.pt-sm { padding-top: 0.5rem; }
.pt-md { padding-top: 1rem; }
.pt-lg { padding-top: 2rem; }

.px-none { padding-left: 0; padding-right: 0; }
.px-sm { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-md { padding-left: 1rem; padding-right: 1rem; }
.px-lg { padding-left: 2rem; padding-right: 2rem; }

.py-none { padding-top: 0; padding-bottom: 0; }
.py-sm { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-md { padding-top: 1rem; padding-bottom: 1rem; }
.py-lg { padding-top: 2rem; padding-bottom: 2rem; }

// Margins
.m-none { margin: 0; }
.m-sm { margin: 0.5rem; }
.m-md { margin: 1rem; }
.m-lg { margin: 2rem; }
.m-auto { margin: auto; }

.mb-none { margin-bottom: 0; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 2rem; }
.mb-auto { margin-bottom: auto; }

.ml-none { margin-left: 0; }
.ml-sm { margin-left: 0.5rem; }
.ml-md { margin-left: 1rem; }
.ml-lg { margin-left: 2rem; }
.ml-auto { margin-left: auto; }

.mr-none { margin-right: 0; }
.mr-sm { margin-right: 0.5rem; }
.mr-md { margin-right: 1rem; }
.mr-lg { margin-right: 2rem; }
.mr-auto { margin-right: auto; }

.mt-none { margin-top: 0; }
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 2rem; }
.mt-auto { margin-top: auto; }

.mx-none { margin-left: 0; margin-right: 0; }
.mx-sm { margin-left: 0.5rem; margin-right: 0.5rem; }
.mx-md { margin-left: 1rem; margin-right: 1rem; }
.mx-lg { margin-left: 2rem; margin-right: 2rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.my-none { margin-top: 0; margin-bottom: 0; }
.my-sm { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-md { margin-top: 1rem; margin-bottom: 1rem; }
.my-lg { margin-top: 2rem; margin-bottom: 2rem; }
.my-auto { margin-top: auto; margin-bottom: auto; }

Calling spacing without arguments will get you the default spacing mapping, which is:

{
  xxs: '0.25rem',
  xs: '0.5rem',
  sm: '0.75rem',
  md: '1rem',
  lg: '1.75rem',
  xl: '3.25rem',
  xxl: '5rem',
}

Changelog

v0.4.0

  • Make all styles add !important suffix.

v0.3.0

  • Automatically insert none classes since they're expected as defaults.

v0.2.0

  • Add margin auto helpers: .m-auto, .ml-auto, .mr-auto, .mb-auto, .mt-auto, .mx-auto, .my-auto

v0.1.1

  • Remove flow cruft

v0.1.0

  • Initial release!

License

MIT

Credits

Dana Woodman