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

[UX] Restyle global breadcrumbs #1954

Merged
merged 11 commits into from
Jul 28, 2022
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
3 changes: 3 additions & 0 deletions src/core/public/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@import "@elastic/eui/src/global_styling/variables/header";

$osdHeaderOffset: $euiHeaderHeightCompensation;
$osdHeaderBreadcrumbBlueBackground: #b9d9eb;
$osdHeaderBreadcrumbGrayBackground: #d9e1e2;
$osdHeaderBreadcrumbCollapsedLink: #002a3a;
8 changes: 8 additions & 0 deletions src/core/public/chrome/public/assets/round_filter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions src/core/public/chrome/ui/header/header_breadcrumbs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@import "../../../../public/variables";

$firstBreadcrumbPolygon: polygon(
0% 0%,
100% 0%,
calc(100% - #{$euiSizeS}) 100%,
0% 100%
);
$breadcrumbPolygon: polygon(
$euiSizeS 0%,
100% 0%,
calc(100% - #{$euiSizeS}) 100%,
0% 100%
);

.osdHeaderBreadcrumbs {
/*
filter defines a custom filter effect by grouping atomic filter primitives!
here we are using Gaussian filter with stdDeviation for applying
border-radius on clipped background.
*/

filter: url("../../public/assets/round_filter.svg#round");

.osdBreadcrumbs {
clip-path: $breadcrumbPolygon;
background-color: $osdHeaderBreadcrumbGrayBackground;
padding: $euiSizeXS - 2.5 $euiSizeL - $euiSizeXS;
Copy link
Collaborator

Choose a reason for hiding this comment

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

- 2.5 $euiSizeL ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

padding:
top and bottom paddings are $euiSizeXS - 2.5 => 1.5px
right and left paddings are $euiSizeL - $euiSizeXS => 20px


&:first-child {
clip-path: $firstBreadcrumbPolygon;
}

&:last-child {
background-color: $osdHeaderBreadcrumbBlueBackground;
}
}

.euiBreadcrumbSeparator {
display: none;
}

.euiBreadcrumb__collapsedLink {
color: $osdHeaderBreadcrumbCollapsedLink;
background: $euiColorEmptyShade;
}

.euiPopover__anchor {
padding: 0 $euiSizeS;
}

.euiBreadcrumb:not(.euiBreadcrumb:last-child) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

.euiBreadcrumb:not(.euiBreadcrumb:last-child) { can simply be .euiBreadcrumb:not(:last-child) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just overriding the already existing css! so going with what they already have!

margin-right: 0;
}
}
12 changes: 11 additions & 1 deletion src/core/public/chrome/ui/header/header_breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import useObservable from 'react-use/lib/useObservable';
import { Observable } from 'rxjs';
import { ChromeBreadcrumb } from '../../chrome_service';

import './header_breadcrumbs.scss';

interface Props {
appTitle$: Observable<string>;
breadcrumbs$: Observable<ChromeBreadcrumb[]>;
Expand All @@ -57,7 +59,15 @@ export function HeaderBreadcrumbs({ appTitle$, breadcrumbs$ }: Props) {
i === 0 && 'first',
i === breadcrumbs.length - 1 && 'last'
Comment on lines 59 to 60
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these still needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes! this is from data-test-subj! this part we are not touching!

),
className: classNames('osdBreadcrumbs'),
}));

return <EuiHeaderBreadcrumbs breadcrumbs={crumbs} max={10} data-test-subj="breadcrumbs" />;
return (
<EuiHeaderBreadcrumbs
breadcrumbs={crumbs}
max={10}
data-test-subj="breadcrumbs"
className="osdHeaderBreadcrumbs"
/>
);
}