Skip to content

Commit

Permalink
fix(@clayui/css): Mixins update sheet-footer-btn-block to use `clay…
Browse files Browse the repository at this point in the history
…-css` pattern

issue #3987
  • Loading branch information
pat270 committed Jul 19, 2021
1 parent 64c20ca commit 5523b67
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 10 deletions.
16 changes: 15 additions & 1 deletion packages/clay-css/src/scss/cadmin/variables/_sheets.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,21 @@ $cadmin-sheet-footer-btn-block-sm-down: () !default;
$cadmin-sheet-footer-btn-block-sm-down: map-deep-merge(
(
breakpoint-down: sm,
btn-margin-bottom-mobile: 16px,
mobile: (
display: block,
btn: (
display: block,
margin-bottom: 16px,
width: 100%,
),
btn-group: (
display: block,
),
btn-group-item: (
display: block,
margin-right: 0,
),
),
),
$cadmin-sheet-footer-btn-block-sm-down
);
Expand Down
29 changes: 21 additions & 8 deletions packages/clay-css/src/scss/mixins/_sheet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,38 @@

$breakpoint-down: map-get($map, breakpoint-down);

$btn-margin-bottom-mobile: map-get($map, btn-margin-bottom-mobile);
$mobile: setter(map-get($map, mobile), ());

$btn-mobile: setter(map-get($mobile, btn), ());
$btn-mobile: map-merge(
$btn-mobile,
(
margin-bottom:
setter(
map-get($map, btn-margin-bottom-mobile),
map-get($btn-mobile, margin-bottom)
),
)
);

$btn-group-mobile: setter(map-get($mobile, btn-group), ());

$btn-group-item-mobile: setter(map-get($mobile, btn-group-item), ());

@if ($enabled) {
@include media-breakpoint-down($breakpoint-down) {
display: block;
@include clay-css($mobile);

.btn {
display: block;
margin-bottom: $btn-margin-bottom-mobile;
width: 100%;
@include clay-css($btn-mobile);
}

.btn-group {
display: block;
@include clay-css($btn-group-mobile);
}

.btn-group-item {
display: block;
margin-right: 0;
@include clay-css($btn-group-item-mobile);
}
}
}
Expand Down
16 changes: 15 additions & 1 deletion packages/clay-css/src/scss/variables/_sheets.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,21 @@ $sheet-footer-btn-block-sm-down: () !default;
$sheet-footer-btn-block-sm-down: map-deep-merge(
(
breakpoint-down: sm,
btn-margin-bottom-mobile: 1rem,
mobile: (
display: block,
btn: (
display: block,
margin-bottom: 1rem,
width: 100%,
),
btn-group: (
display: block,
),
btn-group-item: (
display: block,
margin-right: 0,
),
),
),
$sheet-footer-btn-block-sm-down
);
Expand Down

0 comments on commit 5523b67

Please sign in to comment.