Skip to content

Commit

Permalink
Merge pull request #9460 from quarto-dev/fix/value-box-override-default
Browse files Browse the repository at this point in the history
fix(valuebox): Override theme color when default only
  • Loading branch information
cscheid committed May 7, 2024
2 parents 2440f26 + 54a1e0a commit c2fe9e1
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 40 deletions.
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

0 comments on commit c2fe9e1

Please sign in to comment.