Skip to content

Commit 660c4c3

Browse files
committed
add header with basic styles
1 parent 3905972 commit 660c4c3

File tree

3 files changed

+66
-3
lines changed

3 files changed

+66
-3
lines changed

src/components/Header.module.scss

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
@import "/src/theme/colors.scss";
2+
3+
.header {
4+
position: fixed;
5+
width: 100vw;
6+
height: 68px;
7+
background: $theme-accent;
8+
top: 0;
9+
left: 0;
10+
display: flex;
11+
justify-content: flex-end;
12+
align-items: center;
13+
14+
div, nav {
15+
flex: 1 0;
16+
}
17+
18+
div {
19+
padding-left: 25px;
20+
span {
21+
font-size: 18px;
22+
font-weight: bold;
23+
color: $accent-accent-dark;
24+
}
25+
}
26+
27+
nav {
28+
display: flex;
29+
justify-content: flex-end;
30+
padding-right: 25px;
31+
}
32+
33+
ul {
34+
list-style: none;
35+
padding: 0;
36+
li {
37+
float: left;
38+
a {
39+
display: inline-block;
40+
text-transform: uppercase;
41+
text-decoration: none;
42+
padding: 12px 20px;
43+
border: 1px transparent;
44+
border-radius: 8px;
45+
font-weight: bold;
46+
font-size: 14px;
47+
-webkit-transition: all 0.2s ease-in-out;
48+
-moz-transition: all 0.2s ease-in-out;
49+
transition: all 0.2s ease-in-out;
50+
&:hover {
51+
background: $accent-accent-dark;
52+
color: $white;
53+
}
54+
}
55+
}
56+
}
57+
}

src/components/Header.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import React from "react";
22
import { Link } from "react-router-dom";
3+
import styles from "./Header.module.scss";
34

45
// Define a header component that renders a navigation bar with links
56
const Header: React.FC = () => {
67
// Return the JSX element for the header component
78
return (
8-
<header>
9+
<header className={styles.header}>
10+
<div className={styles.navbarBrand}>
11+
<span>CRA Boilerplate</span>
12+
</div>
913
<nav>
1014
<ul>
1115
<li>

src/theme/colors.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
$theme-link-color: #ff5733;
2-
$theme-link-color-dark: #fe3e13;
1+
$theme-accent: #D4ADFC;
2+
$accent-accent-dark: #5C469C;
3+
$theme-link-color: #1D267D;
4+
$theme-link-color-dark: #0C134F;
35
$white: #ffffff;

0 commit comments

Comments
 (0)