New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mrhenry/stylelint-mrhenry-prop-order

Package Overview
Dependencies
Maintainers
0
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mrhenry/stylelint-mrhenry-prop-order

Mr. Henry's preferred order for CSS properties

  • 3.0.20
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
447
increased by18.57%
Maintainers
0
Weekly downloads
 
Created
Source

@mrhenry/stylelint-mrhenry-prop-order Mr. Henry's logo.

version

Specify a strict order for CSS properties.

/* valid */
.foo {
	width: 100px;
	height: 20px;
}

/* invalid */
.foo {
	height: 20px; /* we prefer width before height */
	width: 100px;
}
/* valid */
.foo {
	margin: 20px;
	margin-top: 10px;
}

/* invalid */
.foo {
	margin-top: 10px; /* longhand before a shorthand */
	margin: 20px;
}

This package doesn't create groups of properties. But it will respect patterns that are often used to group properties:

  • empty lines
  • comments
  • custom properties
  • vendor prefixed CSS
.foo {
	a: 0; /* section : 1 */
	b: 0; /* section : 1 */

	c: 0; /* section : 2 */
	d: 0; /* section : 2 */
	/* a comment */
	e: 0; /* section : 3 */
	f: 0; /* section : 3 */
	--a: 0; /* ignored */
	--b: 0; /* ignored */
	-webkit-foo: 0; /* ignored */
}

Usage

npm install --save-dev @mrhenry/stylelint-mrhenry-prop-order

// stylelint.config.js
module.exports = {
	plugins: [
		"@mrhenry/stylelint-mrhenry-prop-order",
	],
	rules: {
		"@mrhenry/stylelint-mrhenry-prop-order": true,
	},
}

List of properties :

The list is sourced from @webref/css.

To update properties :

  • npm run update (to get the latest @webref/css)
  • npm run test

This will tell you which properties are missing.

Keywords

FAQs

Package last updated on 17 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc