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

stylelint-config-rational-declaration

v2.0.0

Published

Stylelint config that sorts related property declarations by grouping together following the order: Positioning, Structure, Grid, Dimension, Definition, Typography, Visual, Animation, Other.

Downloads

9

Readme

stylelint-config-rational-declaration

Stylelint config that sorts related property declarations by grouping together following the order:

  1. Positioning
  2. Structure
  3. Dimension
  4. Definition
  5. Typography
  6. Visual
  7. Animation
  8. Misc
.declaration-order {
  /* Positioning */
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;

  /* Structure */
  display: flex;
  flex: 1;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  float: right;

  /* Grid */
  display: grid;
  grid-template-columns: 40px 50px auto 50px 40px;
  grid-template-rows: 25% 100px auto;

  /* Dimension */
  width: 100px;
  height: 100px;

  /* Definition */
  padding: 10px;
  border: 1px solid #888;
  border-radius: 4px;
  margin: 10px;

  /* Typography */
  font: normal 16px Helvetica, sans-serif;
  color: #888;
  line-height: 1.3;
  text-align: center;

  /* Visual */
  background-color: #eee;
  opacity: 1;

  /* Animation */
  transition: all 1s;

  /* Misc */
  user-select: none;
}

Usage

  1. Add stylelint, stylelint-order and this package to your project:
npm install --save-dev stylelint stylelint-order stylelint-config-rational-declaration
# or, if you prefer yarn over npm:
yarn add --dev stylelint stylelint-order stylelint-config-rational-declaration
  1. Add this package to the end of your extends array inside Stylelint configuration (.stylelintrc for example):
{
  "extends": [
    // "stylelint-config-standard",
    "stylelint-config-rational-declaration"
  ]
}

This shareable config contains the following:

{
  "plugins": [
    "stylelint-order",
    "stylelint-config-rational-declaration/plugin"
  ],
  "rules": {
    "order/properties-order": [],
    "plugin/rational-declaration": [true, {
      "empty-line-between-groups": false,
    }]
  }
}

Since it adds stylelint-order and stylelint-config-rational-declaration to plugins and also adds required rules, you don't have to do this yourself when extending this config.

Optional options / rules

empty-line-between-groups

If true adds an empty line between groups. The default value is false.

FAQ

The pros and cons of both ways in detail:

Credits

https://github.com/constverum/stylelint-config-rational-order/packages