Skip to content
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

docs: update MenuBar docs to use CSS class #3048

Merged
merged 9 commits into from
Dec 19, 2023

Conversation

DiegoCardoso
Copy link
Contributor

Update MenuBar documentation to use CSS classes instead of the theme API

Fixes #3030

@github-actions github-actions bot added the Language unchecked English language and AsciiDoc formatting checks haven't been done label Dec 12, 2023
vaadin-menu-bar-button[theme~="custom-theme"],
vaadin-menu-bar-item[theme~="custom-theme"] {
vaadin-menu-bar-button.custom-classname,
vaadin-menu-bar-item.custom-classname {
text-transform: uppercase;
Copy link
Contributor

Choose a reason for hiding this comment

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

We could change the styling to something people actually might notice, like background color?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to use Lumo utility classes and removed this file.

An individual menu item can be styled using custom theme variants. A custom variant can be created by adding a custom theme name (e.g., `custom-theme`) to an item, and then adding CSS for styling all items using that theme name.

The following example shows how to add a custom theme variant named `custom-theme` to individual menu bar buttons and items, and how to style that variant with CSS:
Individual menu items can be styled by [since:com.vaadin:[email protected]]##applying custom classnames to them##, and writing CSS style blocks targeting those classnames. Note that root-level menu items in the Menu Bar are wrapped inside `vaadin-menu-bar-button` elements which inherit the classnames from the items inside them.
Copy link
Contributor

Choose a reason for hiding this comment

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

Apparently we've decided to go with "class names" instead of "classnames" in docs, so let's change all occurrences to that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@russelljtdyer russelljtdyer added Language checking English language and AsciiDoc formatting checking is in progress and removed Language unchecked English language and AsciiDoc formatting checks haven't been done labels Dec 13, 2023
@russelljtdyer russelljtdyer added Language checked English language and AsciiDoc formatting checks done and removed Language checking English language and AsciiDoc formatting checking is in progress labels Dec 19, 2023
@DiegoCardoso DiegoCardoso enabled auto-merge (squash) December 19, 2023 17:31
@DiegoCardoso DiegoCardoso merged commit 77d0c4f into latest Dec 19, 2023
2 of 3 checks passed
@DiegoCardoso DiegoCardoso deleted the docs/menu-bar/styling-class branch December 19, 2023 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language checked English language and AsciiDoc formatting checks done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update MenuBar docs with menu-item classname API
3 participants