@sproutsocial/seeds-typography
Advanced tools
Comparing version 0.4.4 to 0.4.5
@@ -51,29 +51,36 @@ const fs = require('fs'); | ||
gulp.task('typography-docs', done => { | ||
theo.plugins.file(typographyTokensPath).pipe(theo.plugins.transform('web')).pipe( | ||
theo.plugins.getResult(result => { | ||
const tokens = JSON.parse(result); | ||
const tokensJson = tokens.propKeys.map(key => { | ||
const prop = tokens.props[key]; | ||
return { | ||
app: upperFirst(prop.name), | ||
sass: prop.category === 'font size' | ||
? `@include ${suitCssName(prop.package, prop.name)};` | ||
: sassVar(prop.package, prop.name), | ||
javascript: typeof prop.value == 'object' ? `{ style: ${javascriptConst(prop.package, prop.name)} }` : javascriptConst(prop.package, prop.name), | ||
category: prop.category, | ||
value: typeof prop.value == 'object' ? { | ||
fontSize: prop.value.value, | ||
lineHeightProportional: prop.value.rules && prop.value.rules['line-height'], | ||
lineHeightPx: prop.value.rules && prop.value.rules['line-height'] * parseInt(prop.value.value, 10) | ||
} : prop.value | ||
}; | ||
}); | ||
theo.plugins | ||
.file(typographyTokensPath) | ||
.pipe(theo.plugins.transform('web')) | ||
.pipe( | ||
theo.plugins.getResult(result => { | ||
const tokens = JSON.parse(result); | ||
const tokensJson = tokens.propKeys.map(key => { | ||
const prop = tokens.props[key]; | ||
return { | ||
app: upperFirst(prop.name), | ||
sass: | ||
prop.category === 'font size' | ||
? `@include ${suitCssName(prop.package, prop.name)};` | ||
: sassVar(prop.package, prop.name), | ||
javascript: | ||
typeof prop.value == 'object' | ||
? `{ style: ${javascriptConst(prop.package, prop.name)} }` | ||
: javascriptConst(prop.package, prop.name), | ||
category: prop.category, | ||
value: | ||
typeof prop.value == 'object' | ||
? { | ||
fontSize: prop.value.value, | ||
lineHeightProportional: prop.value.rules && prop.value.rules['line-height'], | ||
lineHeightPx: prop.value.rules && prop.value.rules['line-height'] * parseInt(prop.value.value, 10) | ||
} | ||
: prop.value | ||
}; | ||
}); | ||
fs.writeFileSync( | ||
'dist/tokens.json', | ||
`${JSON.stringify(tokensJson)}` | ||
); | ||
done(); | ||
}) | ||
); | ||
fs.writeFileSync('dist/tokens.json', `${JSON.stringify(tokensJson)}`); | ||
done(); | ||
}) | ||
); | ||
}); | ||
@@ -80,0 +87,0 @@ |
{ | ||
"name": "@sproutsocial/seeds-typography", | ||
"version": "0.4.4", | ||
"version": "0.4.5", | ||
"stability": "stable", | ||
@@ -16,4 +16,4 @@ "description": "SEEDS Design System Typography Styles", | ||
"devDependencies": { | ||
"@sproutsocial/seeds-utils": "^0.1.10" | ||
"@sproutsocial/seeds-utils": "^0.1.11" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93910
20
142