]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Fix .dropdown-item border-radius when -padding-y is 0
authorMark Otto <markdotto@gmail.com>
Thu, 26 May 2022 21:40:19 +0000 (14:40 -0700)
committerMark Otto <otto@github.com>
Thu, 2 Jun 2022 01:41:26 +0000 (18:41 -0700)
scss/_dropdown.scss

index d4be30eeafef28e31c907f8246ae2e6383a0e2f5..62125b96783a25934f469e7c5e270f1050d02c2c 100644 (file)
     left: 0;
     margin-top: var(--#{$prefix}dropdown-spacer);
   }
+
+  @if $dropdown-padding-y == 0 {
+    > .dropdown-item:first-child,
+    > li:first-child .dropdown-item {
+      @include border-top-radius(var(--#{$prefix}dropdown-inner-border-radius));
+    }
+    > .dropdown-item:last-child,
+    > li:last-child .dropdown-item {
+      @include border-bottom-radius(var(--#{$prefix}dropdown-inner-border-radius));
+    }
+
+  }
 }
 
 // scss-docs-start responsive-breakpoints
   background-color: transparent; // For `<button>`s
   border: 0; // For `<button>`s
 
-  // Prevent dropdown overflow if there's no padding
-  // See https://github.com/twbs/bootstrap/pull/27703
-  @if $dropdown-padding-y == 0 {
-    &:first-child {
-      @include border-top-radius(var(--#{$prefix}dropdown-inner-border-radius));
-    }
-
-    &:last-child {
-      @include border-bottom-radius(var(--#{$prefix}dropdown-inner-border-radius));
-    }
-  }
-
   &:hover,
   &:focus {
     color: var(--#{$prefix}dropdown-link-hover-color);