Skip to content

Commit

Permalink
fix: (Core) remove responsive paddings when Shellbar is used with Sid…
Browse files Browse the repository at this point in the history
…e Nav (#4566)

* fix: (Core) remove responsive paddings when Shellbar is used with Side Nav

* remove unnecessary type
  • Loading branch information
InnaAtanasova committed Feb 4, 2021
1 parent cf394c7 commit aa46dbb
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<fd-shellbar class="fd-shellbar-navigation-custom">
<fd-shellbar [sideNav]="true">
<button
fd-shellbar-side-nav
fd-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
display: none;
}

.fd-shellbar-navigation-custom {
.fd-shellbar {
padding: 0;
}
}

.shellbar-sidenav-content-example {
display: flex;
align-items: flex-start;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
Shellbar with SideNavigation
</fd-docs-section-title>
<description>
There is used <code>sideNavigation</code> in the <code>Shellbar</code> component. To add some control button, it is
mandatory to use <code>fd-shellbar-side-nav</code>, which will be placed in the left side of shellbar.
When Shellbar is used together with Vertical Navigation (aka Side Navigation) set the
<code>sideNav</code> property to <b>true</b>. This will remove the responsive paddings applied on different screen sizes and will align vertically the control button with the items in the Side Navigation. The control button, situated on the far left hand-side of the Shellbar, is responsible for switching the modes of the Side Navigation (expanded, condensed and off-screen) and requires the <code>fd-shellbar-side-nav</code> directive.
</description>
<component-example>
<fd-shellbar-side-nav-example></fd-shellbar-side-nav-example>
Expand Down
5 changes: 4 additions & 1 deletion libs/core/src/lib/shellbar/shellbar.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<div class="fd-shellbar" [ngClass]="'fd-shellbar--' + size">
<div
class="fd-shellbar"
[ngClass]="'fd-shellbar--' + size"
[class.fd-shellbar--side-nav]="sideNav">
<div class="fd-shellbar__group fd-shellbar__group--product">
<ng-content select="[fd-shellbar-side-nav]"></ng-content>
<ng-content select="fd-shellbar-logo"></ng-content>
Expand Down
18 changes: 17 additions & 1 deletion libs/core/src/lib/shellbar/shellbar.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,21 @@

.fd-shellbar__group {
flex-basis: auto;
}
}

&--side-nav {
&.fd-shellbar--s,
&.fd-shellbar--m,
&.fd-shellbar--l,
&.fd-shellbar--xl {
padding: 0 0.5rem 0 0;

@at-root {
[dir="rtl"] &,
&[dir="rtl"] {
padding: 0 0 0 0.5rem;
}
}
}
}
}
7 changes: 7 additions & 0 deletions libs/core/src/lib/shellbar/shellbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ export class ShellbarComponent implements AfterContentInit {
@Input()
size: ShellbarSizes = 'm';

/**
* Whether the Shellbar is used with Side Navigation
* When set to true, the responsive paddings are not applied
*/
@Input()
sideNav = false;

/** @hidden */
@ContentChild(ComboboxComponent, { static: false })
comboboxComponent: ComboboxComponent;
Expand Down

0 comments on commit aa46dbb

Please sign in to comment.