Skip to content

Overwrite of css function contrast in scss output #10529

Answered by gadenbuie
acederberg asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks @acederberg, I can see the issue here now. I'm going to summarize:

  1. Quarto defines a contrast() function that is used to calculate the contrast ratio between two colors.
  2. CSS itself has a contrast() function that can be used in a filter: 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 of contrast(). Sass is case-sensitive, but CSS is not, so Sass will pass CONTRAST() 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…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@mcanouil
Comment options

Comment options

You must be logged in to vote
4 replies
@gadenbuie
Comment options

Answer selected by acederberg
@acederberg
Comment options

@cscheid
Comment options

@cscheid
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #10528 on August 15, 2024 16:27.