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

(feat) Even more left nav UI tweaks #647

Merged
merged 1 commit into from
Mar 16, 2023
Merged
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
63 changes: 27 additions & 36 deletions packages/framework/esm-styleguide/src/left-nav/left-nav.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,39 @@

.leftNav {
border-right: 1px solid $ui-03;
margin-top: 1rem;
padding-top: 1rem;

:global(.active-left-nav-link) {
background-color: $ui-03;
outline: none;
border-left: 0.25rem solid var(--brand-01);
// Left nav menu item
:global(.cds--side-nav__link) {
color: $text-02;
@include type.type-style("heading-compact-01");

> :global(.cds--side-nav__link) {
padding: 0 0.75rem;
color: $ui-05;
&:focus,
&:hover {
background-color: $ui-01;
}
}

div {
&:global(.omrs-breakpoint-gt-tablet) {
padding-top: 1rem;
// Active menu item
&:global(.active-left-nav-link) {
color: $ui-05;
border-left: 0.25rem solid var(--brand-01);
background-color: $ui-03;
outline: none;
padding: 0 0.75rem;
}
}
}

a {
:global(.omrs-breakpoint-gt-tablet) {
height: 2rem;
}

:global(.omrs-breakpoint-lt-desktop) {
height: 3rem;
}

color: $ui-04;
@include type.type-style("heading-compact-01");
color: $text-02;

&:hover {
background-color: $ui-03;
color: $ui-05;
border-left: var(--brand-01);
}
/* Desktop */
:global(.omrs-breakpoint-gt-tablet) {
:global(.cds--side-nav__link) {
height: 2rem;
}
}

&:focus {
background-color: $ui-03;
color: $ui-05;
border-left: var(--brand-01);
}
}
/* Tablet */
:global(.omrs-breakpoint-lt-desktop) {
:global(.cds--side-nav__link) {
height: 3rem;
Copy link
Member

Choose a reason for hiding this comment

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

I believe this should be taken by the size prop of the menu item instead of CSS, creates confusion when making changes in the component. Faced it when working with tables too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Although, there is a large prop on side nav links which applies the .#{$prefix}--side-nav__item--large class which defaults to 3rem.

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't see it in the docs. Mind dropping a link, Ian?

Copy link
Member Author

Choose a reason for hiding this comment

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

Never mind, just seen it

Copy link
Member

Choose a reason for hiding this comment

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

The SideNavLink component in the docs you shared. The class I was referring to is defined here

}
}