Skip to content

Commit

Permalink
Chat: Improve JetBrains and Visual Studio themes (#5265)
Browse files Browse the repository at this point in the history
This commit refines the JetBrains and Visual Studio themes for webviews:

JetBrains Theme:

- Removes custom scrollbar styles for pre and .model-selector-popover
elements, aligning with the default JetBrains experience (but currently
still not working correctly, will address in a follow-up).
- Uses var(--jetbrains-ActionButton-hoverBackground) for hover
background on .tw-bg-muted-transparent elements.
- Adds padding for the editor input box:

![image](https://github.com/user-attachments/assets/c6568cfb-6bd5-43f2-9b75-f12c4395d5d7)


Visual Studio Theme:

- Defines missing color variables for input validation and active
options, enhancing consistency with the Visual Studio theme. These
changes improve the overall visual fidelity and consistency of the
webview themes.
- Commented out variables that are currently not used.

## Test plan

<!-- Required. See
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles.
-->

Stylesheets update - check UI.

Currently on main:


![image](https://github.com/user-attachments/assets/b3d88b6e-3a5a-48d7-8696-c5ad1c74449b)


After:


![image](https://github.com/user-attachments/assets/7433f5c7-fd9a-43d6-b8df-eed20bf63f86)


## Changelog

<!-- OPTIONAL; info at
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c
-->
  • Loading branch information
abeatrix authored Aug 21, 2024
1 parent 4b7843c commit e4661c5
Show file tree
Hide file tree
Showing 3 changed files with 517 additions and 540 deletions.
4 changes: 4 additions & 0 deletions lib/prompt-editor/src/BaseEditor.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@
.theme-paragraph {
margin: 0;
}

html[data-ide='JetBrains'] .theme-paragraph {
padding: 0.5rem;
}
37 changes: 4 additions & 33 deletions vscode/webviews/themes/jetbrains.css
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ html[data-ide='JetBrains'] {
--vscode-editorIndentGuide-activeBackground5: var(--jetbrains-Menu-selectionForeground);
--vscode-editorIndentGuide-activeBackground6: var(--jetbrains-TextPane-selectionForeground);
--vscode-editorIndentGuide-background: var(--jetbrains-Separator-foreground);
--vscode-editorIndentGuide-background1: var(--jetbrains-Scrollbar-foreground);
--vscode-editorIndentGuide-background1: var(--jetbrains-scrollbar);
--vscode-editorIndentGuide-background2: var(--jetbrains-Scrollbar-background);
--vscode-editorIndentGuide-background3: var(--jetbrains-Scrollbar-thumb);
--vscode-editorIndentGuide-background4: var(--jetbrains-Scrollbar-thumbShadow);
Expand Down Expand Up @@ -585,15 +585,11 @@ html[data-ide='JetBrains'] {
--vscode-editor-font-weight: var(--font-weight);
--vscode-editor-font-size: var(--type-ramp-minus1-font-size);


--vscode-widget-shadow: rgba(0, 0, 0, 0.36);

/* todo: get this from the vscode implementation instead of hardcoded on this theme file*/
--vscode-font-size: 13px;

/* Mimic rules injected by VSCode */
scrollbar-color: var(--vscode-scrollbarSlider-background) var(--vscode-editor-background);

}

/* Mimic rules injected by VSCode */
Expand Down Expand Up @@ -640,38 +636,13 @@ html[data-ide='JetBrains'] pre code {
padding: 0;
}

html[data-ide='JetBrains'] pre::-webkit-scrollbar {
width: 14px;
height: 14px;
background-color: transparent;
}

html[data-ide='JetBrains'] pre::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.15);
border-radius: 100px;
border: 3px solid var(--jetbrains-Desktop-background);
}

html[data-ide='JetBrains'] blockquote {
background: var(--vscode-textBlockQuote-background);
border-color: var(--vscode-textBlockQuote-border);
}


html[data-ide='JetBrains'] .model-selector-popover::-webkit-scrollbar {
width: 10px;
height: 8px;
background-color: transparent;
}

html[data-ide='JetBrains'] .model-selector-popover::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.15);
border-radius: 100px;
border: 1px solid var(--vscode-sideBar-background);
}

/* color-mix is not supported on JetBrains webview */
html[data-ide=JetBrains] .context-item-mention-node {
html[data-ide='JetBrains'] .context-item-mention-node {
color: var(--vscode-inputOption-activeForeground);
background-color: var(--vscode-badge-background);
gap: 0.2rem;
Expand All @@ -682,10 +653,10 @@ html[data-ide=JetBrains] .context-item-mention-node {
}
}

html[data-ide=JetBrains] .container {
html[data-ide='JetBrains'] .container {
background-color: var(--vscode-input-background);
}

html[data-ide=JetBrains] .hover\:tw-bg-muted-transparent:hover {
html[data-ide='JetBrains'] .tw-bg-muted-transparent:hover {
background-color: var(--jetbrains-ActionButton-hoverBackground);
}
Loading

0 comments on commit e4661c5

Please sign in to comment.