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 CSS: data-vscode-theme-name attribute changes when the language changes #149661

Closed
pwang347 opened this issue May 16, 2022 · 1 comment · Fixed by #154635
Closed

Webview CSS: data-vscode-theme-name attribute changes when the language changes #149661

pwang347 opened this issue May 16, 2022 · 1 comment · Fixed by #154635
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders verified Verification succeeded webview Webview issues

Comments

@pwang347
Copy link
Member

pwang347 commented May 16, 2022

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.68.0-insider
  • OS Version: Windows 10

Steps to Reproduce:

  1. Write webview CSS depending on data-vscode-theme-name, e.g. see support limit markdown.styles active in single theme #97663 (comment)
  2. Change the language by installing a language pack - the CSS will stop working

Would it be possible to use an ID instead of a name string for this attribute (e.g. a new attribute to prevent breaking changes), or perhaps to force this attribute to be English only?

@mjbvz mjbvz self-assigned this May 16, 2022
@mjbvz mjbvz added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities webview Webview issues labels May 16, 2022
pingren added a commit to pingren/vscode that referenced this issue Jul 9, 2022
Fixes microsoft#149661

Adds a data attribute to webviews with the themeId. Extension could write theme specific CSS for webviews. Unlike theme name, themeId will not change if changing the display language.
@pingren
Copy link
Contributor

pingren commented Jul 9, 2022

@pwang347 @mjbvz

I submitted a PR to address the issue. Please take a look when you have a moment.

pingren added a commit to pingren/vscode that referenced this issue Jul 24, 2022
pingren added a commit to pingren/vscode that referenced this issue Sep 5, 2022
pingren added a commit to pingren/vscode that referenced this issue Sep 13, 2022
@mjbvz mjbvz added this to the September 2022 milestone Sep 22, 2022
mjbvz added a commit that referenced this issue Sep 23, 2022
* Expose data-vscode-theme-id and data-vscode-theme-label in webviews, deprecate data-vscode-theme-name.

Fixes #149661

* fix: remove useless id in test

* Use settingId and remove theme-label

Co-authored-by: Matt Bierner <matb@microsoft.com>
@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Sep 23, 2022
@connor4312 connor4312 added the verified Verification succeeded label Sep 30, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders verified Verification succeeded webview Webview issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants