diff --git a/scss/_variables.scss b/scss/_variables.scss
index 36241680b2..cf9ba56c6f 100644
--- a/scss/_variables.scss
+++ b/scss/_variables.scss
@@ -969,27 +969,16 @@ $form-check-inline-margin-end: 1rem !default;
$form-switch-color: rgba($black, .25) !default;
$form-switch-width: 2em !default;
$form-switch-padding-start: $form-switch-width + .5em !default;
-@if $enable-rounded {
- $form-switch-bg-image: url("data:image/svg+xml,") !default;
-} @else {
- $form-switch-bg-image: url("data:image/svg+xml,") !default;
-}
+
+$form-switch-bg-image: if(enable-rounded, url("data:image/svg+xml,"), url("data:image/svg+xml,")) !default;
$form-switch-border-radius: $form-switch-width !default;
$form-switch-transition: background-position .15s ease-in-out !default;
$form-switch-focus-color: $input-focus-border-color !default;
-@if $enable-rounded {
- $form-switch-focus-bg-image: url("data:image/svg+xml,") !default;
-} @else {
- $form-switch-focus-bg-image: url("data:image/svg+xml,") !default;
-}
+$form-switch-focus-bg-image: if(enable-rounded, url("data:image/svg+xml,"), url("data:image/svg+xml,")) !default;
$form-switch-checked-color: $component-active-color !default;
-@if $enable-rounded {
- $form-switch-checked-bg-image: url("data:image/svg+xml,") !default;
-} @else {
- $form-switch-checked-bg-image: url("data:image/svg+xml,") !default;
-}
+$form-switch-checked-bg-image: if(enable-rounded, url("data:image/svg+xml,"), url("data:image/svg+xml,")) !default;
$form-switch-checked-bg-position: right center !default;
// scss-docs-end form-switch-variables