@node-projects/web-component-designer 0.1.183 → 0.1.184
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.
|
@@ -23,14 +23,16 @@ export class CssCurrentPropertiesService extends AbstractCssPropertiesService {
|
|
|
23
23
|
async getProperties(designItem) {
|
|
24
24
|
if (!designItem || designItem.nodeType != NodeType.Element)
|
|
25
25
|
return [];
|
|
26
|
-
let styles = designItem.getAllStyles().
|
|
26
|
+
let styles = designItem.getAllStyles().reverse().sort((a, b) => {
|
|
27
27
|
if (a.specificity == null)
|
|
28
28
|
return -1;
|
|
29
29
|
if (b.specificity == null)
|
|
30
30
|
return 1;
|
|
31
31
|
if (a.specificity.A > b.specificity.A || a.specificity.B > b.specificity.B || a.specificity.C > b.specificity.C)
|
|
32
32
|
return -1;
|
|
33
|
-
|
|
33
|
+
if (a.specificity.A === b.specificity.A && a.specificity.B === b.specificity.B && a.specificity.C === b.specificity.C)
|
|
34
|
+
return 0;
|
|
35
|
+
return 1;
|
|
34
36
|
});
|
|
35
37
|
let arr = styles.map(x => ({
|
|
36
38
|
name: (x.selector ?? localName) + (x.specificity ? ' (' + x.specificity.A + '-' + x.specificity.B + '-' + x.specificity.C + ')' : ''), description: x.stylesheetName ?? '', properties: [
|
package/package.json
CHANGED