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

Use vscode styles #455

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

noamzaks
Copy link

@noamzaks noamzaks commented Jul 31, 2021

This basically uses VSCode's button styling (and can probably add more similar styling)

I.e. the RioLog looks like this
riolog-new
when previously it looked like this
riolog-old

Similarly:
createproject-new
2020import-new
eclipseimport-new

PS. I didn't want to bombard with PRs but the RioLog page is missing the WPILib logo. A suggested fix can be found here.

@@ -0,0 +1,55 @@
const applyVsCodeStyling = () => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be cleaner/simpler if you had static .css files that you included in the webviews like in this example:

https://github.com/microsoft/vscode-extension-samples/blob/main/webview-sample/media/reset.css
https://github.com/microsoft/vscode-extension-samples/blob/main/webview-sample/media/vscode.css

And include them in the webviews like this: https://github.com/microsoft/vscode-extension-samples/blob/main/webview-sample/src/extension.ts#L201

Or maybe you can put those files in a vscode-wpilib/resources/css folder and include them into webviews like projectcreator.html by adding this to the <head> tag:

<link href="../css/reset.css" rel="stylesheet">
<link href="../css/vscode.css" rel="stylesheet">

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried going this way but using the relative path doesn't seem to work for me.
I think maybe we should use the styling from these files, but keep the way it is currently set up.
What do you think?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you get some sort of console error? I'm not too familiar with this extension so I'd have to run it myself to see what the issue might be.

It looks like they're updating urls by replacing text in the html: https://github.com/wpilibsuite/vscode-wpilib/blob/main/vscode-wpilib/src/webviews/webviewbase.ts#L52

So I guess you can do something similar to what they do here? https://github.com/wpilibsuite/vscode-wpilib/blob/main/vscode-wpilib/resources/webviews/projectcreator.html#L18

So something like:

<link href="replaceresource/resources/css/reset.css" rel="stylesheet">
<link href="replaceresource/resources/css/vscode.css" rel="stylesheet">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants