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

@chialab/cells

v1.5.4

Published

A strongly opinionated modular utility-first CSS library.

Downloads

433

Readme

Cells

A strongly opinionated modular utility-first CSS library.

Why

Cells looks like just any another utility-first CSS library like bootstrap, tailwind and unocss, but it has a slightly different scope. The library is designed to work as a configurable primer for themable components library and frontend skeletons.

Since it does not try to cover the entire styling experience of a project, it does not require build-time optimizations. You can import base custom properties and classes using plain CSS imports and load opinionated rules from the provided presets.

Please note that Cells does not aim to compete in the CSS frameworks market. It will evolve in the only interest of our development teams, but we are happy to share and discuss design choices with other developers.

Cells is distribuited as plain CSS files. You can import the whole library using the index.css file or single modules from the lib folder. Each module is configurable using CSS custom properties.

Implemented modules:

  • Spacing defines base spacing variables
  • Colors defines base theming variables such as primary, secondary and accent colors and base text and background colors classes
  • Typography defines base variables for families, weights and size scale, as well as declinated classes for composition
  • Layout contains classes for general grid layout, as well as utility classes for flexbox specs
  • Paddings contains classes to set incremental paddings, from p-0 to p-10 and with px, py, pt, pr, pb, pl variants
  • Margins contains classes to set incremental margins, from m-0 to m-10 and with mx, my, mt, mr, mb, ml variants
  • Borders contains radius-N classes for rounded borders
  • Shadows contains both classes for inset shadows, from deep-1 to deep-4, and drop shadows from elevation-0 to elevation-10 plus elevation-12, elevation-186 and elevation-24
  • Outline customizes the global page outline for keyboard navigation
  • Scollbar contains classes to customize scrollbars

Presets:

  • Website configures the grid layout for each viewport (mobile 4 columns, tablet portrait 6 columns, tablet landscape 8 columns, desktop 12 columns)

Usage

NPM

You can install and consume Cells with npm:

$ npm i @chialab/cells
$ yarn add @chialab/cells

and import it in your stylesheet:

@import '@chialab/cells';

or using the unpkg CDN:

<link rel="stylesheet" href="https://unpkg.com/@chialab/cells/lib/index.css" />
@import 'https://unpkg.com/@chialab/cells/lib/index.css';

Correctly set --window-width variable.

Viewport units (vw, vh) do not take into account scrollbars width. In Cells, we use the overflow: overlay; property in order to avoid horizontal scrolling when using 100vw in mobile viewports, but that property is not a safe cross-browser solution and will be removed in the next major iteration of Cells. From 1.5.0, to solve this problem we have introduced the --window-width variable that can be set using the following JavaScript snippet:

function updateViewportSize() {
    document.documentElement.style.setProperty('--window-width', `${document.body.clientWidth}px`);
};

updateViewportSize();
window.addEventListener('resize', updateViewportSize);

License

Cells is released under the MIT license.