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

stylus-lightning

v1.0.2

Published

Stylus library for Site Lightning.

Downloads

5

Readme

Stylus Lightning

This is a small library of Stylus mixins and stylesheets. It's purpose built to include in the Site Lightning front-end development boilerplate (source code here). You might also find it useful on it's own.

Site Lightning uses Axis so this library is mostly just extra helpers on top of that.

Installation

npm install --save stylus-lightning

Dependency

This library is dependent on using Axis for the hover-gradient() mixin. Important! Make sure you import Axis first since this library overwrites the buggy transition() mixin in Axis.

Usage

Like other Stylus libraries you need to use() it when calling Stylus. Here's an example Gulp config using four other awesome Stylus libraries: Happy Grid, Downbeat, Rupture and Axis.

var stylus = require('gulp-stylus');
var lib = require('stylus-lightning');
var downbeat = require('downbeat');
var grid = require('happy-grid');
var rupture = require('rupture');
var axis = require('axis');

gulp.task('style', function() {
  gulp.src('styles/main.styl')
    .pipe(stylus({use: [lib(), downbeat(), rupture(), axis(), grid()]}))
    .pipe(gulp.dest('./compiled/css'))
});

Then in your main.styl just @import 'lib'.

Styles

These two stylesheets add CSS to your output.

Reset

This is on top of normalize.css to give a nicer baseline for new styles.

  • border box everything
  • Improved font-smoothing and text-rendering
  • iOS scrolling and highlight improvements
  • html and body height 100%
  • overflow-x hidden for full-width() mixin
  • Reset padding and margin on commonly styled elements
  • Unstyled links
  • Unstyled buttons: no outlines, backgrounds or borders
  • Unstyled hr
  • fluid width, responsive media (max-width 100%)

Print

Print styles inspired by Hartija with some typography changes. Print styles in a @media query so you don' have to worry about it.

Mixins

Just a few mixins for now.

Full Width

It's easier to layout your site so that it is contained to a max-width. But sometimes you want a section background to go full width but your content to still be contained. This is a bit of a hack but works great.

section.wide
  full-width()
  color black

Hover Gradient

Uses Axis to create a gradient background and style the :hover to offset the gradient. Also sets the color to the element's color (or a color you pass) which is important if you are styling an anchor tag. When applied to an element (like a.button for instance) with transition background-position .2s you get a nice transition.

You can pass up to 4 args but only background-color is required.

  • background-color
  • [color: @color]
  • [strength: null] // uses Axis default (10%)
  • [offset: -2.5em]
a.button
  &.facebook
    hover-gradient #425c9e

Ratio Box

Set a specific ratio for background images and video iframe embeds.

Example:

.widescreen-video
  ratio-box(16/9)

Transition

This is a reset to fix occassional problems caused by the way Axis caches Nib's transition mixin. Since it's only for vendor prefixing and I use Auto-prefixer I just want transition to work normally.