Skip to content

Commit

Permalink
Merge pull request #22 from palmetto/develop
Browse files Browse the repository at this point in the history
Fix font-size utilities.
  • Loading branch information
juanfabrega authored Jun 30, 2020
2 parents f97512e + e3395c0 commit f419a64
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,22 @@ StyleDictionary.registerFilter({
var utilities = [
{
"name": "font-color",
"tokenType": "color",
"tokenCategory": "color",
"tokenType": "font",
"CSSprop": "color"
},
{
"name": "background-color",
"tokenType": "color",
"tokenCategory": "color",
"tokenType": "brand",
"CSSprop": "background-color"
},
{
"name": "font-size",
"tokenType": "size",
"tokenCategory": "size",
"tokenType": "font",
"CSSprop": "font-size"
}
},
];


Expand All @@ -48,10 +51,10 @@ StyleDictionary.registerFormat({
formatter: function(dictionary, platform) {
let output = '';
dictionary.allProperties.forEach(function(prop) {
const tokenType = prop.path.slice(0,1)[0];

const tokenCategory = prop.attributes.category;
const tokenType = prop.attributes.type;
utilities.forEach(function(utility) {
if (tokenType === utility.tokenType) {
if (tokenCategory === utility.tokenCategory && tokenType === utility.tokenType) {
let utilityClass = `${utility.name}-${prop.attributes.item}`;
if (prop.attributes.subitem && prop.attributes.subitem !== 'base') {
utilityClass += `-${prop.attributes.subitem}`;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@palmetto/palmetto-design-tokens",
"version": "0.1.7",
"version": "0.1.8",
"description": "Design tokens that power all Palmetto UIs.",
"main": "build/index.js",
"files": [
Expand Down

0 comments on commit f419a64

Please sign in to comment.