Skip to content

feat(Chore): support per-corner border radius tokens - #1771

Closed
AlexandraGallipoliRodrigues wants to merge 2 commits into
masterfrom
alex/1752-per-corner-border-radius
Closed

AlexandraGallipoliRodrigues wants to merge 2 commits into
masterfrom
alex/1752-per-corner-border-radius

Conversation

@AlexandraGallipoliRodrigues

Copy link
Copy Markdown
Contributor

Adds support for per-corner border radius tokens in the design token generator. Exports the four corners as a CSS shorthand string in both TypeScript skins and CSS, preserving existing uniform radius tokens.

Validates corner values and rejects incomplete or mixed definitions. Includes 23 tests covering parsing and generation, added to CI.

Token names, per-skin values, and Message integration remain pending agreement with Design.

Ref: #1752

@AlexandraGallipoliRodrigues
AlexandraGallipoliRodrigues requested a review from a team as a code owner October 14, 2026 11:29
Copilot AI balanced review requested due to automatic review settings October 14, 2026 11:29
@AlexandraGallipoliRodrigues AlexandraGallipoliRodrigues added the AI AI Generated label Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Size stats

master this branch diff
Total JS 16.4 MB 16.4 MB -2 B
JS without icons 2.06 MB 2.06 MB -2 B
Lib overhead 100 kB 100 kB 0 B
Lib overhead (gzip) 21.5 kB 21.5 kB 0 B

Copilot AI 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.

🟢 Approval recommended

The implementation satisfies the stated requirements with appropriate validation, backward compatibility, documentation, and coverage.

0 open findings

What changed in this PR

Adds per-corner border-radius token support while preserving uniform-radius generation.

Changes:

  • Validates and converts uniform and four-corner radius values.
  • Generates CSS shorthand values for TypeScript skins and CSS variables.
  • Adds documentation, automated tests, and CI execution.
File Description
packages/​generate-design-tokens/​token-types.ts Models uniform and per-corner radius tokens.
packages/​generate-design-tokens/​css-generator.ts Validates and formats radius values.
packages/​generate-design-tokens/​radius-test.ts Tests parsing, validation, and generated output.
packages/​generate-design-tokens/​package.json Adds the package test command.
packages/​generate-design-tokens/​README.md Documents the token format and constraints.
.github/​workflows/​ci.yml Runs generator tests in CI.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Deploy preview for mistica-web ready!

Project:mistica-web
Status: ✅  Deploy successful!
Preview URL:https://mistica-b8mjbmtgr-flows-projects-65bb050e.vercel.app
Latest Commit:0a80b2e

Deployed with vercel-action

@github-actions

Copy link
Copy Markdown

Accessibility report
✔️ No issues found

ℹ️ You can run this locally by executing yarn audit-accessibility.

@AnaMontes11 AnaMontes11 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.

Useful improvement and keeps compatibility with existing tokens. :)

@brtbrt

brtbrt commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

I think we've implemented this too early, because we don't have a branch on mistica-design with the schema evolution about this, right?

To check we properly implement what's needed, and make it 100% compatible with mistica-design, we do need that branch and schema change 🤔

@Marcosld

Copy link
Copy Markdown
Contributor

I think we've implemented this too early, because we don't have a branch on mistica-design with the schema evolution about this, right?

To check we properly implement what's needed, and make it 100% compatible with mistica-design, we do need that branch and schema change 🤔

We can just create a test branch with per-corner tokens, test and merge this so we have it already in main

Comment on lines +25 to +30
const corners = {
bottomLeft: {value: '16', type: 'borderRadius'},
topRight: {value: '8px', type: 'borderRadius'},
topLeft: {value: '4', type: 'borderRadius'},
bottomRight: {value: '50%', type: 'borderRadius'},
} as const;

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.

Should we support defining only a subset of the corners? for example topLeft and bottomRight but not the other two?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Currently all four corners are required. Supporting a subset makes sense, but what should omitted corners resolve to? For Message, we’d need them to use the regular container radius rather than zero. Should we represent that fallback in the token schema?

@Marcosld Marcosld Oct 15, 2026 •

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.

Omitted corners could default to 0

@AlexandraGallipoliRodrigues

AlexandraGallipoliRodrigues commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

I think we've implemented this too early, because we don't have a branch on mistica-design with the schema evolution about this, right?
To check we properly implement what's needed, and make it 100% compatible with mistica-design, we do need that branch and schema change 🤔

We can just create a test branch with per-corner tokens, test and merge this so we have it already in main

Yes, this implementation follows the illustrative structure in the issue, but we still need to validate it against the schema in mistica-design. A test branch with the schema change and sample per-corner tokens sounds good. We can use it to verify the import before merging this PR

@AnaMontes11 will you create the test branch with the schema change and the example tokens? As soon as it’s ready, I’ll approve the import using the generator in this PR. But before that, we’ll need to agree on how to deal with the missing corners.

@AlexandraGallipoliRodrigues
AlexandraGallipoliRodrigues marked this pull request as draft October 15, 2026 11:26
@AlexandraGallipoliRodrigues
AlexandraGallipoliRodrigues marked this pull request as ready for review October 15, 2026 11:33
@brtbrt

brtbrt commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

I still don't see any mistica-design PR to make this branch comply with that one?

@AnaMontes11

Copy link
Copy Markdown
Contributor

I think we've implemented this too early, because we don't have a branch on mistica-design with the schema evolution about this, right?
To check we properly implement what's needed, and make it 100% compatible with mistica-design, we do need that branch and schema change 🤔

We can just create a test branch with per-corner tokens, test and merge this so we have it already in main

Yes, this implementation follows the illustrative structure in the issue, but we still need to validate it against the schema in mistica-design. A test branch with the schema change and sample per-corner tokens sounds good. We can use it to verify the import before merging this PR

@AnaMontes11 will you create the test branch with the schema change and the example tokens? As soon as it’s ready, I’ll approve the import using the generator in this PR. But before that, we’ll need to agree on how to deal with the missing corners.

hi @AlexandraGallipoliRodrigues @Marcosld @brtbrt Finally, for this specific case (the Message/Bubble corners) there’s going to be no variation across skins, so we’ve found a simpler solution that resolves at the component level, avoiding the schema change and the new token: 3 corners use the existing container token, and the fourth uses a fixed value.

I’ve updated the Bubble specs in Figma to make this explicit.

This evolution may be necessary in the future, so we’ll revisit the schema change when that case comes up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI AI Generated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Mística] Evolve the token script to support per-corner border radius

6 participants