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

jss-styles

v0.1.3

Published

A Stylesguide parser (and example generator) for creating living styleguides, based on kss - http://github.com/kneath/kss.

Downloads

14

Readme

JSS

javascript styleguides, jesse's style sheets, whatever...

Inspired by KSS, which was in turn inspired by TomDoc, JSS attempts to provide a javascript version of KSS & TomDoc's methodology for writing maintainable, documented CSS within a team. Like KSS, JSS is a documentation specification and styleguide format. It is not a preprocessor, CSS framework, naming convention, or specificity guideline.

JSS currently conforms exactly to the KSS spec - found here:

You can get started quickly by copying the example:

JSS/KSS in a nutshell

The methodology and ideas behind Knyle Style Sheets are contained in SPEC.md. At it's core, KSS is a documenting syntax for CSS. JSS conforms exactly to those ideas. Here's an example:

/*
A button suitable for giving stars to someone.

:hover             - Subtle hover highlight.
.stars-given       - A highlight indicating you've already given a star.
.stars-given:hover - Subtle hover highlight on top of stars-given styling.
.disabled          - Dims the button to indicate it cannot be used.

Styleguide 2.1.3.
*/
a.button.star{
  ...
}
a.button.star.stars-given{
  ...
}
a.button.star.disabled{
  ...
}

NPM package

This repository is also the npm package, and should not be used as a substitute for it. Someone already had "jss" on npm (disputing, we'll see.), so as of speaking, you can install jss by doing a simple:

npm install jss-styles, or add it to your package.json file and do an npm install .

Once you have jss as a dependency, you can use the example folder either found here in this repo or at node_modules/jss-style/example once you've installed jss as a starting point.

Currently I wouldn't recommend playing with the logic in app.js, but I'm not making any rules. The quickest way to get started is to copy the example folder, edit the stylesheets, index.html, styleguide.html, and layout.html files.

Generating styleguides

The documenting syntax and ruby library are intended to generate styleguides automatically. To do this, you'll need to leverage a small javascript library that generates class styles for pseudo-class styles (:hover, :disabled, etc).

  • kss.js (compiled js, directly pulled from kss)

For an example of how to generate a styleguide, check out the example express application.

Development

To hack on JSS - fork away, go crazy. JSS has no dependencies except underscore, which is currently packaged with it. (Probably will change that in the future.)

Unfortunately no unit tests are in yet - this is the next step, so expect them in soon.