]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Add default parameters to each border radius mixin (#31571)
authorJeremy Jackson <git@jeremyvii.com>
Tue, 1 Sep 2020 21:17:17 +0000 (21:17 +0000)
committerGitHub <noreply@github.com>
Tue, 1 Sep 2020 21:17:17 +0000 (14:17 -0700)
* Add default parameters to each border radius mixin

* Add border radius changes to migration guide

Co-authored-by: Jeremy Jackson <jeremy@librarymarket.com>
scss/mixins/_border-radius.scss
site/content/docs/5.0/migration.md

index aee9bf3d3e1adf4ad0516db9229746938af6b373..3163fc0e795b3d855037dc329fe379c6cbe1f0c6 100644 (file)
   }
 }
 
-@mixin border-top-radius($radius) {
+@mixin border-top-radius($radius: $border-radius) {
   @if $enable-rounded {
     border-top-left-radius: valid-radius($radius);
     border-top-right-radius: valid-radius($radius);
   }
 }
 
-@mixin border-right-radius($radius) {
+@mixin border-right-radius($radius: $border-radius) {
   @if $enable-rounded {
     border-top-right-radius: valid-radius($radius);
     border-bottom-right-radius: valid-radius($radius);
   }
 }
 
-@mixin border-bottom-radius($radius) {
+@mixin border-bottom-radius($radius: $border-radius) {
   @if $enable-rounded {
     border-bottom-right-radius: valid-radius($radius);
     border-bottom-left-radius: valid-radius($radius);
   }
 }
 
-@mixin border-left-radius($radius) {
+@mixin border-left-radius($radius: $border-radius) {
   @if $enable-rounded {
     border-top-left-radius: valid-radius($radius);
     border-bottom-left-radius: valid-radius($radius);
   }
 }
 
-@mixin border-top-left-radius($radius) {
+@mixin border-top-left-radius($radius: $border-radius) {
   @if $enable-rounded {
     border-top-left-radius: valid-radius($radius);
   }
 }
 
-@mixin border-top-right-radius($radius) {
+@mixin border-top-right-radius($radius: $border-radius) {
   @if $enable-rounded {
     border-top-right-radius: valid-radius($radius);
   }
 }
 
-@mixin border-bottom-right-radius($radius) {
+@mixin border-bottom-right-radius($radius: $border-radius) {
   @if $enable-rounded {
     border-bottom-right-radius: valid-radius($radius);
   }
 }
 
-@mixin border-bottom-left-radius($radius) {
+@mixin border-bottom-left-radius($radius: $border-radius) {
   @if $enable-rounded {
     border-bottom-left-radius: valid-radius($radius);
   }
index 4a4cddbcbdc297a5044c2e226e142e0d0dc35625..03657ea0fd2974b85983db30b61c18a072728626 100644 (file)
@@ -111,6 +111,7 @@ Changes to our source Sass files and compiled CSS.
 - The `media-breakpoint-down()` uses the breakpoint itself instead of the next breakpoint. Use `media-breakpoint-down(lg)` instead of `media-breakpoint-down(md)` to target viewports smaller than the `lg` breakpoint.
 - The `media-breakpoint-between()` mixin's second parameter also uses the breakpoint itself instead of the next breakpoint. Use `media-between(sm, lg)` instead of `media-breakpoint-between(sm, md)` to target viewports between the `sm` and `lg` breakpoints.
 - The `box-shadow()` mixin now better supports `none` and `null` with multiple arguments. Now you can pass multiple arguements with either value, and get the expected output. [See #30394](https://github.com/twbs/bootstrap/pull/30394).
+- Each `border-radius()` mixin now has a default value. You can now call these mixins without specifying a border radius value and the `$border-radius` variable will be used. [See #31571](https://github.com/twbs/bootstrap/pull/31571)
 
 ### JavaScript