Skip to content

Latest commit

 

History

History

no-at-nest-rule

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

version

Prevent usage of @nest in CSS.

/* valid */
.element {
	article & {}
}

/* invalid */
.element {
	@nest article & {}
}

The CSS Nesting specification has changed and @nest is no longer required and has been removed from the specification.
Since it will never be valid CSS in browsers it is important to migrate away from it.

Valid CSS :

.element {
	article {}

	article & {}
}

Invalid CSS :

.foo {
	@nest article {}

	@nest article & {}
}

Usage

npm install --save-dev @csstools/stylelint-no-at-nest-rule

// stylelint.config.js
module.exports = {
	plugins: [
		"@csstools/stylelint-no-at-nest-rule",
	],
	rules: {
		"@csstools/stylelint-no-at-nest-rule": true,
	},
}