1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-21 20:55:50 +02:00

layout/z-index.md: retrieve z-index variables on build time

This commit is contained in:
XhmikosR
2020-04-02 22:27:17 +03:00
committed by Mark Otto
parent e2efa2b764
commit 5f932ff734

View File

@@ -12,13 +12,19 @@ These higher values start at an arbitrary number, high and specific enough to id
We don't encourage customization of these individual values; should you change one, you likely need to change them all. We don't encourage customization of these individual values; should you change one, you likely need to change them all.
{{< highlight scss >}} {{< highlight scss >}}
$zindex-dropdown: 1000 !default; {{< zindex.inline >}}
$zindex-sticky: 1020 !default; {{- $file := readFile "scss/_variables.scss" -}}
$zindex-fixed: 1030 !default; {{- $matches := findRE `\$zindex\-.+;` $file -}}
$zindex-modal-backdrop: 1040 !default;
$zindex-modal: 1050 !default; {{- if (eq (len $matches) 0) -}}
$zindex-popover: 1060 !default; {{- errorf "Got no matches for $zindex- in %q!" $.Page.Path -}}
$zindex-tooltip: 1070 !default; {{- end -}}
{{- range $matches }}
{{ . | replaceRE "\\s{13}" " " }}
{{- end -}}
{{< /zindex.inline >}}
{{< /highlight >}} {{< /highlight >}}
To handle overlapping borders within components (e.g., buttons and inputs in input groups), we use low single digit `z-index` values of `1`, `2`, and `3` for default, hover, and active states. On hover/focus/active, we bring a particular element to the forefront with a higher `z-index` value to show their border over the sibling elements. To handle overlapping borders within components (e.g., buttons and inputs in input groups), we use low single digit `z-index` values of `1`, `2`, and `3` for default, hover, and active states. On hover/focus/active, we bring a particular element to the forefront with a higher `z-index` value to show their border over the sibling elements.