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

somacss

v1.1.2

Published

Pure CSS3 Solutions for the Web

Downloads

14

Readme

Soma CSS is a small, functional and pure CSS3 library which offers CSS components that are:

  • Immutable like Pure Functions in FP approach
  • Reusable like Objects in OOP approach
  • Nestable like Components in React approach

Components can be created:

  • manually using simple editors or emmet plugin
  • or using JavaScript

But, For their actions they do not need JavaScript.

  • flex-box
  • input's UI-State pseudo-class (= :checked)
  • label's [for] attribute
  • transform: transition
  • document.createElement
  • element.[get|set]Attribute
  • element.appendChild( Node )
  • etc
  • react 16+
  • react-dom
  • JSX

You can use them in either way of Pure CSS or creating them using JS and then using them. Actually API has been divided in to three types:

CSS file:

<link rel="stylesheet" type="text/css" href="soma.prefixed.min.css" />

JS in ES6 format:

import { carouselZ, carouselY, carouselX, slickX, progressX } from 'somacss';

JS in ES5 format using Global S

<script type="application/javascript" src="soma.es5.js"></script>
// Global S.xxx are available to use
// S.carouselZ
// S.carouselY
// S.carouselX
// and so on
# Soma CSS
git clone https://github.com/k-five/soma

# Soma JS


# Soma React

If you want to build it from source, install:

  • sass && jest globally
  • And devDependencies on package.json file

There is no __tests__ directory, so for running test just try:

jest src/
# or
jest --max-workers 2 src/
# Soma CSS
npm install somacss     # install the package
cd node_modules/somacss # package root
cd build                # release file are here
tree --dirsfirst -sh
.
├── [4.0K]  css
│   ├── [ 47K]  soma.css              # raw version
│   ├── [ 23K]  soma.css.map
│   ├── [ 40K]  soma.min.css          # minified version
│   ├── [ 23K]  soma.min.css.map
│   ├── [ 50K]  soma.prefixed.css     # prefixed version
│   ├── [ 15K]  soma.prefixed.css.map
│   └── [ 42K]  soma.prefixed.min.css # prefixed + minified
└── [4.0K]  js
    ├── [ 11K]  soma.es5.js           # is used with <script src> which has global S
    └── [ 11K]  soma.js               # import { name-of-the-component } from 'somacss'

# Soma JS


# Soma React
  • CarouselZ (managing Brands)
  • CarouselY (managing Categories)
  • CarouselX (managing Sections)
  • SlickX (managing Products)
  • Carousel(Z or Y or X) (managing Types)
// eCommerce is a JSON file
// var keys = Object.keys
brands = keys( eCommerce );
var final = carouselZ({
    titles: brands,
    children: brands.map( function( brand ){

        // array of categories for each brand
        var categories = keys( eCommerce[ brand ] );

        // and for each brand creating carousel-y
        return carouselY({
            titles: categories,
            children: categories.map( function( category ){

                // array of sections for each category
                var sections = keys( eCommerce[ brand ][ category ] );

                // and for each category creating carousel-x
                return carouselX({
                    titles: sections,
                    children: sections.map( function( section ){

                        // if we have any products
                        var products = keys( eCommerce[ brand ][ category ][ section ] );

                        // one slide for each product
                        return slickX({
                            children: products.map( function( product, productIndex ){

                                // when we have types of products
                                var types = keys( eCommerce[ brand ][ category ][ section ][ product ] );

								// just playing with combination of carousel(Z or Y or X)
                                switch( types.length ){
                                    case 0:
                                        return h1( "dummy content " + productIndex ).cloneNode( true );
									break;

                                    case 2:
                                    return carouselX({
                                        titles: types,
                                        children: types.map( function( typeName ){
                                            return h1( typeName ).cloneNode( true );
                                        })
                                    });
									break;

                                    case 3:
                                    return carouselY({
                                        titles: types,
                                        children: types.map( function( typeName ){
                                            return h1( typeName ).cloneNode( true );
                                        })
                                    });
									break;

                                    default:
                                    return carouselZ({
                                        titles: types,
                                        children: types.map( function( typeName ){
                                            return h1( typeName ).cloneNode( true );
                                        })
                                    });
                                } // end of switch()
                            })
                        });
                    })
                });
            })
        });
    })
});
carouselZ
├── titles
└── children
    └── carouselY
        ├── titles
        └── children
            └── carouselX
                ├── titles
                └── children
                    └── slickX
                        └── children
                            └── carouselZ
                                ├── titles
                                └── children