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-logic-order

v1.0.1

Published

This Stylelint configuration validates the ordering of CSS properties according to a certain logic :D

Downloads

9

Readme

stylelint-config-logic-order

This stylelint configuration validates the order of CSS properties according to Logic CSS. It's highly recommended that you use this in addition to your own rules (or rules from a shareable configuration), since it is only concerned with ordering. The configuration works with both stylelint --fix and stylefmt to automatically sort your CSS properties.

This package is inspired by Stylelint Concentric Order.

Installation

npm install --save-dev stylelint-config-logic-order

Usage

Add this configuration to the end of your extends array inside .stylelintrc

{
  "extends": [
    // ...some other shareable Stylelint configuration
    "stylelint-config-logic-order"
  ],

  "rules": {
    // ...your own custom rules and overrides
  }
}

Explanations : about Logic CSS

Logic CSS doen't really exist, but I havn't found any good name for this ordering logic… I encourage you to see ./src/ index.js for full order list.

The purpose : order the CSS properties with a certains logic :

1/ External styles

When using Sass, @include and @extend should be on top, so we directly see what they herited from mixin, placeholder, included styles. It's easier to override them right after. The only exeption are for mediaqueries with @include, they should be at the end.

2/ Positioning

Beacause position affect directly the render of the styled component/item, it's on top of the properties. For example, position: absolute can completly change the CSS flow.

3/ Flex and grid self positionning

All proporties that the parent induced for the component. Typically: flex proporties for flex-iems, or self positionning in grid/flex context.

4/ Self display

Set the component display method before all other style can avoid miss understaning display when debugging.

4/ From inside to outsite

Content styles first: fonts styles, paddings, border, background, decorative box elements, margins

5/ Effects

Then, all other styles: opacity, cursor,… And to finish transforms and animations.