-
Notifications
You must be signed in to change notification settings - Fork 599
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
feat: Remove inline styling logic from DataGrid #6886
Closed
KingOfTac
wants to merge
10
commits into
master
from
users/kingoftac/foundation/update-grid-row-style-method
Closed
feat: Remove inline styling logic from DataGrid #6886
KingOfTac
wants to merge
10
commits into
master
from
users/kingoftac/foundation/update-grid-row-style-method
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KingOfTac
requested review from
EisenbergEffect,
chrisdholt,
bheston,
scomea and
radium-v
as code owners
January 8, 2024 19:04
awentzel
approved these changes
Jan 8, 2024
scomea
reviewed
Jan 8, 2024
packages/web-components/fast-foundation/src/data-grid/data-grid-row.ts
Outdated
Show resolved
Hide resolved
7 tasks
scomea
approved these changes
Jan 8, 2024
bheston
approved these changes
Jan 9, 2024
KingOfTac
changed the title
fix: change
feat: Remove inline styling logic from DataGrid
Jan 9, 2024
FASTDataGridRow.updateRowStyle
from a private arrow function property to protected member
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. |
janechu
deleted the
users/kingoftac/foundation/update-grid-row-style-method
branch
June 14, 2024 17:10
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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