]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
🐛 Enable `0.x` with negative margins @ v4 (#33593)
authork-utsumi <k-utsumi@users.noreply.github.com>
Thu, 24 Jun 2021 07:57:47 +0000 (16:57 +0900)
committerGitHub <noreply@github.com>
Thu, 24 Jun 2021 07:57:47 +0000 (10:57 +0300)
* 🐛 Enable `0.x` with negative margins @ v4

I set it as below, but no negative margin was added.
`$spacers: (0\.5: ($spacer * .125));`

After investigating, it seems that `0 \ .5` is also evaluated as 0.
So I changed it to string comparison.

HTML example: `<img class="mt-n0.5">`

* 💚 Clear CI errors

scss/utilities/_spacing.scss

index 351136790a48a33a2622627e4267425a2ec90b61..3e98581a941b518251e5bd8e1af6f77bd09f2482 100644 (file)
@@ -30,7 +30,7 @@
 
     // Negative margins (e.g., where `.mb-n1` is negative version of `.mb-1`)
     @each $size, $length in $spacers {
-      @if $size != 0 {
+      @if "#{$size}" != "0" {
         .m#{$infix}-n#{$size} { margin: -$length !important; }
         .mt#{$infix}-n#{$size},
         .my#{$infix}-n#{$size} {