Skip to content
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

Webview: allow me to adjust my content based on theme #5737

Closed
bpasero opened this issue Apr 25, 2016 · 4 comments
Closed

Webview: allow me to adjust my content based on theme #5737

bpasero opened this issue Apr 25, 2016 · 4 comments
Assignees
Labels
feature-request Request for new features or functionality
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Apr 25, 2016

I am providing content to the webview via my extension. The user can switch between dark and light theme so I would like my content to adjust based on the selected theme.

I think the simplest solution would be to just set a CSS class on the container I am hosted in that reflects the theme that is being used (light or dark).

Another thought I had was to maybe leverage CSS variables that are available in recent Chrome releases (https://developers.google.com/web/updates/2016/02/css-variables-why-should-you-care?hl=en). I could get access to the base colors a theme defines via variables.

In the end, maybe both things are desired.

@jrieken fyi

@bpasero bpasero added the feature-request Request for new features or functionality label Apr 25, 2016
@jrieken jrieken added this to the May 2016 milestone May 12, 2016
@jrieken
Copy link
Member

jrieken commented May 12, 2016

theme so I would like my content to adjust based on the selected theme.

that sounds like an event but I don't know if we need that. By default, some styles where defined in the * selector. I have know a change where those styles are applied to the body only but its values come from corresponding variables, like so:

:root {
    --background-color: ${backgroundColor};
    --color: ${color};
    --font-family: ${fontFamily};
    --font-size: ${fontSize};
}

Unsure if that's what you want. Is it that you need to set more styles and need different variables?

@bpasero
Copy link
Member Author

bpasero commented May 12, 2016

Given that @kieferrm took the markdown extension over, maybe he can chime in how he expects support for dark and light theme to work.

@jrieken
Copy link
Member

jrieken commented May 17, 2016

@kieferrm Can you enlighten me with what you are planning there?

@jrieken
Copy link
Member

jrieken commented May 20, 2016

I think we are good here

@jrieken jrieken closed this as completed May 20, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants