|
Last change
on this file since 2058e5c was 2058e5c, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Working / before login
|
-
Property mode
set to
100644
|
|
File size:
569 bytes
|
| Line | |
|---|
| 1 | 'use strict'
|
|---|
| 2 |
|
|---|
| 3 | let Container = require('./container')
|
|---|
| 4 | let list = require('./list')
|
|---|
| 5 |
|
|---|
| 6 | class Rule extends Container {
|
|---|
| 7 | get selectors() {
|
|---|
| 8 | return list.comma(this.selector)
|
|---|
| 9 | }
|
|---|
| 10 |
|
|---|
| 11 | set selectors(values) {
|
|---|
| 12 | let match = this.selector ? this.selector.match(/,\s*/) : null
|
|---|
| 13 | let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen')
|
|---|
| 14 | this.selector = values.join(sep)
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | constructor(defaults) {
|
|---|
| 18 | super(defaults)
|
|---|
| 19 | this.type = 'rule'
|
|---|
| 20 | if (!this.nodes) this.nodes = []
|
|---|
| 21 | }
|
|---|
| 22 | }
|
|---|
| 23 |
|
|---|
| 24 | module.exports = Rule
|
|---|
| 25 | Rule.default = Rule
|
|---|
| 26 |
|
|---|
| 27 | Container.registerRule(Rule)
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.