]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Blacklist border-radius property (use mixin instead) (#27900)
authorMartijn Cuppens <martijn.cuppens@gmail.com>
Sun, 23 Dec 2018 07:11:11 +0000 (08:11 +0100)
committerXhmikosR <xhmikosr@gmail.com>
Sun, 23 Dec 2018 07:11:11 +0000 (09:11 +0200)
14 files changed:
.stylelintrc
scss/_card.scss
scss/_custom-forms.scss
scss/_forms.scss
scss/_reboot.scss
scss/_spinners.scss
scss/mixins/_border-radius.scss
scss/mixins/_buttons.scss
scss/utilities/_borders.scss
site/docs/4.2/assets/scss/_ads.scss
site/docs/4.2/assets/scss/_brand.scss
site/docs/4.2/assets/scss/_callouts.scss
site/docs/4.2/assets/scss/_clipboard-js.scss
site/docs/4.2/assets/scss/_component-examples.scss

index dac9edbf43861872e3982ce866e9971802c4788b..fce97867fc279bef140fb4ef11144733f550b53c 100644 (file)
       "fill",
       "stroke"
     ],
-    "property-blacklist": ["transition"],
+    "property-blacklist": [
+      "border-radius",
+      "border-top-left-radius",
+      "border-top-right-radius",
+      "border-bottom-right-radius",
+      "border-bottom-left-radius",
+      "transition"
+    ],
     "property-no-vendor-prefix": true,
     "rule-empty-line-before": null,
     "scss/at-function-named-arguments": "never",
index 377bec0f1a4357d2479d71c5b090d492e2c35ce7..bbdb15bce5e0ed6c90baf5c7074fa5bb6f2379b8 100644 (file)
 
           .card-img-top,
           .card-header {
+            // stylelint-disable-next-line property-blacklist
             border-top-right-radius: 0;
           }
           .card-img-bottom,
           .card-footer {
+            // stylelint-disable-next-line property-blacklist
             border-bottom-right-radius: 0;
           }
         }
 
           .card-img-top,
           .card-header {
+            // stylelint-disable-next-line property-blacklist
             border-top-left-radius: 0;
           }
           .card-img-bottom,
           .card-footer {
+            // stylelint-disable-next-line property-blacklist
             border-bottom-left-radius: 0;
           }
         }
 
     &:not(:first-of-type) {
       .card-header:first-child {
-        border-radius: 0;
+        @include border-radius(0);
       }
 
       &:not(:last-of-type) {
         border-bottom: 0;
-        border-radius: 0;
+        @include border-radius(0);
       }
     }
 
     &:first-of-type {
       border-bottom: 0;
-      border-bottom-right-radius: 0;
-      border-bottom-left-radius: 0;
+      @include border-bottom-radius(0);
     }
 
     &:last-of-type {
-      border-top-left-radius: 0;
-      border-top-right-radius: 0;
+      @include border-top-radius(0);
     }
 
     .card-header {
index e6bf7ad6f53fcbed36f6c2f010dd051389c8c609..985dddba42db713dbd9c1ccaf85a7a448b4832f0 100644 (file)
 
 .custom-radio {
   .custom-control-label::before {
+    // stylelint-disable-next-line property-blacklist
     border-radius: $custom-radio-indicator-border-radius;
   }
 
       left: -($custom-switch-width + $custom-control-gutter);
       width: $custom-switch-width;
       pointer-events: all;
+      // stylelint-disable-next-line property-blacklist
       border-radius: $custom-switch-indicator-border-radius;
     }
 
       width: $custom-switch-indicator-size;
       height: $custom-switch-indicator-size;
       background-color: $custom-control-indicator-border-color;
+      // stylelint-disable-next-line property-blacklist
       border-radius: $custom-switch-indicator-border-radius;
       @include transition(transform .15s ease-in-out, $custom-forms-transition);
     }
   background: $custom-select-background;
   background-color: $custom-select-bg;
   border: $custom-select-border-width solid $custom-select-border-color;
-  @if $enable-rounded {
-    border-radius: $custom-select-border-radius;
-  } @else {
-    border-radius: 0;
-  }
+  @include border-radius($custom-select-border-radius, 0);
   @include box-shadow($custom-select-box-shadow);
   appearance: none;
 
index 2db6d834cd241d1dd17350ca160bda3fa4889d0e..92175b09027e458ccdc536d4f97861b19b717276 100644 (file)
   border: $input-border-width solid $input-border-color;
 
   // Note: This has no effect on <select>s in some browsers, due to the limited stylability of `<select>`s in CSS.
-  @if $enable-rounded {
-    // Manually use the if/else instead of the mixin to account for iOS override
-    border-radius: $input-border-radius;
-  } @else {
-    // Otherwise undo the iOS default
-    border-radius: 0;
-  }
+  @include border-radius($input-border-radius, 0);
 
   @include box-shadow($input-box-shadow);
   @include transition($input-transition);
