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

@neolithic-css/framework

v1.4.5

Published

CSS utilities framework written in Sass.

Downloads

5

Readme

A fully configurable CSS utility framework written in Sass.

version license Sass

Installation

You can install it via npm 📦

npm i @neolithic-css/framework

Basic Usage

If you use Webpack's sass loader, just reference it using the ~ syntax 🤟🏼

Here is a simple example.

@use "~@neolithic-css/framework" as nc with
(
    $breakpoints: (
        xs: 320px,
        sm: 550px,
        md: 768px,
    ),
    $modules: [
        'grid',
        'spacing',
        'typography',

        // to config a module use this syntax 
        [ 'background/background-color', ( property-name-alias: bg ) ],
    ],
    $colors: [ 'black', 'white', 'gray', 'red' ],
    $extra-colors: (
        primary: #0667B7,
        blue: (
            50: #f7fafd,
            100: #eaf2f9,
        )
    ),
    $mobile-first: true,
);

@include nc.build;

Default Naming Convention

By default, the framework use the CSS property name as the class name.

For example:

.border-top\:5 {
  border-top: 5px solid !important;
}

.border-radius\:20 {
  border-radius: 20px !important;
}

Only for some frequently used utilities use shortened class name.

  • background-colorbg
  • text-align, text-transform, text-decoration, vertical-alignt
  • font-size, font-style, font-wightfz, fs, fw
  • margin-top, margin-bottom, margin-left, margin-rightmt, mb, ml, mr
  • padding-top, padding-bottom, padding-left, padding-rightpt, pb, pl, pr

You can change the class name by set the property-name-alias option for each module.

See here to understand the core concept of neolithic-css's naming convention.

Fluid utility

Fluid utility utilizes the calc() function to automatically change a CSS property from one value to another according to the viewport width.

For example:

<div class="fz:50~23 mb:90~20">Text</div>

The above example indicates:

  • change font-size from 50px to 23px automatically
  • change margin-bottom from 90px to 20px automatically

By default, the value changes from breakpoint lg to xs.
You can set the range via the start-shrinking-width and stop-shrinking-width in $fluid option.

Breakpoint utility

By using breakpoint utilities, you can apply a utility conditionally at different breakpoints.

For example:

<div class="mb:20@md">Text</div>

where mb:20@md means:

@media (min-width: 768px) {
    .mb\:20\@md {
        margin-bottom: 20px !important;
    }
}

Grid System

By using the grid-cols and col-span utility, you can create almost any responsive grid layout.

Just some examples:

<div class="d:grid grid-cols:3@md gap:40~10">
    <div>column 1</div>
    <div>column 2</div>
    <div>column 3</div>
</div>

<div class="d:grid grid-cols:4@md">
    <div class="col-span:1@md">column 1</div>
    <div class="col-span:3@md">column 2</div>
</div>

<div class="d:grid grid-cols:12@md grid-cols:9@sm">
    <div class="col-span:5@md col-span:3@sm">column 1</div>
    <div class="col-span:7@md col-span:6@sm">column 2</div>
</div>

Options

$breakpoints

The breakpoints for each utility.

Default Value

$breakpoints: (
    xs: 320px,
    sm: 550px,
    md: 768px,
    lg: 1024px,
    xl: 1256px,
    xxl: 1600px,
) !default;

$property-name-delimiter $query-delimiter

Default Value

See more details about the concept of these two options.

$property-name-delimiter: ':' !default;
$query-delimiter: '@' !default;

$mobile-first

Default Value

Determine if use mobile-first mode for media query.

$mobile-first: true !default;

$important

Determine if appends the !important to each utility.

Default Value

$important: true !default;

$modules

The modules to be included. You can find all the modules in the src/** directory.

Default Value

$modules: [ 'grid', 'spacing', 'typography', ] !default;

To config a module use this syntax :

$modules: [
  [ 'background/background-color', ( property-name-alias: bg ) ]
],

$colors

The colors variations for the utilities.

For example, if you have included the module background/background-color, and have the green included in the $colors.

Classes like bg:green.300 will be generated, the 300 is the level of the color.

The default colors are picked up from Material Design color palettes.

Default Value

$colors: [ 'white', 'black', 'gray', 'red', 'green', 'blue', ] !default;

$extra-colors

In addition to $colors, you can define your own colors with this option.

For example:

$extra-colors: (
    primary: #0667B7,
    blue: (
        50: #f7fafd,
        100: #eaf2f9,
    )
)

$fluid

Options for fluid utility.

Default Value

$fluid: (
    start-shrinking-width: default(map.get($breakpoints, lg), 1024px),
    stop-shrinking-width: default(map.get($breakpoints, xs), 320px),
    strip-unit: true,
    step: 10px,
    min: 0px,
) !default;