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

GN-139 Conditions and diseases carousel stacking issue #152

Merged
merged 2 commits into from
Nov 23, 2021
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: 3 additions & 1 deletion src/Common.module.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import 'Header/header-settings';

.link .tooltip {
clip: rect(1px 1px 1px 1px);
clip: rect(1px, 1px, 1px, 1px);
Expand All @@ -18,7 +20,7 @@
padding: rem(0 $nds-spacing-x-small);
position: absolute;
width: auto;
z-index: 1;
z-index: $base-z-index;
}

.visuallyHidden {
Expand Down
68 changes: 42 additions & 26 deletions src/Footer/Services/Services.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,14 @@ export default class Services extends Component {
<nav className={styles.wrapper} aria-label="Our services">
<ul className={styles.list}>
{links.external.map(
function ({ href, id, text, abbreviation, title }) {
return (
<li key={id}>
<TrackedLink
href={href}
eventAction={footerClickEventAction}
eventLabel={text}
aria-current={id == this.props.service ? "true" : null}
className={styles.link}
>
{abbreviation ? (
<>
<abbr title={title}>
{text}{" "}
<span className={styles.visuallyHidden}>{title}</span>
</abbr>
<span aria-hidden="true" className={styles.tooltip}>
{title}
</span>
</>
) : (
text
)}
</TrackedLink>
</li>
);
function (link) {
if (link.nestedLinks) {
return link.nestedLinks.map((nestedLink) => {
return <FooterLink key={nestedLink.id} {...nestedLink} />;
});
} else {
return <FooterLink key={link.id} {...link} />;
}
}.bind(this)
)}
</ul>
Expand All @@ -46,6 +28,40 @@ export default class Services extends Component {
}
}

FooterLink.propTypes = {
href: PropTypes.string,
id: PropTypes.string,
text: PropTypes.string,
abbreviation: PropTypes.string,
title: PropTypes.string,
};

function FooterLink({ href, text, abbreviation, title }) {
return (
<li>
<TrackedLink
href={href}
eventAction={footerClickEventAction}
eventLabel={text}
className={styles.link}
>
{abbreviation ? (
<>
<abbr title={title}>
{text} <span className={styles.visuallyHidden}>{title}</span>
</abbr>
<span aria-hidden="true" className={styles.tooltip}>
{title}
</span>
</>
) : (
text
)}
</TrackedLink>
</li>
);
}

Services.propTypes = {
service: PropTypes.string,
};
2 changes: 1 addition & 1 deletion src/Header/Account/Account.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
position: absolute;
right: 0;
top: 100%;
z-index: 1;
z-index: $base-z-index;

// We move focus when we expand via keyboard navigation
&:focus {
Expand Down
4 changes: 2 additions & 2 deletions src/Header/Header.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
box-sizing: border-box;
font-family: unquote($nds-font-family-sans);
position: relative;
z-index: 2;
z-index: $base-z-index;

*,
*:before,
Expand Down Expand Up @@ -131,7 +131,7 @@
position: fixed;
top: 0;
width: 100vw;
z-index: 2;
z-index: $base-z-index;
}

.header {
Expand Down
2 changes: 1 addition & 1 deletion src/Header/Nav/Nav.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ a.link,
color: $colour-nav-text;
outline: rem($nds-spacing-x-small) solid $nds-colour-focus-inverse;
outline-offset: rem(-$nds-spacing-small);
z-index: 1; // Push above the adjacent nav items
z-index: $base-z-index + 1; // Push above the adjacent nav items
}

&:active,
Expand Down
2 changes: 1 addition & 1 deletion src/Header/Nav/NavLinks/NavLinks.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ button.link {
left: 0;
position: relative;
width: 100%;
z-index: 1;
z-index: $base-z-index;

&.active {
display: block;
Expand Down
6 changes: 3 additions & 3 deletions src/Header/Search/Autocomplete/Autocomplete.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
margin: 0 !important;
max-width: 100% !important;
position: relative;
z-index: 101;
z-index: $base-z-index + 1;

&:focus {
outline: 3px solid $nds-colour-focus;
outline-offset: -3px;
z-index: 1;
z-index: $base-z-index - 1;
}

&::placeholder {
Expand Down Expand Up @@ -103,7 +103,7 @@
left: 0;
position: absolute;
top: 100%;
z-index: 100;
z-index: $base-z-index;
}

.autocomplete__menu--inline {
Expand Down
2 changes: 1 addition & 1 deletion src/Header/Search/Search.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
right: 0;
text-align: center;
top: 0;
z-index: 101; // To sit above the search box so the focus outline surrounds the button
z-index: $base-z-index + 2; // To sit above the search box so the focus outline surrounds the button

&:focus {
@include nds-default-focus-style;
Expand Down
3 changes: 2 additions & 1 deletion src/Header/SkipLink/SkipLink.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import '~@nice-digital/nds-core/scss/core';
@import '../header-settings';

.link {
clip: rect(1px 1px 1px 1px);
Expand All @@ -22,6 +23,6 @@
top: rem($nds-spacing-x-small);
white-space: nowrap;
width: auto;
z-index: 5;
z-index: $base-z-index + 5;
}
}
2 changes: 2 additions & 0 deletions src/Header/_header-settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ $colour-nav-background: $nds-colour-nice-teal;
$colour-nav-text: $nds-colour-text-inverse;

$search-height: 40;

$base-z-index: 99990;
Copy link
Contributor

Choose a reason for hiding this comment

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

what's this number about?