From 0c983d56230a7d1da42a2e46f5a2be6125a1a1d1 Mon Sep 17 00:00:00 2001 From: REJack Date: Tue, 18 Jan 2022 19:47:31 +0100 Subject: [PATCH] fix/remove-division (#4204) * Fix Using / for division is deprecated (#4123) * Fix Using / for division is deprecated * replace divide function by multiplication * attempt to fix tests * fix: remove leading zero * fix: Undefined operation "times" Co-authored-by: Vincent Garnier --- build/scss/_bootstrap-variables.scss | 12 ++++++------ build/scss/_cards.scss | 10 +++++----- build/scss/_main-header.scss | 2 +- build/scss/_main-sidebar.scss | 10 +++++----- build/scss/_variables.scss | 2 +- build/scss/plugins/_select2.scss | 12 ++++++------ 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/build/scss/_bootstrap-variables.scss b/build/scss/_bootstrap-variables.scss index 6dc3c7e1c..d8961d155 100644 --- a/build/scss/_bootstrap-variables.scss +++ b/build/scss/_bootstrap-variables.scss @@ -263,7 +263,7 @@ $h4-font-size: $font-size-base * 1.5 !default; $h5-font-size: $font-size-base * 1.25 !default; $h6-font-size: $font-size-base !default; -$headings-margin-bottom: ($spacer / 2) !default; +$headings-margin-bottom: ($spacer * .5) !default; $headings-font-family: inherit !default; $headings-font-weight: 500 !default; $headings-line-height: 1.2 !default; @@ -430,7 +430,7 @@ $input-height-border: $input-border-width * 2 !default; $input-height-inner: ($font-size-base * $input-btn-line-height) + ($input-btn-padding-y * 2) !default; $input-height-inner-half: calc(#{$input-line-height * .5em} + #{$input-padding-y}) !default; -$input-height-inner-quarter: calc(#{$input-line-height * .25em} + #{$input-padding-y / 2}) !default; +$input-height-inner-quarter: calc(#{$input-line-height * .25em} + #{$input-padding-y * .5}) !default; $input-height: calc(#{$input-height-inner} + #{$input-height-border}) !default; @@ -607,8 +607,8 @@ $nav-pills-link-active-bg: $component-active-bg !default; // Navbar -$navbar-padding-y: ($spacer / 2) !default; -$navbar-padding-x: ($spacer / 2) !default; +$navbar-padding-y: ($spacer * .5) !default; +$navbar-padding-x: ($spacer * .5) !default; $navbar-nav-link-padding-x: 1rem !default; @@ -616,7 +616,7 @@ $navbar-brand-font-size: $font-size-lg !default; // Compute the navbar-brand padding-y so the navbar-brand will have the same height as navbar-text and nav-link $nav-link-height: ($font-size-base * $line-height-base + $nav-link-padding-y * 2) !default; $navbar-brand-height: $navbar-brand-font-size * $line-height-base !default; -$navbar-brand-padding-y: ($nav-link-height - $navbar-brand-height) / 2 !default; +$navbar-brand-padding-y: ($nav-link-height - $navbar-brand-height) * .5 !default; $navbar-toggler-padding-y: .25rem !default; $navbar-toggler-padding-x: .75rem !default; @@ -686,7 +686,7 @@ $card-bg: $white !default; $card-img-overlay-padding: 1.25rem !default; -$card-group-margin: ($grid-gutter-width / 2) !default; +$card-group-margin: ($grid-gutter-width * .5) !default; $card-deck-margin: $card-group-margin !default; $card-columns-count: 3 !default; diff --git a/build/scss/_cards.scss b/build/scss/_cards.scss index 58fe98b4b..9899fa84c 100644 --- a/build/scss/_cards.scss +++ b/build/scss/_cards.scss @@ -213,7 +213,7 @@ html.maximized-card { .card-header { background-color: transparent; border-bottom: 1px solid $card-border-color; - padding: (($card-spacer-y / 2) * 2) $card-spacer-x; + padding: (($card-spacer-y * .5) * 2) $card-spacer-x; position: relative; @if $enable-rounded { @@ -226,13 +226,13 @@ html.maximized-card { > .card-tools { float: right; - margin-right: -$card-spacer-x / 2; + margin-right: -$card-spacer-x * .5; .input-group, .nav, .pagination { - margin-bottom: -$card-spacer-y / 2.5; - margin-top: -$card-spacer-y / 2.5; + margin-bottom: -$card-spacer-y * .4; + margin-top: -$card-spacer-y * .4; } [data-toggle="tooltip"] { @@ -258,7 +258,7 @@ html.maximized-card { background-color: transparent; color: $gray-500; font-size: $font-size-sm; - margin: -(($card-spacer-y / 2) * 2) 0; + margin: -(($card-spacer-y * .5) * 2) 0; padding: .25rem .5rem; .btn-group.show &, diff --git a/build/scss/_main-header.scss b/build/scss/_main-header.scss index f43019236..43d25abe3 100644 --- a/build/scss/_main-header.scss +++ b/build/scss/_main-header.scss @@ -58,7 +58,7 @@ // Add this class to images within a nav-link .navbar-img { - height: $main-header-height / 2; + height: calc(#{$main-header-height} * .5); width: auto; } diff --git a/build/scss/_main-sidebar.scss b/build/scss/_main-sidebar.scss index 7127ea870..e95a79535 100644 --- a/build/scss/_main-sidebar.scss +++ b/build/scss/_main-sidebar.scss @@ -513,7 +513,7 @@ // Nav Flat .nav-flat { - margin: (-$sidebar-padding-x / 2) (-$sidebar-padding-x) 0; + margin: (-$sidebar-padding-x * .5) (-$sidebar-padding-x) 0; .nav-item { > .nav-link { @@ -678,7 +678,7 @@ } .nav-legacy { - margin: (-$sidebar-padding-x / 2) (-$sidebar-padding-x) 0; + margin: (-$sidebar-padding-x * .5) (-$sidebar-padding-x) 0; &.nav-sidebar .nav-item { > .nav-link { @@ -890,13 +890,13 @@ .nav-compact { .nav-link, .nav-header { - padding-top: ($nav-link-padding-y / 2); - padding-bottom: ($nav-link-padding-y / 2); + padding-top: ($nav-link-padding-y * .5); + padding-bottom: ($nav-link-padding-y * .5); } .nav-header:not(:first-of-type) { padding-top: ($nav-link-padding-y * 1.5); - padding-bottom: ($nav-link-padding-y / 2); + padding-bottom: ($nav-link-padding-y * .5); } .nav-link > .right, diff --git a/build/scss/_variables.scss b/build/scss/_variables.scss index 4bec008c1..6f48902e2 100644 --- a/build/scss/_variables.scss +++ b/build/scss/_variables.scss @@ -138,7 +138,7 @@ $sidebar-light-submenu-active-bg: $sidebar-light-submenu-hover-bg !default; // -------------------------------------------------------- $sidebar-mini-width: ($nav-link-padding-x + $sidebar-padding-x + .8rem) * 2 !default; $sidebar-nav-icon-width: $sidebar-mini-width - (($sidebar-padding-x + $nav-link-padding-x) * 2) !default; -$sidebar-user-image-width: $sidebar-nav-icon-width + ($nav-link-padding-x / 2) !default; +$sidebar-user-image-width: $sidebar-nav-icon-width + ($nav-link-padding-x * .5) !default; // CONTROL SIDEBAR // -------------------------------------------------------- diff --git a/build/scss/plugins/_select2.scss b/build/scss/plugins/_select2.scss index 91fcd8616..ce7b6787b 100644 --- a/build/scss/plugins/_select2.scss +++ b/build/scss/plugins/_select2.scss @@ -123,12 +123,12 @@ } .select2-selection__rendered { - padding: 0 $input-padding-x / 2 $input-padding-y; - margin-bottom: -$input-padding-x / 2; + padding: 0 $input-padding-x * 0.5 $input-padding-y; + margin-bottom: -$input-padding-x * 0.5; li:first-child.select2-search.select2-search--inline { width: 100%; - margin-left: $input-padding-x / 2; + margin-left: $input-padding-x * 0.5; .select2-search__field { width: 100% !important; @@ -241,11 +241,11 @@ select.form-control-sm ~ { min-height: $input-height-sm; .select2-selection__rendered { - padding: 0 $input-padding-x-sm / 2 $input-padding-y-sm; - margin-top: -($input-padding-x-sm / 5); + padding: 0 $input-padding-x-sm * 0.5 $input-padding-y-sm; + margin-top: -($input-padding-x-sm * .2); li:first-child.select2-search.select2-search--inline { - margin-left: $input-padding-x-sm / 2; + margin-left: $input-padding-x-sm * 0.5; } .select2-search.select2-search--inline {