Skip to content

Commit

Permalink
feat(tooltip): Force the bubble to display to the left at small break…
Browse files Browse the repository at this point in the history
…points
  • Loading branch information
ryanoglesby08 committed Oct 4, 2017
1 parent 7bc9ff8 commit 7b0546a
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions src/components/Tooltip/Tooltip.modules.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@import '../../scss/settings/colours';
@import '../../scss/settings/responsive-grid';
@import '../../scss/utility/responsive';

$bubble-trigger-size: 24px;

Expand Down Expand Up @@ -52,22 +54,42 @@ $bubble-triangle-position: $bubble-triangle-width + 5px;
}
}

.left {
composes: bubble;

@mixin left-bubble {
right: $bubble-offset * -1;

&::before {
right: $bubble-triangle-position;
}
}

.left {
composes: bubble;

@include left-bubble;
}

.right {
composes: bubble;
}

left: calc(100% - #{$bubble-trigger-size} - #{$bubble-offset});
@include at-breakpoint(xs) {
.right {
@include left-bubble;
}
}

&::before {
left: $bubble-triangle-position;
@include at-breakpoint(small) {
.right {
@include left-bubble;
}
}

@include from-breakpoint(medium) {
.right {
left: calc(100% - #{$bubble-trigger-size} - #{$bubble-offset});

&::before {
left: $bubble-triangle-position;
}
}
}

0 comments on commit 7b0546a

Please sign in to comment.