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

greencss

v1.3.3

Published

The classy way to write sustainable CSS.

Downloads

27

Readme

A classy way to write sustainable CSS

Prettier Code Style Downloads p/week NPM version License

greencss logo

Getting started

npm i greencss

To install the greenCSS dark mode add-on, head to @greencss/dark-mode.

Initialisation

  • Import all CSS classes into your project.
import 'greencss/css/greencss.css'
  • If you only want to use the animations, for example, import only one category into your project.
import 'greencss/css/classes/animation/animation.css'

Currently, the following categories are available:

  • animation/animation.css
  • background/background.css
  • borders/borders.css
  • color/color.css
  • effects/effects.css
  • filters/filters.css
  • flex-grow/flex-grow.css
  • interactivity/interactivity.css
  • layout/layout.css
  • sizing/sizing.css
  • spacing/spacing.css
  • svg/svg.css
  • tables/tables.css
  • transforms/transforms.css
  • typography/typography.css

You will find all CSS categories here.

Lightweight Version

Instead of the normal version, you can also import a lightweight minified version.

import 'greencss/css/minified/greencss.css'

Compact imports also work with categories:

import 'greencss/css/minified/classes/animation/animation.css'
import 'greencss/css/minified/classes/color/color.css'

Before you code

By default, all default browser settings are reset. This means that you enjoy unlimited freedom and can choose your own design. Create a default reset.css file and specify your desired spacing, fonts, text sizes and font weights. Make sure that your reset file is imported after the greencss file. This way your file has a higher priority and you overwrite any greencss classes.

import 'greencss/css/greencss.css'.
import 'path-to-your-reset.css-file'.

By the way, when you use greenCSS, sustainability is not the only thing which is important. Writing CSS intuitively and easily is also crucial. For this reason, greenCSS has decided to reset the default font size to 62.5%. For you, this means that 1rem = 10px. This allows you to calculate in the simplified power of ten.

/* Set core root defaults */
html {
  font-size: 62.5%; // default pixel size reset to 10px
}

How it works

All greenCSS classes have the same structure. An explanation of this principle can be given with the help of the examples below.

<p class="text-blue">a blue text</p>

If the text colour for an element is to be changed on small screens only (0px - 480px), the class is inserted with a prefix called "sm:".

<p class="text-blue sm:text-purple">a purple text for small screens</p>

If the text colour for an element should be changed on medium screens (480px - 768px), the "md:" needs to be inserted. Large screens (768px - 1080px) will use the "lg:" prefix.

<p class="text-blue sm:text-purple md:text-green lg:text-orange">Different colours for different screen sizes</p>

In addition to the responsive classes, all classes also have active, focus and hover classes, which can be combined as desired.

<p
  class="text-blue sm:text-purple sm:active:text-purple-5 md:text-green md:focus:text-green-2 lg:text-orange lg:hover:text-orange-10">
  Different text colours and different states for all screens
</p>

Values & unit sizes should have intuitive notation and resemble the original CSS where possible.

<div class="opacity-50per w-100px h-20rem sm:rotate-neg-180deg"></div>

In the example above, the element has an opacity of 50 percent, it is 100 pixels wide and 20 REM (200pixel) tall. On small screens it has a negative tilt of 180 degrees.

All examples mentioned above can also be adapted to the darkmode. Add the prefix "dark-" where applicable.

<p class="text-blue dark:text-blue-10 sm:text-purple dark:sm:text-purple-10 hover:dark:sm:text-purple-5">Darkmode example</p>

Contribute

You want to collaborate? Have a look at the documentation in the information folder.

For commits, use semantig writing:

| Commit | Usage | | ------------------------------------------------------------------ | :--------------: | | fix(pencil): stop graphite breaking when too much pressure applied | Fix Release | | feat(pencil): add 'graphiteWidth' option | Feature Release | | perf(pencil): remove graphiteWidth option | Breaking Release |

Useful links