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

tutti-ch-styleguide

v2.4.99

Published

React-based styleguide for tutti.ch

Downloads

199

Readme

tutti.ch Styleguide

CircleCI

How to start

To develop:

git clone https://github.com/tutti-ch/react-styleguide.git
cd react-styleguide
npm install
npm run styleguide

Then open http://localhost:6060 in your browser.

To include in your project:

npm install --save tutti-ch-styleguide

or

yarn add tutti-ch-styleguide

We do work with scss files. In order to include the styles in your project, simply:

@import '~tutti-ch-styleguide/dist/normalize.scss'
@import '~tutti-ch-styleguide/dist/index.scss'

The first file normalize.scss is a normalizer to have a common style accross browsers. The second file will give you access to all variables that are mentioned in the styleguide.

Then you can easily import our components like:

import { Table, Spinner, Image } from 'tutti-ch-styleguide' // See our styleguide for a full list of components

Changing content

We have currently divided the style guide into two sections.

1. Styles

Everything related to styles (colors, sizes, icons etc...) goes under this folder. The styleguide will look into the src/styles folder and load every file matching the following glob:

src/styles/**/[A-Z]*.js

These files will be directly included in the style guide under the Styles Section.

2. Components

Components that will be used in our project will be grouped under this section. The styleguide will look into the src/components folder and load every file matching the following glob:

src/components/**/[A-Z]*.js

These files will be directly included in the style guide under the UI Components Section.

3. Icons

In order to generate icons one must execute the following command:

npm run icons

This command will search for svg files recursively under styles/ folder and will create an index.js file within each folder that svgs are located. This index file serves to import the svgs files directly into react as images. If you prefer to use it as a font, then simply use the corresponding class name. For instance, for kanton-aargau.svg file one will be able to write:

import { icons } from "tutti-ch-styleguide"
icons.cantons.CantonAargau
icons.categories.Tv
icons.SocialFacebook

Publishing to Github Pages


For detailed information regarding publishing on GitHub pages, you can check this link.

We use the docs/ way. GitHub will read everything under this folder. The index.html is the main file to be loaded.

To facilitate the build procedure, we have configured the styleguide to build directly into the docs/ folder. If you ever have to change this behaviour, check the styleguideDir configuration under styleguide.config.js file.

Publishing to npm


In order to publish to npm one must first create an npm user. npm adduser

Once done, an admin should provide access to the created user on npm's admin page. Afterwards it is as simple as executing the following command:

npm run dist:publish

This command will pull the latest version from the master, build the styleguide, patch the package version, push the changes to master and finally will publish.