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

stylebook

v1.0.0

Published

Styles for The Things Network websites

Downloads

11

Readme

The Things Network Stylebook

The goal of this project is to contain a shared set of styles and related assets for use on several website properties of The Things Network. It does not enforce a particular CSS preprocessor or build flow and allows us to adopt global styles step by step.

Why Less?

The source stylesheets are in Less because it was the only format that can be automatically converted to SCSS and Stylus.

Documentation

The docs folder uses dist/scss to demonstrate the styles and is a usage example at the same time. You can view the documentation via GitHub Pages.

Usage

  1. Depend on the repository, e.g. via NPM:

    npm install --save thethingsnetwork/stylebook

    You can also lock in to a certain branch or commit.

  2. Import a stylesheet in the language you use:

    @import 'ttn/ttn-variables';
       
    body {
    	color: $ttn-color-brand;
    }

    This example assumes you run Sass with --load-path node_modules/stylebook/dist/scss to not have to give the full path on every import.

Stylesheets

There are different strategies for using the stylesheets:

Development

  1. Install Ruby

  2. Install Bundler:

    $ gem install bundler
  3. Install Ruby dependencies via Bundler:

    $ bundle install
  4. Install Node.js and NPM.

  5. Install Node.js dependencies via NPM:

$ npm install
  1. Update styles in src using Less.

  2. Run convert to update dist with Less, SCSS, Stylus and CSS versions and process docs/src.

    $ npm run convert

NOTE: Running npm install will overwrite the git pre-commit hook to execute npm run convert & npm run add automagically on every commit so you can ignore step 7.

Conventions

  • Variables, selectors and mixins should start with ttn- so that they do not conflict with other frameworks or custom styles on the site.

Default variables

Both Stylus and Sass support variable defaults. Less does not and promotes lazy loading instead. Because we use Less as source to convert to Sass and Stylus this is an issue. So bin/convert does has replacements to make all variables in Stylus and Sass defaults, except dist/*/ttn/bootstrap-variables so it can use but also override Bootstrap variabls.

Tests

To run all tests:

npm install
npm test

To update expected with actual output:

UPDATE=1 npm test

TODO

  • Add more base variables.
  • Add styles for custom components.
  • Include TTN assets logos.
  • Maybe even include common templates and scripts?