Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(titlesColor): Fixed utilities' primary color #872

Merged
merged 17 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scss/_root.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
--#{$prefix}#{$color}-rgb: #{$value};
}

--#{$prefix}primary-text: #{to-rgb($accessible-orange)}; // Boosted mod
julien-deramond marked this conversation as resolved.
Show resolved Hide resolved
--#{$prefix}white-rgb: #{to-rgb($white)};
--#{$prefix}black-rgb: #{to-rgb($black)};
--#{$prefix}body-color-rgb: #{to-rgb($body-color)};
Expand Down Expand Up @@ -84,6 +85,7 @@
[class*="bg-black"],
[class*="-dark"]:not(.border-dark):not(.text-dark),
[class*="bg-secondary"] {
--#{$prefix}primary-text: #{to-rgb($brand-orange)};
--#{$prefix}link-color: #{$link-color-dark};
--#{$prefix}link-hover-color: #{$link-hover-color-dark};
--#{$boosted-prefix}caption-color: #{$table-caption-color-dark};
Expand All @@ -96,6 +98,7 @@

// stylelint-disable-next-line scss/selector-no-redundant-nesting-selector
[class*="bg-"]:not(&):not(.bg-transparent) {
--#{$prefix}primary-text: #{to-rgb($accessible-orange)};
--#{$prefix}link-color: #{$link-color};
--#{$prefix}link-hover-color: #{$link-hover-color};
--#{$boosted-prefix}caption-color: #{$table-caption-color};
Expand Down
1 change: 1 addition & 0 deletions scss/_utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ $utilities: map-merge(
"black-50": rgba($black, .5), // deprecated
"white-50": rgba($white, .5), // deprecated
"reset": inherit,
"primary": rgba(var(--#{$prefix}primary-text), var(--#{$prefix}text-opacity)), // Boosted mod: redefine primary value
)
)
),
Expand Down
6 changes: 4 additions & 2 deletions scss/mixins/_utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
$rgba-string-index-before-color-name: str-index($value, $func-prefix);
@if $rgba-string-index-before-color-name == 1 {
$rgba-string-index-after-color-name: str-index($value, "-rgb");
@return str-slice($value, $rgba-string-index-before-color-name + str-length($func-prefix), $rgba-string-index-after-color-name - 1);
@if type-of($rgba-string-index-after-color-name) == "number" {
@return str-slice($value, $rgba-string-index-before-color-name + str-length($func-prefix), $rgba-string-index-after-color-name - 1);
}
}
@return undefined;
}
Expand Down Expand Up @@ -117,7 +119,7 @@
}
}
}
@if "inherit" != inspect($value) and $accessible-orange != $value and $primary != $value and $text-muted != $value {
@if "inherit" != inspect($value) and $accessible-orange != $value and $primary != $value and $text-muted != $value and "rgba(var(--#{$prefix}primary-text), var(--#{$prefix}text-opacity))" != $value {
background-color: color-contrast($value);
}
}
Expand Down
1 change: 1 addition & 0 deletions site/content/docs/5.2/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ If you need more details about the changes, please refer to the [v5.2.2 release]
<summary><span class="badge bg-success">New</span> CSS variables:</summary>
<ul>
<li><code>--bs-btn-letter-spacing</code></li>
<li><code>--bs-primary-text</code></li>
</ul>
</details>

Expand Down