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

Merge branch 'v4-dev' into yiq-function-update

This commit is contained in:
Gijs Boddeus
2017-10-04 08:46:03 +02:00
committed by GitHub
241 changed files with 9700 additions and 6947 deletions

View File

@@ -1,3 +1,5 @@
// stylelint-disable declaration-no-important
// Contextual backgrounds
@mixin bg-variant($parent, $color) {

View File

@@ -81,8 +81,18 @@
$min: breakpoint-min($lower, $breakpoints);
$max: breakpoint-max($upper, $breakpoints);
@media (min-width: $min) and (max-width: $max) {
@content;
@if $min != null and $max != null {
@media (min-width: $min) and (max-width: $max) {
@content;
}
} @else if $max == null {
@include media-breakpoint-up($lower) {
@content;
}
} @else if $min == null {
@include media-breakpoint-down($upper) {
@content;
}
}
}

35
scss/mixins/_caret.scss Normal file
View File

@@ -0,0 +1,35 @@
@mixin caret-down {
border-top: $caret-width solid;
border-right: $caret-width solid transparent;
border-bottom: 0;
border-left: $caret-width solid transparent;
}
@mixin caret-up {
border-top: 0;
border-right: $caret-width solid transparent;
border-bottom: $caret-width solid;
border-left: $caret-width solid transparent;
}
@mixin caret($direction: down) {
@if $enable-caret {
&::after {
display: inline-block;
width: 0;
height: 0;
margin-left: $caret-width * .85;
vertical-align: $caret-width * .85;
content: "";
@if $direction == down {
@include caret-down;
} @else if $direction == up {
@include caret-up;
}
}
&:empty::after {
margin-left: 0;
}
}
}

View File

@@ -1,3 +1,5 @@
// stylelint-disable declaration-no-important
@mixin float-left {
float: left !important;
}

View File

@@ -1,7 +1,7 @@
// Form control focus state
//
// Generate a customized focus state and for any input with the specified color,
// which defaults to the `@input-border-color-focus` variable.
// which defaults to the `$input-focus-border-color` variable.
//
// We highly encourage you to not customize the default value, but instead use
// this to tweak colors on an as-needed basis. This aesthetic change is based on
@@ -23,6 +23,28 @@
@mixin form-validation-state($state, $color) {
.#{$state}-feedback {
display: none;
margin-top: .25rem;
font-size: .875rem;
color: $color;
}
.#{$state}-tooltip {
position: absolute;
top: 100%;
z-index: 5;
display: none;
width: 250px;
padding: .5rem;
margin-top: .1rem;
font-size: .875rem;
line-height: 1;
color: #fff;
background-color: rgba($color,.8);
border-radius: .2rem;
}
.form-control,
.custom-select {
.was-validated &:#{$state},

View File

@@ -10,7 +10,7 @@
width: 100%;
min-height: 1px; // Prevent columns from collapsing when empty
padding-right: ($gutter / 2);
padding-left: ($gutter / 2);
padding-left: ($gutter / 2);
}
@each $breakpoint in map-keys($breakpoints) {
@@ -46,6 +46,10 @@
}
}
.order#{$infix}-first {
order: -1;
}
@for $i from 1 through $columns {
.order#{$infix}-#{$i} {
order: $i;
@@ -56,7 +60,7 @@
@for $i from 0 through ($columns - 1) {
@if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-0
.offset#{$infix}-#{$i} {
@include make-col-offset($i, $columns)
@include make-col-offset($i, $columns);
}
}
}

View File

