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

@twitchseventeen/spacing-css

v1.1.0

Published

[![npm version](https://badge.fury.io/js/%40twitchseventeen%2Fspacing-css.svg)](https://badge.fury.io/js/%40twitchseventeen%2Fspacing-css)

Downloads

17

Readme

Spacing-CSS

npm version

Spacing CSS is a CSS library for adding responsive margin / padding utility classes. It's sole purpose is to add space between elements.

Usage

Include the spacing.css file in the of your webpage.

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

Then add classes to elements to create margins and padding.

<p class="mt">Top margin of 1rem</p>
<p class="pl-2x">Left padding of 2rem</p>

Spacing classes

Each spacing class is created in the following format:

(property)(direction)-(mediaQuery)-(multiplier)

Only property is required, the rest can be omitted.

Property

This specifies whether the spacing is margin or padding, it's the only required part of the spacing class.

m - margin
p - padding

Direction

This specifies the direction for the space, if you omit this value then space will be applied to all sides.

t - top
r - right
b - bottom
l - left
h - horizontal
v - vertical
*blank* - all directions

Media Query

This specifies the screen size the space should apply to. If you omit this value then the space will apply to all screen sizes.

These are the default media queries, the /dist directory also contains builds for popular libraries. Check the docs for these.

small - 320px -> 480px
medium - 481px -> 767px
large - 768px -> 1024px
xlarge - 1025px -> 1280px
xxlarge - 1281px and up

Multiplier

By default 1rem of space is applied, this multiplier allows you to increase that amount. You can also use a multiplier of 0, which removes space. For margin you can also set a multiplier of a, which sets a margin of auto

0 - no space
a - auto space (margin only)
2x - space of 2rem
3x - space of 3rem
4x - space of 4rem
5x - space of 5rem

Examples

.mt-small-2x <!-- margin-top: 2rem -->
.pb_3x <!-- padding-bottom: 3rem -->
.p-0 <!-- padding: 0 -->
.mh_a <!--  margin-right: auto; margin-left: auto -->