-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Update Pages preview field display #57919
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
Size Change: +64 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
width: $grid-unit-50; | ||
height: $grid-unit-50; | ||
display: block; | ||
.dataviews-view-table { |
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.
What do we need this for? I presume so these styles are only used in the table layout? Can we perhaps add the .edit-site-page-pages_media-wrapper
class (or a different one) to the span
in the page-pages/index.js component only if the table layout is in use?
I think it's best if the consumers (Pages, Templates, etc.) don't use dataviews' classes, because they can change. In general, we avoid making classes "public API".
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.
You mean the specificity? Yes it's because the styles should only be applied in table layout. List layout already adds these styles on behalf of the consumer.
Can we perhaps add the .edit-site-page-pages_media-wrapper class (or a different one) to the span in the page-pages/index.js component only if the table layout is in use?
Let me see if I can do that.
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.
I can take a look at this and push to the branch tomorrow morning as well.
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.
I got it working, but there's no doubt a better way so feel free to push any improvements.
Fixes #57649.
What?
Ensures the preview/media field display for pages is consistent across layouts.
Why?
Currently they are inconsistent:
This PR fixes that inconsistency:
How?
The pages preview/media field output now includes a wrapper to which the required styles are attached.
Note
The styles to achieve the consistent display are applied differently;
I don't know this this is ideal, it might be better to apply the table layout media styles globally, but I believe that's a larger change.