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(valuebox): Override theme color when default only #9460

Merged
merged 3 commits into from
May 7, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions news/changelog-1.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ All changes included in 1.5:
- ([#9282](https://github.com/quarto-dev/quarto-cli/issues/9282)): Fix name clash in Lua local declarations for `mediabag` in bundled releases.
- ([#9394](https://github.com/quarto-dev/quarto-cli/issues/9394)): Make `template` a required field in the `about` schema.
- ([#9426](https://github.com/quarto-dev/quarto-cli/issues/9426)): Update `crossref.lua` filter to avoid crashes and hangs in documents with custom AST nodes.
- ([#9460](https://github.com/quarto-dev/quarto-cli/pulls/9460)): `$valuebox-bg-{color}` Sass variables, e.g. `$valuebox-bg-primary`, can now be set directly for custom value box background colors.
- ([#9492](https://github.com/quarto-dev/quarto-cli/issues/9492)): Improve performance of `quarto preview` when serving resource files of the following formats: HTML, PDF, DOCX, and plaintext.
- ([#9496](https://github.com/quarto-dev/quarto-cli/issues/9496)): Improve parsing error message from `js-yaml` when `key:value` is used together with `key: value` in the same YAML block.
- ([#9527](https://github.com/quarto-dev/quarto-cli/pull/9527)): Add `quarto.format` and `quarto.format.typst` to Quarto's public Lua filter API.
Expand Down
88 changes: 48 additions & 40 deletions src/resources/formats/dashboard/quarto-dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -342,48 +342,56 @@ $dashboard-card-toolbar-top-margin: 6px !default;
/*-- scss:rules --*/

// Value Boxes
$valuebox-bg-primary: $primary !default;
$valuebox-bg-secondary: $secondary !default;
$valuebox-bg-success: $success !default;
$valuebox-bg-info: $info !default;
$valuebox-bg-warning: $warning !default;
$valuebox-bg-danger: $danger !default;
$valuebox-bg-light: $light !default;
$valuebox-bg-dark: $dark !default;
$valuebox-bg-primary: theme-override-value(
$theme-name,
"valuebox-bg-primary",
$primary
) !default;
$valuebox-bg-secondary: theme-override-value(
$theme-name,
"valuebox-bg-secondary",
$secondary
) !default;
$valuebox-bg-success: theme-override-value(
$theme-name,
"valuebox-bg-success",
$success
) !default;
$valuebox-bg-info: theme-override-value(
$theme-name,
"valuebox-bg-info",
$info
) !default;
$valuebox-bg-warning: theme-override-value(
$theme-name,
"valuebox-bg-warning",
$warning
) !default;
$valuebox-bg-danger: theme-override-value(
$theme-name,
"valuebox-bg-danger",
$danger
) !default;
$valuebox-bg-light: theme-override-value(
$theme-name,
"valuebox-bg-light",
$light
) !default;
$valuebox-bg-dark: theme-override-value(
$theme-name,
"valuebox-bg-dark",
$dark
) !default;

$valuebox-colors: (
"primary":
theme-override-value(
$theme-name,
"valuebox-bg-primary",
$valuebox-bg-primary
),
"secondary":
theme-override-value(
$theme-name,
"valuebox-bg-secondary",
$valuebox-bg-secondary
),
"success":
theme-override-value(
$theme-name,
"valuebox-bg-success",
$valuebox-bg-success
),
"info":
theme-override-value($theme-name, "valuebox-bg-info", $valuebox-bg-info),
"warning":
theme-override-value(
$theme-name,
"valuebox-bg-warning",
$valuebox-bg-warning
),
"danger":
theme-override-value($theme-name, "valuebox-bg-danger", $valuebox-bg-danger),
"light":
theme-override-value($theme-name, "valuebox-bg-light", $valuebox-bg-light),
"dark":
theme-override-value($theme-name, "valuebox-bg-dark", $valuebox-bg-dark),
"primary": $valuebox-bg-primary,
"secondary": $valuebox-bg-secondary,
"success": $valuebox-bg-success,
"info": $valuebox-bg-info,
"warning": $valuebox-bg-warning,
"danger": $valuebox-bg-danger,
"light": $valuebox-bg-light,
"dark": $valuebox-bg-dark,
);

// Dashboards
Expand Down