Skip to content

Commit

Permalink
🐛 Enable 0.x with negative margins @ v4 (#33593)
Browse files Browse the repository at this point in the history
* 🐛 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
  • Loading branch information
k-utsumi authored Jun 24, 2021
1 parent 538ea32 commit 086c0bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scss/utilities/_spacing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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} {
Expand Down

0 comments on commit 086c0bf

Please sign in to comment.