index d4167cc8ecf500b5153030f4ec5a6b7f3f05feb1..10e2273c4175a78fdfb7e5c1fd72cf279514ab80 100644 (file)
@@ -297,6 +297,7 @@ label {
 //
 // Details at https://github.com/twbs/bootstrap/issues/24093
 button {
+  // stylelint-disable-next-line property-blacklist
   border-radius: 0;
 }
 
index ed7e2bc6500536b68514501b4bba8c0e2598d4ab..364a5c1a65f71e0828a23752934a95e42e511236 100644 (file)
@@ -13,6 +13,7 @@
   vertical-align: text-bottom;
   border: $spinner-border-width solid currentColor;
   border-right-color: transparent;
+  // stylelint-disable-next-line property-blacklist
   border-radius: 50%;
   animation: spinner-border .75s linear infinite;
 }
@@ -42,6 +43,7 @@
   height: $spinner-height;
   vertical-align: text-bottom;
   background-color: currentColor;
+  // stylelint-disable-next-line property-blacklist
   border-radius: 50%;
   opacity: 0;
   animation: spinner-grow .75s linear infinite;
index 2024febcfa82ffa56efb6a3c26255613da03d211..f32feca90c99ebacc71a1f22dea28af2ad8c7476 100644 (file)
@@ -1,9 +1,13 @@
+// stylelint-disable property-blacklist
 // Single side border-radius
 
-@mixin border-radius($radius: $border-radius) {
+@mixin border-radius($radius: $border-radius, $fallback-border-radius: false) {
   @if $enable-rounded {
     border-radius: $radius;
   }
+  @else if $fallback-border-radius != false {
+    border-radius: $fallback-border-radius;
+  }
 }
 
 @mixin border-top-radius($radius) {
index 3e1e2c09d059a9b9c8c5f5d5daca38cf4a22878a..64cc482f69503f691d748a5408067447603d537f 100644 (file)
   font-size: $font-size;
   line-height: $line-height;
   // Manually declare to provide an override to the browser default
-  @if $enable-rounded {
-    border-radius: $border-radius;
-  } @else {
-    border-radius: 0;
-  }
+  @include border-radius($border-radius, 0);
 }
index fb759c9ba017827714c279b37e49559011a4d7a5..78c9cb5b2d875c0df4534da6fdb4cb22acd3801f 100644 (file)
@@ -1,4 +1,4 @@
-// stylelint-disable declaration-no-important
+// stylelint-disable property-blacklist, declaration-no-important
 
 //
 // Border
index 375a9e01fa3838bbd21febe58563889dd055071e..c207f1682fbd970b852c3798e4cf84cff699e23b 100644 (file)
@@ -23,7 +23,7 @@
 
   @include media-breakpoint-up(sm) {
     max-width: 330px;
-    border-radius: 4px;
+    @include border-radius(4px);
   }
 }
 
index c8c5c2d5662620074e214b2d486ac4fa335b1fc6..d7d9f1f09ba5c40178e57d6b0d0f6986f9f4be13 100644 (file)
@@ -10,7 +10,7 @@
   overflow: hidden;
   color: $bd-purple;
   background-color: #f9f9f9;
-  border-radius: .25rem;
+  @include border-radius;
 
   .inverse {
     color: $white;
@@ -79,7 +79,7 @@
   height: 4rem;
   margin-right: .25rem;
   margin-left: .25rem;
-  border-radius: .25rem;
+  @include border-radius;
 
   @include media-breakpoint-up(md) {
     width: 6rem;
index b11e370c6418930db4b0f98c0a0077697d749ebd..a10fc05b8d77e88924e058abd85feff1afc252cd 100644 (file)
@@ -8,7 +8,7 @@
   margin-bottom: 1.25rem;
   border: 1px solid #eee;
   border-left-width: .25rem;
-  border-radius: .25rem;
+  @include border-radius;
 
   h4 {
     margin-top: 0;
@@ -20,7 +20,7 @@
   }
 
   code {
-    border-radius: .25rem;
+    @include border-radius;
   }
 
   + .bd-callout {
index 001a6b01e29e7e30a1b33ee39fa2ad2a185ca0c7..0cf39964464a6a313f4f3dfbde2d3bba6c9d0157 100644 (file)
@@ -28,7 +28,7 @@
   cursor: pointer;
   background-color: transparent;
   border: 0;
-  border-radius: .25rem;
+  @include border-radius;
 
   &:hover {
     color: $white;
index 1235695b2cdebf1bf7207bbfe8d7ecb9801a8922..c508764203de72050cf66bdf635b267862001bc3 100644 (file)
@@ -87,7 +87,7 @@
   height: 3rem;
   margin-bottom: .5rem;
   background-color: lighten($blue, 50%);
-  border-radius: .25rem;
+  @include border-radius;
 }
 
 .bd-example-container-sidebar {
   width: 4rem;
   height: 8rem;
   background-color: lighten($blue, 25%);
-  border-radius: .25rem;
+  @include border-radius;
 }
 
 .bd-example-container-body {
   height: 8rem;
   margin-right: 4.5rem;
   background-color: lighten($bd-purple, 25%);
-  border-radius: .25rem;
+  @include border-radius;
 }
 
 .bd-example-container-fluid {