Skip to content

Commit

Permalink
fix(core-components): Sidebar styles
Browse files Browse the repository at this point in the history
1. Remove unused class "nav-content".
2. Use anchor tag pseduo classes to overwrite "elements.css".
3. Add missing style for nav content.

Depends on: e859114 (i.e. previous commit)
  • Loading branch information
wesleyboar committed Jun 20, 2022
1 parent e859114 commit 2243276
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libs/core-components/src/lib/Sidebar/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const SidebarItem = ({ to, iconName, label, children, disabled, hidden }) => {
<div
className={`${disabled ? styles['disabled'] : ''} ${
styles['content']
} nav-content`}
}`}
>
<Icon name={iconName} />
<span className={styles['text']}>{label}</span>
Expand Down
11 changes: 7 additions & 4 deletions libs/core-components/src/lib/Sidebar/Sidebar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,25 @@
padding-top: 20px;
}

.link {
.link:is(:link, :visited) {
color: var(--global-color-primary--dark);
font-weight: 500;
}
.link:hover,
.link--active {
.link--active:is(:link, :visited) {
color: var(--global-color-primary--x-dark); /* to pass color contrast test */
background-color: var(--global-color-accent--weak);
}
.link--active,
.link:active {
.link:active,
.link--active:is(:link, :visited) {
font-weight: 700;
}

.content {
padding-left: 20px;

display: flex;
align-items: center;
}

.text {
Expand Down

0 comments on commit 2243276

Please sign in to comment.