Replies: 2 comments 8 replies
-
FYI / for reference purposes: |
Beta Was this translation helpful? Give feedback.
-
If you look at custom theme for HTML, you'll be directed to the design system for Quarto theme: https://quarto.org/docs/output-formats/html-themes-more.html In there, you'll find the layering logic. and you'll see this
It shows how the Your custom them becomes /*-- scss:defaults --*/
$pinkish: #e83e8c;
// What if we prefer to do: scale($pinkish, $lightness: 30%); where `scale()` is
// part of the Sass built-in module sass:color
$body-color: lighten($pinkish, 30%);
/*-- scss:uses --*/
// What if we want to write the following function with functions that are
// not deprecated by Sass and part of sass:color, e.g., channel($color, "red")
// instead of red($color)
// https://github.com/quarto-dev/quarto-cli/blob/af454e8c07abe1c3570342c20e4fb62b33b907cb/src/resources/formats/html/_quarto-functions.scss#L6
@function colorToRGBA($color) {
@return rgba(red($color), green($color), blue($color), alpha($color));
}
/*-- scss:rules --*/
// And we would like to use our `colorToRGBA()` in the rules for example
h1 {
color: #{colorToRGBA($pinkish)};
} and in the output you get
Note that I need to tweak your function and its usage so that the external double quotes are not in the output. Hope it helps |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Hi quarto devs
I like many of the possibilities that quarto theming allows. One thing that is not yet clear to me is how to
@use
a Sass module, be it built-in or private (e.g., _companyfun.scss), in a .scss file that is a quartotheme
argument value.I would be very grateful to hear what you recommend as the preferred approach to get things work.
Below is a reprex, using quarto website, illustrating a few common use cases. I have not documented any potential solution attempts as I do not consider any of the numerous ones tried to be the one to share and I think it is most straightforward that way.
The discussion arguably nearest to link to was #11729, but I don’t think it does help here.
styles.scss
_quarto.yml
about.qmd
index.qmd
Beta Was this translation helpful? Give feedback.
All reactions