mirror of
https://github.com/brianlovin/security-checklist.git
synced 2026-03-11 08:55:31 +00:00
Style modifications
This commit is contained in:
parent
033c954323
commit
ea26d4e419
2 changed files with 76 additions and 22 deletions
|
|
@ -7,7 +7,8 @@ import {
|
||||||
Label,
|
Label,
|
||||||
LogoLink,
|
LogoLink,
|
||||||
Progression,
|
Progression,
|
||||||
ProgressBar } from './style';
|
ProgressBar,
|
||||||
|
ProgressLabel } from './style';
|
||||||
import { PrimaryButton, GhostButton } from '../Button';
|
import { PrimaryButton, GhostButton } from '../Button';
|
||||||
import Logo from './Logo';
|
import Logo from './Logo';
|
||||||
|
|
||||||
|
|
@ -32,11 +33,6 @@ export default function Header(props: Props) {
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Progression isHidden={!displayProgress}>
|
|
||||||
{currentCount} of {totalItemsCount} completed
|
|
||||||
<ProgressBar />
|
|
||||||
</Progression>
|
|
||||||
|
|
||||||
<ButtonRowContainer>
|
<ButtonRowContainer>
|
||||||
<Link href="/about">
|
<Link href="/about">
|
||||||
<GhostButton as="a" href="/about">
|
<GhostButton as="a" href="/about">
|
||||||
|
|
@ -53,6 +49,21 @@ export default function Header(props: Props) {
|
||||||
Contribute
|
Contribute
|
||||||
</PrimaryButton>
|
</PrimaryButton>
|
||||||
</ButtonRowContainer>
|
</ButtonRowContainer>
|
||||||
|
|
||||||
|
{ displayProgress && (
|
||||||
|
<Progression
|
||||||
|
id="progress"
|
||||||
|
aria-label={`${currentCount} of ${totalItemsCount} completed`}
|
||||||
|
>
|
||||||
|
<ProgressBar
|
||||||
|
id="progress_bar"
|
||||||
|
aria-describedby="progress_tooltip"
|
||||||
|
/>
|
||||||
|
<ProgressLabel
|
||||||
|
id="progress_tooltip"
|
||||||
|
role="tooltip"
|
||||||
|
>{currentCount} of {totalItemsCount} completed</ProgressLabel>
|
||||||
|
</Progression>)}
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,24 +5,20 @@ import { hexa } from '../globals';
|
||||||
|
|
||||||
export const Container = styled.div`
|
export const Container = styled.div`
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
grid-template-areas: 'logo progression actions';
|
grid-template-areas: "logo actions";
|
||||||
padding: 16px;
|
padding: 16px 16px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
background: ${props =>
|
background: ${theme.bg.default};
|
||||||
props.showHeaderShadow ? props.theme.bg.default : props.theme.bg.wash};
|
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
box-shadow: ${props =>
|
box-shadow: 0 4px 8px rgba(0,0,0,0.04);
|
||||||
props.showHeaderShadow ? '0 4px 8px rgba(0,0,0,0.04)' : 'none'};
|
|
||||||
transition: all 0.2s ease-in-out;
|
transition: all 0.2s ease-in-out;
|
||||||
|
|
||||||
@media (max-width: 968px) {
|
@media (max-width: 968px) {
|
||||||
padding: 8px 16px;
|
padding: 8px 16px;
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
grid-template-areas: "logo actions" "progression progression";
|
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
@ -33,26 +29,46 @@ export const Logo = styled.h1`
|
||||||
color: ${theme.text.default};
|
color: ${theme.text.default};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const Progression = styled.div`
|
export const Progression = styled.button`
|
||||||
grid-area: progression;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 32px;
|
||||||
|
width: 100%;
|
||||||
|
bottom: -16px;
|
||||||
|
display: block;
|
||||||
|
background: transparent;
|
||||||
|
|
||||||
display: ${props =>
|
&:active, &:focus {
|
||||||
props.isHidden ? 'none' : 'block'};
|
outline: none;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const ProgressBar = styled.div`
|
export const ProgressBar = styled.div`
|
||||||
|
display: block;
|
||||||
height: 8px;
|
height: 8px;
|
||||||
margin: 6px 0;
|
width: 100%;
|
||||||
|
margin: 8px 0 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: 4px;
|
border-bottom-left-radius: 8px;
|
||||||
|
border-bottom-right-radius: 8px;
|
||||||
background-image: linear-gradient(to left, #a913de, #6ac9ff);
|
background-image: linear-gradient(to left, #a913de, #6ac9ff);
|
||||||
|
box-shadow: 0 4px 8px rgba(0,0,0,0.04);
|
||||||
|
z-index: 5;
|
||||||
|
|
||||||
|
${Progression}:focus &,
|
||||||
|
${Progression}:active & {
|
||||||
|
box-shadow: 0 0 0 1px ${theme.bg.default},
|
||||||
|
0 0 0 3px ${props => hexa(props.theme.brand.default, 0.25)};
|
||||||
|
}
|
||||||
|
|
||||||
&:after {
|
&:after {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: ${theme.border.default};
|
background: ${theme.border.default};
|
||||||
|
|
@ -61,6 +77,32 @@ export const ProgressBar = styled.div`
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
export const ProgressLabel = styled.p`
|
||||||
|
visibility: hidden;
|
||||||
|
opacity: 0;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 4;
|
||||||
|
bottom: -25%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
background: ${theme.bg.default};
|
||||||
|
padding: 8px 16px;
|
||||||
|
|
||||||
|
transition: all ${theme.animations.default};
|
||||||
|
|
||||||
|
border-bottom-left-radius: 8px;
|
||||||
|
border-bottom-right-radius: 8px;
|
||||||
|
|
||||||
|
${Progression}:hover &,
|
||||||
|
${Progression}:focus &,
|
||||||
|
${Progression}:active &
|
||||||
|
{
|
||||||
|
visibility: visible;
|
||||||
|
opacity: 1;
|
||||||
|
bottom: calc((100% - 8px) * -1);
|
||||||
|
}
|
||||||
|
`
|
||||||
|
|
||||||
export const ButtonRowContainer = styled.div`
|
export const ButtonRowContainer = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
|
@ -77,7 +119,8 @@ export const LogoLink = styled.a`
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
transform: scale(1.2);
|
transform: scale(1.2);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue