Skip to content

Commit

Permalink
[ResourceList] Make se23 styles the default
Browse files Browse the repository at this point in the history
  • Loading branch information
jesstelford committed Aug 15, 2023
1 parent 805cf5c commit 5bb9000
Showing 1 changed file with 33 additions and 80 deletions.
113 changes: 33 additions & 80 deletions polaris-react/src/components/ResourceList/ResourceList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,14 @@ $item-wrapper-loading-height: 64px;
}

.FiltersWrapper {
padding: var(--p-space-3) var(--p-space-3) var(--p-space-4);
padding: var(--p-space-3);

@media #{$p-breakpoints-sm-up} {
padding: var(--p-space-4);
}

#{$se23} & {
padding: var(--p-space-3);

@media #{$p-breakpoints-sm-up} {
padding: var(--p-space-3);
}
}

+ .ResourceList {
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);

#{$se23} & {
border-top: none;
@include item-separator;
}
@include item-separator;
}
}

Expand All @@ -49,12 +36,7 @@ $item-wrapper-loading-height: 64px;
border-top-right-radius: var(--p-border-radius-2);

+ .ResourceList {
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);

#{$se23} & {
border-top: none;
@include item-separator;
}
@include item-separator;
}
}

Expand All @@ -77,55 +59,41 @@ $item-wrapper-loading-height: 64px;
.HeaderWrapper {
position: relative;
display: flex;
align-items: flex-start;
width: 100%;
min-height: resource-list(header-min-height);
padding: calc(var(--p-space-3) - var(--p-space-05)) var(--p-space-5);
background-color: var(--p-color-bg);
border-radius: var(--p-border-radius-2);
#{$se23} & {
// This container conditionally includes a Select component for sorting
// It's 32px above md-up and 36px below
// This hardcoded min-height is to ensure the Select has uniform padding when it's 36px high
min-height: 52px;
align-items: center;
padding: var(--p-space-2) var(--p-space-3);
// We reduce the min-height here to account for the Select shrinking to 32px at this breakpoint.
@media #{$p-breakpoints-md-up} {
min-height: 48px;
}
// This container conditionally includes a Select component for sorting
// It's 32px above md-up and 36px below
// This hardcoded min-height is to ensure the Select has uniform padding when it's 36px high
min-height: 52px;
align-items: center;
padding: var(--p-space-2) var(--p-space-3);
// We reduce the min-height here to account for the Select shrinking to 32px at this breakpoint.
@media #{$p-breakpoints-md-up} {
min-height: 48px;
}
}

.HeaderWrapper-isSticky {
box-shadow: var(--p-shadow-md);

#{$se23} & {
box-shadow: var(--p-shadow-xs);
border-radius: 0;
}
box-shadow: var(--p-shadow-xs);
border-radius: 0;
}

.HeaderContentWrapper {
position: absolute;
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
z-index: resource-list(content-wrapper-stacking-order);
right: var(--p-space-5);
left: var(--p-space-5);
right: var(--p-space-3);
left: var(--p-space-3);
// Regardless of the variable height of the content
// we just want it to be center aligned.
top: 0;
bottom: 0;
display: flex;
min-height: resource-list(header-content-min-height);
opacity: 1;
transition: opacity var(--p-motion-ease) var(--p-motion-duration-200);

#{$se23} & {
right: var(--p-space-3);
left: var(--p-space-3);
// Regardless of the variable height of the content
// we just want it to be center aligned.
top: 0;
bottom: 0;
align-items: center;
}
align-items: center;

.HeaderWrapper-inSelectMode & {
opacity: 0;
Expand Down Expand Up @@ -222,33 +190,23 @@ $item-wrapper-loading-height: 64px;
z-index: resource-list(bulk-actions-wrapper-stacking-order);
width: 100%;

// se23: This is the initial value of flex, is there something else that mutates this in other components?
@media #{$p-breakpoints-sm-up} {
flex: 0 1 auto;
align-self: flex-start;
}
/*
We do not want to worry about setting the height and width explicitly.
We want to inherits the height and width of its child (in this case the SelectAllActions component).
#{$se23} & {
/*
We do not want to worry about setting the height and width explicitly.
We want to inherits the height and width of its child (in this case the SelectAllActions component).
We do this using flexbox because "the cross size of each flex container is the minimum size necessary to contain the flex items" as per the spec.
https://www.w3.org/TR/css-flexbox-1/#flex-lines
*/
display: flex;
align-self: auto;
}
We do this using flexbox because "the cross size of each flex container is the minimum size necessary to contain the flex items" as per the spec.
https://www.w3.org/TR/css-flexbox-1/#flex-lines
*/
display: flex;
align-self: auto;
}

.CheckableButtonWrapper {
display: none;

#{$se23} & {
// Checkable button has no opinion on its height, so we just fill the
// container
height: 100%;
}
// Checkable button has no opinion on its height, so we just fill the
// container
height: 100%;

@media #{$p-breakpoints-sm-up} {
flex: 1;
Expand Down Expand Up @@ -303,12 +261,7 @@ $item-wrapper-loading-height: 64px;
max-width: 100%;

+ .ItemWrapper {
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);

#{$se23} & {
border-top: none;
@include item-separator;
}
@include item-separator;
}
}

Expand Down

0 comments on commit 5bb9000

Please sign in to comment.