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

gensass

v1.0.6

Published

Gensass is a .scss micro framework that was designed to be used in a Laravel project in order complement Bootstrap

Downloads

23

Readme

Gensass

Gensass is a .scss micro framework that was designed to be used in a Laravel project in order to complement Bootstrap. Since a lot of classes are generated, this package is made to be used with PurgeCss to get rid of unused style.

Gensass comes with a feature that allows you to use any svg as an icon (see Installation > Icons).

Table of content

  • Installation
  • Icons usage
  • Classes usage
  • Classes
  • Authors

Installation

Package

Install package using npm

    npm install gensass

Icons

1. Add every svg you intent to use as an icon in folder /public/images/icons. The svg name must not contain any spaces.

2. In your package.json, add the following lines :

    "init-icons": "node node_modules/gensass/dist/js/icons.mjs",
    "build": "npm run init-icons && vite build",

Now, everytime your compiler runs it will generate a .scss file with all your icons ready to use.

3. In your app.scss file, you must load your icons. It should look like something like this :

    // Variables
    @import 'variables';

    // Bootstrap
    @import 'bootstrap/scss/bootstrap';

    // Gensass
    @import '/node_modules/gensass/dist/sass/gensass';

    // Project
    @import 'bases/icons';

    /*! purgecss start ignore */
    // Import your style
    // ...
    /*! purgecss end ignore */

Icons usage

Few sizes are predetermined but you can customize it freely using Gensass width and height classes.

| Nom | Width | Height | | :-------- | :------- | :-------------------------------- | | small | 24px | 24px | | medium | 48px | 48px | | large | 96px | 96px |

    <i class="icon icon-sunset icon-medium bg-is-c1"></i>

Classes usage

Many of the generated classes make profit of bootstrap breakpoints, which are the following :

    "xs", "sm", "md", "lg", "xl", "xxl"

Colors

Setup

Gensass uses a list of colors to generate useful classes. To make it work, your _variables.scss must respect a certain format.

To help you setting this up, you will find a _variables.example.scss file in our package.

Your _variables.scss should look like this :

    $colors-list : (
      #FFFFFF,  // 1
      #FFFFFF,  // 2
      #FFFFFF,  // 3
      #FFFFFF,  // 4
      #FFFFFF,  // 5
    );

Usage with scss

Using css variables :

  background-color: var(--c1);

Or with custom function :

  background-color: color(1);

Usage with generated classes

  <div class="is-c1 bg-c3"></div>

Classes

Hover

  <div class="hover-is-c3 hover-bg-c3"></div>

Borders

  <div class="border-w-10px is-border-c3 border-style-dotted"></div>

Offsets

Units : px, rem, %

| Offsets | Units | Classes | | :-------- | :------- | :-------------------------------- | | Top | px, rem, % | t-10px, t-n10, t-10, t-10pc, t-#mediaBreakpoint-10pc | | Right | px, rem, % | r-10px, r-n10, r-10, r-10pc, r-#mediaBreakpoint-10pc | | Bottom | px, rem, % | b-10px, b-n10, b-10, b-10pc, b-#mediaBreakpoint-10pc | | Left | px, rem, % | l-10px, l-n10, l-10, l-10pc, l-#mediaBreakpoint-10pc |

Position

Make usage of bootstrap breakpoints

  <div class="position-relative position-lg-absolute"></div>

Margins

Units : px, rem, %

| Margins | Units | Classes | | :-------- | :------- | :-------------------------------- | | Top | px, rem, % | mt-10px, mt-n10, mt-10, mt-10pc, mt-#mediaBreakpoint-10pc | | Right | px, rem, % | mr-10px, mr-n10, r-10, r-10pc, mr-#mediaBreakpoint-10pc | | Bottom | px, rem, % | mb-10px, mb-n10, mb-10, mb-10pc, mb-#mediaBreakpoint-10pc | | Left | px, rem, % | ml-10px, ml-n10, ml-10, ml-10pc, ml-#mediaBreakpoint-10pc | | MX | px, rem, % | mx-10px, mx-n10, mx-10, mx-10pc, mx-#mediaBreakpoint-10pc | | MY | px, rem, % | my-10px, my-n10, my-10, my-10pc, my-#mediaBreakpoint-10pc |

Opacity

  <div class="opacity-75 opacity-hover-50"></div>

Z-index

  <div class="z-index-50"></div>

Font-weight

Add "thin", "regular", "medium", "semi-bold", "heavy", "black" to Bootstrap classes.

  <div class="fw-thin"></div>

Font-size

Units : px, rem, %

| Margins | Units | Classes | | :-------- | :------- | :-------------------------------- | | Font-size | px, rem, % | font-size-10px, font-size-10, font-size-10pc, font-size-#mediaBreakpoint-10pc |

Width

Units : px, rem, %

| Margins | Units | Classes | | :-------- | :------- | :-------------------------------- | | Width | px, rem, % | w-10px, w-10, w-10pc, w-#mediaBreakpoint-10pc |

Height

Units : px, rem, %

| Margins | Units | Classes | | :-------- | :------- | :-------------------------------- | | Height | px, rem, % | h-10px, h-10, h-10pc, h-#mediaBreakpoint-10pc |

Loader

    <div class="loader">
        <div class="spinner"></div>
    </div>

Utilities

Some useful classes are available with Gensass, you can see the full list in gensass bases/utilities.scss file.

Authors