summaryrefslogtreecommitdiff
path: root/scripts/generate-style-code.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/generate-style-code.js')
-rw-r--r--scripts/generate-style-code.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/generate-style-code.js b/scripts/generate-style-code.js
index bf9bef837a..9629c8fe45 100644
--- a/scripts/generate-style-code.js
+++ b/scripts/generate-style-code.js
@@ -47,7 +47,20 @@ global.evaluatedType = function (property) {
};
function attributeType(property, type) {
- const name = property.name.replace(type + '-', '').replace('-', '_');
+ const attributeNameExceptions = {
+ 'text-opacity': 'opacity',
+ 'icon-opacity': 'opacity',
+ 'text-color': 'fill_color',
+ 'icon-color': 'fill_color',
+ 'text-halo-color': 'halo_color',
+ 'icon-halo-color': 'halo_color',
+ 'text-halo-blur': 'halo_blur',
+ 'icon-halo-blur': 'halo_blur',
+ 'text-halo-width': 'halo_width',
+ 'icon-halo-width': 'halo_width'
+ }
+ const name = attributeNameExceptions[property.name] ||
+ property.name.replace(type + '-', '').replace(/-/g, '_');
return `attributes::a_${name}${name === 'offset' ? '<1>' : ''}`;
}