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

[plug-in] webview and css #4179

Closed
benoitf opened this issue Jan 28, 2019 · 3 comments
Closed

[plug-in] webview and css #4179

benoitf opened this issue Jan 28, 2019 · 3 comments
Assignees
Labels
bug bugs found in the application plug-in system issues related to the plug-in system

Comments

@benoitf
Copy link
Contributor

benoitf commented Jan 28, 2019

There is an issue when using some "Theia CSS" variables in a plug-in's web-view

Let say we use in our own CSS (css of the web-view) --theia-accent-color0, this variable won't be resolved.

It's because definition of variable is using

-theia-accent-color0: var(--md-blue-900);

and all these material design colors (like https://github.com/theia-ide/theia/blob/248775060d2e4815306ac025b18f67364ff5d62a/packages/core/src/browser/style/materialcolors.css) are not included in the webview iframe

@benoitf benoitf added bug bugs found in the application plug-in system issues related to the plug-in system labels Jan 28, 2019
@svenefftinge
Copy link
Contributor

But why do you expect --theia-accent-color0 being available in an iframe?

@benoitf
Copy link
Contributor Author

benoitf commented Feb 1, 2019

@svenefftinge the same I expect VSCode constants
https://code.visualstudio.com/api/extension-guides/webview

Webviews can also access VS Code theme colors using CSS variables. These variable names are prefixed with vscode and replace the . with -. For example editor.foreground becomes var(--vscode-editor-foreground):

csscode {
    color: var(--vscode-editor-foreground);
}

@benoitf
Copy link
Contributor Author

benoitf commented Feb 1, 2019

It's to have the rendering of an iframe looking integrated in the IDE, (so matching styles and handling theme switch, etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application plug-in system issues related to the plug-in system
Projects
None yet
Development

No branches or pull requests

3 participants