Skip to content

Commit

Permalink
TCI-1133: mobile theme on trigger container (#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
melwong-jcc committed Aug 24, 2023
1 parent 08425a7 commit 34b823c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions source/_patterns/03-organisms/offcanvas/_offcanvas.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ $_config: map-merge-by-keys($_config_schemes, base, $_config_schemes, $scheme);
@include u-margin-bottom(4);
}

&.mobile {
.block {
width: 50%;
&:only-child {
@include u-width(full);
}
}
}

&.open {
@include u-display(block);
@include u-margin-bottom(0);
Expand All @@ -104,13 +113,6 @@ $_config: map-merge-by-keys($_config_schemes, base, $_config_schemes, $scheme);
a, iframe {
@include u-width(full, !important);
}

&--mobile {
width: 50%;
&:only-child {
@include u-width(full);
}
}
}

%jcc-button {
Expand Down
4 changes: 2 additions & 2 deletions source/_patterns/03-organisms/offcanvas/offcanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ const autoDesktopDialogHeight = () => {
const triggersAdjust = (state) => {
if (state) {
$(triggerContainer).attr("style", "width: " + $(window).width() + "px");
$(offcanvas_triggers).addClass("block--mobile");
$(triggerContainer).addClass("mobile");
} else {
$(triggerContainer).removeAttr("style");
$(offcanvas_triggers).removeClass("block--mobile");
$(triggerContainer).removeClass("mobile");
}
}

Expand Down

0 comments on commit 34b823c

Please sign in to comment.