1
0
mirror of https://github.com/locomotivemtl/locomotive-boilerplate.git synced 2026-01-15 00:55:08 +08:00
Files
locomotive-boilerplate/_assets/styles/settings/_config.zindexes.scss

45 lines
1.4 KiB
SCSS
Raw Normal View History

2023-06-08 11:48:00 +02:00
// ==========================================================================
2023-08-14 10:56:14 +02:00
// Settings / Config / Z-indexes
2023-06-08 11:48:00 +02:00
// ==========================================================================
// Timings
// ==========================================================================
$z-indexes: (
"header": 200,
"above": 1,
2023-12-11 11:00:21 +01:00
"default": 0,
2023-06-08 11:48:00 +02:00
"below": -1
);
// Default z-index for z()
$z-index-default: "above" !default;
2023-06-08 11:48:00 +02:00
// Function
// ==========================================================================
// Retrieves the z-index from the {@see $layers master list}.
//
// @link on http://css-tricks.com/handling-z-index/
//
// @param {string} $layer The name of the z-index.
// @param {number} $modifier A positive or negative modifier to apply
// to the returned z-index value.
// @throw Error if the $layer does not exist.
// @throw Warning if the $modifier might overlap another master z-index.
// @return {number} The computed z-index of $layer and $modifier.
@function z($layer: $z-index-default, $modifier: 0) {
2023-06-08 11:48:00 +02:00
@if not map-has-key($z-indexes, $layer) {
@error "Unknown master z-index layer: #{$layer}";
}
@if ($modifier >= 50 or $modifier <= -50) {
@warn "Modifier may overlap the another master z-index layer: #{$modifier}";
}
$index: map-get($z-indexes, $layer);
@return $index + $modifier;
}