}
```
-See how `margin-left` wasn't printed as this mixin also accept `null` as a value. Click here for more [Sass Reference](#margin)
+See how `margin-left` wasn't printed as this mixin also accept `null` as a value. Sass Reference [here](#margin)
---
}
```
-See how `padding-left` wasn't printed as this mixin also accept `null` as a value. Click here for more [Sass Reference](#padding)
+See how `padding-left` wasn't printed as this mixin also accept `null` as a value. Sass Reference [here](#padding)
---
<div class="position-fixed-bottom"></div>
```
+#### Positioning: Usage as a Mixin
+
+```scss
+.foo {
+ @include position(fixed, 1, 2, 0, null);
+}
+```
+
+This above code will generate the below output
+
+```scss
+.foo {
+ position: fixed !important;
+ top: 1rem !important;
+ right: 2rem !important;
+ bottom: 0rem !important;
+}
+```
+
+See how `left` offset wasn't printed as this mixin also accept `null` as a value. Sass Reference [here](#position)
+
---
## Overflow
/// @type Number
$global-padding: 1rem !default;
+/// Global value used for positioning on components.
+/// @type Number
+$global-postion: 1rem !default;
+
/// Global font weight used for normal type.
/// @type Keyword | Number
$global-weight-normal: normal !default;
/// @type Number
$prototype-position-z-index: 975 !default;
-/// Position classes, by default coming through a map `$prototype-position`
+/// Position classes, by default coming through a map `$prototype-position`, whereas all the offset values are multiplied by `$global-position` which by default is equal to `1rem`.
/// @param {String} $position [] Position classes, Either `static`, `relative`, `absolute` or `fixed`
/// @param {Number} $top [null] - Top offset
/// @param {Number} $right [null] - Right offset
) {
position: $position !important;
@if $top != null {
- top: $top !important;
+ top: $top * $global-postion !important;
}
@if $right != null {
- right: $right !important;
+ right: $right * $global-postion !important;
}
@if $bottom != null {
- bottom: $bottom !important;
+ bottom: $bottom * $global-postion !important;
}
@if $left != null {
- left: $left !important;
+ left: $left * $global-postion !important;
}
}
@mixin position-fixed-top(
$z-index: $prototype-position-z-index
) {
- @include position(fixed, $top: 0, $right: 0, $left: 0);
+ @include position(fixed, 0, 0, null, 0);
z-index: $z-index;
}
@mixin position-fixed-bottom(
$z-index: $prototype-position-z-index
) {
- @include position(fixed, $right: 0, $bottom: 0, $left: 0);
+ @include position(fixed, null, 0, 0, 0);
z-index: $z-index;
}