You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A larger commit again, closing #10. Changes the structure of the config so class are now under include.classNames, and tags under include.tags (same for exclude).
Copy file name to clipboardExpand all lines: README.md
+50-8Lines changed: 50 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -28,26 +28,68 @@ After:
28
28
</html>
29
29
```
30
30
31
-
Pseudo classes dependent on input values (`:valid`, `:invalid`, ...), browser history (`:visted`, `:link`, ...), interaction (`:hover`, `:focus:`), parameters (`:nth-child()`, `:lang()`, ...), page url (`:target`) or require JS (`:indeterminate`), have been excluded. See [support list](#pseudo-class-names).
31
+
**Note on supported classes**: Pseudo classes dependent on input values (`:valid`, `:invalid`, ...), browser history (`:visted`, `:link`, ...), interaction (`:hover`, `:focus:`), parameters (`:nth-child()`, `:lang()`, ...), page url (`:target`) or require JS (`:indeterminate`), have been excluded. See [support list](#pseudo-class-names).
32
32
33
33
## Options
34
34
35
-
Options config has two properties —`include` and `exclude`— to define which psuedo class names to add. Both `include` and `exclude` can be:
35
+
Options config has two properties —`include` and `exclude`— to define which psuedo class names to add, and which tags to add them to. Both `include.classNames` and `exclude.classNames` can be:
36
36
37
37
- a string of a [class name group](#class-name-groups)
38
38
- a string of a class name (`/^:\S+/`, from those in the `all` group)
39
39
- an array of class name groups and/or class names
40
40
41
41
### Example Options Config
42
42
43
+
This config adds all supported pseudo class names to all appropriate elements using their default class names.
44
+
43
45
```js
44
46
let config = {
45
-
include :"all", // default is [ "all" ]
46
-
exclude : [ // default is []
47
-
"onlyChild",
48
-
":root",
49
-
":read-only"
50
-
]
47
+
include : {
48
+
classNames :"all"// all group
49
+
}
50
+
};
51
+
```
52
+
53
+
Here's something more complex, adding only two class names but only to elements that aren't `div`, `table` or `form.
54
+
55
+
```js
56
+
let config = {
57
+
include : {
58
+
classNames : [ ":first-child", ":last-child" ]
59
+
},
60
+
exclude : {
61
+
tags : [
62
+
"div", "table", "form"
63
+
]
64
+
}
65
+
};
66
+
```
67
+
68
+
And here's an unrealistic and irresponsible config showing more options.
69
+
70
+
```js
71
+
let config = {
72
+
include : {
73
+
classNames : [
74
+
"all", // include the "all" group using default class names
75
+
":first-child":"fc", // custom class name; below using function
0 commit comments