@import 'fonts.scss'; $font-size-2: 19px; $landing-size-value: 2.2; $landing-line-height: 1.4em; $font-family-body: 'Castoro', serif; @mixin light-theme { --color-bg: #fff; --color-text: #111; --color-accent: #b91c1c; --color-accent-hover: #df2929; --color-muted: #60606f; --color-faint: #afafb9; --color-rule: #ddd; --color-code-bg: #f4f4f2; } @mixin dark-theme { --color-bg: #2d3929; --color-text: #f5f2e9; --color-accent: #e38a3d; --color-accent-hover: #e9a56a; --color-muted: #b0b4a7; --color-faint: #9b9f93; --color-rule: #1a1d19; --color-code-bg: #1a1d19; } :root { @include light-theme; color-scheme: light; } @media (prefers-color-scheme: dark) { :root { @include dark-theme; color-scheme: dark; } } html[data-theme="light"] { @include light-theme; color-scheme: light; } html[data-theme="dark"] { @include dark-theme; color-scheme: dark; } * { box-sizing: border-box; } html { font-family: $font-family-body; font-weight: 500; font-size: $font-size-2; line-height: 1.4; background: var(--color-bg); } body { max-width: 900px; margin: 0 auto; padding: 2rem 1rem; color: var(--color-text); } a { color: var(--color-accent); &:hover { color: var(--color-accent-hover); } } header { display: flex; flex-wrap: nowrap; flex: 1 0 67%; align-items: center; .logo { flex-grow: 0; flex-shrink: 0; img { width: auto; height: 100px; max-width: 100%; } } nav { text-align: right; margin-left: auto; padding-left: 2.5vw; flex-grow: 1; flex-shrink: 1; a { font-family: sans-serif; font-weight: 700; &:not(:first-child) { margin-left: 2.5vw; } } } } .theme-toggle { display: inline-flex; align-items: center; justify-content: center; margin-left: 2.5vw; padding: 0.25rem; border: 0; border-radius: 4px; background: none; color: var(--color-accent); cursor: pointer; svg { display: block; width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; } .icon-sun { display: none; } &:hover { color: var(--color-accent-hover); } &:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; } } html[data-theme="dark"] .theme-toggle .icon-sun { display: block; } html[data-theme="dark"] .theme-toggle .icon-moon { display: none; } @media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; } html:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; } } //html[data-theme="dark"] .logo-type { // filter: brightness(1.5); //} // //@media (prefers-color-scheme: dark) { // html:not([data-theme="light"]) .logo-type { // filter: brightness(1.5); // } //} .fine-line { color: var(--color-faint); } footer { text-align: center; margin-top: 2rem; color: var(--color-muted); display: flex; flex-direction: column; justify-content: center; .links { display: flex; justify-content: center; } a { color: var(--color-muted); } } .landing p { font-style: normal; font-size: calc(calc(#{$landing-size-value} - 1) * calc(.012 * min(100vh, 900px)) + 1rem); font-weight: 400; line-height: calc(#{$landing-line-height} * (1 + (1 - #{$landing-size-value})/25)); text-align: justify; } @media (max-width: 640px) { header { flex-wrap: wrap; } header nav { order: 3; width: 100%; margin-top: 0.75rem; padding-left: 0; } header .theme-toggle { margin-left: auto; } }