Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

fraincs
Copy link
Contributor

@fraincs fraincs commented Nov 24, 2023

  • The Typography Table Overline Table was returning heading md values. This is now fixed.

Copy link

changeset-bot bot commented Nov 24, 2023

⚠️ No Changeset found

Latest commit: 59d4f52

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

netlify bot commented Nov 24, 2023

Deploy Preview for wl-hopper ready!

Name Link
🔨 Latest commit 59d4f52
🔍 Latest deploy log https://app.netlify.com/sites/wl-hopper/deploys/6581f45b4e5f6200085ca555
😎 Deploy Preview https://deploy-preview-99--wl-hopper.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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>;
Copy link
Member

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 => {
Copy link
Member

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

Copy link
Member

@alexasselin008 alexasselin008 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants