Fix top level ampersand (#29518)

Fixes dart sass compatibility.
This commit is contained in:
Martijn Cuppens 2019-10-12 15:07:22 +02:00 committed by XhmikosR
parent 64e22b4284
commit 7327e38b1c
1 changed files with 5 additions and 3 deletions

View File

@ -26,14 +26,16 @@
@include deprecate("The `form-control-focus()` mixin", "v4.3.2", "v5", $ignore-warning);
}
// This mixin uses an `if()` technique to be compatible with Dart Sass
// See https://github.com/sass/sass/issues/1873#issuecomment-152293725 for more details
@mixin form-validation-state-selector($state) {
@if ($state == "valid" or $state == "invalid") {
.was-validated &:#{$state},
&.is-#{$state} {
.was-validated #{if(&, "&", "")}:#{$state},
#{if(&, "&", "")}.is-#{$state} {
@content;
}
} @else {
&.is-#{$state} {
#{if(&, "&", "")}.is-#{$state} {
@content;
}
}