1
0
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:
Martijn Cuppens
2019-05-23 11:56:03 +02:00
committed by GitHub
parent a4a04cd9ec
commit 769c8d8246
40 changed files with 957 additions and 449 deletions

View File

@@ -0,0 +1,5 @@
@if $enable-gradients {
@each $color, $value in $theme-colors {
@include bg-gradient-variant(".bg-gradient-#{$color}", $value);
}
}

View File

@@ -0,0 +1,3 @@
.clearfix {
@include clearfix();
}

36
scss/helpers/_embed.scss Normal file
View 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));
}
}
}

View 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;
}
}

View File

@@ -0,0 +1,8 @@
//
// Screenreaders
//
.sr-only,
.sr-only-focusable:not(:focus) {
@include sr-only();
}

View 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
View File

@@ -0,0 +1,7 @@
//
// Text
//
.text-truncate {
@include text-truncate;
}