Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion css/base/variables.css

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions features/sooper-colors/colors-theme-settings-css.inc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,28 @@ function colors_theme_settings_css($theme, &$css, array $palette) {
$css .= " --bs-tertiary-color: var(--dxt-color-text);\n";
$css .= " --bs-tertiary-bg: var(--dxt-color-silver);\n";

// Bootstrap 5.3 utility classes (.text-primary, .bg-primary, .border-primary,
// etc.) use the -rgb triplet form via rgba(), not the hex custom properties.
$rgb_map = [
'--bs-primary-rgb' => 'base',
'--bs-secondary-rgb' => 'accent1',
'--bs-body-color-rgb' => 'text',
'--bs-body-bg-rgb' => 'body',
'--bs-emphasis-color-rgb' => 'headings',
'--bs-link-color-rgb' => 'link',
'--bs-link-hover-color-rgb' => 'accent1',
'--bs-light-rgb' => 'silver',
'--bs-dark-rgb' => 'headings',
'--bs-secondary-bg-rgb' => 'card',
'--bs-tertiary-bg-rgb' => 'silver',
];
foreach ($rgb_map as $css_var => $palette_key) {
if (!empty($palette[$palette_key])) {
$rgb = Color::hexToRgb($palette[$palette_key]);
$css .= " $css_var: {$rgb['red']}, {$rgb['green']}, {$rgb['blue']};\n";
}
}

$css .= "}\n\n";
}
}
23 changes: 23 additions & 0 deletions scss/base/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,29 @@ $schemes: (
@if $key == "header" {
--dxt-color-#{$key}-rgb:#{color.red($color),color.green($color),color.blue($color)};
}

$rgb: #{color.red($color),color.green($color),color.blue($color)};

@if $key == "base" {
--bs-primary-rgb: #{$rgb};
} @else if $key == "accent1" {
--bs-secondary-rgb: #{$rgb};
--bs-link-hover-color-rgb: #{$rgb};
} @else if $key == "text" {
--bs-body-color-rgb: #{$rgb};
} @else if $key == "body" {
--bs-body-bg-rgb: #{$rgb};
} @else if $key == "headings" {
--bs-emphasis-color-rgb: #{$rgb};
--bs-dark-rgb: #{$rgb};
} @else if $key == "link" {
--bs-link-color-rgb: #{$rgb};
} @else if $key == "silver" {
--bs-light-rgb: #{$rgb};
--bs-tertiary-bg-rgb: #{$rgb};
} @else if $key == "card" {
--bs-secondary-bg-rgb: #{$rgb};
}
}

// Base color variants
Expand Down
Loading