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