Skip to content

refactor: remove usage of CSS layers from base styles #9659

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 8, 2025

Conversation

web-padawan
Copy link
Member

@web-padawan web-padawan commented Jul 8, 2025

Description

As previously agreed, let's remove @layer from base styles to make it easier for themes to override certain properties without having specificity issues. This also removes corresponding Stylelint rule.

Note: please review with "hide whitespaces" option enabled.

Type of change

  • Refactor

@web-padawan web-padawan requested review from jouni and vursen July 8, 2025 08:39
@@ -3,62 +3,60 @@
* Copyright (c) 2020 - 2025 Vaadin Ltd.
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
import '@vaadin/component-base/src/style-props.js';
Copy link
Member Author

Choose a reason for hiding this comment

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

Added missing import since the component uses --vaadin-focus-ring-width defined in style-props.js.

@@ -3,270 +3,269 @@
* Copyright (c) 2024 - 2025 Vaadin Ltd.
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
import '@vaadin/component-base/src/style-props.js';
Copy link
Member Author

Choose a reason for hiding this comment

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

Added missing import.

html {
/* Background color */
--vaadin-background-color: light-dark(#fff, #222);
:where(html) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to align with the approach used in Lumo.

@@ -3,57 +3,56 @@
* Copyright (c) 2021 - 2025 Vaadin Ltd.
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
import '@vaadin/component-base/src/style-props.js';
Copy link
Member Author

Choose a reason for hiding this comment

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

Added missing import as the component uses --vaadin-clickable-cursor defined in style-props.js.

@@ -3,30 +3,29 @@
* Copyright (c) 2021 - 2025 Vaadin Ltd.
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
import '@vaadin/component-base/src/style-props.js';
Copy link
Member Author

Choose a reason for hiding this comment

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

Added missing import.

Copy link

sonarqubecloud bot commented Jul 8, 2025

vaadin-side-nav-item:has(> vaadin-icon[slot='prefix'])::part(link) {
--_has-prefix-icon:;
}
:where(vaadin-side-nav-item:has(> vaadin-icon[slot='prefix']))::part(link) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if we need :where here but I added it to align with other components using SlotStylesMixin.

@web-padawan web-padawan removed the request for review from jouni July 8, 2025 08:56
@web-padawan web-padawan merged commit ca6a71c into main Jul 8, 2025
10 checks passed
@web-padawan web-padawan deleted the refactor/drop-base-layer branch July 8, 2025 08:56
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.

2 participants