-
Notifications
You must be signed in to change notification settings - Fork 87
experiment: add upload base styles and visual tests #9691
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
Conversation
Agreed with @anezthes to refactor the vaadin-upload-file layout to use CSS grid instead of nested flex containers. |
Done. |
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.
Good to go. Needs visual tests.
|
New Upload base style
Drag enabled (above), drag disabled (below).

"Dragover valid"

Supported custom properties
--vaadin-upload-background
--vaadin-upload-border
--vaadin-upload-border-color
--vaadin-upload-border-radius
--vaadin-upload-border-width
--vaadin-upload-gap
--vaadin-upload-padding
Drop label
--vaadin-upload-drop-label-color
--vaadin-upload-drop-label-font-size
--vaadin-upload-drop-label-font-weight
--vaadin-upload-drop-label-gap
--vaadin-upload-drop-label-line-height
Drop/upload icon
--vaadin-upload-icon-color
File
--vaadin-upload-file-gap
--vaadin-upload-file-padding
File Icons
--vaadin-upload-file-done-color
--vaadin-upload-file-warning-color
File Name
--vaadin-upload-file-name-color
--vaadin-upload-file-name-font-size
--vaadin-upload-file-name-font-weight
--vaadin-upload-file-name-line-height
File Status
--vaadin-upload-file-status-color
--vaadin-upload-file-status-font-size
--vaadin-upload-file-status-font-weight
--vaadin-upload-file-status-line-height
File Error Message
--vaadin-upload-file-error-color
--vaadin-upload-file-error-font-size
--vaadin-upload-file-error-font-weight
--vaadin-upload-file-error-line-height
File Buttons
--vaadin-upload-file-button-background
--vaadin-upload-file-button-border
--vaadin-upload-file-button-border-color
--vaadin-upload-file-button-border-radius
--vaadin-upload-file-button-border-width
--vaadin-upload-file-button-font-family
--vaadin-upload-file-button-font-size
--vaadin-upload-file-button-font-weight
--vaadin-upload-file-button-height
--vaadin-upload-file-button-line-height
--vaadin-upload-file-button-padding
--vaadin-upload-file-button-text-color
File List
--vaadin-upload-file-list-border
--vaadin-upload-file-list-border-color
--vaadin-upload-file-list-border-width
Concerns
gap: var(--vaadin-gap-container-inline);
directly instead of defining a dedicated custom property — for example, in theprimary-buttons
andinfo
parts.gap
property for themeta
part, although I could see it being useful. It’s a bit tricky to determine what’s necessary versus what’s superfluous.I apply padding to theSwitched to grid.meta
part using[part='done-icon'][hidden] + [part='warning-icon'][hidden] ~ [part='meta']
. I’m not a fan of forcing visibility on one of the hidden icons (as is done in Lumo), but I’m also not entirely happy with thecalc
used here. Switching togrid
might be a cleaner solution.The gap onMoved gap to margin-top on the first file list item.vaadin-upload
creates some extra space at the bottom. The solution is to hide the list when it's empty, but as far as I know, there's no equivalent ofvaadin-upload-file-list:not(:has(vaadin-upload-file))
that works in Shadow DOM.