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

Added a tooltip for keyboard navigation #83

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion packages/app/client/src/ui/shell/navBar/navBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
box-shadow: var(--box-shadow-right);
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
width: 50px;
}
Expand Down Expand Up @@ -125,6 +124,10 @@
border: 1px solid transparent;
}

> span {
color: transparent;
}

&:hover {
border: var(--nav-link-hover-border);
> div {
Expand All @@ -140,6 +143,23 @@
&::before {
opacity: var(--nav-focused-tag-bg-opacity);
}

> span {
position: absolute;
z-index: 1;
background-color: var(--nav-link-tooltip-bg);
color: var(--nav-link-tooltip-color);
border: var(--nav-link-tooltip-border);
white-space: nowrap;
font-size: 12px;
text-align: center;
padding: 4px;
top: 22px;
left: 22px;
transition-property: visibility;
transition-duration: 2s;
visibility: hidden;
}
}

&:active {
Expand Down
6 changes: 6 additions & 0 deletions packages/app/client/src/ui/shell/navBar/navBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export class NavBarComponent extends React.Component<NavBarProps, NavBarState> {
>
<div />
{this.renderNotificationBadge(title)}
{this.renderKeyboardTooltip(title)}
</button>
);
});
Expand All @@ -145,4 +146,9 @@ export class NavBarComponent extends React.Component<NavBarProps, NavBarState> {
}
return null;
}

/** Renders a tooltip for keyboard navigation */
private renderKeyboardTooltip(title: string): JSX.Element {
return <span>{title}</span>;
}
}
3 changes: 3 additions & 0 deletions packages/app/client/src/ui/styles/themes/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ html {
--nav-link-hover-border: 1px solid transparent;
--nav-link-badge-color: var(--neutral-1);
--nav-link-badge-bg: #FF0000;
--nav-link-tooltip-bg: #212121;
--nav-link-tooltip-color: #C8C8C8;
--nav-link-tooltip-border: 1px solid #444;

/* input[type="text"] */
--input-color: var(--neutral-1);
Expand Down
3 changes: 3 additions & 0 deletions packages/app/client/src/ui/styles/themes/high-contrast.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ html {
--nav-link-hover-border: var(--list-item-hover-border);
--nav-link-badge-color: var(--neutral-1);
--nav-link-badge-bg: #FF0000;
--nav-link-tooltip-bg: #000;
--nav-link-tooltip-color: #FFF;
--nav-link-tooltip-border: 1px solid #72C3DF;

/* input[type="text"] */
--input-color: var(--neutral-1);
Expand Down
3 changes: 3 additions & 0 deletions packages/app/client/src/ui/styles/themes/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ html {
--nav-link-hover-border: 1px solid transparent;
--nav-link-badge-color: var(--neutral-1);
--nav-link-badge-bg: #FF0000;
--nav-link-tooltip-bg: #FFF;
--nav-link-tooltip-color: #000;
--nav-link-tooltip-border: 1px solid #000;

/* input[type="text"] */
--input-color: var(--neutral-12);
Expand Down