-
Notifications
You must be signed in to change notification settings - Fork 72
feat: Allow customizing Spreadsheet via part names and css properties #8228
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?
Conversation
DiegoCardoso
left a comment
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.
Added some tests and made a suggestion about one of the parts's name.
...spreadsheet-flow-client/src/main/java/com/vaadin/addon/spreadsheet/client/SheetTabSheet.java
Show resolved
Hide resolved
| vaadin-spreadsheet.custom { | ||
| --vaadin-spreadsheet-header-border-color: #add8e6; | ||
| --vaadin-spreadsheet-border-color: unset; | ||
| --vaadin-spreadsheet-cell-border-color: #add8e6; | ||
| } No newline at end of file |
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.
The properties should also work if defined on an ancestor element:
html {
/* Works */
--vaadin-checkbox-label-color: red;
/* Doesn't work */
--vaadin-spreadsheet-header-border-color: red;
--vaadin-spreadsheet-border-color: red;
--vaadin-spreadsheet-cell-border-color: red;
}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 catch! I refactored it to use private CSS properties as we do in other components. PTAL
| scrollEnd.setClassName("scroll-tabs-end"); | ||
| scrollEnd.setAttribute("part", "scroll-tab scroll-tab-end"); |
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.
Is it intentional that the class name is plural but the part name isn't?
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.
Yes, I think plural is odd in the original class names.
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.
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.
The listing was added later by me, BTW.
|
| border-bottom: 2px solid #add8e6; | ||
| } | ||
|
|
||
| vaadin-spreadsheet.custom::part(column-header selected-header) { |
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.
The "selected-header" part name seems to be set incorrectly to the column headers






Add the following list of parts to the internal elements to enable customization without injecting CSS in the shadow root of the
<vaadin-spreadsheet>component:vaadin-spreadsheet::part(formula-field)vaadin-spreadsheet::part(address-field)vaadin-spreadsheet::part(popup-button)vaadin-spreadsheet::part(selection-corner)vaadin-spreadsheet::part(scroll-tab)vaadin-spreadsheet::part(scroll-tab-start)vaadin-spreadsheet::part(scroll-tab-end)vaadin-spreadsheet::part(scroll-tab-left)vaadin-spreadsheet::part(scroll-tab-right)vaadin-spreadsheet::part(add-new-tab)vaadin-spreadsheet::part(tabsheet-tab)vaadin-spreadsheet::part(selected-tab)vaadin-spreadsheet::part(cell-input)vaadin-spreadsheet::part(cell)vaadin-spreadsheet::part(comment-triangle)Also adds the following CSS properties:
--vaadin-spreadsheet-border-color--vaadin-spreadsheet-cell-border-color--vaadin-spreadsheet-header-border-color--vaadin-spreadsheet-text-colorFixes #8143