1
0
mirror of https://github.com/thangisme/notes.git synced 2024-06-12 11:20:57 +00:00
notes/node_modules/stylelint/lib/rules/custom-property-empty-line-before
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00
..
index.js Initial commit 2017-03-09 13:16:08 -05:00
README.md Initial commit 2017-03-09 13:16:08 -05:00

custom-property-empty-line-before

Require or disallow an empty line before custom properties.

a {
  top: 10px;
                          /* ← */
  --foo: pink;            /* ↑ */
}                         /* ↑ */
/**                          ↑
 *                   This line */

Options

string: "always"|"never"

"always"

The following patterns are considered warnings:

a {
  top: 10px;
  --foo: pink;
  --bar: red;
}

The following patterns are not considered warnings:

a {
  top: 10px;

  --foo: pink;

  --bar: red;
}

"never"

The following patterns are considered warnings:

a {
  top: 10px;

  --foo: pink;

  --bar: red;
}
a {

  --foo: pink;
  --bar: red;
}

The following patterns are not considered warnings:

a {
  top: 10px;
  --foo: pink;
  --bar: red;
}
a {
  --foo: pink;
  --bar: red;
}

Optional secondary options

except: ["after-comment", "after-custom-property", "first-nested"]

"after-comment"

Reverse the primary option for custom properties that come after a comment.

For example, with "always":

The following patterns are considered warnings:

a {

  --foo: pink;
  /* comment */

  --bar: red;
}

The following patterns are not considered warnings:

a {

  --foo: pink;
  /* comment */
  --bar: red;
}

"after-custom-property"

Reverse the primary option for custom properties that come after another custom property.

For example, with "always":

The following patterns are considered warnings:

a {

  --foo: pink;

  --bar: red;
}

The following patterns are not considered warnings:

a {

  --foo: pink;
  --bar: red;
}

"first-nested"

Reverse the primary option for custom properties that are nested and the first child of their parent node.

For example, with "always":

The following patterns are considered warnings:

a {

  --foo: pink;

  --bar: red;
}

The following patterns are not considered warnings:

a {
  --foo: pink;

  --bar: red;
}

ignore: ["after-comment", "inside-single-line-block"]

"after-comment"

Ignore custom properties that are preceded by comments.

For example, with "always":

The following patterns are not considered warnings:

a {
  /* comment */
  --foo: pink;
}

"inside-single-line-block"

Ignore custom properties that are inside single-line blocks.

For example, with "always":

The following patterns are not considered warnings:

a { --foo: pink; --bar: red; }