#Z-Index
These are utility classes that specify the z-index of elements.
Class | Styles |
---|---|
u-z-0 |
|
u-z-1 |
|
u-z-10 |
|
u-z-20 |
|
u-z-30 |
|
u-z-40 |
|
u-z-50 |
|
u-z-n1 |
|
These are utility classes that specify the z-index of elements.
Class | Styles |
---|---|
u-z-0 |
|
u-z-1 |
|
u-z-10 |
|
u-z-20 |
|
u-z-30 |
|
u-z-40 |
|
u-z-50 |
|
u-z-n1 |
|
Below is a demo of all supported z-index utility classes.
The div with u-z-n1
is up there somewhere.
And of course...
<div class="u-z-50 ...">50</div>
<div class="u-z-40 ...">40</div>
<div class="u-z-30 ...">30</div>
<div class="u-z-20 ...">20</div>
<div class="u-z-10 ...">10</div>
<div class="u-z-1 ...">1</div>
<div class="u-z-0 ...">0</div>
<div class="u-z-n1 ...">-1</div>
<div class="u-z-auto ...">auto</div>
⚠ Note that the viewport variants are disabled in the default build of Cirrus. To enable, you must enable it yourself in
_configs.scss
and create a custom build or enable it in the config in your Sass project.//_configs.scss $config: ( viewports: ( flags.$ZINDEX: true, ) ) !default;
To use the viewport variant of a given class, you just need to suffix each class with a viewport selector. For example, if I only want u-z-20
to be applied to some element for lg
and above, then I would use the u-z-20-lg
class.
<div class="u-z-20-lg">
<!-- ... -->
</div>
For more information, visit the Viewports documentation.
The classes specified above are the default utility classes for setting z-indexes. You can add, change, or remove classes within the _config.scss
file of Cirrus.
// _config.scss
$config: (
extend: (
z-index: (
25: 25,
75: 75,
)
)
) !default;
This would generate the following classes.
.u-z-25 {
z-index: 25 !important;
}
.u-z-75 {
z-index: 75 !important;
}
Learn more about how to extend Cirrus to support your use cases in the Configuration documentation.