Skip to content

Commit

Permalink
Rename typography sizes to generic xsmall-3xlarge names #40
Browse files Browse the repository at this point in the history
fix(pencil): Decouple size token names from headings
  • Loading branch information
CCAyl authored Jul 11, 2022
2 parents 6637a15 + cebec33 commit b484de7
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 70 deletions.
3 changes: 1 addition & 2 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ StyleDictionary.registerTransform({
transformer: function(token) {
const slicePrefix = token.path.slice(1);
const filterDesktop = slicePrefix.filter(prefix => prefix !== "desktop");

return ChangeCase.camelCase(filterDesktop.join(" "));
return ChangeCase.camelCase(filterDesktop.join(" ")).replace("_","");
}
});

Expand Down
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 Thu, 07 Jul 2022 13:19:06 GMT
// Generated on Thu, 07 Jul 2022 19:30:52 GMT

$green100: #FAFFFC;
$green200: #EBF2EF;
Expand Down
22 changes: 11 additions & 11 deletions build/scss/typography.scss
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@

// Do not edit directly
// Generated on Thu, 07 Jul 2022 13:19:06 GMT
// Generated on Thu, 07 Jul 2022 19:30:52 GMT

$letterSpacingBase: 0;
$paragraphSpacingBase: 0;
$textDecorationBase: none;
$textCaseBase: none;
$sizeH1: 40px;
$sizeH2: 32px;
$sizeH3: 24px;
$sizeH4: 20px;
$sizeBody: 16px;
$sizeFootnote: 14px;
$sizeCaption: 12px;
$sizeMobileH1: 32px;
$sizeMobileH2: 28px;
$sizeMobileH3: 22px;
$size3xlarge: 40px;
$size2xlarge: 32px;
$sizeXlarge: 24px;
$sizeLarge: 20px;
$sizeNormal: 16px;
$sizeSmall: 14px;
$sizeXsmall: 12px;
$sizeMobile3xlarge: 32px;
$sizeMobile2xlarge: 28px;
$sizeMobileXlarge: 22px;
$lineHeightXlarge: 40px;
$lineHeightLarge: 32px;
$lineHeightNormal: 24px;
Expand Down
2 changes: 1 addition & 1 deletion build/ts/colors.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Thu, 07 Jul 2022 13:19:06 GMT
* Generated on Thu, 07 Jul 2022 19:30:52 GMT
*/

export const green100 : string;
Expand Down
2 changes: 1 addition & 1 deletion build/ts/colors.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Thu, 07 Jul 2022 13:19:06 GMT
* Generated on Thu, 07 Jul 2022 19:30:52 GMT
*/

