-
Notifications
You must be signed in to change notification settings - Fork 87
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
base: main
Are you sure you want to change the base?
Dashboard style update #8962
Changes from all commits
e5cf364
6594cd7
ec3d273
4ecafdb
df14465
4a0f724
8972bb7
75ead65
24cd287
8693c92
8cdd0e9
e571cc3
a7439f0
c79aec8
051daee
6246c69
52b4ccc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,10 +68,19 @@ import { DashboardSection } from './vaadin-dashboard-section.js'; | |
* | ||
* The following custom properties are available: | ||
* | ||
* Custom Property | Description | ||
* ----------------------------------|------------- | ||
* `--vaadin-dashboard-item-colspan` | colspan of the widget | ||
* `--vaadin-dashboard-item-rowspan` | rowspan of the widget | ||
* Custom Property | Description | ||
* --------------------------------------------|---------------------- | ||
* `--vaadin-dashboard-item-colspan` | colspan of the widget | ||
* `--vaadin-dashboard-item-rowspan` | rowspan of the widget | ||
* `--vaadin-dashboard-widget-background` | widget background | ||
* `--vaadin-dashboard-widget-border-radius` | widget corner radius | ||
* `--vaadin-dashboard-widget-border-width` | widget border width | ||
* `--vaadin-dashboard-widget-border-color` | widget border color | ||
* `--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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should also add the new properties to the TS file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added them. |
||
* `--vaadin-dashboard-widget-title-wrap` | widget title wrap | ||
* | ||
* The following state attributes are available for styling: | ||
* | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -57,19 +57,20 @@ const dashboardWidgetAndSection = css` | |||
|
||||
header { | ||||
display: flex; | ||||
align-items: center; | ||||
align-items: start; | ||||
box-sizing: border-box; | ||||
justify-content: space-between; | ||||
gap: var(--lumo-space-xs); | ||||
} | ||||
|
||||
[part='title'] { | ||||
flex: 1; | ||||
color: var(--lumo-header-text-color); | ||||
margin: 0; | ||||
white-space: nowrap; | ||||
white-space: var(--vaadin-dashboard-widget-title-wrap, wrap); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to be missing from the property list. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added this property. |
||||
text-overflow: ellipsis; | ||||
overflow: hidden; | ||||
line-height: var(--lumo-line-height-s); | ||||
margin: 0; | ||||
align-self: safe center; | ||||
} | ||||
|
||||
vaadin-dashboard-button { | ||||
|
@@ -110,6 +111,7 @@ const dashboardWidgetAndSection = css` | |||
[part~='remove-button'] { | ||||
cursor: pointer; | ||||
--icon: var(--lumo-icons-cross); | ||||
margin-inline-start: var(--lumo-space-xs); | ||||
} | ||||
|
||||
/* Mode controls */ | ||||
|
@@ -144,23 +146,35 @@ const dashboardWidget = css` | |||
:host { | ||||
background: var(--_vaadin-dashboard-widget-background); | ||||
border-radius: var(--_vaadin-dashboard-widget-border-radius); | ||||
--_border-shadow: 0 0 0 var(--_vaadin-dashboard-widget-border-width) var(--_vaadin-dashboard-widget-border-color); | ||||
--_shadow: var(--_vaadin-dashboard-widget-shadow); | ||||
box-shadow: var(--_shadow), var(--_border-shadow); | ||||
box-shadow: var(--_vaadin-dashboard-widget-shadow); | ||||
position: relative; | ||||
} | ||||
|
||||
:host::before { | ||||
content: ''; | ||||
display: block; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
|
||||
position: absolute; | ||||
inset: calc(-1 * var(--_vaadin-dashboard-widget-border-width)); | ||||
border: var(--_vaadin-dashboard-widget-border-width) solid var(--_vaadin-dashboard-widget-border-color); | ||||
border-radius: calc(var(--_vaadin-dashboard-widget-border-radius) + var(--_vaadin-dashboard-widget-border-width)); | ||||
pointer-events: none; | ||||
} | ||||
|
||||
/* Widget states */ | ||||
|
||||
:host([editable]) { | ||||
--_shadow: var(--_vaadin-dashboard-widget-editable-shadow); | ||||
--_vaadin-dashboard-widget-shadow: var(--_vaadin-dashboard-widget-editable-shadow); | ||||
--_vaadin-dashboard-widget-border-color: var(--lumo-contrast-20pct); | ||||
--_vaadin-dashboard-widget-border-width: 1px; | ||||
} | ||||
|
||||
:host([focused]) { | ||||
--_border-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color); | ||||
:host([focused])::before { | ||||
border-width: var(--_focus-ring-width); | ||||
border-color: var(--_focus-ring-color); | ||||
} | ||||
|
||||
:host([selected]) { | ||||
--_shadow: var(--_vaadin-dashboard-widget-selected-shadow); | ||||
--_vaadin-dashboard-widget-shadow: var(--_vaadin-dashboard-widget-selected-shadow); | ||||
background: var(--lumo-primary-color-10pct); | ||||
} | ||||
|
||||
|
@@ -179,8 +193,7 @@ const dashboardWidget = css` | |||
|
||||
header { | ||||
min-height: var(--lumo-size-l); | ||||
padding: 0 var(--lumo-space-m); | ||||
border-bottom: 1px solid var(--lumo-contrast-10pct); | ||||
padding: var(--lumo-space-xs) var(--lumo-space-m); | ||||
} | ||||
|
||||
:host([editable]) header { | ||||
|
@@ -194,7 +207,16 @@ const dashboardWidget = css` | |||
|
||||
#content { | ||||
min-height: var(--lumo-size-m); | ||||
padding: var(--lumo-space-s); | ||||
padding: var(--vaadin-dashboard-widget-padding, 0); | ||||
padding-top: 0; | ||||
border-radius: inherit; | ||||
border-top-left-radius: 0; | ||||
border-top-right-radius: 0; | ||||
overflow: hidden; | ||||
} | ||||
|
||||
::slotted([slot='header-content']) { | ||||
align-self: center; | ||||
} | ||||
|
||||
:host([resize-mode]) #content, | ||||
|
There was a problem hiding this comment.
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
?