5 A dropdown menu that sticks to the bottom of the screen on small devices, and becomes a dropdown menu on larger devices.
8 /// @Foundation.settings
10 $actionsheet-background: white !default;
11 $actionsheet-border-color: #ccc !default;
12 $actionsheet-animate: transform opacity !default;
13 $actionsheet-animation-speed: 0.25s !default;
14 $actionsheet-width: 300px !default;
15 $actionsheet-radius: 4px !default;
16 $actionsheet-shadow: 0 -3px 10px rgba(black, 0.25) !default;
17 $actionsheet-padding: $global-padding !default;
18 $actionsheet-tail-size: 10px !default;
20 $actionsheet-popup-shadow: 0 0 10px rgba(black, 0.25) !default;
22 $actionsheet-link-color: #000 !default;
23 $actionsheet-link-background-hover: smartscale($actionsheet-background) !default;
27 Styles for the list inside an action sheet.
28 Don't include this mixin if you want to build custom controls inside the sheet.
30 @mixin action-sheet-menu(
31 $padding: $actionsheet-padding,
32 $color: $actionsheet-link-color,
33 $border-color: $actionsheet-border-color,
34 $background-hover: $actionsheet-link-background-hover
40 list-style-type: none;
43 // If the menu has no content above it
45 margin-top: -$padding;
55 padding: $padding * 0.8;
58 border-top: 1px solid $border-color;
62 background: $background-hover;
77 Styles for the action sheet container. Action sheets pin to the top or bottom of the screen.
81 $shadow: $actionsheet-shadow,
82 $animate: $actionsheet-animate,
83 $animation-speed: $actionsheet-animation-speed,
84 $padding: $actionsheet-padding,
85 $background: $actionsheet-background
92 background: $background;
94 transition-property: $animate;
95 transition-duration: $animation-speed;
96 transition-timing-function: ease-out;
98 @if hasvalue($shadow) {
103 @if $position == bottom {
105 transform: translateY(100%);
108 transform: translateY(0%);
111 // These two don't quite work as planned yet
112 @else if $position == top {
114 transform: translateY(-100%);
117 transform: translateY(0%);
124 $background: $actionsheet-background,
125 $width: $actionsheet-width,
126 $radius: $actionsheet-radius,
127 $shadow: $actionsheet-popup-shadow,
128 $tail-size: $actionsheet-tail-size
136 border-radius: $radius;
138 pointer-events: none;
143 @if hasvalue($shadow) {
152 pointer-events: auto;
158 &::before, &::after {
165 border-left: $tail-size solid transparent;
166 border-right: $tail-size solid transparent;
167 margin-left: -($tail-size);
173 @if $position == bottom {
176 transform: translateX(-50%) translateY(110%);
178 transform: translateX(-50%) translateY(100%);
181 &::before, &::after {
185 border-bottom: $tail-size solid $background;
188 top: -($tail-size + 2);
189 border-bottom-color: rgba(black, 0.15);
193 @else if $position == top {
196 transform: translateX(-50%) translateY(-120%);
198 transform: translateX(-50%) translateY(-110%);
201 &::before, &::after {
203 bottom: -($tail-size);
204 border-top: $tail-size solid $background;
208 bottom: -($tail-size + 2);
209 border-top-color: rgba(black, 0.15);
214 @include exports(action-sheet) {
215 .action-sheet-container {
217 display: inline-block;
225 @include action-sheet;
226 @include action-sheet-menu;
228 @include breakpoint(medium) {
232 @include popup-menu(top);
237 background: $primary-color;
238 color: isitlight($primary-color);
240 &::before { display: none; }
241 &::before, &::after { border-top-color: $primary-color; }
242 &.top::before, &.top::after { border-bottom-color: $primary-color; }
244 @include action-sheet-menu(
245 $color: isitlight($primary-color),
246 $border-color: smartscale($primary-color, 10%),
247 $background-hover: smartscale($primary-color)
251 background: $dark-color;
252 color: isitlight($dark-color);
254 &::before { display: none; }
255 &::before, &::after { border-top-color: $dark-color; }
256 &.top::before, &.top::after { border-bottom-color: $dark-color; }
258 @include action-sheet-menu(
259 $color: isitlight($dark-color),
260 $border-color: smartscale($dark-color, 10%),
261 $background-hover: smartscale($dark-color)