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

@scratch-css/helpers

v1.0.1

Published

Helper classes for scratch framework. They use Scratch as a base. It's purpose of using is to write them inline in HTML for just easy markup.

Downloads

4

Readme

Scratch Helpers

Helper classes for scratch framework. They use Scratch as a base. It's purpose of using is to write them inline in HTML for just easy markup.

Gitter npm (scoped) David

API reference:

Color helper classes:

We can use them instead of {color-name} placeholder below, and we'll be able to use it inline in HTML to give color and background color to any element.

Brand colors:
  • .primary
  • .secondary
  • .tertiary
  • .quaternary
  • .quinary
State colors:
  • .color-success
  • .color-warning
  • .color-info
  • .color-error
Social network colors:
  • .color-facebook
  • .color-twitter
  • .color-google
  • .color-youtube
  • .color-vimeo
  • .color-rss
  • .color-pinterest

Use .color- prefix for those, to not to be confused with naming conflicts.

Table reference:

Let's use {color-name} as a placeholder for this table.

| Name | Color | Background | |--- |--- |--- | | .{color-name} | --{color-name}-inverse | --{color-name} | | .{color-name}-contrast | --{color-name} | --{color-name}-contrast | | .{color-name}-color | --{color-name} | | | .{color-name}-color-contrast | --{color-name}-contrast | | | .{color-name}-background | | --{color-name} | | .{color-name}-background-contrast | | --{color-name}-contrast |

For example, {color-name} is primary, --primary itself is green and contrast color for it - --primary-contrast is white. As we see in the table, We can use .primary class to apply white color on the green background. .primary-contrast to opposite, like green on white. .primary-background for applying only green background and etc.

Don't get confused about color helpers starting with .color- prefix. As for only color usage, it can repeat color word like .color-facebook-color-inverse. It's the same structure, just starts with that prefix.

--

Typography helper classes:

Families by priority

  • .font-family-primary
  • .font-family-secondary
  • .font-family-tertiary
  • .font-family-quaternary

Families by type

Also, families can be divided by type, as they may have serif, sans-serif or monospace options.

  • Sans Serif

    • .font-family-sans-serif-primary
    • .font-family-sans-serif-secondary
  • Serif

    • .font-family-serif-primary
    • .font-family-serif-secondary
  • Monospace (using of this is very rare, so I don't think we need priorities)

    • .font-family-monospace

Font sizes

  • .font-size-h1
  • .font-size-h2
  • .font-size-h3
  • .font-size-h4
  • .font-size-h5
  • .font-size-h6
  • .font-size-h7
  • .font-size-h8
  • .font-size-h9
  • .font-size-h10

Font weight

  • .font-thin
  • .font-extralight
  • .font-light
  • .font-regular
  • .font-medium
  • .font-semibold
  • .font-bold
  • .font-extrabold
  • .font-black

Text transform

  • .text-transform-reset
  • .text-uppercase
  • .text-lowercase
  • .text-capitalize

.text- prefix applies here, since it just matches CSS naming.

--

Other helper classes for CSS shortcuts:

  • Align

    • .align-left
    • .align-center
    • .align-right
  • Flexbox

    • .flex-center - vertical and horizontal centering (affects on a child element).
    • .flex-center-x - horizontal centering.
    • .flex-center-y - vertical centering.
    • .flex-stretch - stretches child elements.
    • Directions
      • .flex-row
      • .flex-row-reverse
      • .flex-column
      • .flex-column-reverse
  • Position

    • .position-absolute
    • .position-relative
    • .position-static
  • Display

    • .display-flex
    • .display-inline-flex
    • .display-none
    • .display-block
    • .display-inline
    • .display-inline-block
    • .display-table
    • .display-table-row
    • .display-table-cell
  • Sizing

    • .full-size - full width and height dependent on parent container (100% with vh and vw fallbacks).
    • .full-width
    • .full-height
    • .full-viewport-size - full width and height dependent on document size (using vh and vw with percent fallbacks).
    • .full-viewport-width
    • .full-viewport-height
  • Transition

    • .transition - default duration, which is defined in Scratch config.
      • .shorter
      • .short
      • .long
      • .longer
    • .transition.delay - default delay, which is defined in Scratch config.
      • .delay-shorter
      • .delay-short
      • .delay-long
      • .delay-longer

For more complex UI components you can check UIkit library. For animations, check Animations library.

--

Using examples:

<main class="flex-center | full-viewport-size | position-absolute">

  <article class="primary-background-inverse">
    <h1 class="text-uppercase">Title</h1>
    <p class="margin-bottom-gutter-large">Lorem ipsum dolor sit amet</p>
    <a class="primary-color | text-underline">Learn More</a>
  </article>

</main>