Overwrite of css function contrast
in scss output
#10529
-
Thank you for I am having trouble defining a css filter for some animations using scss: /*-- scss:rules*/
.animation img,
.figure img {
filter: invert(1) hue-rotate(135deg) saturate(2) contrast(0.75);
}
.anim-controls button i,
.anim-buttons button i .fa-flip-horizontal,
.anim-buttons button i .fa {
filter: invert(1) !important;
} I then run
The above code implies that the declaration of |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
@cscheid Why was this converted to a discussion but unanswered? Converting it to a discussion would imply that you have insight into this. Please help - I am confused. |
Beta Was this translation helpful? Give feedback.
-
Thank you! I know that it works when I use the Reproducing the ErrorHere is the code in a repository. I never committed the changes since I found a better way to use To reproduce, check out
The project does build, and can be done like sed -i 's/filter:/filter: contrast(1)/' ./themes/dark.scss
docker compose --file docker/compose.yaml exec server bash -c 'source ~/.bashrc && quarto render' About Theme FilesIt is possible to compile the code by changing the header of
I get that content is merged in to different locations depending on the comment headers provided, I just suppose that the naming of the function
What I am trying to say is that the original |
Beta Was this translation helpful? Give feedback.
-
Because there wasn't enough detail in the post for us to know for sure what was happening (we always need a reproducible example, in this sense), and maybe someone else could provide enough context for us to determine either way. Garrick did, and now we have a bug report. |
Beta Was this translation helpful? Give feedback.
Thanks @acederberg, I can see the issue here now. I'm going to summarize:
contrast()
function that is used to calculate the contrast ratio between two colors.contrast()
function that can be used in afilter:
property value.In Sass, Sass-defined functions take precedence over CSS functions.
rgb()
is a common instance of this.@acederberg You can use a trick/hack that is often used in Sass to call
CONTRAST()
instead ofcontrast()
. Sass is case-sensitive, but CSS is not, so Sass will passCONTRAST()
through to the compiled CSS without error.@cscheid @mcanouil There's a good argument to be made here that Quarto should avoid creating functions named after…