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

stylint-config-groupon

v3.2.3

Published

Stylint configuration, groupon-style

Downloads

3

Readme

stylint-config-groupon

A stylint config for Groupon's way of writing stylesheets using stylus.

Philosophy

Whenever possible favor a simple solution over a smart one. The harder it is to work with the framework, the more likely people will be to work around it instead. The grosser the hack, the more difficult it will be to roll back or standardize. Consider specificity a smell.

Browser Support

IE 9 is the limbo stick to clear but be pragmatic. Rounded corners are not worth a 40kb polyfill.

Styleguide

Beyond Formatting

  • Write your styles to have as low a specificity as possible/reasonable. Nobody should have to struggle to come up with a chain of selectors that will override yours.
  • Don't write your styles to be dependent on markup structures. Use descriptive class names liberally to apply styles to elements directly rather than generic class names whose styles changes based on their parent markup.
  • If a variable exists for something, use it! Hardcoding hex values or rgb/rgba/hsl/hsla declarations into your files when there's already a variable for them only causes headaches down the road.
  • Prefer nib's mixins & browser prefixing to homegrown solutions.

Formatting

Spacing & Blocks

Use 2 spaces for indentation, 1 space after operators, and empty lines between rules. Omit the curly braces around blocks and semicolons. Keep the colons after properties. Use // for comments.

// Bad
.container color: $body-background-color
a
  color $color-link
  //A comment
  text-decoration: none
  &:hover {
    text-decoration: underline
  }

// Good
.container
  color: $body-background-color

a
  color: $color-link
  // A comment
  text-decoration: none

  &:hover
    text-decoration: underline

Naming Conventions

Use hyphens & lowercase to identify elements. No underscores or camelcase.

prefixVarsWithDollar

To make it easier to distinguish variables from values, prefix them with a dollar sign.

// Bad
hide = transparent

.thing
  background-color: hide

// Good
$hide = transparent

.thing
  background-color: $hide

Units

Omit units for zero-values. Avoid confusing shorthand properties when order is significant.

// Bad
.container
  margin: 10px 0px
  // Quick, which dimension is repeated?
  padding: 10px 5px 15px

// Good
.container
  margin: 10px 0
  border-radius: 10px 5px 15px 5px

quotePref

Because it's what we do for JavaScript, we prefer single quotes for stylus as well.

// Bad
.container
  content: "x"

// Good
.container
  content: 'x'

duplicates/globalDupe

It's a good practice to only define a selector/property combination once per project and to use @import if it's needed in different files.

This rule may be broken to provide fallbacks:

// Bad
.some-class
  width: 920px
  width: 100%

// Good
.some-class
  width: 95% // old browser that dont know the calc property (I know this is a guess)
  width: calc(100% - 10px) // modern browsers

noImportant

Avoid !important at all costs. See: How style precendence works.

@css

Some CSS features like certain media queries aren't handled well by stylus. In those cases CSS can be inlined via @css blocks or put into separate .css files. You should use @import and external CSS files.

The reason for this rule isn't great - stylint just can't handle inline @css blocks properly. The good news is that you should rarely need to drop down to raw CSS.