X-Git-Url: https://git.danix.xyz/?a=blobdiff_plain;f=assets%2Fsass%2Fbourbon%2Fbourbon%2Flibrary%2F_position.scss;fp=assets%2Fsass%2Fbourbon%2Fbourbon%2Flibrary%2F_position.scss;h=3161757c197440e94d3a4bea195ffc632c08b4d1;hb=2d3ca553a3d3345ec8ecdf0faedc6924cd0e2f5d;hp=0000000000000000000000000000000000000000;hpb=2ae9d02fd007f6d0bab6576f8f26d66570358605;p=theme-danix.xyz.git diff --git a/assets/sass/bourbon/bourbon/library/_position.scss b/assets/sass/bourbon/bourbon/library/_position.scss new file mode 100644 index 0000000..3161757 --- /dev/null +++ b/assets/sass/bourbon/bourbon/library/_position.scss @@ -0,0 +1,62 @@ +@charset "UTF-8"; + +/// Provides a concise, one-line method for setting an element’s positioning +/// properties: `position`, `top`, `right`, `bottom` and `left`. Use a `null` +/// value to “skip” an edge of the box. +/// +/// @argument {string} $position +/// A CSS position value. +/// +/// @argument {list} $box-edge-values +/// List of lengths; accepts CSS shorthand. +/// +/// @example scss +/// .element { +/// @include position(relative, 0 null null 10em); +/// } +/// +/// // CSS Output +/// .element { +/// left: 10em; +/// position: relative; +/// top: 0; +/// } +/// +/// @example scss +/// .element { +/// @include position(absolute, 0); +/// } +/// +/// // CSS Output +/// .element { +/// position: absolute; +/// top: 0; +/// right: 0; +/// bottom: 0; +/// left: 0; +/// } +/// +/// @require {function} _is-length +/// +/// @require {function} _unpack-shorthand + +@mixin position( + $position, + $box-edge-values +) { + $box-edge-values: _unpack-shorthand($box-edge-values); + $offsets: ( + "top": nth($box-edge-values, 1), + "right": nth($box-edge-values, 2), + "bottom": nth($box-edge-values, 3), + "left": nth($box-edge-values, 4), + ); + + position: $position; + + @each $offset, $value in $offsets { + @if _is-length($value) { + #{$offset}: $value; + } + } +}