Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vantagedesign/ace-documentation.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'assets/css/bootstrap/mixins')
-rw-r--r--assets/css/bootstrap/mixins/_background-variant.scss3
-rw-r--r--assets/css/bootstrap/mixins/_border-radius.scss39
-rw-r--r--assets/css/bootstrap/mixins/_buttons.scss12
-rw-r--r--assets/css/bootstrap/mixins/_forms.scss4
-rw-r--r--assets/css/bootstrap/mixins/_grid-framework.scss40
-rw-r--r--assets/css/bootstrap/mixins/_transition.scss24
6 files changed, 78 insertions, 44 deletions
diff --git a/assets/css/bootstrap/mixins/_background-variant.scss b/assets/css/bootstrap/mixins/_background-variant.scss
index 3ceb5c5..8058018 100644
--- a/assets/css/bootstrap/mixins/_background-variant.scss
+++ b/assets/css/bootstrap/mixins/_background-variant.scss
@@ -15,8 +15,9 @@
@include deprecate("The `bg-variant` mixin", "v4.4.0", "v5", $ignore-warning);
}
-@mixin bg-gradient-variant($parent, $color) {
+@mixin bg-gradient-variant($parent, $color, $ignore-warning: false) {
#{$parent} {
background: $color linear-gradient(180deg, mix($body-bg, $color, 15%), $color) repeat-x !important;
}
+ @include deprecate("The `bg-gradient-variant` mixin", "v4.5.0", "v5", $ignore-warning);
}
diff --git a/assets/css/bootstrap/mixins/_border-radius.scss b/assets/css/bootstrap/mixins/_border-radius.scss
index 88aeb37..aee9bf3 100644
--- a/assets/css/bootstrap/mixins/_border-radius.scss
+++ b/assets/css/bootstrap/mixins/_border-radius.scss
@@ -1,9 +1,22 @@
// stylelint-disable property-blacklist
// Single side border-radius
+// Helper function to replace negative values with 0
+@function valid-radius($radius) {
+ $return: ();
+ @each $value in $radius {
+ @if type-of($value) == number {
+ $return: append($return, max($value, 0));
+ } @else {
+ $return: append($return, $value);
+ }
+ }
+ @return $return;
+}
+
@mixin border-radius($radius: $border-radius, $fallback-border-radius: false) {
@if $enable-rounded {
- border-radius: $radius;
+ border-radius: valid-radius($radius);
}
@else if $fallback-border-radius != false {
border-radius: $fallback-border-radius;
@@ -12,52 +25,52 @@
@mixin border-top-radius($radius) {
@if $enable-rounded {
- border-top-left-radius: $radius;
- border-top-right-radius: $radius;
+ border-top-left-radius: valid-radius($radius);
+ border-top-right-radius: valid-radius($radius);
}
}
@mixin border-right-radius($radius) {
@if $enable-rounded {
- border-top-right-radius: $radius;
- border-bottom-right-radius: $radius;
+ border-top-right-radius: valid-radius($radius);
+ border-bottom-right-radius: valid-radius($radius);
}
}
@mixin border-bottom-radius($radius) {
@if $enable-rounded {
- border-bottom-right-radius: $radius;
- border-bottom-left-radius: $radius;
+ border-bottom-right-radius: valid-radius($radius);
+ border-bottom-left-radius: valid-radius($radius);
}
}
@mixin border-left-radius($radius) {
@if $enable-rounded {
- border-top-left-radius: $radius;
- border-bottom-left-radius: $radius;
+ border-top-left-radius: valid-radius($radius);
+ border-bottom-left-radius: valid-radius($radius);
}
}
@mixin border-top-left-radius($radius) {
@if $enable-rounded {
- border-top-left-radius: $radius;
+ border-top-left-radius: valid-radius($radius);
}
}
@mixin border-top-right-radius($radius) {
@if $enable-rounded {
- border-top-right-radius: $radius;
+ border-top-right-radius: valid-radius($radius);
}
}
@mixin border-bottom-right-radius($radius) {
@if $enable-rounded {
- border-bottom-right-radius: $radius;
+ border-bottom-right-radius: valid-radius($radius);
}
}
@mixin border-bottom-left-radius($radius) {
@if $enable-rounded {
- border-bottom-left-radius: $radius;
+ border-bottom-left-radius: valid-radius($radius);
}
}
diff --git a/assets/css/bootstrap/mixins/_buttons.scss b/assets/css/bootstrap/mixins/_buttons.scss
index c82c4d6..d6235aa 100644
--- a/assets/css/bootstrap/mixins/_buttons.scss
+++ b/assets/css/bootstrap/mixins/_buttons.scss
@@ -20,10 +20,10 @@
color: color-yiq($hover-background);
@include gradient-bg($hover-background);
border-color: $hover-border;
- // Avoid using mixin so we can pass custom focus shadow properly
@if $enable-shadows {
- box-shadow: $btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
+ @include box-shadow($btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5));
} @else {
+ // Avoid using mixin so we can pass custom focus shadow properly
box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
}
}
@@ -51,10 +51,10 @@
border-color: $active-border;
&:focus {
- // Avoid using mixin so we can pass custom focus shadow properly
@if $enable-shadows and $btn-active-box-shadow != none {
- box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
+ @include box-shadow($btn-active-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5));
} @else {
+ // Avoid using mixin so we can pass custom focus shadow properly
box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
}
}
@@ -90,10 +90,10 @@
border-color: $active-border;
&:focus {
- // Avoid using mixin so we can pass custom focus shadow properly
@if $enable-shadows and $btn-active-box-shadow != none {
- box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($color, .5);
+ @include box-shadow($btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($color, .5));
} @else {
+ // Avoid using mixin so we can pass custom focus shadow properly
box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
}
}
diff --git a/assets/css/bootstrap/mixins/_forms.scss b/assets/css/bootstrap/mixins/_forms.scss
index 418470d..57c2d79 100644
--- a/assets/css/bootstrap/mixins/_forms.scss
+++ b/assets/css/bootstrap/mixins/_forms.scss
@@ -16,10 +16,10 @@
background-color: $input-focus-bg;
border-color: $input-focus-border-color;
outline: 0;
- // Avoid using mixin so we can pass custom focus shadow properly
@if $enable-shadows {
- box-shadow: $input-box-shadow, $input-focus-box-shadow;
+ @include box-shadow($input-box-shadow, $input-focus-box-shadow);
} @else {
+ // Avoid using mixin so we can pass custom focus shadow properly
box-shadow: $input-focus-box-shadow;
}
}
diff --git a/assets/css/bootstrap/mixins/_grid-framework.scss b/assets/css/bootstrap/mixins/_grid-framework.scss
index 8e291f7..191fb56 100644
--- a/assets/css/bootstrap/mixins/_grid-framework.scss
+++ b/assets/css/bootstrap/mixins/_grid-framework.scss
@@ -15,12 +15,15 @@
@each $breakpoint in map-keys($breakpoints) {
$infix: breakpoint-infix($breakpoint, $breakpoints);
- // Allow columns to stretch full width below their breakpoints
- @for $i from 1 through $columns {
- .col#{$infix}-#{$i} {
- @extend %grid-column;
+ @if $columns > 0 {
+ // Allow columns to stretch full width below their breakpoints
+ @for $i from 1 through $columns {
+ .col#{$infix}-#{$i} {
+ @extend %grid-column;
+ }
}
}
+
.col#{$infix},
.col#{$infix}-auto {
@extend %grid-column;
@@ -31,12 +34,15 @@
.col#{$infix} {
flex-basis: 0;
flex-grow: 1;
+ min-width: 0; // See https://github.com/twbs/bootstrap/issues/25410
max-width: 100%;
}
- @for $i from 1 through $grid-row-columns {
- .row-cols#{$infix}-#{$i} {
- @include row-cols($i);
+ @if $grid-row-columns > 0 {
+ @for $i from 1 through $grid-row-columns {
+ .row-cols#{$infix}-#{$i} {
+ @include row-cols($i);
+ }
}
}
@@ -44,9 +50,11 @@
@include make-col-auto();
}
- @for $i from 1 through $columns {
- .col#{$infix}-#{$i} {
- @include make-col($i, $columns);
+ @if $columns > 0 {
+ @for $i from 1 through $columns {
+ .col#{$infix}-#{$i} {
+ @include make-col($i, $columns);
+ }
}
}
@@ -58,11 +66,13 @@
.order#{$infix}-#{$i} { order: $i; }
}
- // `$columns - 1` because offsetting by the width of an entire row isn't possible
- @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);
+ @if $columns > 0 {
+ // `$columns - 1` because offsetting by the width of an entire row isn't possible
+ @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);
+ }
}
}
}
diff --git a/assets/css/bootstrap/mixins/_transition.scss b/assets/css/bootstrap/mixins/_transition.scss
index 8ce35a6..54553de 100644
--- a/assets/css/bootstrap/mixins/_transition.scss
+++ b/assets/css/bootstrap/mixins/_transition.scss
@@ -1,16 +1,26 @@
// stylelint-disable property-blacklist
@mixin transition($transition...) {
+ @if length($transition) == 0 {
+ $transition: $transition-base;
+ }
+
+ @if length($transition) > 1 {
+ @each $value in $transition {
+ @if $value == null or $value == none {
+ @warn "The keyword 'none' or 'null' must be used as a single argument.";
+ }
+ }
+ }
+
@if $enable-transitions {
- @if length($transition) == 0 {
- transition: $transition-base;
- } @else {
+ @if nth($transition, 1) != null {
transition: $transition;
}
- }
- @if $enable-prefers-reduced-motion-media-query {
- @media (prefers-reduced-motion: reduce) {
- transition: none;
+ @if $enable-prefers-reduced-motion-media-query and nth($transition, 1) != null and nth($transition, 1) != none {
+ @media (prefers-reduced-motion: reduce) {
+ transition: none;
+ }
}
}
}