Danny Banks
Sr. UX Designer, Amazon
// Here is a simple implementation | |
theo.registerValueTransform( | |
"size/pxToRem", | |
prop => prop.get("type") === "size", // Or whatever props you want to match | |
prop => { | |
let val = Math.floor(parseFloat(prop.get("value").replace(/px/g, "")) / 16) | |
return `${val}rem`; | |
} | |
); |
{ | |
"color": { | |
"background": { | |
"base": { | |
"value": "#ffffff", | |
"attributes": { | |
"androidName": "someName", | |
"iosName": "someOtherName" | |
} | |
} |
{ | |
"color": { | |
"base": { | |
"transparent": { "value": "#DDFF33AA" }, | |
"nontransparent": { "value": "#DDFF33" } | |
} | |
} | |
} |
const StyleDictionary = require('style-dictionary'); | |
const watch = require('node-watch'); | |
watch('./', { recursive: true, filter: /^(properties|components)/ }, function(evt, name) { | |
console.log('Updating the style dictionary'); | |
try { | |
styleDictionary = StyleDictionary.extend('config.json'); | |
styleDictionary.buildAllPlatforms(); | |
console.log('\n🎉 Style dictionary finished!'); | |
} catch (e) { |
// | |
// PvlseFromBottomSegue.m | |
// Pvlse | |
// | |
// Created by Daniel Banks on 2/9/14. | |
// Copyright (c) 2014 Pvlse. All rights reserved. | |
// | |
#import "PvlseFromBottomSegue.h" | |
#import "PvlseNavigationController.h" |