Skip to content

Sizing, spacing and typography design tokens - #297

Merged
langermank merged 53 commits into
mainfrom
functional-tokens
Apr 13, 2022
Merged

Sizing, spacing and typography design tokens#297
langermank merged 53 commits into
mainfrom
functional-tokens

Conversation

@langermank

@langermank langermank commented Feb 22, 2022

Copy link
Copy Markdown
Contributor

✨ New sizing, spacing, and typography design tokens

This PR introduces a new set of tokens to be shared across all Primer frameworks. Using style-dictionary, we transform raw values from JSON into CSS and JS. We've crafted a functional layer of tokens that combine to form components and patterns, along with a naming convention to encourage consistency and developer experience.

[namespace]-[item]-[variant]-[property]-[modifier]

{
    "gh": { <------------------------------------------------ Namespace
        "control": { <--------------------------------------- Item
            "xsmall": { <------------------------------------ Variant
                "paddingInline": { <------------------------- Property
                    "condensed": { <------------------------- Modifier
                        "value": "8px" 
                    }, 
                }
            }
        }
    }
}

table showing token properties

Initial release

The existing tokens will remain intact as we slowly transition to style-dictionary. This new set of tokens will distribute to /tokens-v2-private as they are still experimental and not intended for usage outside of Primer (for now). This PR should not introduce any breaking changes to existing primitives.

Remaining TODO

  • Cleanup JS output
  • Fix mobile/desktop build
  • Remove docs from site navigation

@changeset-bot

changeset-bot Bot commented Feb 22, 2022

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 06d80a7

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

@vercel

vercel Bot commented Feb 22, 2022

Copy link
Copy Markdown

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/primer/primitives/88AZA9fJpkgBxfvNZUSRve9Zg92j
✅ Preview: https://primitives-git-functional-tokens-primer.vercel.app

@github-actions

github-actions Bot commented Feb 22, 2022

Copy link
Copy Markdown
Contributor
Variables changed
No variables changed

langermank and others added 2 commits March 7, 2022 14:32
Co-authored-by: Cole Bemis <colebemis@users.noreply.github.com>
Comment thread build.js
@langermank langermank changed the title Configure style-dictionary for functional tokens Sizing, spacing and typography design tokens Mar 31, 2022
Comment thread docs/src/@primer/gatsby-theme-doctocat/nav.yml Outdated
@langermank
langermank marked this pull request as ready for review April 13, 2022 14:20
@langermank
langermank requested a review from a team as a code owner April 13, 2022 14:20
@langermank
langermank requested review from a team, colebemis and simurai April 13, 2022 14:20

@rezrah rezrah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🥳 This is great @langermank

Recommend this gets merged into main so we can continue to iterate on it in shorter-lived branches. Merging shouldn't impact the release process for existing tokens.

@langermank
langermank merged commit a7599b2 into main Apr 13, 2022
@langermank
langermank deleted the functional-tokens branch April 13, 2022 17:10
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.

3 participants