All Projects → kristerkari → Stylelint Declaration Block No Ignored Properties

kristerkari / Stylelint Declaration Block No Ignored Properties

Licence: mit
Disallow property values that are ignored due to another property value in the same rule.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Stylelint Declaration Block No Ignored Properties

Stylelint Webpack Plugin
A Stylelint plugin for webpack
Stars: ✭ 411 (+532.31%)
Mutual labels:  stylelint
Stylelint.io
The source of the stylelint website
Stars: ✭ 26 (-60%)
Mutual labels:  stylelint
Generator Dhboilerplate
Boilerplate made by David Hellmann
Stars: ✭ 54 (-16.92%)
Mutual labels:  stylelint
Stylelint Order
A plugin pack of order related linting rules for stylelint.
Stars: ✭ 607 (+833.85%)
Mutual labels:  stylelint
Stylefmt Loader
Webpack-loader. Fixes stylelint issues automatically while bundling with Webpack.
Stars: ✭ 24 (-63.08%)
Mutual labels:  stylelint
Stylelint No Browser Hacks
Stylelint plugin for stylehacks linting
Stars: ✭ 12 (-81.54%)
Mutual labels:  stylelint
Stylelint A11y
Plugin for stylelint with a11y rules
Stars: ✭ 384 (+490.77%)
Mutual labels:  stylelint
Webpack Es6 Sass Setup
A basic setup for Webpack with ES6, Babel, Sass and stylelint
Stars: ✭ 63 (-3.08%)
Mutual labels:  stylelint
Jest Styled Components Stylelint
Run stylelint on your styled-components styles at runtime.
Stars: ✭ 25 (-61.54%)
Mutual labels:  stylelint
Stylelint Module
Stylelint module for Nuxt.js
Stars: ✭ 32 (-50.77%)
Mutual labels:  stylelint
Stylelint Processor Styled Components
Lint your styled components with stylelint!
Stars: ✭ 639 (+883.08%)
Mutual labels:  stylelint
Stylelint Scss
A collection of SCSS specific linting rules for stylelint
Stars: ✭ 655 (+907.69%)
Mutual labels:  stylelint
Mvfsillva
My personal website
Stars: ✭ 13 (-80%)
Mutual labels:  stylelint
Magento2 Frontools
Set of front-end tools for Magento 2 based on Gulp.js
Stars: ✭ 416 (+540%)
Mutual labels:  stylelint
Stylelint Config Standard
The standard shareable config for stylelint
Stars: ✭ 1,108 (+1604.62%)
Mutual labels:  stylelint
React 2048 Game
🎮 A fancy 2048 game build with react, redux best practices.
Stars: ✭ 401 (+516.92%)
Mutual labels:  stylelint
React Mobx React Router Boilerplate
A simple boilerplate based on create-react-app and add mobx, react-router, linter, prettier and so on. 一个简单的 react 脚手架依赖于 create-react-app 新增了 mobx react-router,linter,prettier 等。
Stars: ✭ 12 (-81.54%)
Mutual labels:  stylelint
Stylelint Validator
Stylelint plugin to validate CSS syntax
Stars: ✭ 64 (-1.54%)
Mutual labels:  stylelint
Flake8
The official GitHub mirror of https://gitlab.com/pycqa/flake8
Stars: ✭ 1,112 (+1610.77%)
Mutual labels:  stylelint
React Ssr Starter
All have been introduced React environment
Stars: ✭ 20 (-69.23%)
Mutual labels:  stylelint

stylelint-declaration-block-no-ignored-properties

Greenkeeper badge

NPM version Build Status Build status PRs Welcome Downloads per month

Original rule: stylelint/declaration-block-no-ignored-properties.

Disallow property values that are ignored due to another property value in the same rule.

a { display: inline; width: 100px; }
/**                  ↑
 *       This property */

Certain property value pairs rule out other property value pairs, causing them to be ignored by the browser. For example, when an element has display: inline, any further declarations about width, height and margin-top properties will be ignored. Sometimes this is confusing: maybe you forgot that your margin-top will have no effect because the element has display: inline, so you spend a while struggling to figure out what you've done wrong. This rule protects against that confusion by ensuring that within a single rule you don't use property values that are ruled out by other property values in that same rule.

The rule complains when it finds:

  • display: inline used with width, height, margin, margin-top, margin-bottom, overflow (and all variants).
  • display: list-item used with vertical-align.
  • display: block used with vertical-align.
  • display: flex used with vertical-align.
  • display: table used with vertical-align.
  • display: table-* (except table-caption) used with margin.
  • display: table-* (except table-cell) used with padding.
  • display: table-* (except table-cell) used with vertical-align.
  • display: table-(row|row-group) used with width, min-width or max-width.
  • display: table-(column|column-group) used with height, min-height or max-height.
  • float: left and float: right used with vertical-align.
  • position: static used with top, right, bottom, left or z-index.
  • position: absolute used with float, clear or vertical-align.
  • position: fixed used with float, clear or vertical-align.
  • list-style-type: none used with list-style-image.
  • overflow: visible used with resize.

Installation

npm install stylelint-declaration-block-no-ignored-properties --save-dev

Usage

// .stylelintrc
{
  "plugins": [
    "stylelint-declaration-block-no-ignored-properties"
  ],
  "rules": {
    "plugin/declaration-block-no-ignored-properties": true,
  }
}

Options

true

The following patterns are considered violations:

a { display: inline; width: 100px; }

display: inline causes width to be ignored.

a { display: inline; height: 100px; }

display: inline causes height to be ignored.

a { display: inline; margin: 10px; }

display: inline causes margin to be ignored.

a { display: block; vertical-align: baseline; }

display: block causes vertical-align to be ignored.

a { display: flex; vertical-align: baseline; }

display: flex causes vertical-align to be ignored.

a { position: absolute; vertical-align: baseline; }

position: absolute causes vertical-align to be ignored.

a { float: left; vertical-align: baseline; }

float: left causes vertical-align to be ignored.

The following patterns are not considered violations:

a { display: inline; margin-left: 10px; }
a { display: inline; margin-right: 10px; }
a { display: inline; padding: 10px; }
a { display: inline-block; width: 100px; }

Although display: inline causes width to be ignored, inline-block works with width.

a { display: table-cell; vertical-align: baseline; }

Although display: block causes vertical-align to be ignored, table-cell works with vertical-align.

a { position: relative; vertical-align: baseline; }

Although position: absolute causes vertical-align to be ignored, relative works with vertical-align.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].