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

wc-jss

v0.3.3

Published

WC-JSS is based on InuitCSS and inspired by ITCSS architecture. The idea of this library is to follow ITCSS, but using only javascript and get read of SASS/SCSS. It is optimised to use within WebComponents

Downloads

27

Readme

WC- JSS

Based on InuitCSS this framework substitute SASS with plain JavaScript using modules and string literals. It is design to use in conjunction with Web Components

Installation & usage

Install npm package in your project npm i wc-jss

Once installed on your project you can star using styles inside your Web Components like above :

// app.js (web component)

import reset from 'wc-jss/generic/reset';
import {LitElement, html} from '@polymer/lit-element';

class WcApp extends LitElement {
  render() {
      return html`
        <style>
          ${reset}
        </style>
        <div class="app-bar">Example App</div>
     }
}

Note: Be aware that you will need a bundler in order to import NPM packages

Custom configuration object

You can customize initial settings params (or plugin settings params) by parsing an object the first time you call the singleton config object JSSConfig.

In order to add custom config , create a file , import JSSConfig, and instanciate JSSConfig with the new config object like:

// wcJssSettings.js
import JSSConfig from 'wc-jss/settings/JSSConfig';

const WCJSS = {
  fontSizeHeading: {
    h1: 180,
    h2: 80,
    h3: 40,
    h4: 20,
    h5: 10,
    h6: 8,
  },
};

JSSConfig.getInstance(WCJSS);

The new JSSConfig object will keep original parameters and will add or override parameters with the new one passed in

Because JSSConfig object is a singleton you need to assure that the first time you get the instance you are parsing the new config object. In order to do this your custom file will be the first file imported on your project, this way any further use of the library will contain the custom JSSConfig.

Now in your main index.js the first import will be this file:

import './wcJssSettings';
import './components/app';
// ...

TODO: Input in Pixels output in any

To make it easier for developers, every measure will be in pixels and the output (TODO) will be parametrize, upon config rules (px, rem, em, %)


TDD

We use TDD in our development. To run test:

 npm run test

This will run Jest with a watcher

Demo: Storybook

We use story book to make our demos.

We are keeping two packages.json , one for main app and another one only for storybook this way we are not polluting our main library with unwanted packages only needed for storybook

So the first time you start story book you will nedd to to an extra installation:

cd storybook
npm i

And then each time you want to run the server from storybook directory just do:

# To run server on port 6006
npm run storybook
# To build the storybook 
npm run build-storybook