Skip to content

feat(ui-heading,shared-types): add ai color#1974

Merged
HerrTopi merged 1 commit intomasterfrom
ai-heading
May 16, 2025
Merged

feat(ui-heading,shared-types): add ai color#1974
HerrTopi merged 1 commit intomasterfrom
ai-heading

Conversation

@HerrTopi
Copy link
Contributor

TEST_PLAN: compare with design documentation

INSTUI-4550

@HerrTopi HerrTopi requested review from balzss, Copilot and joyenjoyer May 15, 2025 11:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces an “ai” color variant for the Heading component by extending theme variables, styles, props, and documentation.

  • Adds aiTextTopGradientColor and aiTextBottomGradientColor to the component theme
  • Implements an ai style variant using a gradient text background
  • Updates prop definitions and README to support color="ai"
  • Broadens theme color types to string and includes new AI gradient variables in shared-types

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/ui-heading/src/Heading/theme.ts Add aiTextTopGradientColor and aiTextBottomGradientColor
packages/ui-heading/src/Heading/styles.ts Define ai variant with linear-gradient text styling
packages/ui-heading/src/Heading/props.ts Include 'ai' in the color prop union
packages/ui-heading/src/Heading/README.md Document usage example for color="ai"
packages/shared-types/src/ComponentThemeVariables.ts Change several contrast colors to string and add AI variables
Comments suppressed due to low confidence (2)

packages/ui-heading/src/Heading/props.ts:61

  • [nitpick] Add unit tests to cover the new 'ai' color variant, ensuring the prop is accepted and the gradient styling is applied correctly.
| 'ai'

packages/shared-types/src/ComponentThemeVariables.ts:659

  • Widening specific contrast color properties to string reduces compile-time safety; consider using Colors['contrasts'][keyof Colors['contrasts']] or explicit keys to retain type guarantees.
primaryInverseColor: string

background: `
linear-gradient(to bottom, ${componentTheme.aiTextTopGradientColor} 0%, ${componentTheme.aiTextBottomGradientColor} 100%) text`,
border: 'solid transparent',
'-webkit-text-fill-color': 'transparent'
Copy link

Copilot AI May 15, 2025

Choose a reason for hiding this comment

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

Missing background-clip: text (and vendor-prefixed -webkit-background-clip: text) may prevent the gradient from being clipped to the text, causing unexpected backgrounds.

Suggested change
'-webkit-text-fill-color': 'transparent'
'-webkit-text-fill-color': 'transparent',
'-webkit-background-clip': 'text',
'background-clip': 'text'

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented May 15, 2025

PR Preview Action v1.6.1
Preview removed because the pull request was closed.
2025-05-16 10:49 UTC

Copy link
Contributor

@joyenjoyer joyenjoyer left a comment

Choose a reason for hiding this comment

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

gj

@HerrTopi HerrTopi merged commit a00690b into master May 16, 2025
8 checks passed
@HerrTopi HerrTopi deleted the ai-heading branch May 16, 2025 10:49
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