stylelint-selector-pattern

A stylelint plugin that allows to check selectors with regular expressions.
git clone https://git.ce9e.org/stylelint-selector-pattern.git

commit
4f31a8abbf9821deb58dc3581acfe0b073ccffdf
parent
422b50357efc9b6b4f4f4fa5bc249c426eca9814
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2017-02-17 08:39
add README

Diffstat

A README.md 46 ++++++++++++++++++++++++++++++++++++++++++++++

1 files changed, 46 insertions, 0 deletions


diff --git a/README.md b/README.md

@@ -0,0 +1,46 @@
   -1     1 # stylelint-selector-pattern
   -1     2 
   -1     3 A [stylelint](https://github.com/stylelint/stylelint) plugin that allows to
   -1     4 check selectors with regular expressions.
   -1     5 
   -1     6 ## installation
   -1     7 
   -1     8     npm install stylelint-selector-pattern
   -1     9 
   -1    10 ## Simple Usage
   -1    11 
   -1    12 Add it to the `plugin` section in your stylelint config and specify a regular
   -1    13 expression in the rules section:
   -1    14 
   -1    15     // .stylelintrc
   -1    16     {
   -1    17       "plugins": [
   -1    18         "stylelint-selector-pattern"
   -1    19       ],
   -1    20       "rules": {
   -1    21         // ...
   -1    22         "xi/selector-pattern": "^\.[a-z-]+$",
   -1    23         // ...
   -1    24       }
   -1    25     }
   -1    26 
   -1    27 Instead of a pattern, you can also use the name of one of the presets: `bem`,
   -1    28 `suit`, and `itcss`.
   -1    29 
   -1    30 ## Options
   -1    31 
   -1    32 In order to not keep the pattern readable, you can use the `subpatterns` option:
   -1    33 
   -1    34     "xi/selector-pattern": ["^{component}({modifier}|{element})?$", {
   -1    35       "subpatterns": {
   -1    36         "component": "\.[a-z-]+",
   -1    37         "modifier": "--[a-z-]+",
   -1    38         "element": "__[a-z-]+"
   -1    39       }
   -1    40     }]
   -1    41 
   -1    42 You can also filter the selectors that the rule should apply to:
   -1    43 
   -1    44     "xi/selector-pattern": ["^\.[a-z-]+$", {
   -1    45       "filter": "^\\."
   -1    46     }]