Skip to content

Commit

Permalink
Merge pull request #13 from Fullscript/reformat-typography-tokens
Browse files Browse the repository at this point in the history
Reformat typography tokens
  • Loading branch information
alexandra-lim authored Jun 22, 2022
2 parents 6710a92 + d0d09ba commit 5a32745
Show file tree
Hide file tree
Showing 9 changed files with 486 additions and 165 deletions.
50 changes: 50 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
const StyleDictionary = require("style-dictionary").extend("config.json");

StyleDictionary.registerFilter({
name: "filter-typography",
matcher: ({ attributes }) => {
return attributes.type === "typography";
},
});

StyleDictionary.extend({
platforms: {
Owlery: {
transformGroup: "scss",
buildPath: "build/scss/",
files: [
{
destination: "colors.scss",
format: "scss/variables",
filter: {
type: "color",
},
},
{
destination: "typography.scss",
format: "scss/variables",
filter: "filter-typography",
},
],
},

Aviary: {
transformGroup: "js",
buildPath: "build/ts/",
files: [
{
format: "javascript/es6",
destination: "colors.ts",
filter: {
type: "color",
},
},
{
format: "javascript/es6",
destination: "typography.ts",
filter: "filter-typography",
},
],
},
},
}).buildAllPlatforms();
2 changes: 1 addition & 1 deletion build/scss/colors.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Do not edit directly
// Generated on Wed, 15 Jun 2022 15:44:11 GMT
// Generated on Thu, 16 Jun 2022 19:25:52 GMT

$global-colors-green-100: #FAFFFC;
$global-colors-green-200: #EBF2EF;
Expand Down
74 changes: 65 additions & 9 deletions build/scss/typography.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,68 @@

// Do not edit directly
// Generated on Wed, 15 Jun 2022 15:44:11 GMT
// Generated on Thu, 16 Jun 2022 19:25:52 GMT

$global-typography-h1: [object Object];
$global-typography-h2: [object Object];
$global-typography-h3: [object Object];
$global-typography-h4: [object Object];
$global-typography-h5: [object Object];
$global-typography-body: [object Object];
$global-typography-footnote: [object Object];
$global-typography-caption: [object Object];
$global-typography-h1-font-family: Mulish;
$global-typography-h1-font-weight: 700;
$global-typography-h1-line-height: 40;
$global-typography-h1-font-size: 40;
$global-typography-h1-letter-spacing: 0;
$global-typography-h1-paragraph-spacing: 0;
$global-typography-h1-text-decoration: none;
$global-typography-h1-text-case: none;
$global-typography-h2-font-family: Mulish;
$global-typography-h2-font-weight: 700;
$global-typography-h2-line-height: 40;
$global-typography-h2-font-size: 32;
$global-typography-h2-letter-spacing: 0;
$global-typography-h2-paragraph-spacing: 0;
$global-typography-h2-text-decoration: none;
$global-typography-h2-text-case: none;
$global-typography-h3-font-family: Mulish;
$global-typography-h3-font-weight: 700;
$global-typography-h3-line-height: 32;
$global-typography-h3-font-size: 24;
$global-typography-h3-letter-spacing: 0;
$global-typography-h3-paragraph-spacing: 0;
$global-typography-h3-text-decoration: none;
$global-typography-h3-text-case: none;
$global-typography-h4-font-family: Mulish;
$global-typography-h4-font-weight: 700;
$global-typography-h4-line-height: 24;
$global-typography-h4-font-size: 20;
$global-typography-h4-letter-spacing: 0;
$global-typography-h4-paragraph-spacing: 0;
$global-typography-h4-text-decoration: none;
$global-typography-h4-text-case: none;
$global-typography-h5-font-family: Mulish;
$global-typography-h5-font-weight: 700;
$global-typography-h5-line-height: 24;
$global-typography-h5-font-size: 16;
$global-typography-h5-letter-spacing: 0;
$global-typography-h5-paragraph-spacing: 0;
$global-typography-h5-text-decoration: none;
$global-typography-h5-text-case: none;
$global-typography-body-font-family: Mulish;
$global-typography-body-font-weight: 500;
$global-typography-body-line-height: 24;
$global-typography-body-font-size: 16;
$global-typography-body-letter-spacing: 0;
$global-typography-body-paragraph-spacing: 0;
$global-typography-body-text-decoration: none;
$global-typography-body-text-case: none;
$global-typography-footnote-font-family: Mulish;
$global-typography-footnote-font-weight: 500;
$global-typography-footnote-line-height: 16;
$global-typography-footnote-font-size: 12;
$global-typography-footnote-letter-spacing: 0;
$global-typography-footnote-paragraph-spacing: 0;
$global-typography-footnote-text-decoration: none;
$global-typography-footnote-text-case: none;
$global-typography-caption-font-family: Mulish;
$global-typography-caption-font-weight: 500;
$global-typography-caption-line-height: 16;
$global-typography-caption-font-size: 14;
$global-typography-caption-letter-spacing: 0;
$global-typography-caption-paragraph-spacing: 0;
$global-typography-caption-text-decoration: none;
$global-typography-caption-text-case: none;
2 changes: 1 addition & 1 deletion build/ts/colors.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Wed, 15 Jun 2022 15:44:11 GMT
* Generated on Thu, 16 Jun 2022 19:25:52 GMT
*/

