ether-code 0.5.8 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/ether.js +1 -1
- package/ether-parser.js +6 -5
- package/generators/css-generator.js +16 -13
- package/package.json +1 -1
package/cli/ether.js
CHANGED
package/ether-parser.js
CHANGED
|
@@ -719,7 +719,8 @@ class EtherParser {
|
|
|
719
719
|
'filtre': ['fond'],
|
|
720
720
|
'decoupe': ['fond'],
|
|
721
721
|
'découpe': ['fond'],
|
|
722
|
-
'origine': ['transformation', 'perspective']
|
|
722
|
+
'origine': ['transformation', 'perspective'],
|
|
723
|
+
'liste': ['style', 'ordonnee', 'description']
|
|
723
724
|
}
|
|
724
725
|
|
|
725
726
|
let property = token.value
|
|
@@ -803,13 +804,13 @@ class EtherParser {
|
|
|
803
804
|
} else if (current.type === TokenType.MINUS) {
|
|
804
805
|
if (current.value === '--') {
|
|
805
806
|
valueParts.push('--')
|
|
806
|
-
} else if (lastType === TokenType.LPAREN
|
|
807
|
+
} else if (lastType === TokenType.LPAREN) {
|
|
807
808
|
valueParts.push(current.value)
|
|
808
|
-
} else if (needsSpace) {
|
|
809
|
-
valueParts.push(' ' + current.value)
|
|
810
809
|
} else {
|
|
811
|
-
valueParts.push(current.value)
|
|
810
|
+
valueParts.push(' ' + current.value)
|
|
812
811
|
}
|
|
812
|
+
} else if (current.type === TokenType.PLUS) {
|
|
813
|
+
valueParts.push(' +')
|
|
813
814
|
} else if (current.type === TokenType.COLON) {
|
|
814
815
|
valueParts.push(':')
|
|
815
816
|
} else if (current.type === TokenType.DOT) {
|
|
@@ -1416,23 +1416,26 @@ class CSSGenerator {
|
|
|
1416
1416
|
const translatedSelectors = selectors.map(s => this.translateSelector(s))
|
|
1417
1417
|
const isRoot = translatedSelectors.some(s => s === ':root')
|
|
1418
1418
|
|
|
1419
|
-
this.writeLine(`${translatedSelectors.join(', ')} {`)
|
|
1420
|
-
this.indent++
|
|
1421
|
-
|
|
1422
1419
|
const declarations = node.declarations || node.properties || []
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1420
|
+
|
|
1421
|
+
if (declarations.length > 0 || node.children) {
|
|
1422
|
+
this.writeLine(`${translatedSelectors.join(', ')} {`)
|
|
1423
|
+
this.indent++
|
|
1426
1424
|
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
this.generateNode(child)
|
|
1425
|
+
for (const decl of declarations) {
|
|
1426
|
+
this.generateDeclaration(decl, isRoot)
|
|
1430
1427
|
}
|
|
1431
|
-
}
|
|
1432
1428
|
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1429
|
+
if (node.children) {
|
|
1430
|
+
for (const child of node.children) {
|
|
1431
|
+
this.generateNode(child)
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
this.indent--
|
|
1436
|
+
this.writeLine('}')
|
|
1437
|
+
this.writeLine('')
|
|
1438
|
+
}
|
|
1436
1439
|
|
|
1437
1440
|
if (node.nestedRules) {
|
|
1438
1441
|
for (const nested of node.nestedRules) {
|