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

Add styles for locked nav #2

Merged
merged 1 commit into from
Aug 26, 2019
Merged
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
4 changes: 2 additions & 2 deletions src/core/public/chrome/ui/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import { Header as HeaderUI, HeaderProps } from './header/header';
export const Header: FunctionComponent<HeaderProps> = props => {
const [isLocked, setIsLocked] = useState(false);
const className = classnames(
'header-global-wrapper',
'chrHeaderWrapper',
{
'header-global-wrapper--isNavLocked': isLocked,
'chrHeaderWrapper--navIsLocked': isLocked,
},
'hide-for-sharing'
);
Expand Down
29 changes: 20 additions & 9 deletions src/core/public/chrome/ui/header/_index.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
@import '@elastic/eui/src/components/header/variables';
@import '@elastic/eui/src/components/nav_drawer/variables';

.header-global-wrapper {
.chrHeaderWrapper {
width: 100%;
position: fixed;
top: 0;
z-index: 10;
}

.header-global-wrapper + .app-wrapper:not(.hidden-chrome) {
.chrHeaderWrapper ~ .app-wrapper:not(.hidden-chrome) {
top: $euiHeaderChildSize;
left: $euiHeaderChildSize;

Expand All @@ -19,13 +20,6 @@
}
}

// Mobile header is smaller
@include euiBreakpoint('xs', 's') {
.header-global-wrapper + .app-wrapper:not(.hidden-chrome) {
left: 0;
}
}

.chrHeaderHelpMenu__version {
text-transform: none;
}
Expand All @@ -34,3 +28,20 @@
align-self: center;
margin-right: $euiSize;
}

// Mobile header is smaller
@include euiBreakpoint('xs', 's') {
.chrHeaderWrapper ~ .app-wrapper:not(.hidden-chrome) {
left: 0;
}
}

@include euiBreakpoint('xl') {
.chrHeaderWrapper--navIsLocked {
~ .app-wrapper:not(.hidden-chrome) {
// Shrink the content from the left so it's no longer overlapped by the nav drawer (ALWAYS)
left: $euiNavDrawerWidthExpanded !important; // sass-lint:disable-line no-important
transition: left $euiAnimSpeedFast $euiAnimSlightResistance;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ body.canvas-isFullscreen { // sass-lint:disable-line no-qualifying-elements
}

// remove space for global nav elements
.header-global-wrapper + .app-wrapper {
left: 0;
.chrHeaderWrapper ~ .app-wrapper {
// Override locked nav at all breakpoints
left: 0 !important; // sass-lint:disable-line no-important
top: 0;
}

Expand All @@ -16,7 +17,7 @@ body.canvas-isFullscreen { // sass-lint:disable-line no-qualifying-elements
}

// hide all the interface parts
.header-global-wrapper, // K7 global top nav
.chrHeaderWrapper, // K7 global top nav
.canvasLayout__stageHeader,
.canvasLayout__sidebar,
.canvasLayout__footer,
Expand Down