This commit is contained in:
urania 2024-06-18 07:16:18 +00:00
parent 92f3964668
commit 385f959068
5 changed files with 40 additions and 30 deletions

View File

@ -7967,7 +7967,7 @@ textarea.form-control-lg {
.bg-primary-400 {
background-color: #337ec6;
color: #fff9e5;
color: #ffffff;
}
.bg-gradient-x-primary-400 {
@ -8138,7 +8138,7 @@ textarea.form-control-lg {
.bg-secondary-400 {
background-color: #ed63bd;
color: #33322e;
color: #000000;
}
.bg-gradient-x-secondary-400 {
@ -8157,7 +8157,7 @@ textarea.form-control-lg {
.bg-secondary-500 {
background-color: #e93cac;
color: #fff9e5;
color: #ffffff;
}
.bg-gradient-x-secondary-500 {
@ -8366,7 +8366,7 @@ textarea.form-control-lg {
.bg-success-700 {
background-color: #5b8100;
color: #fff9e5;
color: #ffffff;
}
.bg-gradient-x-success-700 {
@ -8518,7 +8518,7 @@ textarea.form-control-lg {
.bg-info-600 {
background-color: #3492b8;
color: #33322e;
color: #000000;
}
.bg-gradient-x-info-600 {
@ -8708,7 +8708,7 @@ textarea.form-control-lg {
.bg-warning-700 {
background-color: #99771a;
color: #fff9e5;
color: #ffffff;
}
.bg-gradient-x-warning-700 {
@ -8822,7 +8822,7 @@ textarea.form-control-lg {
.bg-danger-400 {
background-color: #e15449;
color: #fff9e5;
color: #ffffff;
}
.bg-gradient-x-danger-400 {
@ -9050,7 +9050,7 @@ textarea.form-control-lg {
.bg-light-700 {
background-color: #999589;
color: #33322e;
color: #000000;
}
.bg-gradient-x-light-700 {
@ -9145,7 +9145,7 @@ textarea.form-control-lg {
.bg-dark-300 {
background-color: #858482;
color: #fff9e5;
color: #ffffff;
}
.bg-gradient-x-dark-300 {
@ -16093,4 +16093,11 @@ a {
text-decoration-thickness: 2px;
}
@media (min-width: 992px) {
.toc-margin {
max-width: 70%;
margin-left: 0;
}
}
/*# sourceMappingURL=compiled.css.map */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,4 @@
@use "sass:math";
@import '../node_modules/bootstrap/scss/functions';
// override variables
@ -58,36 +59,31 @@
@import './bootstrap/utilities';
@function contrast-ratio($color1, $color2) {
// Calculate the relative luminance for each color
$luminance1: luminance($color1);
$luminance2: luminance($color2);
// Calculate the contrast ratio
$contrastRatio: if(
@return if(
$luminance1 > $luminance2,
calc(($luminance1 + 0.05) / ($luminance2 + 0.05)),
calc(($luminance2 + 0.05) / ($luminance1 + 0.05))
math.div($luminance1 + 0.05,$luminance2 + 0.05),
math.div($luminance2 + 0.05,$luminance1 + 0.05),
);
// Return the contrast ratio
@return $contrastRatio;
}
@function get-contrasting-text-color($background-color, $min-contrast-ratio: 4.5) {
// Calculate relative luminance
$rel-lum: luminance($background-color);
$bg-lum: if($rel-lum > 0.5, $rel-lum, 1 - $rel-lum);
// Calculate contrast ratio
@function get-contrasting-text-color(
$background-color,
$light: #fff9e5,
$dark: #33322e,
$min-contrast-ratio: 4.5
) {
$light-contrast: contrast-ratio($light, $background-color);
$dark-contrast: contrast-ratio($dark, $background-color);
// Determine the text color based on contrast ratio and minimum threshold
@if (calc($bg-lum * $dark-contrast) >= $min-contrast-ratio) {
@if ($dark-contrast >= $min-contrast-ratio) {
@return $dark;
} @else if (calc($bg-lum * $light-contrast) >= $min-contrast-ratio) {
} @else if ($light-contrast >= $min-contrast-ratio) {
@return $light;
} @else {
@return if($light-contrast > $dark-contrast, $light, $dark);
@return if($light-contrast < $dark-contrast, #000000, #ffffff);
}
}
@ -166,3 +162,10 @@ body {
a {
text-decoration-thickness: 2px;
}
@media (min-width: 992px) {
.toc-margin {
max-width: 70%;
margin-left: 0;
}
}