Add initial version of navbar
This commit is contained in:
parent
fe9ffbfa84
commit
5b111bb9ce
4 changed files with 61 additions and 1 deletions
17
_components/navbar.tsx
Normal file
17
_components/navbar.tsx
Normal file
|
@ -0,0 +1,17 @@
|
|||
export default function() {
|
||||
return (
|
||||
<nav className="navbar">
|
||||
<ul className="navbar-list">
|
||||
<li className="navbar-list-item home">
|
||||
<a href="/"></a>
|
||||
</li>
|
||||
<li className="navbar-list-item">
|
||||
<a href="/resume" title="resume"></a>
|
||||
</li>
|
||||
</ul>
|
||||
<div className="navbar-actions">
|
||||
<button className="navbar-theme-switcher"></button>
|
||||
</div>
|
||||
</nav>
|
||||
);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
export default function({ title, children }) {
|
||||
export default function({ title, children, comp }) {
|
||||
return (
|
||||
<html>
|
||||
<head>
|
||||
|
@ -8,6 +8,7 @@ export default function({ title, children }) {
|
|||
<link rel="stylesheet" href="/styles/main.css"/>
|
||||
</head>
|
||||
<body>
|
||||
{comp.navbar()}
|
||||
<div className="main-content">
|
||||
{ children }
|
||||
</div>
|
||||
|
|
39
_includes/styles/components/navbar.scss
Normal file
39
_includes/styles/components/navbar.scss
Normal file
|
@ -0,0 +1,39 @@
|
|||
.navbar {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr auto;
|
||||
margin: 0 auto;
|
||||
max-width: 48rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.navbar-list {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
list-style: none;
|
||||
padding-left: 0;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
.navbar-list-item {
|
||||
margin: 0;
|
||||
font-size: 2rem;
|
||||
&.home {
|
||||
margin-right: auto;
|
||||
}
|
||||
a {
|
||||
color: var(--color-green);
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-left: 1px solid var(--color-black);
|
||||
padding-left: 1rem;
|
||||
}
|
||||
|
||||
button.navbar-theme-switcher {
|
||||
padding: 0.3em;
|
||||
}
|
|
@ -3,3 +3,6 @@
|
|||
@import "styles/variables";
|
||||
@import "styles/color-palette";
|
||||
@import "styles/base";
|
||||
|
||||
// Components
|
||||
@import "styles/components/navbar";
|
||||
|
|
Loading…
Reference in a new issue