You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
website/assets/style.css

308 lines
5.0 KiB
CSS

/* TODO: Don't use CDN and serve as assets */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap');
4 years ago
:root {
--bg: #f0f0f0;
--fg: #333;
/* --bg-dark: #e0e0d6;
--bg-darker: #d6d6cc; */
--bg-dark: hsl(220, 5%, 93%);
--bg-darker: hsl(220, 5%, 90%);
--accent-1: #278542;
--accent-1-fg: #154d24;
--font-sf: 'Inter', sans-serif;
--font-weight-light: 300;
--font-weight-normal: 400;
--font-weight-medium: 500;
--font-weight-bold: 700;
--shadow-1: 0 0 16px 0 #00000018;
}
* {
box-sizing: border-box;
}
html, body {
margin: 0;
width: 100%;
height: fit-content;
}
body {
display: flex;
flex-direction: column;
align-items: center;
background: var(--bg);
color: var(--fg);
font-family: var(--font-sf);
font-size: 17px;
font-weight: var(--font-weight-normal);
position: relative;
}
.main {
max-width: 70ch;
margin: 0 auto 8rem;
display: flex;
flex-direction: column;
gap: 3rem;
}
nav {
margin: 1rem 0;
display: grid;
grid-template-columns: auto 1fr;
gap: 1rem;
align-items: center;
font-weight: var(--font-weight-medium);
color: var(--accent-1-fg);
z-index: 0;
}
/* Tutti i link dentro la navbar sono speciali e non sembrano link */
nav a {
display: flex;
width: 100%;
height: 100%;
align-items: center;
justify-content: center;
text-decoration: none;
color: inherit;
}
nav a:hover {
color: var(--accent-1-fg);
text-decoration: none;
}
nav .nav-logo {
/* height: 3.5rem; */
display: flex;
align-items: center;
justify-content: center;
padding: 0.5rem;
background: var(--bg-dark);
border-radius: 4px;
border: 1px solid #dadada;
box-shadow: var(--shadow-1);
}
nav .nav-main {
display: grid;
grid-template-columns: repeat(5, 1fr) 2fr 1fr;
4 years ago
background: var(--bg-dark);
border-radius: 4px;
border: 1px solid #dadada;
box-shadow: var(--shadow-1);
z-index: -1;
}
4 years ago
nav .nav-main a {
padding: 0.75rem 1rem;
4 years ago
}
nav .nav-main .nav-item {
display: flex;
align-items: center;
justify-content: center;
background: var(--bg-dark);
4 years ago
user-select: none;
cursor: pointer;
z-index: 2;
}
nav .nav-main .nav-item:hover {
background: var(--bg-darker);
}
nav .nav-main .nav-item:last-child {
grid-column: 7 / 8;
}
nav .nav-main .nav-item.dropdown {
position: relative;
z-index: 1;
}
nav .nav-main .nav-item.dropdown .name {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: var(--bg-dark);
z-index: 10;
}
nav .nav-main .nav-item.dropdown .name:hover {
background: var(--bg-darker);
}
nav .nav-main .nav-item.dropdown .nav-items {
position: absolute;
top: 100%;
width: 100%;
display: none;
background: var(--bg-dark);
border-radius: 4px;
border: 1px solid #dadada;
box-shadow: var(--shadow-1);
}
/*
nav .nav-main .nav-item.dropdown .nav-items::before {
position: absolute;
content: '';
top: -2px;
height: 2px;
left: 0;
right: 0;
width: 100%;
background: var(--bg-darker);
} */
nav .nav-main .nav-item.dropdown .name:hover + .nav-items, nav .nav-main .nav-item.dropdown .name + .nav-items:hover {
display: flex;
flex-direction: column;
}
/* .nav-main borders */
.nav-main > .nav-item:first-child {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.nav-main > .nav-item:last-child {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
footer {
position: absolute;
bottom: 0;
left: 50%;
height: 3rem;
width: 80ch;
transform: translate(-50%, 0);
background: var(--bg-dark);
border-radius: 4px;
border: 1px solid #dadada;
border-bottom: none;
box-shadow: var(--shadow-1);
display: flex;
align-items: center;
justify-content: center;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
/* Components */
section {
display: flex;
flex-direction: column;
align-items: center;
}
.card-list {
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
margin-top: 1rem;
}
.card {
background: var(--bg-dark);
border-radius: 4px;
border: 1px solid #dadada;
box-shadow: var(--shadow-1);
max-width: 60ch;
padding: 1rem;
display: flex;
flex-direction: column;
}
.card .title {
font-size: 22px;
font-weight: var(--font-weight-bold);
}
.card .date {
font-size: 15px;
color: #666;
margin-bottom: 0.75rem;
}
.card .description {
font-weight: var(--font-weight-light);
color: #222;
}
/* Typography */
h1, h2, h3, h4 {
margin: 0;
margin-top: 1rem;
margin-bottom: 0.5rem;
font-weight: var(--font-weight-light);
}
p {
margin: 0.5rem 0;
}
/* Controls */
a {
color: var(--accent-1-fg);
text-decoration: none;
}
a:hover {
color: var(--accent-1);
text-decoration: underline;
}