@@ -4,10 +4,10 @@
@mixin make-container() {
width: 100%;
padding-right: ($grid-gutter-width / 2);
padding-left: ($grid-gutter-width / 2);
margin-right: auto;
margin-left: auto;
padding-right: ($grid-gutter-width / 2);
padding-left: ($grid-gutter-width / 2);
}
@@ -24,7 +24,7 @@
display: flex;
flex-wrap: wrap;
margin-right: ($grid-gutter-width / -2);
margin-left: ($grid-gutter-width / -2);
margin-left: ($grid-gutter-width / -2);
}
@mixin make-col-ready() {
@@ -35,7 +35,7 @@
width: 100%;
min-height: 1px; // Prevent collapsing
padding-right: ($grid-gutter-width / 2);
padding-left: ($grid-gutter-width / 2);
padding-left: ($grid-gutter-width / 2);
}
@mixin make-col($size, $columns: $grid-columns) {

View File

@@ -1,3 +1,4 @@
// stylelint-disable indentation
@mixin hover {
// TODO: re-enable along with mq4-hover-shim
// @if $enable-hover-media-query {
@@ -8,21 +9,21 @@
// }
// }
// @else {
// scss-lint:disable Indentation
&:hover { @content }
// scss-lint:enable Indentation
&:hover { @content; }
// }
}
@mixin hover-focus {
@if $enable-hover-media-query {
&:focus { @content }
@include hover { @content }
&:focus {
@content;
}
@include hover { @content; }
} @else {
&:focus,
&:hover {
@content
@content;
}
}
}
@@ -31,14 +32,14 @@
@if $enable-hover-media-query {
&,
&:focus {
@content
@content;
}
@include hover { @content }
@include hover { @content; }
} @else {
&,
&:focus,
&:hover {
@content
@content;
}
}
}
@@ -47,14 +48,14 @@
@if $enable-hover-media-query {
&:focus,
&:active {
@content
@content;
}
@include hover { @content }
@include hover { @content; }
} @else {
&:focus,
&:active,
&:hover {
@content
@content;
}
}
}

View File

@@ -20,15 +20,15 @@
//
// Short retina mixin for setting background-image and -size.
// stylelint-disable indentation, media-query-list-comma-newline-after
@mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) {
background-image: url($file-1x);
// Autoprefixer takes care of adding -webkit-min-device-pixel-ratio and -o-min-device-pixel-ratio,
// but doesn't convert dppx=>dpi.
// There's no such thing as unprefixed min-device-pixel-ratio since it's nonstandard.
// Compatibility info: http://caniuse.com/#feat=css-media-resolution
@media
only screen and (min-resolution: 192dpi), // IE9-11 don't support dppx
// Compatibility info: https://caniuse.com/#feat=css-media-resolution
@media only screen and (min-resolution: 192dpi), // IE9-11 don't support dppx
only screen and (min-resolution: 2dppx) { // Standardized
background-image: url($file-2x);
background-size: $width-1x $height-1x;

View File

@@ -6,7 +6,6 @@
background-color: $background;
}
//scss-lint:disable QualifyingElement
a.list-group-item-#{$state},
button.list-group-item-#{$state} {
color: $color;
@@ -22,5 +21,4 @@
border-color: $color;
}
}
// scss-lint:enable QualifyingElement
}

View File

@@ -1,7 +1,8 @@
// Navbar vertical align
//
// Vertically center elements in the navbar.
// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);`
// to calculate the appropriate top margin.
// @mixin navbar-vertical-align($element-height) {
// margin-top: (($navbar-height - $element-height) / 2);

View File

@@ -1,4 +1,3 @@
// scss-lint:disable DuplicateProperty
@mixin reset-text {
font-family: $font-family-base;
// We deliberately do NOT reset font-size or word-wrap.
@@ -6,7 +5,7 @@
font-weight: $font-weight-normal;
line-height: $line-height-base;
text-align: left; // Fallback for where `start` is not supported
text-align: start;
text-align: start; // stylelint-disable-line declaration-block-no-duplicate-properties
text-decoration: none;
text-shadow: none;
text-transform: none;

View File

@@ -1,7 +1,7 @@
// Only display content to screen readers
//
// See: http://a11yproject.com/posts/how-to-hide-content
// See: http://hugogiraudel.com/2016/10/13/css-hide-and-seek/
// See: http://a11yproject.com/posts/how-to-hide-content/
// See: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/
@mixin sr-only {
position: absolute;

View File

@@ -1,3 +1,5 @@
// stylelint-disable declaration-no-important
// Typography
@mixin text-emphasis-variant($parent, $color) {

View File

@@ -1,3 +1,5 @@
// stylelint-disable declaration-no-important
// Visibility
@mixin invisible($visibility) {