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

cherry-css

v0.9.3

Published

CSS util that builds .css file that includes normalize.css, cherry-sass lib, and minified version of font-awesome with fonts which includes only specified icons

Downloads

20

Readme

Cherry-css

The goal of this css util is to provide a small css bundle that contains everything you need for the begining. You can enable optional dependencies (subtasks) each of which brings it benefits.

How to use

    npm i cherry-css

In your JS file do:

    require('cherry-css')({
        // overwrite default config 
    }).then(() => console.log('done'))

Util has it default config you can override by your own. Default config looks next:

  out_bundle: './cherry_bundle.css',
  no_log: false,
  subtasks: {
    font_awesome: { /* subtask config */ },
    cherry: { /* subtask config */ },
    normalize: { /* subtask config */ }
  }
  • out_bundle - path to output bundle css
  • no_log - turn the logs

Subtasks

cherry

Small SASS lib that brings you such classes as:

  • mobile first responsive grid
    • .xs-1 .md-2 .hg-6 .
  • mobile first hide / show
    • .hide-xs .show-md .hide-sm
  • move left/right
    • .move-right-6 .move-left-1
  • add padding / margin
    • .m-r-5 p-b-30 p-a-15 top/right/bottom/left/all
  • css grid
    • .col-start-6 .row-end-10
  • mixins, common classes. More info will be added in future. Explore cherry-css/source/sass-source/core for now

SASS lib can be easily configured, You can define output classes or turn them off. This is SASS config you can redefine using the same variable's name somewhere in your own SASS file. Just specify pass to this SASS file using user_vars_path in a passed config.

$_C_media_value_map: (xs: 320px, sm: 480px, md: 767px, lg: 992px, hg: 1200px) 
//where key is a class name part and value is @media min-width

$_C_grid_columns: 12    // set 1 to turn it off
$_C_add_hide-show: true

$_C_add_move: true    

$_C_padding_values: 5 10 15 20 30 40      // set false to turn it off
$_C_margin_values: 5 10 15 20 30 40

$_C_max_grid_cols: 7    // set 1 to turn it off
$_C_max_grid_rows: 7

JS config looks next:

subtasks: {
    cherry: {
        enabled: true,
        out_sass: '',
        user_vars_path: ''
    }
}
  • out_sass - creates concatenated SASS file provided by cherry subtask. path/filename
  • user_vars_path - path/filename to redefined variables

Font Awesome

You can specify font types, icons, help classes you need in your project and as result you get processed version of font-awesome which has only icons you specified. Also processed fonts like woff, woff2, ttf, eot, svg will be much more lighter. JS config looks next:

subtasks: {
    font_awesome: {
        enabled: true,
        font_dest: './',
        css_font_src: '',
        font_types: ['woff'],
        icons: ['taxi'],
        help_classes: ['lg', '2x', '3x', '4x', '5x', 'fw', 'border']
    }
}
  • font_dest - fonts output dirname
  • css_font_src - by default it's relative path between out_bundle and font_dest, but you can specify more precisely
  • font_types - array of font types you will get after font-awesome will be processed
  • icons - array of font-awesome icons (http://fontawesome.io/icons)
  • help_classes - array of font-awesome help classes

normalize

It just adds normalize to the output_bundle. Look at this for more info https://github.com/necolas/normalize.css/

    subtasks: {
        normalize: {
            enabled: true
        }
    }