mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-02 18:02:37 +02:00
Helpers & utilities split (#28445)
This commit is contained in:
5
scss/helpers/_background.scss
Normal file
5
scss/helpers/_background.scss
Normal file
@@ -0,0 +1,5 @@
|
||||
@if $enable-gradients {
|
||||
@each $color, $value in $theme-colors {
|
||||
@include bg-gradient-variant(".bg-gradient-#{$color}", $value);
|
||||
}
|
||||
}
|
3
scss/helpers/_clearfix.scss
Normal file
3
scss/helpers/_clearfix.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
.clearfix {
|
||||
@include clearfix();
|
||||
}
|
36
scss/helpers/_embed.scss
Normal file
36
scss/helpers/_embed.scss
Normal file
@@ -0,0 +1,36 @@
|
||||
// Credit: Nicolas Gallagher and SUIT CSS.
|
||||
|
||||
.embed-responsive {
|
||||
position: relative;
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
|
||||
&::before {
|
||||
display: block;
|
||||
content: "";
|
||||
}
|
||||
|
||||
.embed-responsive-item,
|
||||
iframe,
|
||||
embed,
|
||||
object,
|
||||
video {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@each $key, $ratio in $embed-responsive-aspect-ratios {
|
||||
.embed-responsive-#{$key} {
|
||||
&::before {
|
||||
padding-top: percentage(map-get($ratio, y) / map-get($ratio, x));
|
||||
}
|
||||
}
|
||||
}
|
27
scss/helpers/_position.scss
Normal file
27
scss/helpers/_position.scss
Normal file
@@ -0,0 +1,27 @@
|
||||
// stylelint-disable declaration-no-important
|
||||
|
||||
// Shorthand
|
||||
|
||||
.fixed-top {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: $zindex-fixed;
|
||||
}
|
||||
|
||||
.fixed-bottom {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: $zindex-fixed;
|
||||
}
|
||||
|
||||
.sticky-top {
|
||||
@supports (position: sticky) {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: $zindex-sticky;
|
||||
}
|
||||
}
|
8
scss/helpers/_screenreaders.scss
Normal file
8
scss/helpers/_screenreaders.scss
Normal file
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// Screenreaders
|
||||
//
|
||||
|
||||
.sr-only,
|
||||
.sr-only-focusable:not(:focus) {
|
||||
@include sr-only();
|
||||
}
|
19
scss/helpers/_stretched-link.scss
Normal file
19
scss/helpers/_stretched-link.scss
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Stretched link
|
||||
//
|
||||
|
||||
.stretched-link {
|
||||
&::after {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
// Just in case `pointer-events: none` is set on a parent
|
||||
pointer-events: auto;
|
||||
content: "";
|
||||
// IE10 bugfix, see https://stackoverflow.com/questions/16947967/ie10-hover-pseudo-class-doesnt-work-without-background-color
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
}
|
7
scss/helpers/_text.scss
Normal file
7
scss/helpers/_text.scss
Normal file
@@ -0,0 +1,7 @@
|
||||
//
|
||||
// Text
|
||||
//
|
||||
|
||||
.text-truncate {
|
||||
@include text-truncate;
|
||||
}
|
Reference in New Issue
Block a user