Skip to content

Instantly share code, notes, and snippets.

View dbanksdesign's full-sized avatar
🐈
hello

Danny Banks dbanksdesign

🐈
hello
View GitHub Profile
// 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"
}
}
@dbanksdesign
dbanksdesign / color.json
Last active April 13, 2018 21:00
Style Dictionary SCSS with Transparency
{
"color": {
"base": {
"transparent": { "value": "#DDFF33AA" },
"nontransparent": { "value": "#DDFF33" }
}
}
}
@dbanksdesign
dbanksdesign / watch.js
Created February 14, 2018 06:02
Style Dictionary Demo Watcher
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"