Skip to content

refactor!: remove class names from list-box and items - #5111

Merged
web-padawan merged 3 commits into
masterfrom
refactor/context-menu-class-remove
Dec 8, 2022
Merged

web-padawan merged 3 commits into
masterfrom
refactor/context-menu-class-remove

Conversation

@web-padawan

Copy link
Copy Markdown
Member

Description

Fixes #795

  1. Removed usage of CSS classes from vaadin-context-menu list-box and items when using items API,
  2. Changed Lumo and Material themes to use role="menuitem" and aria-haspopup attributes instead.

Type of change

  • Breaking change

'vaadin-context-menu-list-box',
css`
:host(.vaadin-menu-list-box) {
:host {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Adding specificity here isn't needed, see #795 (comment)

cursor: default;
}

[part='items'] ::slotted(.vaadin-menu-item) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Merged two blocks of rules using duplicate CSS selectors into a single one.

Comment on lines -70 to -72
:host(.vaadin-menu-item)::before {
display: block;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This CSS is no longer working after we introduced part="checkmark", removed.

@web-padawan
web-padawan force-pushed the refactor/context-menu-class-remove branch from fb6af63 to 3e3eda3 Compare December 8, 2022 13:32
@web-padawan
web-padawan force-pushed the refactor/context-menu-class-remove branch from 10ba3b9 to 908dd78 Compare December 8, 2022 13:47
@sonarqubecloud

sonarqubecloud Bot commented Dec 8, 2022

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 24.0.0.alpha7 and is also targeting the upcoming stable 24.0.0 version.

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.

[context-menu] Menu items do not follow public styling API conventions

3 participants