-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
81 additions
and
52 deletions.
There are no files selected for viewing
46 changes: 0 additions & 46 deletions
46
packages/core/chrome/core-chrome-browser-internal/src/ui/header/collapsible_nav.scss
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
...ages/core/chrome/core-chrome-browser-internal/src/ui/header/get_collapsible_nav_styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
import { UseEuiTheme, euiYScroll, mathWithUnits } from '@elastic/eui'; | ||
import { css } from '@emotion/react'; | ||
|
||
export const getCollapsibleNavStyles = (euiThemeContext: UseEuiTheme) => { | ||
const { euiTheme } = euiThemeContext; | ||
const screenHeightBreakpoint = mathWithUnits(euiTheme.size.base, (x) => x * 15); | ||
const _euiYScroll = euiYScroll(euiThemeContext); | ||
|
||
const navCss = css` | ||
@media (max-height: ${screenHeightBreakpoint}) { | ||
overflow-y: auto; | ||
} | ||
`; | ||
|
||
const navRecentsListGroupCss = [ | ||
css` | ||
max-height: calc(${euiTheme.size.base} * 10); | ||
margin-right: -${euiTheme.size.s}; | ||
`, | ||
_euiYScroll, | ||
]; | ||
|
||
const navSolutions = [ | ||
_euiYScroll, | ||
css` | ||
/** | ||
* Allows the solutions nav group to be viewed on | ||
* very small screen sizes and when the browser Zoom is high | ||
*/ | ||
@media (max-height: ${screenHeightBreakpoint}) { | ||
flex: 1 0 auto; | ||
} | ||
`, | ||
]; | ||
|
||
/** | ||
* 1. Increase the hit area of the link (anchor) | ||
* 2. Only show the text underline when hovering on the text/anchor portion | ||
*/ | ||
const navSolutionGroupButton = css` | ||
display: block; /* 1 */ | ||
&:hover { | ||
text-decoration: none; /* 2 */ | ||
} | ||
`; | ||
|
||
const navSolutionGroupLink = css` | ||
display: block; /* 1 */ | ||
&:hover { | ||
text-decoration: underline; /* 2 */ | ||
} | ||
`; | ||
|
||
return { | ||
navCss, | ||
navRecentsListGroupCss, | ||
navSolutions, | ||
navSolutionGroupButton, | ||
navSolutionGroupLink, | ||
}; | ||
}; |