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

detach from Figma's tokens #2140

Merged
merged 25 commits into from
Aug 13, 2023
Merged

detach from Figma's tokens #2140

merged 25 commits into from
Aug 13, 2023

Conversation

six7
Copy link
Collaborator

@six7 six7 commented Aug 7, 2023

This is a WIP PR to detach from Figma's tokens and instead ship our own.

/describe

@changeset-bot
Copy link

changeset-bot bot commented Aug 7, 2023

🦋 Changeset detected

Latest commit: bb5e9ff

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tokens-studio/figma-plugin Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2023

Commit SHA:dd93d4dcbad1378d84ba22e65e72065bdce7c09a

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: feat/introduce-own-tokens 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 68.36 (0.08) 59.61 (0.01) 66.65 (0.07) 68.64 (0.08)
🔴 src/app/components/AppContainer/AppContainer.tsx 83.33 (0.73) 88.23 (-5.1) 75 (0) 83.33 (0.73)
🔴 src/app/components/inspector/TokenNodes.tsx 30 (-3.33) 0 (0) 0 (0) 33.33 (-4.17)
✨ 🆕 src/hooks/useFigmaTheme.ts 83.33 50 75 81.81
✨ 🆕 src/tokens/core.ts 100 100 100 100
✨ 🆕 src/tokens/dark.ts 100 100 100 100
✨ 🆕 src/tokens/light.ts 100 100 100 100

@six7
Copy link
Collaborator Author

six7 commented Aug 8, 2023

/review

@six7 six7 marked this pull request as ready for review August 8, 2023 20:53
@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2023

PR Analysis

  • 🎯 Main theme: This PR is about detaching from Figma's tokens and shipping their own tokens.
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: No
  • Focused PR: Yes, the PR code diff changes are focused on detaching from Figma's tokens and introducing their own tokens.
  • 🔒 Security concerns: No

PR Feedback

  • General suggestions: The PR looks good overall. It's great that the team is detaching from Figma's tokens and introducing their own tokens. However, it would be beneficial to add relevant tests to ensure the correctness of the changes.

  • 🤖 Code feedback:

    • relevant file: src/stitches.config.ts
      suggestion: Consider removing the unused globalTokens object. [medium]
      relevant line: const globalTokens = {

    • relevant file: src/tokens/light.ts
      suggestion: Update the colors object to use the new token names. [important]
      relevant line: export const colors = {

    • relevant file: src/tokens/dark.ts
      suggestion: Update the colors object to use the new token names. [important]
      relevant line: export const colors = {

How to use

To invoke the PR-Agent, add a comment using one of the following commands:
/review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option.
/describe: Modify the PR title and description based on the contents of the PR.
/improve: Suggest improvements to the code in the PR.
/ask <QUESTION>: Pose a question about the PR.

To edit any configuration parameter from 'configuration.toml', add --config_path=new_value
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, use the /config command.

@six7
Copy link
Collaborator Author

six7 commented Aug 8, 2023

/describe

@six7 six7 requested a review from LukeFinch August 10, 2023 16:55
Copy link
Contributor

@LukeFinch LukeFinch left a comment

Choose a reason for hiding this comment

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

Only a couple of minor comments - nothing major.
This looks really good - and will be super helpful for iterating designs!

'&:focus-visible': {
boxShadow: '$focus',
},
},
ghost: {
background: 'transparent',
padding: '$2 $3',
color: '$fgBtnGhost',
'&:hover': {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do ghost buttons not have hover states?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

that must've been by mistake 👍

@@ -110,7 +110,7 @@ export const ThemeSelector: React.FC = () => {
return (
filteredThemes.length > 0 && (
<DropdownMenuRadioGroup value={typeof activeTheme[groupName] !== 'undefined' ? activeTheme[groupName] : ''}>
<Text css={{ color: '$staticTextMuted', padding: '$2 $3' }}>{groupName === INTERNAL_THEMES_NO_GROUP ? INTERNAL_THEMES_NO_GROUP_LABEL : groupName}</Text>
<Text css={{ color: '$contextMenuForegroundMuted', padding: '$2 $3' }}>{groupName === INTERNAL_THEMES_NO_GROUP ? INTERNAL_THEMES_NO_GROUP_LABEL : groupName}</Text>
Copy link
Contributor

Choose a reason for hiding this comment

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

This token name doesn't match the naming convention of 'fg' for foreground

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

💯 i will create a followup PR for a second refactor just to keep this PR a bit smaller. i'd also like to change textMuted / textDefault over to fgDefault etc

@@ -5,8 +5,21 @@ export function useFigmaTheme() {

useEffect(() => {
const htmlClassList = document.documentElement?.classList || [];
console.log('useFigmaTheme', isDarkTheme, htmlClassList);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need the console log here in production?

@six7 six7 merged commit 03aa9d0 into main Aug 13, 2023
6 checks passed
@six7 six7 mentioned this pull request Aug 13, 2023
six7 added a commit that referenced this pull request Aug 14, 2023
changes naming on a few tokens to align with Studio tokens, followup to
#2140
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