security-checklist/components/Header/style.js

162 lines
3.2 KiB
JavaScript
Raw Normal View History

// @flow
import styled from 'styled-components';
import { theme } from '../theme';
import { hexa } from '../globals';
2019-02-13 14:43:40 +00:00
import { Shadows } from '../globals';
export const Container = styled.div`
display: grid;
2019-02-09 12:48:31 +00:00
grid-template-columns: 1fr 1fr;
grid-template-areas: "logo actions";
padding: 16px 16px;
position: fixed;
top: 0;
left: 0;
right: 0;
2019-02-09 12:48:31 +00:00
background: ${theme.bg.default};
z-index: 3;
2019-02-09 12:48:31 +00:00
box-shadow: 0 4px 8px rgba(0,0,0,0.04);
transition: all 0.2s ease-in-out;
@media (max-width: 968px) {
padding: 8px 16px;
}
`;
export const Logo = styled.h1`
grid-area: logo;
font-size: 18px;
font-weight: 700;
color: ${theme.text.default};
`;
2019-02-03 22:34:32 +00:00
export const Progression = styled.div`
text-align: center;
2019-02-09 12:48:31 +00:00
position: absolute;
left: 0;
right: 0;
height: 32px;
width: 100%;
bottom: -16px;
display: block;
background: transparent;
2019-02-03 22:34:32 +00:00
2019-02-09 12:48:31 +00:00
&:active, &:focus {
outline: none;
}
2019-02-03 22:34:32 +00:00
`;
export const ProgressBar = styled.div`
2019-02-09 12:48:31 +00:00
display: block;
2019-02-13 14:43:40 +00:00
height: 4px;
2019-02-09 12:48:31 +00:00
width: 100%;
2019-02-09 13:31:49 +00:00
margin: 16px 0 0;
2019-02-03 22:34:32 +00:00
position: relative;
overflow: hidden;
background-image: linear-gradient(to left, #a913de, #6ac9ff);
2019-02-09 12:48:31 +00:00
box-shadow: 0 4px 8px rgba(0,0,0,0.04);
z-index: 5;
2019-02-03 22:34:32 +00:00
2019-02-09 12:48:31 +00:00
${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)};
}
2019-02-03 22:34:32 +00:00
2019-02-13 14:43:40 +00:00
&::after {
2019-02-03 22:34:32 +00:00
content: '';
position: absolute;
height: 100%;
2019-02-09 12:48:31 +00:00
top: 0;
2019-02-03 22:34:32 +00:00
right: 0;
width: 100%;
background: ${theme.border.default};
max-width: var(--progress);
2019-02-13 14:43:40 +00:00
transition: max-width ${theme.animations.default}, background ${theme.animations.default};
}
&[disabled]::after {
background: ${theme.bg.default};
2019-02-03 22:34:32 +00:00
}
`;
2019-02-09 12:48:31 +00:00
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;
2019-02-13 17:54:14 +00:00
font-size: 14px;
font-weight: 600;
2019-02-09 12:48:31 +00:00
transition: all ${theme.animations.default};
2019-02-13 17:54:14 +00:00
border-radius: 8px;
2019-02-09 13:52:35 +00:00
white-space: nowrap;
2019-02-13 14:43:40 +00:00
${Shadows.default};
2019-02-09 12:48:31 +00:00
2019-02-13 17:31:23 +00:00
${Progression}:hover ${ProgressBar}:not([disabled]) + &,
${Progression}:focus ${ProgressBar}:not([disabled]) + &,
${Progression}:active ${ProgressBar}:not([disabled]) + &
2019-02-09 12:48:31 +00:00
{
visibility: visible;
opacity: 1;
2019-02-13 17:54:14 +00:00
bottom: -100%;
2019-02-09 12:48:31 +00:00
}
2019-02-09 13:43:43 +00:00
@media (max-width: 968px) {
padding: 8px 12px;
}
2019-02-09 12:48:31 +00:00
`
export const ButtonRowContainer = styled.div`
display: flex;
justify-content: flex-end;
grid-area: actions;
align-items: center;
a {
margin-left: 8px;
}
`;
export const LogoLink = styled.a`
transition: all ${props => props.theme.animations.default};
display: inline-flex;
align-items: center;
border-radius: 6px;
2019-02-09 12:48:31 +00:00
height: 100%;
&:hover {
transform: scale(1.2);
}
&:active, &:focus {
transform: scale(1.2);
box-shadow: 0 0 0 1px ${theme.bg.default},
0 0 0 3px ${props => hexa(props.theme.text.tertiary, 0.25)};
}
`;
2019-01-14 17:54:56 +00:00
export const Label = styled.h1`
position: absolute;
left: -9999px;
visibility: none;
`;
2019-02-13 15:43:00 +00:00
export const ParticleZone = styled.div`
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
& > div, & > svg {
position: absolute;
transition: all 5s ease-out;
}
`