Skip to content

Commit

Permalink
docs: remove no longer needed class name from grid example
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan committed Jul 25, 2024
1 parent 26e5673 commit 6682259
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
7 changes: 1 addition & 6 deletions frontend/demo/component/grid/grid-styling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@ export class Example extends LitElement {

protected override render() {
return html`
<vaadin-grid
.items="${this.items}"
.cellPartNameGenerator="${this.cellPartNameGenerator}"
class="styling"
>
<vaadin-grid-column path="firstName"></vaadin-grid-column>
<vaadin-grid .items="${this.items}" .cellPartNameGenerator="${this.cellPartNameGenerator}">
<vaadin-grid-column path="lastName"></vaadin-grid-column>
<vaadin-grid-column path="profession"></vaadin-grid-column>
<vaadin-grid-column
Expand Down
2 changes: 1 addition & 1 deletion frontend/demo/component/grid/react/grid-styling.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function Example() {
}, []);

return (
<Grid items={items.value} cellPartNameGenerator={cellPartNameGenerator} className="styling">
<Grid items={items.value} cellPartNameGenerator={cellPartNameGenerator}>
<GridColumn path="firstName" />
<GridColumn path="lastName" />
<GridColumn path="profession" />
Expand Down
10 changes: 3 additions & 7 deletions frontend/themes/docs/grid-styling.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
/* Add this to your global CSS, for example in: */
/* frontend/theme/[my-theme]/styles.css */

vaadin-grid.styling::part(high-rating) {
vaadin-grid::part(high-rating) {
background-color: var(--lumo-success-color-10pct);
}

vaadin-grid.styling::part(low-rating) {
vaadin-grid::part(low-rating) {
background-color: var(--lumo-error-color-10pct);
}

vaadin-grid.styling::part(loading-row-cell) {
background-color: var(--lumo-base-color);
}

vaadin-grid.styling::part(font-weight-bold) {
vaadin-grid::part(font-weight-bold) {
font-weight: bold;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public class GridStyling extends Div {
public GridStyling() {
// tag::snippet[]
Grid<PersonWithRating> grid = new Grid<>(PersonWithRating.class, false);
grid.addClassName("styling");
grid.addColumn(PersonWithRating::getFirstName).setHeader("First name");
grid.addColumn(PersonWithRating::getLastName).setHeader("Last name");
grid.addColumn(PersonWithRating::getProfession).setHeader("Profession");
Expand Down

0 comments on commit 6682259

Please sign in to comment.