Skip to content

Conversation

@balzss
Copy link
Contributor

@balzss balzss commented Dec 2, 2025

INSTUI-4865

Summary

Migrates View and ContextView components to token-based theme system:

  • Remove theme.ts files from View and ContextView
  • Switch from withStyleRework to withStyle decorator
  • Rename calcMarginFromShorthandcalcSpacingFromShorthand with support for hyphen-case tokens (e.g., 'medium-small')
  • Add token conversion utilities: elevationTokenToBoxShadow, processBorderRadiusValue, processBorderWidthValue
  • Add withFocusOutline parameter to calcFocusOutlineStyles
  • Fix ContextView placement padding override
  • Update consuming components (Avatar, ColorPicker, FormFieldLayout, Link, Spinner)

Test Plan

  • Run unit tests: pnpm run test:vitest ui-view
  • Verify View renders with various props (margin, padding, border, shadow)
  • Test ContextView positioning and placement
  • Confirm spacing tokens resolve (camelCase and hyphen-case: 'mediumSmall', 'medium-small')
  • Check focus outline styles
  • Run visual regression tests
  • Verify consuming components work correctly
  • Test documentation site: pnpm run devhttp://localhost:9090

@balzss balzss self-assigned this Dec 2, 2025
@github-actions
Copy link

github-actions bot commented Dec 2, 2025

PR Preview Action v1.6.3

🚀 View preview at
https://instructure.design/pr-preview/pr-2282/

Built to branch gh-pages at 2025-12-23 13:57 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@matyasf matyasf force-pushed the v12-view-token branch 2 times, most recently from e0dbb3f to f923c03 Compare December 8, 2025 21:59
@balzss balzss force-pushed the v12-view-token branch 4 times, most recently from 794f0ae to b9a0366 Compare December 8, 2025 22:22
@balzss balzss requested review from HerrTopi and matyasf December 9, 2025 11:51
Copy link
Collaborator

@matyasf matyasf left a comment

Choose a reason for hiding this comment

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

See my comments. Also the shadows, borders look different in ContextView, is this normal?

Image

borderColor: borderColor
})
}
borderStyle: 'solid',
Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont see this in the token changelog

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll double check with the design

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add this back

@matyasf
Copy link
Collaborator

matyasf commented Dec 11, 2025

Also please fix test and add the token changes to the upgrade guide

…token-based theme system

- Remove theme.ts files from View and ContextView components
- Switch from withStyleRework to withStyle decorator
- Update components to use NewComponentTypes and SharedTokens
- Enhance calcMarginFromShorthand to support hyphen-case tokens
- Add elevationTokenToBoxShadow utility for box-shadow token conversion
- Add processBorderRadiusValue and processBorderWidthValue helpers
- Add withFocusOutline parameter to calcFocusOutlineStyles
- Fix ContextView placement padding override with high-specificity selector
@balzss
Copy link
Contributor Author

balzss commented Dec 23, 2025

@adamlobler the arrowBorderColor theme token for the contextview has a wrong contrast (reported by the axe a11y tool). can/should we change that?

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.

4 participants