module.exports = {
Expand Down
22 changes: 11 additions & 11 deletions build/ts/typography.d.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
/**
* Do not edit directly
* Generated on Thu, 07 Jul 2022 13:19:06 GMT
* Generated on Thu, 07 Jul 2022 19:30:52 GMT
*/

export const letterSpacingBase : number;
export const paragraphSpacingBase : number;
export const textDecorationBase : string;
export const textCaseBase : string;
export const sizeH1 : string;
export const sizeH2 : string;
export const sizeH3 : string;
export const sizeH4 : string;
export const sizeBody : string;
export const sizeFootnote : string;
export const sizeCaption : string;
export const sizeMobileH1 : string;
export const sizeMobileH2 : string;
export const sizeMobileH3 : string;
export const size3xlarge : string;
export const size2xlarge : string;
export const sizeXlarge : string;
export const sizeLarge : string;
export const sizeNormal : string;
export const sizeSmall : string;
export const sizeXsmall : string;
export const sizeMobile3xlarge : string;
export const sizeMobile2xlarge : string;
export const sizeMobileXlarge : string;
export const lineHeightXlarge : string;
export const lineHeightLarge : string;
export const lineHeightNormal : string;
Expand Down
22 changes: 11 additions & 11 deletions build/ts/typography.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
/**
* Do not edit directly
* Generated on Thu, 07 Jul 2022 13:19:06 GMT
* Generated on Thu, 07 Jul 2022 19:30:52 GMT
*/

module.exports = {
"letterSpacingBase": 0,
"paragraphSpacingBase": 0,
"textDecorationBase": "none",
"textCaseBase": "none",
"sizeH1": "40px",
"sizeH2": "32px",
"sizeH3": "24px",
"sizeH4": "20px",
"sizeBody": "16px",
"sizeFootnote": "14px",
"sizeCaption": "12px",
"sizeMobileH1": "32px",
"sizeMobileH2": "28px",
"sizeMobileH3": "22px",
"size3xlarge": "40px",
"size2xlarge": "32px",
"sizeXlarge": "24px",
"sizeLarge": "20px",
"sizeNormal": "16px",
"sizeSmall": "14px",
"sizeXsmall": "12px",
"sizeMobile3xlarge": "32px",
"sizeMobile2xlarge": "28px",
"sizeMobileXlarge": "22px",
"lineHeightXlarge": "40px",
"lineHeightLarge": "32px",
"lineHeightNormal": "24px",
Expand Down
44 changes: 22 additions & 22 deletions data/tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,45 +233,45 @@
},
"size": {
"desktop": {
"h1": {
"3xlarge": {
"value": "40px",
"type": "fontSizes"
},
"h2": {
"2xlarge": {
"value": "32px",
"type": "fontSizes"
},
"h3": {
"xlarge": {
"value": "24px",
"type": "fontSizes"
},
"h4": {
"large": {
"value": "20px",
"type": "fontSizes"
},
"body": {
"normal": {
"value": "16px",
"type": "fontSizes"
},
"footnote": {
"small": {
"value": "14px",
"type": "fontSizes"
},
"caption": {
"xsmall": {
"value": "12px",
"type": "fontSizes"
}
},
"mobile": {
"h1": {
"3xlarge": {
"value": "32px",
"type": "fontSizes"
},
"h2": {
"2xlarge": {
"value": "28px",
"type": "fontSizes"
},
"h3": {
"xlarge": {
"value": "22px",
"type": "fontSizes"
}
Expand Down Expand Up @@ -329,7 +329,7 @@
"fontFamily": "{typography.fontFamily.sansSerif}",
"fontWeight": "{typography.weight.semiBold}",
"lineHeight": "{typography.lineHeight.xlarge}",
"fontSize": "{typography.size.desktop.h1}",
"fontSize": "{typography.size.desktop.3xlarge}",
"letterSpacing": "{typography.letterSpacing.base}",
"paragraphSpacing": "{typography.paragraphSpacing.base}",
"textDecoration": "{typography.textDecoration.base}",
Expand All @@ -342,7 +342,7 @@
"fontFamily": "{typography.fontFamily.sansSerif}",
"fontWeight": "{typography.weight.semiBold}",
"lineHeight": "{typography.lineHeight.xlarge}",
"fontSize": "{typography.size.desktop.h2}",
"fontSize": "{typography.size.desktop.2xlarge}",
"letterSpacing": "{typography.letterSpacing.base}",
"paragraphSpacing": "{typography.paragraphSpacing.base}",
"textDecoration": "{typography.textDecoration.base}",
Expand All @@ -355,7 +355,7 @@
"fontFamily": "{typography.fontFamily.sansSerif}",
"fontWeight": "{typography.weight.semiBold}",
"lineHeight": "{typography.lineHeight.large}",
"fontSize": "{typography.size.desktop.h3}",
"fontSize": "{typography.size.desktop.xlarge}",
"letterSpacing": "{typography.letterSpacing.base}",
"paragraphSpacing": "{typography.paragraphSpacing.base}",
"textDecoration": "{typography.textDecoration.base}",
Expand All @@ -368,7 +368,7 @@
"fontFamily": "{typography.fontFamily.sansSerif}",
"fontWeight": "{typography.weight.semiBold}",
"lineHeight": "{typography.lineHeight.normal}",
"fontSize": "{typography.size.desktop.h4}",
"fontSize": "{typography.size.desktop.large}",
"letterSpacing": "{typography.letterSpacing.base}",
"paragraphSpacing": "{typography.paragraphSpacing.base}",
"textDecoration": "{typography.textDecoration.base}",
Expand All @@ -381,7 +381,7 @@
"fontFamily": "{typography.fontFamily.sansSerif}",
"fontWeight": "{typography.weight.semiBold}",
"lineHeight": "{typography.lineHeight.normal}",
"fontSize": "{typography.size.desktop.body}",
"fontSize": "{typography.size.desktop.normal}",
"letterSpacing": "{typography.letterSpacing.base}",
"paragraphSpacing": "{typography.paragraphSpacing.base}",
"textDecoration": "{typography.textDecoration.base}",
Expand All @@ -394,7 +394,7 @@
"fontFamily": "{typography.fontFamily.sansSerif}",
"fontWeight": "{typography.weight.base}",
"lineHeight": "{typography.lineHeight.normal}",
"fontSize": "{typography.size.desktop.body}",
"fontSize": "{typography.size.desktop.normal}",
"letterSpacing": "{typography.letterSpacing.base}",
"paragraphSpacing": "{typography.paragraphSpacing.base}",
"textDecoration": "{typography.textDecoration.base}",
Expand All @@ -407,7 +407,7 @@
"fontFamily": "{typography.fontFamily.sansSerif}",
"fontWeight": "{typography.weight.base}",
"lineHeight": "{typography.lineHeight.small}",
"fontSize": "{typography.size.desktop.footnote}",
"fontSize": "{typography.size.desktop.small}",
"letterSpacing": "{typography.letterSpacing.base}",
"paragraphSpacing": "{typography.paragraphSpacing.base}",
"textDecoration": "{typography.textDecoration.base}",
Expand All @@ -421,7 +421,7 @@
"fontFamily": "{typography.fontFamily.sansSerif}",
"fontWeight": "{typography.weight.base}",
"lineHeight": "{typography.lineHeight.small}",
"fontSize": "{typography.size.desktop.caption}",
"fontSize": "{typography.size.desktop.xsmall}",
"letterSpacing": "{typography.letterSpacing.base}",
"paragraphSpacing": "{typography.paragraphSpacing.base}",
"textDecoration": "{typography.textDecoration.base}",
Expand All @@ -435,7 +435,7 @@
"fontFamily": "{typography.fontFamily.sansSerif}",
"fontWeight": "{typography.weight.semiBold}",
"lineHeight": "{typography.lineHeight.xlarge}",
"fontSize": "{typography.size.mobile.h1}",
"fontSize": "{typography.size.mobile.3xlarge}",
"letterSpacing": "{typography.letterSpacing.base}",
"paragraphSpacing": "{typography.paragraphSpacing.base}",
"textDecoration": "{typography.textDecoration.base}",
Expand All @@ -448,7 +448,7 @@
"fontFamily": "{typography.fontFamily.sansSerif}",
"fontWeight": "{typography.weight.semiBold}",
"lineHeight": "{typography.lineHeight.large}",
"fontSize": "{typography.size.mobile.h2}",
"fontSize": "{typography.size.mobile.2xlarge}",
"letterSpacing": "{typography.letterSpacing.base}",
"paragraphSpacing": "{typography.paragraphSpacing.base}",
"textDecoration": "{typography.textDecoration.base}",
Expand All @@ -461,7 +461,7 @@
"fontFamily": "{typography.fontFamily.sansSerif}",
"fontWeight": "{typography.weight.semiBold}",
"lineHeight": "{typography.lineHeight.large}",
"fontSize": "{typography.size.mobile.h3}",
"fontSize": "{typography.size.mobile.xlarge}",
"letterSpacing": "{typography.letterSpacing.base}",
"paragraphSpacing": "{typography.paragraphSpacing.base}",
"textDecoration": "{typography.textDecoration.base}",
Expand All @@ -474,4 +474,4 @@
},
"Light": {},
"$themes": []
}
}
20 changes: 10 additions & 10 deletions data/transformed-tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,45 +232,45 @@
},
"size": {
"desktop": {
"h1": {
"3xlarge": {
"value": "40px",
"type": "fontSizes"
},
"h2": {
"2xlarge": {
"value": "32px",
"type": "fontSizes"
},
"h3": {
"xlarge": {
"value": "24px",
"type": "fontSizes"
},
"h4": {
"large": {
"value": "20px",
"type": "fontSizes"
},
"body": {
"normal": {
"value": "16px",
"type": "fontSizes"
},
"footnote": {
"small": {
"value": "14px",
"type": "fontSizes"
},
"caption": {
"xsmall": {
"value": "12px",
"type": "fontSizes"
}
},
"mobile": {
"h1": {
"3xlarge": {
"value": "32px",
"type": "fontSizes"
},
"h2": {
"2xlarge": {
"value": "28px",
"type": "fontSizes"
},
"h3": {
"xlarge": {
"value": "22px",
"type": "fontSizes"
}
Expand Down

0 comments on commit b484de7

Please sign in to comment.