Skip to content

Commit

Permalink
refactor(header):change styles on header
Browse files Browse the repository at this point in the history
Co-authored-by: Nicolas Froidure <[email protected]>
Co-authored-by: amandine <[email protected]>
  • Loading branch information
amandinelabbe and nfroidure committed Dec 12, 2023
1 parent 861ed19 commit c458a8b
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 47 deletions.
45 changes: 45 additions & 0 deletions src/components/header.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@import '../layouts/variables.scss';

header.root {
display: flex;
flex-direction: column;
background-color: var(--light);
}

.root h1 {
display: block;
margin: 0 auto;
width: calc(var(--vRythm) * 8);
height: calc(var(--vRythm) * 8);
}

.root a {
display: block;
width: calc(var(--vRythm) * 8);
height: calc(var(--vRythm) * 8);
background-image: url('/images/chtijs.svg');
background-size: contain;
background-repeat: no-repeat;
}

.root span {
display: none;
}

@media screen and (max-width: $CSS_BREAKPOINT_END_S) {
header.root {
grid-column-start: 1;
grid-column-end: 3;
grid-row-start: 1;
grid-row-end: 2;
}
}
@media screen and (min-width: $CSS_BREAKPOINT_START_M) {
header.root {
grid-column-start: 1;
grid-column-end: 2;
grid-row-start: 1;
grid-row-end: 2;
border-right: 1px solid var(--grey);
}
}
49 changes: 2 additions & 47 deletions src/components/header.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import Link from 'next/link';
import { publicRuntimeConfig } from '../utils/config';
import {
CSS_BREAKPOINT_END_S,
CSS_BREAKPOINT_START_M,
} from '../utils/constants';
import styles from './header.module.scss';

const Header = () => {
return (
<>
<header>
<header className={styles.root}>
<h1>
<Link href="/" legacyBehavior>
<a>
Expand All @@ -17,47 +13,6 @@ const Header = () => {
</Link>
</h1>
</header>
<style jsx>{`
header {
display: flex;
flex-direction: column;
background-color: var(--light);
}
h1 {
display: block;
margin: 0 auto;
width: calc(var(--vRythm) * 8);
height: calc(var(--vRythm) * 8);
}
a {
display: block;
width: calc(var(--vRythm) * 8);
height: calc(var(--vRythm) * 8);
background-image: url('${publicRuntimeConfig.basePath}/images/chtijs.svg');
background-size: contain;
background-repeat: no-repeat;
}
span {
display: none;
}
@media screen and (max-width: ${CSS_BREAKPOINT_END_S}) {
header {
grid-column-start: 1;
grid-column-end: 3;
grid-row-start: 1;
grid-row-end: 2;
}
}
@media screen and (min-width: ${CSS_BREAKPOINT_START_M}) {
header {
grid-column-start: 1;
grid-column-end: 2;
grid-row-start: 1;
grid-row-end: 2;
border-right: 1px solid var(--grey);
}
}
`}</style>
</>
);
};
Expand Down

0 comments on commit c458a8b

Please sign in to comment.