-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Update page component (and some data view elements) spacing metrics #61333
Changes from 2 commits
d45b50b
975b3b2
afc52a1
6f15aa3
dae0d7b
9dcfa7c
8599ed4
3c7a9c7
12a916f
756bb45
6d27cf4
0292095
244ffd6
1000a17
94806b1
122a91a
d8ea7e4
f466e32
efb40c9
7f7de3b
b17ba83
4145fe6
beeef7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
:root { | ||
--dataviews-padding-x: #{$grid-unit-60}; | ||
} | ||
|
||
.dataviews-wrapper { | ||
height: 100%; | ||
overflow: auto; | ||
box-sizing: border-box; | ||
scroll-padding-bottom: $grid-unit-80; | ||
container: dataviews-wrapper / inline-size; /* stylelint-disable -- '@container' not globally permitted */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that with this comment, all stylelint rules will be disabled in the code that follows. I think it is better to use .dataviews-wrapper {
/* stylelint-disable-next-line property-no-unknown -- '@container' not globally permitted */
container: dataviews-wrapper / inline-size;
}
/* stylelint-disable-next-line scss/at-rule-no-unknown -- '@container' not globally permitted */
@container (max-width: 430px) {
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh you're right! |
||
} | ||
|
||
.dataviews-filters__view-actions { | ||
box-sizing: border-box; | ||
padding: $grid-unit-20 $grid-unit-60; | ||
padding: $grid-unit-20 var(--dataviews-padding-x); | ||
flex-shrink: 0; | ||
position: sticky; | ||
left: 0; | ||
|
@@ -44,7 +49,7 @@ | |
bottom: 0; | ||
left: 0; | ||
background-color: $white; | ||
padding: $grid-unit-20 $grid-unit-60; | ||
padding: $grid-unit-20 var(--dataviews-padding-x); | ||
border-top: $border-width solid $gray-100; | ||
color: $gray-700; | ||
flex-shrink: 0; | ||
|
@@ -104,7 +109,7 @@ | |
|
||
td:first-child, | ||
th:first-child { | ||
padding-left: $grid-unit-60; | ||
padding-left: var(--dataviews-padding-x); | ||
|
||
.dataviews-view-table-header-button, | ||
.dataviews-view-table-header { | ||
|
@@ -114,7 +119,7 @@ | |
|
||
td:last-child, | ||
th:last-child { | ||
padding-right: $grid-unit-60; | ||
padding-right: var(--dataviews-padding-x); | ||
} | ||
|
||
&:last-child { | ||
|
@@ -283,7 +288,7 @@ | |
margin-bottom: $grid-unit-30; | ||
grid-template-columns: repeat(2, minmax(0, 1fr)) !important; | ||
grid-template-rows: max-content; | ||
padding: 0 $grid-unit-60; | ||
padding: 0 var(--dataviews-padding-x); | ||
|
||
@include break-xlarge() { | ||
grid-template-columns: repeat(3, minmax(0, 1fr)) !important; // Todo: eliminate !important dependency | ||
|
@@ -546,7 +551,7 @@ | |
|
||
.dataviews-no-results, | ||
.dataviews-loading { | ||
padding: 0 $grid-unit-60; | ||
padding: 0 var(--dataviews-padding-x); | ||
flex-grow: 1; | ||
display: flex; | ||
align-items: center; | ||
|
@@ -804,10 +809,9 @@ | |
} | ||
} | ||
|
||
@container (max-width: 430px) { /* stylelint-disable -- '@container' not yet globally permitted */ | ||
.dataviews-pagination, | ||
.dataviews-filters__view-actions { | ||
padding: $grid-unit-20 $grid-unit-30; | ||
@container (max-width: 430px) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jameskoster @youknowriad @jasmussen Would it make sense to update this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The question seems to be what makes sense for DataViews component when used in isolation (storybook can be a good way to think about this). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, I think the instinct to find a rule that makes this value feel less arbitrary is valid enough in terms of the component system. But honestly I'd love to move all of the UI towards something better than the 480/600/782px values that currently make up the breakpoints. Those seem perhaps even more arbitrary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should probably be informed by whatever we come up with in #53617. |
||
* { | ||
--dataviews-padding-x: #{$grid-unit-30}; | ||
} | ||
|
||
.dataviews-filters__view-actions { | ||
|
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 I don't like about random CSS variables is that they kind of become official public APIs. Is there a way to achieve the same with SASS variables or something?
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 don't think it's possible to do this with sass vars.