0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-03-04 04:29:23 +01:00

CSS: consistent approach for calc with negative values (#41004)

Co-authored-by: Louis-Maxime Piton <louismaxime.piton@orange.com>
Co-authored-by: Julien Déramond <juderamond@gmail.com>
This commit is contained in:
Grimalkin 2024-12-18 09:51:19 +01:00 committed by GitHub
parent b3d2e7b1d8
commit c536836aa8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 7 additions and 7 deletions

View File

@ -39,7 +39,7 @@
// Prevent double borders when buttons are next to each other // Prevent double borders when buttons are next to each other
> :not(.btn-check:first-child) + .btn, > :not(.btn-check:first-child) + .btn,
> .btn-group:not(:first-child) { > .btn-group:not(:first-child) {
margin-left: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list margin-left: calc(-1 * #{$btn-border-width}); // stylelint-disable-line function-disallowed-list
} }
// Reset rounded corners // Reset rounded corners
@ -126,7 +126,7 @@
> .btn:not(:first-child), > .btn:not(:first-child),
> .btn-group:not(:first-child) { > .btn-group:not(:first-child) {
margin-top: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list margin-top: calc(-1 * #{$btn-border-width}); // stylelint-disable-line function-disallowed-list
} }
// Reset rounded corners // Reset rounded corners

View File

@ -75,7 +75,7 @@
margin-left: $pagination-margin-start; margin-left: $pagination-margin-start;
} }
@if $pagination-margin-start == calc(#{$pagination-border-width} * -1) { @if $pagination-margin-start == calc(-1 * #{$pagination-border-width}) {
&:first-child { &:first-child {
.page-link { .page-link {
@include border-start-radius(var(--#{$prefix}pagination-border-radius)); @include border-start-radius(var(--#{$prefix}pagination-border-radius));

View File

@ -1302,7 +1302,7 @@ $pagination-color: var(--#{$prefix}link-color) !default;
$pagination-bg: var(--#{$prefix}body-bg) !default; $pagination-bg: var(--#{$prefix}body-bg) !default;
$pagination-border-radius: var(--#{$prefix}border-radius) !default; $pagination-border-radius: var(--#{$prefix}border-radius) !default;
$pagination-border-width: var(--#{$prefix}border-width) !default; $pagination-border-width: var(--#{$prefix}border-width) !default;
$pagination-margin-start: calc(#{$pagination-border-width} * -1) !default; // stylelint-disable-line function-disallowed-list $pagination-margin-start: calc(-1 * #{$pagination-border-width}) !default; // stylelint-disable-line function-disallowed-list
$pagination-border-color: var(--#{$prefix}border-color) !default; $pagination-border-color: var(--#{$prefix}border-color) !default;
$pagination-focus-color: var(--#{$prefix}link-hover-color) !default; $pagination-focus-color: var(--#{$prefix}link-hover-color) !default;

View File

@ -121,7 +121,7 @@
} }
> :not(:first-child):not(.dropdown-menu)#{$validation-messages} { > :not(:first-child):not(.dropdown-menu)#{$validation-messages} {
margin-left: calc(#{$input-border-width} * -1); // stylelint-disable-line function-disallowed-list margin-left: calc(-1 * #{$input-border-width}); // stylelint-disable-line function-disallowed-list
@include border-start-radius(0); @include border-start-radius(0);
} }

View File

@ -93,13 +93,13 @@
.fixed-top, .fixed-top,
.sticky-top { .sticky-top {
position: static; position: static;
margin: calc(var(--bd-example-padding) * -1) calc(var(--bd-example-padding) * -1) var(--bd-example-padding); // stylelint-disable-line function-disallowed-list margin: calc(-1 * var(--bd-example-padding)) calc(-1 * var(--bd-example-padding)) var(--bd-example-padding); // stylelint-disable-line function-disallowed-list
} }
.fixed-bottom, .fixed-bottom,
.sticky-bottom { .sticky-bottom {
position: static; position: static;
margin: var(--bd-example-padding) calc(var(--bd-example-padding) * -1) calc(var(--bd-example-padding) * -1); // stylelint-disable-line function-disallowed-list margin: var(--bd-example-padding) calc(-1 * var(--bd-example-padding)) calc(-1 * var(--bd-example-padding)); // stylelint-disable-line function-disallowed-list
} }