Skip to content
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

DataViews: Add missing styles and remove opinionated ones for generic usage #64711

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
}
}

.dataviews-settings-section:has(.dataviews-settings-section__content:empty) {
display: none;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can define fields that can't be hidden and if all your fields are non hideable, the "properties" section of the view config should be hidden entirely.


/* stylelint-disable-next-line scss/at-rule-no-unknown -- '@container' not globally permitted */
@container (max-width: 500px) {
.dataviews-settings-section.dataviews-settings-section {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ export const fields = [
id: 'title',
enableHiding: false,
enableGlobalSearch: true,
render: ( { item } ) => {
return <a href="#nothing">{ item.title }</a>;
},
},
{
id: 'date',
Expand Down
1 change: 1 addition & 0 deletions packages/dataviews/src/dataviews-layouts/list/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
}

.dataviews-view-list__item {
box-sizing: border-box;
padding: $grid-unit-20 $grid-unit-30;
width: 100%;
scroll-margin: $grid-unit-10 0;
Expand Down
5 changes: 0 additions & 5 deletions packages/dataviews/src/dataviews-layouts/table/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
color: $gray-700;
margin-bottom: auto;

a {
text-decoration: none;
color: $gray-900;
font-weight: 500;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The links within the dataviews fields shouldn't be that opinionated, they should just inherit the global link styles applied in the current app.

This is the change this is the most impactful in this PR but I didn't notice any regression.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, but shouldn't we add those styles to our current usages?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems you don't see a regression because we have similar opinionated styles for dataviews-view-grid__primary-field

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I guess these were needed before the introduction of the primary fields.

th {
text-align: left;
color: $gray-900;
Expand Down
Loading