Closed KingOfTac closed 3 months ago
@awentzel @bheston @scomea I ended up moving forward with completely removing the inline styling capabilities. PR title, description, and change files have all been updated.
@awentzel @bheston @scomea I ended up moving forward with completely removing the inline styling capabilities. PR title, description, and change files have all been updated.
I am ok with it, but this is now a "notable" breaking change that should be advertised as such.
I'm going to close this as part of our work on #6951 without merging due to the fact that this is technically a breaking change which is something we want to avoid right now.
Pull Request
š Description
This PR is a first step towards better extensibility for DataGrid by making it possible to override the row's method it uses to apply the grid's column definitions to the row.I ended up removing all the inline styling logic from DataGrid and its sub components. Now that more modern CSS Grid capabilities are available since DataGrid's original implementation we can use less JS for applying the grid's layout across rows and cells in favor of these newer Grid and FAST features, namely
SubGrid
andfast-element
's CSS binding capabilities.Prior to this change DataGrid would either auto calculate the string for the rows'
grid-template-columns
property which they would apply as an inline style, or DataGrid would accept a manual value for the grid columns via itsgrid-template-columns
attribute.After this change the
grid-template-columns
attribute is removed from DataGrid along with all of the logic for creating the CSS string for the columns and rows and cells no longer apply inline styles to themselves for layout within the grid.The CSS layout for DataGrid is now something that needs to be applied by authors consuming Foundation. This ends up making DataGrid easier to style with custom layouts because extending the base class is no longer a requirement to override the default layout functionality and can instead be done entirely through styles.
Breaking changes
grid-template-columns
attribute is removed.grid-template-columns
attribute is removed.grid-template-columns
.grid-template-columns
as an inline style.grid-column
as an inline style.Layout with CSS SubGrid
š« Issues
š©āš» Reviewer Notes
I updated DataGrid's stories with the above layout examples and added a new story that behaves more like a
table
where the grid overflows horizontally with a scrollbar when it runs out of space rather than the column widths shrinking and overflowing individually.š Test Plan
Removed tests related to the inline styling. All other tests continue to pass.
ā Checklist
General
$ yarn change
Component-specific
ā Next Steps