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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add theme support for code snippet #5004
Conversation
Demo starting at https://vanilla-framework-5004.demos.haus |
scss/_settings_colors.scss
Outdated
@@ -109,6 +109,8 @@ $colors--light-theme--text-inactive: rgba($color-x-dark, $inactive-text-opacity- | |||
$colors--light-theme--link-default: $color-link !default; | |||
$colors--light-theme--link-visited: $color-link-visited !default; | |||
|
|||
$colors--light-theme--code-background-default: $color-code-background !default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we will need different code backgrounds, so I would treat it as a variant of background colour.
So following out naming conventions it would be $colors--light-theme--background-code
instead.
Please update all the names to follow this convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where did this code background come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have them defined already, this is just moving them into CSS variables in theme:
vanilla-framework/scss/_settings_colors.scss
Lines 55 to 56 in 5f97871
$color-code-background: rgba($color-x-dark, 0.03); | |
$color-code-background-dark: rgba($color-x-light, 0.3); |
@lyubomir-popov Is this ok from design point of view? Uses dark background for code (that we have already in Vanilla). |
The background of the code snippet has a lot more contrast with the base background than in the light theme, how was that derived? I think we need to make it similar to the contrast we have in the light theme. |
@lyubomir-popov This is what we have in Vanilla for a while: https://vanillaframework.io/docs/examples/base/code-inline-dark If we need to adjust this, it's a good moment to do this. Can you suggest other values? What should the code background be (on white, paper, dark)? |
Hi I don't have capacity to do this right now, please proceed with this, and we can improve later. |
13dcca8
to
daeffe9
Compare
daeffe9
to
89aebe5
Compare
@@ -13,11 +13,11 @@ | |||
&.prolog, | |||
&.doctype, | |||
&.cdata { | |||
color: $colors--light-theme--text-muted; | |||
color: $colors--theme--text-muted; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to look into theming rest of the syntax highlighting colours, but this can wait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for that!
Done
/dropdown-multiple-dark
,/default-dark
,/icon-dark
Not done
Fixes WD-8977
QA
docs/examples
and check if code snippets' themes update accordinglyCheck if PR is ready for release
If this PR contains Vanilla SCSS code changes, it should contain the following changes to make sure it's ready for the release:
Feature 馃巵
,Breaking Change 馃挘
,Bug 馃悰
,Documentation 馃摑
,Maintenance 馃敤
.package.json
should be updated relative to the most recent release, following semver convention:Screenshots