Skip to content

Dashboard style update #8962

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

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Dashboard style update #8962

wants to merge 23 commits into from

Conversation

rolfsmeds
Copy link
Contributor

Description

  • Elevated and Flat style variants
  • Shaded background variant for board itself
  • Wrapping title support (and a style prop for disabling wrapping)

Fixes #8961
Fixes #8706

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/contributing/pr
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.
  • I have not completed some of the steps above and my pull request can be closed immediately.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.


:host::before {
content: '';
display: block;
Copy link
Member

Choose a reason for hiding this comment

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

Minor nit, but this is not required, as absolute/fixed positioned elements become block containers automatically.

Suggested change
display: block;

* `--vaadin-dashboard-item-rowspan` | rowspan of the widget
* Custom Property | Description
* --------------------------------------------|----------------------
* `--vaadin-dashboard-item-colspan` | colspan of the widget
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we align the naming for all the properties to maybe use --vaadin-dashboard-item-xyz?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, done in 93ddf24

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or, rather, renamed -item- properties to -widget-, since they're all widgets anyway

@ugur-vaadin
Copy link
Contributor

We should probably add some visual tests for the themes.

* `--vaadin-dashboard-widget-shadow` | widget shadow (non edit mode)
* `--vaadin-dashboard-widget-editable-shadow` | widget edit mode shadow
* `--vaadin-dashboard-widget-selected-shadow` | selected widget shadow
* `--vaadin-dashboard-widget-padding` | padding around widget content
Copy link
Contributor

Choose a reason for hiding this comment

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

We should also add the new properties to the TS file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Added them.

}

[part='title'] {
flex: 1;
color: var(--lumo-header-text-color);
margin: 0;
white-space: nowrap;
white-space: var(--vaadin-dashboard-widget-title-wrap, wrap);
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be missing from the property list.

Copy link
Contributor

Choose a reason for hiding this comment

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

Added this property.

@ugur-vaadin
Copy link
Contributor

We should probably add some visual tests for the themes.

Added some tests. Can you check the baseline images @rolfsmeds ?

@rolfsmeds
Copy link
Contributor Author

We should probably add some visual tests for the themes.

Added some tests. Can you check the baseline images @rolfsmeds ?

As I've now modified stuff again, I'm guessing the baselines need updating too @ugur-vaadin ?

@ugur-vaadin
Copy link
Contributor

ugur-vaadin commented May 7, 2025

As I've now modified stuff again, I'm guessing the baselines need updating too @ugur-vaadin ?

Updated the images. Header content alignment seems to have changed. Can you check to see if anything looks out of place?

@rolfsmeds
Copy link
Contributor Author

As I've now modified stuff again, I'm guessing the baselines need updating too @ugur-vaadin ?

Updated the images. Header content alignment seems to have changed. Can you check to see if anything looks out of place?

Header content alignment was changed to support wrapping widget titles, but I see now that apparently the titles are rendering significantly lower in the test images than on macOS, which probably means they do so on Windows too. Doesn't look very good. I'll make a couple of small tweaks to hopefully make it look better.

@ugur-vaadin
Copy link
Contributor

Header content alignment was changed to support wrapping widget titles, but I see now that apparently the titles are rendering significantly lower in the test images than on macOS, which probably means they do so on Windows too. Doesn't look very good. I'll make a couple of small tweaks to hopefully make it look better.

Updated the images.

Copy link

sonarqubecloud bot commented May 8, 2025

@rolfsmeds
Copy link
Contributor Author

Header content alignment was changed to support wrapping widget titles, but I see now that apparently the titles are rendering significantly lower in the test images than on macOS, which probably means they do so on Windows too. Doesn't look very good. I'll make a couple of small tweaks to hopefully make it look better.

Updated the images.

LGTM

@@ -85,8 +85,8 @@ export const DashboardLayoutMixin = (superClass) =>
--_vaadin-dashboard-row-height: minmax(var(--_vaadin-dashboard-row-min-height, auto), auto);

display: grid;
overflow: auto;
height: 100%;
overflow: hidden;
Copy link
Member

Choose a reason for hiding this comment

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

Why overflow: hidden here? Wouldn't the default visible work fine? I know it’s unlikely, but perhaps some developer really needs very large shadows on the cards, and makes sure they are visible by adding padding on the host. If this internal element hides overflow, the shadows will be clipped.

And now I realize that `--vaadin-dashboard-padding is on this element as well, not the host – why?

Copy link
Member

Choose a reason for hiding this comment

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

Btw, I don't see the need to prefix the internal custom properties with vaadin-dashboard (e.g., --_vaadin-dashboard-default-row-min-width vs --_default-row-min-width). Just adds noise IMO.

Copy link
Member

Choose a reason for hiding this comment

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

Looks like flat widgets still have a shadow, which it shouldn't.

Copy link
Member

Choose a reason for hiding this comment

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

Similarly here, I wouldn't prefix the internal custom properties with vaadin-dashboard-widget.

Copy link
Member

Choose a reason for hiding this comment

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

Remind me again how the elevated style should differ from the default style. Now I don't really see the difference.

@@ -23,7 +23,7 @@ export const DashboardLayoutMixin = (superClass) =>
return css`
:host {
display: block;
overflow: hidden;
overflow: auto;
width: 100%;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
width: 100%;
box-sizing: border-box;
width: 100%;

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.

Elevated and Flat Dashboard Widget styles Dashboard: style variant for wrapping widget titles
3 participants