-
Notifications
You must be signed in to change notification settings - Fork 335
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
theme - export two more css variable about code block color #10722
Conversation
This is useful for extension like quarto-live to help style code blocks
It seems like this is not the right place to export those variables 🤔 |
Now doing this right where the variables are defined, which avoid the problem. This adds new We do export in several ways. One of theme is even for typescript extra addition also quarto-cli/src/format/html/format-html-shared.ts Lines 222 to 231 in 4bd31bc
Anyhow, discussed with @cscheid : We should export all SCSS variable as CSS variable, namespaced properly. So I'll leave this as draft, and we can probably do the export of everything really soon. |
Yes. Specifically, well use the |
This pull request will make all SCSS color variables available for CSS under the |
@georgestagg I think you can now check for existence and value for
You can try @cscheid I did find those variable using an example and looking at the .css file. Initially I would have expected the value to be the one in SCSS, which is
Just sharing as feedback in case this is not expected. |
Your understanding is correct. My analyzer won't guarantee that a variable with potentially different types will be exposed. Ideally, we'd write our SCSS to have more stable types, and then the analyzer accurately detects what's going on. It's possible that the analyzer is getting confused with the different types happening and it's emitting bad CSS. If that's the case, it's a bug I should fix. If it's emitting correct CSS but with a weird, unexpected CSS variable, then I think it's an annoyance rather than a bug. |
For now I only identified the latter. I'll watch out for the former in cases where Thanks for the clarification ! |
@cderv Sorry that it's taken me a little while to get back to this, I have some feedback below. This seems to mostly work, but I'm coming upon an issue when I have I think there might be a couple of problems colliding here. Firstly, in the theme file for
However, I think things work out OK when rendered because the quarto-cli/src/resources/pandoc/highlight-styles/a11y-dark.theme Lines 20 to 23 in 0ce5ced
These theme text styles are exported as quarto-cli/src/command/render/pandoc-html.ts Lines 429 to 440 in 0ce5ced
However, notice that for the quarto-cli/src/quarto-core/text-highlighting.ts Lines 147 to 179 in 0ce5ced
Since the Is there some way we could add an Or, alternatively, I think we could set |
Thanks a lot for this feedback and the analysis !
I need to understand what this value represent. If I look to other themes, there is either no value (like in I should read the spec for those theme file to understand. 🤔
However, I think we can handle Normal specifically and at least do that. I think this would be ok to add |
Thanks, I think exposing the value in this way would work well for me. I don't have a preference in terms of naming, happy to use whichever is decided. |
This PR just export two more CSS variables to pass the information about color used for code blocks.
This complements the other variables already defined for extension.
closes #10717 for quarto side.
quarto-live
will need to do the rest. cc @georgestaggThis needs to be checked against various example to see if that is enough to handle all themes.
So opening as a draft