Figma branch sync + alternative token setup#61
Draft
sjoerdbeentjes wants to merge 3 commits into
Draft
Conversation
…etup Add Figma branch support to the sync script and apply the redesigned "Alternative token setup" branch token set, migrating the React button and theme bridge to the new role-based taxonomy. - sync-figma: --branch/FIGMA_BRANCH to pull from a branch (key or name), plus auto-detection of the redesigned single-collection layout - tokens: regenerate from the branch (SURF Blue only for now) - react: repoint @theme bridge to the new tokens, keeping shadcn utility names stable; update button to the dedicated hover tokens
Override the Spartan Tailwind preset's color bridge in styles.css to point at the new @surfnet/tokens role-based names, and switch the button to the dedicated hover tokens. Mirrors the React change for parity.
Drop the shadcn-alias bridge. Expose the @surfnet/tokens variables to Tailwind under their literal Figma role names (bg-background-primary, text-foreground-primary, hover:bg-background-item-hover, ...) in both the React @theme block and the Angular styles.css override. Rewrite both button components to the dedicated role tokens, which removes the opacity/dark hacks the redesign makes unnecessary (primary/80 -> background-primary-hover, destructive/10 -> background-error-subtle, the dark:input outline treatment -> theme-aware background-item-hover).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds Figma branch support to the token sync script, then applies the redesigned "Alternative token setup" branch token set and migrates the React and Angular buttons to it.
Opened as a draft for review of the token redesign before adopting it.
Changes
1. Branch-aware sync (
scripts/sync-figma.ts)--branch "<name-or-key>"flag (andFIGMA_BRANCHenv var). A branch key from the URL is used directly; a name is resolved to its key via the file's branch metadata.3. Mode×2. Themecollections, or the redesigned single themes collection (modes likeSURF Blue - Light). Detection is structural, so it survives the branch renumbering its collections.2. Applied the branch token set (
packages/tokens/src/*)tokens.json/tokens.dark.jsonfrom the branch.primarytobackground-primary+foreground-primary,destructivetobackground-error, etc.), adds hover/selected/error/subtle/alt roles, addsheading-*typography andsection-*spacing, and attaches color to shadows.3. Exposed tokens under their literal Figma names + migrated the buttons (React + Angular)
bg-background-primary,text-foreground-primary,hover:bg-background-item-hover, etc. No shadcn-alias bridge.@theme inlineinindex.csspasses the token variables through under their literal names. Angular: same set added tostyles.css(the@spartan-ngpreset's old flat names are simply unused).buttoncomponents rewritten to the dedicated role tokens. This removes the opacity/dark:hacks the redesign makes unnecessary:primary/80tobackground-primary-hover,destructive/10tobackground-error-subtle(+-hover), and thedark:inputoutline treatment to the theme-awarebackground-item-hover.How it was verified
rgb(6,75,203)(--background-primary) with white text (--foreground-primary).styles.cssthrough Tailwind; confirmedbg-background-primaryto--background-primary,border-border-defaultto--border-default,bg-background-error-subtleto--background-error-subtle, etc.Net effect on the button
Default/outline/ghost stay visually close; the redesign gives dedicated tokens for states, so: default hover is a dedicated lighter blue (was primary @ 80%), secondary becomes pale blue, destructive uses the error-subtle role, and the outline dark treatment now comes from the theme-aware tokens rather than
dark:inputoverrides.Open points / not in scope
@themeblocks duplicate the token list by hand; worth generating from@surfnet/tokenslater.border-radius/rounded-*is emitted verbatim from the branch; can be normalized if preferred.