Skip to content

feat: Support Themes DefaultDensity and DefaultCornerRadius properties - #1589

Merged
Kunal22shah merged 3 commits into
mainfrom
dev/sb/density
May 7, 2026
Merged

Kunal22shah merged 3 commits into
mainfrom
dev/sb/density

Conversation

@kazo0

@kazo0 kazo0 commented May 7, 2026

Copy link
Copy Markdown
Contributor

This pull request updates Uno Toolkit to version 9.0, introducing significant changes to theme customization and dependency management. The most important updates are the adoption of Uno Themes 7.0, a new unified design-token system, and the refactoring of theme classes to inherit directly from their underlying themes. This brings new properties for density and corner radius customization, changes to resource dictionary URIs, and the removal of the toolkit's BaseToolkitTheme in favor of direct inheritance. Documentation is updated to reflect all these changes.

Theme System and API Changes

  • MaterialToolkitTheme and the new SimpleToolkitTheme now inherit directly from their underlying themes (MaterialTheme and SimpleTheme), exposing all theme properties (such as Colors, DefaultDensity, DefaultCornerRadius, and font/color overrides) directly and removing the need for the toolkit's own BaseToolkitTheme class. This simplifies theme initialization and customization. [1] [2] [3]
  • A new Colors property is introduced as the recommended way to customize theme colors, supporting seed color generation and override dictionaries. Legacy override properties are routed through this new property.
  • The default Material palette is now seed-generated, and color override precedence is changed so explicit overrides always win over seed-generated colors.

Design Token Customization

  • Both toolkit themes (MaterialToolkitTheme and SimpleToolkitTheme) now expose DefaultDensity and DefaultCornerRadius properties, allowing control over base spacing and corner radius units. Documentation is updated to describe these properties and their effects. [1] [2] [3] [4]

Dependency and Package Updates

  • Updates the Uno Themes package to version 7.0.0-dev.29 and ensures that package references are consistent and centrally managed. [1] [2] [3] [4]
  • Removes the explicit package reference to Uno.Themes.WinUI in the toolkit project file, relying on the new inheritance and package structure.

Documentation Improvements

  • The migration guide is expanded for Uno Toolkit 9.0, detailing breaking changes, new customization options, and upgrade instructions for users.
  • Getting started guides for both Material and Simple themes are updated to reflect the new properties and usage patterns. [1] [2] [3]

These changes modernize the theme system, improve customization, and streamline the codebase for future development.

Copilot AI review requested due to automatic review settings May 7, 2026 01:59
@agneszitte
agneszitte requested review from Kunal22shah and Xiaoy312 May 7, 2026 02:00

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.

Pull request overview

This PR bumps Uno Toolkit to the 9.0 line and aligns it with Uno Themes 7.0 by refactoring toolkit theme wrappers to inherit directly from the underlying Uno Themes, while updating package management and documentation for the new design-token customization surface.

Changes:

  • Update versioning and central package versions to use Uno Themes 7.0.0-dev.29 and start the 9.0-dev.* prerelease line.
  • Refactor MaterialToolkitTheme and SimpleToolkitTheme to inherit from MaterialTheme / SimpleTheme and remove the toolkit’s BaseToolkitTheme.
  • Update migration/getting-started docs to describe new theme properties (e.g., DefaultDensity, DefaultCornerRadius) and URI changes for generated merged dictionaries.

Reviewed changes

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

Show a summary per file
File Description
version.json Bumps repo version to 9.0-dev.{height}.
src/Uno.Toolkit.UI/Uno.Toolkit.WinUI.csproj Removes direct Uno.Themes.WinUI reference from the base WinUI toolkit package.
src/Uno.Toolkit.UI/Themes/BaseToolkitTheme.cs Deletes toolkit-owned theme wrapper base class as themes now inherit directly from Uno Themes.
src/library/Uno.Toolkit.Simple/SimpleToolkitTheme.cs Switches toolkit theme to derive from SimpleTheme and adds toolkit resource merges via GenerateSpecificResources().
src/library/Uno.Toolkit.Material/MaterialToolkitTheme.cs Switches toolkit theme to derive from MaterialTheme and adds toolkit resource merges via GenerateSpecificResources().
src/Directory.Packages.props Updates Uno Themes version and centralizes Uno.Simple.WinUI to use $(UnoThemesVersion).
samples/Directory.Packages.props Updates sample Uno Themes version to match 7.0.0-dev.29.
doc/uno-toolkit-migration.md Adds/updates Toolkit 9.0 migration guidance for the new theme system and design tokens.
doc/simple-getting-started.md Updates Simple getting-started docs to document DefaultDensity / DefaultCornerRadius and related guidance.
doc/material-getting-started.md Updates Material getting-started docs to document DefaultDensity / DefaultCornerRadius.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread doc/uno-toolkit-migration.md Resolved
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown

1 similar comment
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown

@kazo0
kazo0 marked this pull request as draft May 7, 2026 17:06
@kazo0
kazo0 marked this pull request as ready for review May 7, 2026 20:21
@Kunal22shah
Kunal22shah enabled auto-merge (squash) May 7, 2026 20:28
@Kunal22shah
Kunal22shah merged commit 9adf075 into main May 7, 2026
23 checks passed
@Kunal22shah
Kunal22shah deleted the dev/sb/density branch May 7, 2026 20:36
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