chore: improve css with variables

This commit is contained in:
2026-01-28 20:59:07 +01:00
parent 6d88a87b89
commit 226b0d95ab
5 changed files with 126 additions and 129 deletions

View File

@@ -6,12 +6,86 @@
<style lang="css">
:root {
/* Colors */
--primary-color: #fff;
--secondary-color: #000;
/* Spacing scale */
--space-1: 0.25rem;
--space-2: 0.5rem;
--space-3: 0.75rem;
--space-4: 1rem;
--space-5: 1.25rem;
--space-6: 1.5rem;
--space-8: 2rem;
--space-10: 2.5rem;
--space-12: 3rem;
--space-16: 4rem;
/* Typography scale - Mobile first (base) */
--text-xs: 0.65rem;
--text-sm: 0.75rem;
--text-base: 1rem;
--text-lg: 1.25rem;
--text-xl: 1.5rem;
/* Line heights */
--leading-tight: 1.2;
--leading-normal: 1.5;
--leading-relaxed: 1.625;
/* Font families */
--font-primary: 'Abbiocco Beta', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
--font-accent: 'Bazaar', sans-serif;
/* Breakpoints (for reference - use in media queries as raw values) */
/* --bp-md: 768px */
/* --bp-lg: 1024px */
/* --bp-xl: 1536px */
/* --bp-2xl: 1920px */
}
/* Tablet (768px+) */
@media (min-width: 768px) {
:root {
--text-xs: 0.75rem;
--text-sm: 0.9rem;
--text-base: 1rem;
--text-lg: 1.4rem;
--text-xl: 1.5rem;
}
}
/* Desktop (1024px+) */
@media (min-width: 1024px) {
:root {
--text-xs: 0.95rem;
--text-sm: 1.15rem;
--text-base: 1.15rem;
--text-lg: 1.75rem;
--text-xl: 1.8rem;
}
}
/* Large desktop (1536px+) */
@media (min-width: 1536px) {
:root {
--text-xs: 1rem;
--text-sm: 1.35rem;
--text-lg: 2.4rem;
}
}
/* Extra large (1920px+) */
@media (min-width: 1920px) {
:root {
--text-xs: 1.15rem;
--text-lg: 3.2rem;
}
}
html, body, p, a, button, address, h2 {
font-family: 'Abbiocco Beta', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
font-family: var(--font-primary);
}
a {

View File

@@ -36,19 +36,19 @@ onMounted(() => {
footer {
background-color: var(--primary-color);
color: var(--secondary-color);
padding: 0 1.5rem;
padding: 0 var(--space-6);
}
.wrapper {
display: flex;
align-items: flex-end;
gap: 1.5rem;
padding: 1.5rem 0;
gap: var(--space-6);
padding: var(--space-6) 0;
}
address {
font-size: 0.65rem;
line-height: 12px;
font-size: var(--text-xs);
line-height: var(--leading-relaxed);
}
img {
@@ -57,32 +57,22 @@ img {
@media (min-width: 768px) {
.wrapper {
gap: 3rem;
gap: var(--space-12);
}
img {
height: 104px;
}
address {
font-size: 0.75rem;
line-height: 14px;
}
}
@media (min-width: 1024px) {
.wrapper {
gap: 8rem;
gap: var(--space-16);
}
img {
height: 120px;
}
address {
font-size: 0.95rem;
line-height: 15px;
}
}
@media (min-width: 1536px) {
@@ -93,11 +83,6 @@ img {
img {
height: 146px;
}
address {
font-size: 1rem;
line-height: 20px;
}
}
@media (min-width: 1920px) {
@@ -108,11 +93,5 @@ img {
img {
height: 155px;
}
address {
font-size: 1.15rem;
line-height: 22px;
}
}
</style>

View File

@@ -55,9 +55,9 @@ const { isScrolled } = useScroll(scrollThreshold.value)
}
.app-header {
gap: 1rem;
gap: var(--space-4);
flex-direction: column;
padding: 3rem 2rem;
padding: var(--space-12) var(--space-8);
height: 68vh;
box-sizing: border-box;
}
@@ -65,7 +65,7 @@ const { isScrolled } = useScroll(scrollThreshold.value)
.app-header > div {
display: flex;
flex-direction: column;
gap: 1rem;
gap: var(--space-4);
}
.app-header--sticky {
@@ -73,7 +73,7 @@ const { isScrolled } = useScroll(scrollThreshold.value)
top: 0;
width: 100%;
height: 34px;
padding: 0.75rem 1rem;
padding: var(--space-3) var(--space-4);
align-items: center;
animation: slideDown 0.3s ease;
z-index: 10;
@@ -97,21 +97,21 @@ const { isScrolled } = useScroll(scrollThreshold.value)
nav {
display: flex;
gap: 2.5rem;
gap: var(--space-10);
margin-left: auto;
}
a {
display: flex;
gap: 0.5rem;
gap: var(--space-2);
align-items: center;
color: inherit;
font-size: 0.75rem;
font-size: var(--text-sm);
}
p {
font-size: 1.25rem;
line-height: 1.5rem;
font-size: var(--text-lg);
line-height: var(--leading-normal);
}
@media (min-width: 768px) {
@@ -121,14 +121,14 @@ p {
.app-header > div {
position: absolute;
bottom: 3rem;
bottom: var(--space-12);
}
.app-header > div > div {
.app-header > div > div {
display: flex;
flex-direction: row;
gap: 0.25rem;
}
gap: var(--space-1);
}
.brand {
width: 332px;
@@ -137,21 +137,12 @@ p {
.brand-logo {
width: 168px;
}
p {
font-size: 1.4rem;
line-height: inherit;
}
a {
font-size: 0.9rem;
}
}
@media (min-width: 1024px) {
.app-header--sticky {
height: 64px;
padding: 1rem 4rem;
padding: var(--space-4) var(--space-16);
}
.app-header--sticky img {
@@ -165,14 +156,6 @@ p {
.brand {
width: 460px;
}
a {
font-size: 1.15rem;
}
p {
font-size: 1.75rem;
}
}
@media (min-width: 1536px) {
@@ -183,14 +166,6 @@ p {
.brand {
width: 688px;
}
a {
font-size: 1.35rem;
}
p {
font-size: 2.4rem;
}
}
@media (min-width: 1920px) {
@@ -201,9 +176,5 @@ p {
.brand {
width: 892px;
}
p {
font-size: 3.2rem;
}
}
</style>

View File

@@ -63,18 +63,18 @@ article {
border-top: 1px solid var(--primary-color);
display: flex;
flex-direction: column;
gap: 1rem;
gap: var(--space-4);
}
header > div,
h2 {
font-size: 0.75rem;
font-size: var(--text-sm);
}
h2 {
padding: 0.5rem 0rem;
padding: var(--space-2) 0;
display: flex;
gap: 0.5rem;
gap: var(--space-2);
align-items: center;
}
@@ -102,11 +102,11 @@ h2 button img {
.image-wrap > img {
width: 100%;
margin-bottom: 1rem;
margin-bottom: var(--space-4);
}
header > div {
padding-left: 1.25rem;
padding-left: var(--space-5);
}
header {
@@ -125,47 +125,32 @@ header {
}
.trigger-additional {
font-family: 'Bazaar', sans-serif;
font-family: var(--font-accent);
background: transparent;
color: #FFFFFF;
color: var(--primary-color);
border-radius: 16px;
border: 2px solid var(--primary-color);
padding: 0.3rem 0.4rem;
font-size: 1.25rem;
margin-top: 0.85rem;
padding: var(--space-1) var(--space-2);
font-size: var(--text-lg);
line-height: var(--leading-tight);
margin-top: var(--space-3);
transform: rotate(-2.6deg);
line-height: 1.25rem;
}
@media (min-width: 768px) {
h2,
header > div {
font-size: 1rem;
}
.trigger-additional {
font-size: 1.5rem;
line-height: 1.5rem;
border-radius: 20px;
}
}
@media (min-width: 1024px) {
h2,
header > div {
font-size: 1.15rem;
}
h2 button img {
width: 14px;
}
.trigger-additional {
font-size: 1.8rem;
line-height: 1.8rem;
padding: 0.4rem 0.5rem;
padding: var(--space-2) var(--space-2);
border-radius: 24px;
}
}
</style>

View File

@@ -61,13 +61,13 @@ useSeoMeta({
.nuxt-content {
background-color: var(--secondary-color);
color: var(--primary-color);
padding: 1rem;
padding: var(--space-4);
}
.load-more {
display: flex;
align-items: center;
gap: 0.5rem;
gap: var(--space-2);
background: none;
border: none;
color: var(--primary-color);
@@ -80,8 +80,8 @@ useSeoMeta({
}
#about {
padding: 0 1rem;
margin-top: 1rem;
padding: 0 var(--space-4);
margin-top: var(--space-4);
background-color: var(--primary-color);
color: var(--secondary-color);
}
@@ -89,72 +89,60 @@ useSeoMeta({
#about article {
border-top: 1px solid var(--secondary-color);
border-bottom: 1px solid var(--secondary-color);
padding: 0.5rem 0 1rem 0;
padding: var(--space-2) 0 var(--space-4) 0;
display: flex;
flex-direction: column;
gap: 0.5rem;
line-height: 15px;
gap: var(--space-2);
line-height: var(--leading-normal);
}
.load-more,
#about article {
font-size: 0.75rem;
font-size: var(--text-sm);
}
article h2 {
display: flex;
align-items: center;
gap: 0.5rem;
gap: var(--space-2);
}
@media (min-width: 768px) {
#about {
margin-top: 2rem;
margin-top: var(--space-8);
}
#about article {
padding-bottom: 2rem;
padding-bottom: var(--space-8);
}
#about article > div {
margin-left: 33.333%;
display: flex;
flex-direction: column;
gap: 1rem;
}
.load-more,
#about article {
font-size: 1rem;
line-height: 20px;
gap: var(--space-4);
}
}
@media (min-width: 1024px) {
#about {
margin-top: 2.5rem;
margin-top: var(--space-10);
}
#about article {
padding-bottom: 2.5rem;
padding-bottom: var(--space-10);
}
#about article > div {
padding-right: 1rem;
}
.load-more,
#about article {
font-size: 1.15rem;
line-height: 22px;
padding-right: var(--space-4);
}
}
@media (min-width: 1536px) {
#about article > div {
flex-direction: row;
gap: 2rem;
padding-right: 2rem;
gap: var(--space-8);
padding-right: var(--space-8);
}
#about article > div > p {