Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

fix(list): fix checkbox alignment and match dense heights to spec #11971

Merged
merged 1 commit into from
Jul 22, 2020
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
2 changes: 0 additions & 2 deletions src/components/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ $button-fab-mini-line-height: rem(4.00) !default;

$button-fab-toast-offset: $button-fab-height * 0.75 !default;

$icon-button-height: rem(4.000) !default;
$icon-button-width: rem(4.000) !default;
$icon-button-margin: rem(0.600) !default;

// Fix issue causing buttons in Firefox to be 2px bigger than they should
Expand Down
34 changes: 26 additions & 8 deletions src/components/list/list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $list-item-height: 6 * $baseline-grid !default;
$list-item-two-line-height: 9 * $baseline-grid !default;
$list-item-three-line-height: 11 * $baseline-grid !default;

$list-item-dense-height: 12 * $dense-baseline-grid !default;
$list-item-dense-height: 10 * $dense-baseline-grid !default;
$list-item-dense-two-line-height: 15 * $dense-baseline-grid !default;
$list-item-dense-three-line-height: 19 * $dense-baseline-grid !default;
$list-item-dense-primary-icon-width: $dense-baseline-grid * 5 !default;
Expand All @@ -48,7 +48,7 @@ md-list {
line-height: $list-header-line-height;
}

&.md-dense {
&.md-dense:not(.md-dense-disabled) {
md-list-item {
&,
.md-list-item-inner {
Expand All @@ -65,15 +65,28 @@ md-list {

> md-icon:first-child:not(.md-avatar-icon) {
@include rtl-prop(margin-right, margin-left, $list-item-primary-width - $list-item-dense-primary-icon-width, auto);
margin-top: $dense-baseline-grid;
margin-bottom: $dense-baseline-grid;
}
.md-avatar, .md-avatar-icon {
@include rtl-prop(margin-right, margin-left, $list-item-primary-width - $list-item-dense-primary-avatar-width, auto);
margin-top: $dense-baseline-grid + 2px;
margin-bottom: $dense-baseline-grid + 2px;
}
.md-avatar {
flex: none;
width: $list-item-dense-primary-avatar-width;
height: $list-item-dense-primary-avatar-width;
}
.md-secondary-container {
.md-secondary.md-button {
margin-top: $dense-baseline-grid;
margin-bottom: $dense-baseline-grid;
}
md-checkbox:not(.md-dense-disabled) {
min-height: $icon-button-height;
}
}
}

&.md-2-line,
Expand Down Expand Up @@ -123,6 +136,10 @@ md-list {
}
}
}
.md-subheader-inner {
padding-top: $dense-baseline-grid * 3;
padding-bottom: $dense-baseline-grid * 3;
}
}
}

Expand Down Expand Up @@ -277,9 +294,9 @@ md-list-item {

& > md-checkbox {
width: 3 * $baseline-grid;
@include rtl(margin-left, 3px, 29px);
@include rtl(margin-right, 29px, 3px);
margin-top: 16px;
min-height: $icon-button-height;
@include rtl(margin-left, 0px, 29px);
@include rtl(margin-right, 29px, 0px);
}

.md-secondary-container {
Expand Down Expand Up @@ -311,11 +328,12 @@ md-list-item {
}

md-checkbox {
margin-top: 0;
margin-bottom: 0;
margin: 0 6px;
padding: 0 8px;
min-height: $icon-button-height;

&:last-child {
width: 3 * $baseline-grid;
width: $icon-button-width;
@include rtl-prop(margin-right, margin-left, 0, auto);
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/core/style/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ $layout-breakpoint-sm: 960px !default;
$layout-breakpoint-md: 1280px !default;
$layout-breakpoint-lg: 1920px !default;

// Button
$button-left-right-padding: rem(0.800) !default;

// Icon
$icon-size: rem(2.400) !default;

Expand Down Expand Up @@ -119,8 +116,12 @@ $material-leave-duration: 0.3s;
$material-leave-timing-function: cubic-bezier(0.4, 0.0, 1, 1);
$material-leave: all $material-leave-duration $material-leave-timing-function;

// Button
$button-left-right-padding: rem(0.800) !default;
$icon-button-height: rem(4.000) !default;
$icon-button-width: rem(4.000) !default;

// Fab Buttons (shared between buttons.scss and fab*.scss)
// -------------------------------------------
$button-fab-width: rem(5.600) !default;
$button-fab-height: rem(5.600) !default;
$button-fab-padding: rem(1.60) !default;
Expand Down