export const GlobalColorsGreen100 = "#FAFFFC";
Expand Down
74 changes: 65 additions & 9 deletions build/ts/typography.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,69 @@
/**
* Do not edit directly
* Generated on Wed, 15 Jun 2022 15:44:11 GMT
* Generated on Thu, 16 Jun 2022 19:25:52 GMT
*/

export const GlobalTypographyH1 = {"fontFamily":"Mulish","fontWeight":"700","lineHeight":"40","fontSize":"40","letterSpacing":"0%","paragraphSpacing":"0","textDecoration":"none","textCase":"none"};
export const GlobalTypographyH2 = {"fontFamily":"Mulish","fontWeight":"700","lineHeight":"40","fontSize":"32","letterSpacing":"0%","paragraphSpacing":"0","textDecoration":"none","textCase":"none"};
export const GlobalTypographyH3 = {"fontFamily":"Mulish","fontWeight":"700","lineHeight":"32","fontSize":"24","letterSpacing":"0%","paragraphSpacing":"0","textDecoration":"none","textCase":"none"};
export const GlobalTypographyH4 = {"fontFamily":"Mulish","fontWeight":"700","lineHeight":"24","fontSize":"20","letterSpacing":"0%","paragraphSpacing":"0","textDecoration":"none","textCase":"none"};
export const GlobalTypographyH5 = {"fontFamily":"Mulish","fontWeight":"700","lineHeight":"24","fontSize":"16","letterSpacing":"0%","paragraphSpacing":"0","textDecoration":"none","textCase":"none"};
export const GlobalTypographyBody = {"fontFamily":"Mulish","fontWeight":"500","lineHeight":"24","fontSize":"16","letterSpacing":"0%","paragraphSpacing":"0","textDecoration":"none","textCase":"none"};
export const GlobalTypographyFootnote = {"fontFamily":"Mulish","fontWeight":"500","lineHeight":"16","fontSize":"14","letterSpacing":"0%","paragraphSpacing":"0","textDecoration":"none","textCase":"none"};
export const GlobalTypographyCaption = {"fontFamily":"Mulish","fontWeight":"500","lineHeight":"16","fontSize":"12","letterSpacing":"0%","paragraphSpacing":"0","textDecoration":"none","textCase":"none"};
export const GlobalTypographyH1FontFamily = "Mulish";
export const GlobalTypographyH1FontWeight = "700";
export const GlobalTypographyH1LineHeight = "40";
export const GlobalTypographyH1FontSize = "40";
export const GlobalTypographyH1LetterSpacing = "0";
export const GlobalTypographyH1ParagraphSpacing = "0";
export const GlobalTypographyH1TextDecoration = "none";
export const GlobalTypographyH1TextCase = "none";
export const GlobalTypographyH2FontFamily = "Mulish";
export const GlobalTypographyH2FontWeight = "700";
export const GlobalTypographyH2LineHeight = "40";
export const GlobalTypographyH2FontSize = "32";
export const GlobalTypographyH2LetterSpacing = "0";
export const GlobalTypographyH2ParagraphSpacing = "0";
export const GlobalTypographyH2TextDecoration = "none";
export const GlobalTypographyH2TextCase = "none";
export const GlobalTypographyH3FontFamily = "Mulish";
export const GlobalTypographyH3FontWeight = "700";
export const GlobalTypographyH3LineHeight = "32";
export const GlobalTypographyH3FontSize = "24";
export const GlobalTypographyH3LetterSpacing = "0";
export const GlobalTypographyH3ParagraphSpacing = "0";
export const GlobalTypographyH3TextDecoration = "none";
export const GlobalTypographyH3TextCase = "none";
export const GlobalTypographyH4FontFamily = "Mulish";
export const GlobalTypographyH4FontWeight = "700";
export const GlobalTypographyH4LineHeight = "24";
export const GlobalTypographyH4FontSize = "20";
export const GlobalTypographyH4LetterSpacing = "0";
export const GlobalTypographyH4ParagraphSpacing = "0";
export const GlobalTypographyH4TextDecoration = "none";
export const GlobalTypographyH4TextCase = "none";
export const GlobalTypographyH5FontFamily = "Mulish";
export const GlobalTypographyH5FontWeight = "700";
export const GlobalTypographyH5LineHeight = "24";
export const GlobalTypographyH5FontSize = "16";
export const GlobalTypographyH5LetterSpacing = "0";
export const GlobalTypographyH5ParagraphSpacing = "0";
export const GlobalTypographyH5TextDecoration = "none";
export const GlobalTypographyH5TextCase = "none";
export const GlobalTypographyBodyFontFamily = "Mulish";
export const GlobalTypographyBodyFontWeight = "500";
export const GlobalTypographyBodyLineHeight = "24";
export const GlobalTypographyBodyFontSize = "16";
export const GlobalTypographyBodyLetterSpacing = "0";
export const GlobalTypographyBodyParagraphSpacing = "0";
export const GlobalTypographyBodyTextDecoration = "none";
export const GlobalTypographyBodyTextCase = "none";
export const GlobalTypographyFootnoteFontFamily = "Mulish";
export const GlobalTypographyFootnoteFontWeight = "500";
export const GlobalTypographyFootnoteLineHeight = "16";
export const GlobalTypographyFootnoteFontSize = "12";
export const GlobalTypographyFootnoteLetterSpacing = "0";
export const GlobalTypographyFootnoteParagraphSpacing = "0";
export const GlobalTypographyFootnoteTextDecoration = "none";
export const GlobalTypographyFootnoteTextCase = "none";
export const GlobalTypographyCaptionFontFamily = "Mulish";
export const GlobalTypographyCaptionFontWeight = "500";
export const GlobalTypographyCaptionLineHeight = "16";
export const GlobalTypographyCaptionFontSize = "14";
export const GlobalTypographyCaptionLetterSpacing = "0";
export const GlobalTypographyCaptionParagraphSpacing = "0";
export const GlobalTypographyCaptionTextDecoration = "none";
export const GlobalTypographyCaptionTextCase = "none";
47 changes: 1 addition & 46 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,3 @@
{
"source": ["data/tokens.json"],

"platforms": {
"Owlery": {
"transformGroup": "scss",
"buildPath": "build/scss/",
"files": [
{
"destination": "colors.scss",
"format": "scss/variables",
"filter": {
"type": "color"
}
},

{
"destination": "typography.scss",
"format": "scss/variables",
"filter": {
"type": "typography"
}
}
]
},

"Aviary": {
"transformGroup": "js",
"buildPath": "build/ts/",
"files": [
{
"format": "javascript/es6",
"destination": "colors.ts",
"filter": {
"type": "color"
}
},
{
"format": "javascript/es6",
"destination": "typography.ts",
"filter": {
"type": "typography"
}
}
]
}
}
"source": ["data/tokens.json"]
}
Loading

0 comments on commit 5a32745

Please sign in to comment.