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
Connect: Adjust to the light theme #27080
Conversation
1708ed5
to
a07d55c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good! 👍
I'm looking forward to the tab bar changes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this.
I also changed "Drag your files here" border to match the input's border.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I wanted to solve these two things at once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not relevant to the PR, but on full HD the colors on smaller fonts seem to blur a little bit. This is less visible on the dark theme. Compare the Refresh button in the top right and the table headers.
I don't think it's necessarily the fault of the colors, those fonts could be just bigger.
Light | Dark |
---|---|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious if this is related to: https://www.electronjs.org/docs/latest/faq#the-font-looks-blurry-what-is-this-and-what-can-i-do
I have not changed the browser window background color, so it still dark. Would like to test it when you have some time with light bg? (I don't have FHD display 😞)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the browser window background is already light since it uses theme.colors.levels.sunken
. theme
in this context is the light theme since I replaced it whole in the theme provider.
I didn't even look at the code, I'll do so tomorrow. |
…drop area as for the input
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find anything else that @ravicious hadn't already pointed out. Looks fine to me
Not a blocker for merging, but for the tabs, the active tab should ideally merge with the rest of the window like they are part of the same page, sunken slightly below the other tabs. This may be tricky to pull off elegantly in HTML, but if nothing else we could fake it with some clever overlapping of elements to hide the shadow below the active tab and inset shadows to make it look like the tab has shadow falling on it, too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks fine other than the one hardcoded color.
@@ -50,7 +50,8 @@ export function CliCommand({ cliCommand, onRun, isLoading }: CliCommandProps) { | |||
> | |||
<Flex | |||
mr="2" | |||
color={shouldDisplayIsLoading ? 'text.slightlyMuted' : 'text.main'} | |||
// always use light colors | |||
color={shouldDisplayIsLoading ? 'rgba(255, 255, 255, 0.72)' : 'light'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove the hardcoded color? It won't play nice with custom themes that we eventually want to add.
Not sure what are some of the ways we can solve this, perhaps we could manipulate the opacity instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the color modification function to manually add some transparency to the light
color.
The reason for that low contrast between different colors when colored background is used is the option I'm not a heavy terminal user, but tbh I have not seen combinations like green on blue in a real use. Usually, when some background color is set, the foreground is black or white. But even if such combination is used, it seems to me that the readability of the text is more important than its color, right? The only thing that I don't understand is black color in |
I see, in that case only the black and white backgrounds seem out of place. Is it maybe because xterm doesn't recognize the default color of the background properly? So when Also, do you know why VSCode supports hue & saturation and we don't? |
I suggested this back when we were adding that shadow to the top bar (#24883 (comment)) after Grzegorz pointed out the problem with the new colors (#24883 (comment)). Grzegorz tried to make it work back then but it still required a few touch ups and IIRC we didn't have that much time back then to focus on the details. |
Yeah, it looks like xterm incorrectly calculates final color when semitransparent background is used. I prepared a comparison of how different combinations look like together. By alpha colors I mean that brightWhite: lighten('#0C143D', 0.89),
white: lighten('#0C143D', 0.78),
brightBlack: lighten('#0C143D', 0.61),
black: lighten('#0C143D', 0.46),
Looks like the third options is the most legible one, I only miss the colors on a black background (cell C1) - they all look the same, it looks better in B1 :/
Yes, I've just discovered it. |
I agree that the third column looks best. I think we could go with this for now and leave the hue & saturation stuff for later. The colors on black background would probably look better if it was actually black and not grey but that's up to Kenny I guess. 😏 |
Right, the colors look good when black is #000. A summary for @roraback:
|
Codifying Slack DM discussion: although Connect and the Web UI currently have different CLI background colors, I'd like these to be the same going forward; ideally Connect and the web UI will only differ when there's a functional reason for them to do so. In the design system in Figma, I set up all of the contrast ratios to work with the darkest blue background: #0c143d and the darkest off-white background, #e6e9ea. It is not a blocker for this PR, though—the web UI and Connect already have different background colors for the terminal theme, so it isn't a regression. |
* Adjust Connect to light theme * Remove `clusters/*` element * Add terminal colors * Remove warning about using `false` as `color` * Add custom styling for `Toggle` * Fix light theme for file transfer, use the same border color for the drop area as for the input * Do not hardcode color in `CliCommand` * Use #000 as black * Convert rgba colors to be non-opaque * Fix two slightly incorrect colors (cherry picked from commit 1220470)
* Connect: Adjust to the light theme (#27080) * Adjust Connect to light theme * Remove `clusters/*` element * Add terminal colors * Remove warning about using `false` as `color` * Add custom styling for `Toggle` * Fix light theme for file transfer, use the same border color for the drop area as for the input * Do not hardcode color in `CliCommand` * Use #000 as black * Convert rgba colors to be non-opaque * Fix two slightly incorrect colors (cherry picked from commit 1220470) * Connect: Add theme configuration (#27788) * Add a config item for the theme and adjust Electron's `nativeTheme` based on that * Listen to theme changes and update the app accordingly * React to theme changes in teleterm stories * Rename channel * Return boolean from handlers * Do not mock the whole app context in storybook * Fix linting issue * Fix typo (cherry picked from commit 95e6482) * Connect: Make tabs shadows look better (#27931) * Add bottom shadow for inactive tabs and inset for the active one * Add shadow for new tab item by using common styling * Adjust `KeyboardShortcutsPanel` to the light theme * Center Servers/Databases/Kubes navbar vertically between tabs and table by using the same margin values (8px) * Set title on the element that is dragged (cherry picked from commit 1220470)
Contributes to #27079
e https://github.com/gravitational/teleport.e/pull/1522
Our theme was used incorrectly in some places. This led to some visual issues when applied the light theme. This PR fixes that.
The PR also adds our own terminal theme, which we have worked on with @roraback (it will be reused by the WebUI, fyi @rudream). I think this the most important part of the PR, I have tested the terminal in various cases and I think the colors look good, but I would like to hear other's voices.
To test the changes, please manually replace
theme.colors
intheme.ts
with the values from the light theme (also please remember about changing the theme name tolight
- it is hardcoded in some places, unfortunately).Patch
An app setting and the logic that will switch between the themes will be added in another PR.
Btw, I think we should work more on that shadow below the tabs, IMO it was okay on the dark theme, but on the light it looks worse :( I have some ideas, I will send PR after a discussion with the design team.