Skip to content

Latest commit

 

History

History
104 lines (81 loc) · 1.61 KB

File metadata and controls

104 lines (81 loc) · 1.61 KB

properties-alphabetical-order

Specify the alphabetical order of properties within declaration blocks.

a {
	color: pink;
	top: 0;
}
/** ↑
 * These properties */

Shorthand properties must always precede their longhand counterparts, even if that means they are not alphabetized. (See also declaration-block-no-shorthand-property-overrides.)

Prefixed properties must always precede the unprefixed version.

This rule ignores variables ($sass, @less, --custom-property).

Options

Primary option

Value type: boolean.
Default value: none.

{ "order/properties-alphabetical-order": true }

The following patterns are considered warnings:

a {
	top: 0;
	color: pink;
}
a {
	border-bottom-color: pink;
	border-color: transparent;
}
a {
	-moz-transform: scale(1);
	transform: scale(1);
	-webkit-transform: scale(1);
}

The following patterns are not considered warnings:

a {
	color: pink;
	top: 0;
}
a {
	border-color: transparent;
	border-bottom-color: pink;
}
a {
	-webkit-transform: scale(1);
	-moz-transform: scale(1);
	transform: scale(1);
}
a {
	-moz-transform: scale(1);
	-webkit-transform: scale(1);
	transform: scale(1);
}

Optional secondary options

disableFix

Value type: boolean.
Default value: none.

Disable autofixing. Autofixing is enabled by default if it's enabled in stylelint configuration.

{
	"order/properties-alphabetical-order": [
		true,
		{ "diableFix": true }
	]
}