-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix typoTable returning the wrong values for overline #99
Conversation
fraincs
commented
Nov 24, 2023
- The Typography Table Overline Table was returning heading md values. This is now fixed.
|
✅ Deploy Preview for wl-hopper ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -38,6 +41,32 @@ function transformDataToTokenData(inputData: Record<string, { name: string; valu | |||
function groupItemsByPropertiesAndSizes(tokenData: TokenData, itemType: string): GroupedItems { | |||
const groupedItems: GroupedItems = {} as GroupedItems; | |||
|
|||
if (itemType === "overline") { | |||
const overlineItem = {} as Record<typeof FontProperties[number], string>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const overlineItem: Record<typeof FontProperties[number], string> = {}
|
||
return groupedItems; | ||
} | ||
|
||
Sizes.forEach(size => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should really try to simplify all the code in here. There is too many "if overline". The only "real" if overline should be to add the textTransformation uppercase.
All the other ifs should be "if there is no sizes (this only match overline) , don't display the name column".
You can create a token structure like this:
{
"heading": {
"xs" : {
fontSize: {
name: "hop-heading-xs-font-size",
value: "1rem"
},
fontWeight .......
},
"sm" .........
},
"overline": {
fontSize: {
name: "hop-overline-font-size",
value: "0.75rem"
},
}
}
this way, if one of the typo category doesn't have sizes in it, you can skip the name column
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments