Skip to content

Conversation

@Artur-
Copy link
Member

@Artur- Artur- commented Nov 20, 2025

Adds setColorScheme() and getColorScheme() methods to the Style interface,
allowing developers to set the CSS color-scheme property on individual
components. This complements the page-level ColorScheme API.

The implementation follows existing Style interface patterns for CSS
properties and uses the same ColorScheme.Value enum for type safety.

Changes:

  • Added STYLE_COLOR_SCHEME constant to ElementConstants
  • Added setColorScheme(ColorScheme.Value) to Style interface
  • Added getColorScheme() to Style interface
  • Added comprehensive unit tests in HasStyleTest

Usage example:
component.getStyle().setColorScheme(ColorScheme.Value.DARK);

@github-actions
Copy link

github-actions bot commented Nov 20, 2025

Test Results

1 296 files  1 296 suites   1h 18m 9s ⏱️
9 083 tests 9 015 ✅ 68 💤 0 ❌
9 541 runs  9 465 ✅ 76 💤 0 ❌

Results for commit 6891a48.

♻️ This comment has been updated with latest results.

@Artur- Artur- force-pushed the color-scheme-component branch from 2bc4cdf to 5ef5586 Compare November 24, 2025 07:52
@Artur- Artur- marked this pull request as ready for review November 24, 2025 07:53
@github-actions github-actions bot added +0.1.0 and removed +1.0.0 labels Nov 24, 2025
@vaadin-bot vaadin-bot added +1.0.0 and removed +0.1.0 labels Nov 24, 2025
@github-actions github-actions bot added +0.1.0 and removed +1.0.0 labels Nov 24, 2025
@mshabarov mshabarov requested a review from caalador November 24, 2025 12:43
Adds setColorScheme() and getColorScheme() methods to the Style interface,
allowing developers to set the CSS color-scheme property on individual
components. This complements the page-level ColorScheme API.

The implementation follows existing Style interface patterns for CSS
properties and uses the same ColorScheme.Value enum for type safety.

Changes:
- Added STYLE_COLOR_SCHEME constant to ElementConstants
- Added setColorScheme(ColorScheme.Value) to Style interface
- Added getColorScheme() to Style interface
- Added comprehensive unit tests in HasStyleTest

Usage example:
  component.getStyle().setColorScheme(ColorScheme.Value.DARK);
@Artur- Artur- force-pushed the color-scheme-component branch from f6678be to 6891a48 Compare November 24, 2025 16:51
@sonarqubecloud
Copy link

@caalador caalador merged commit db042e8 into main Nov 25, 2025
34 checks passed
@caalador caalador deleted the color-scheme-component branch November 25, 2025 07:17
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 25.0.0-beta8.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants