Last change
on this file since 6a80231 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
599 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | // remove useless universal selector
|
---|
| 2 | module.exports = function cleanTypeSelector(node, item, list) {
|
---|
| 3 | var name = item.data.name;
|
---|
| 4 |
|
---|
| 5 | // check it's a non-namespaced universal selector
|
---|
| 6 | if (name !== '*') {
|
---|
| 7 | return;
|
---|
| 8 | }
|
---|
| 9 |
|
---|
| 10 | // remove when universal selector before other selectors
|
---|
| 11 | var nextType = item.next && item.next.data.type;
|
---|
| 12 | if (nextType === 'IdSelector' ||
|
---|
| 13 | nextType === 'ClassSelector' ||
|
---|
| 14 | nextType === 'AttributeSelector' ||
|
---|
| 15 | nextType === 'PseudoClassSelector' ||
|
---|
| 16 | nextType === 'PseudoElementSelector') {
|
---|
| 17 | list.remove(item);
|
---|
| 18 | }
|
---|
| 19 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.