install/setup sass

This commit is contained in:
2025-11-22 21:01:20 -05:00
parent fb99d9cfef
commit 67d8178270
31 changed files with 442 additions and 282 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ const { size } = Astro.props;
height={`${size}`}
/>
<style>
<style lang="scss">
.portrait {
display: block;
margin: auto;
@@ -1,7 +1,7 @@
---
import { add, format } from "date-fns";
import CalendarIcon from "../assets/svg/calendar.svg";
import CalendarIcon from "@assets/svg/calendar.svg";
interface Props {
title: string;
@@ -20,7 +20,7 @@ const { title, date, slug } = Astro.props;
</div>
</div>
<style>
<style lang="scss">
a {
font-size: 1.3rem;
}
+25
View File
@@ -0,0 +1,25 @@
---
---
<div class="sidebar">
<section>
<h2>Tags</h2>
<ul>
<li>Hello</li>
<li>Hello</li>
<li>Hello</li>
<li>Hello</li>
</ul>
</section>
</div>
<style lang="scss">
.sidebar {
padding: 16px;
border: var(--border);
min-width: 140px;
margin-left: 14px;
height: fit-content;
}
</style>
@@ -1,7 +1,7 @@
---
import type { CollectionEntry } from "astro:content";
import BlogHeader from "@components/BlogHeader.astro";
import Tags from "@components/Tags.astro";
import BlogHeader from "./BlogHeader.astro";
import Tags from "./Tags.astro";
interface Props {
post: CollectionEntry<"blog">;
@@ -15,7 +15,7 @@ const { post } = Astro.props;
<Tags tags={post.data.tags} />
</article>
<style>
<style lang="scss">
article {
padding-bottom: 20px;
}
+4 -2
View File
@@ -32,10 +32,12 @@ const { title, image, links } = Astro.props;
</div>
</div>
<style>
<style lang="scss">
@use "../styles/variables.scss" as *;
.card {
border: var(--border);
border-radius: var(--radius);
border-radius: $radius;
overflow: hidden;
}
+1 -1
View File
@@ -29,7 +29,7 @@ const year = new Date().getFullYear();
</p>
</footer>
<style>
<style lang="scss">
footer {
margin: 2rem 0;
text-align: center;
+6 -4
View File
@@ -38,7 +38,9 @@ import { navLinks } from "../../data/nav-links";
</div>
</div>
<style>
<style lang="scss">
@use "../../styles/variables.scss" as *;
.drawer-container {
display: none;
}
@@ -51,7 +53,7 @@ import { navLinks } from "../../data/nav-links";
height: 100vh;
background-color: rgba(0, 0, 0, 0.6);
z-index: 2;
transition: var(--transition);
transition: $transition;
}
.hidden-overlay {
@@ -66,7 +68,7 @@ import { navLinks } from "../../data/nav-links";
width: 75vw;
height: 100vh;
z-index: 3;
transition: var(--transition);
transition: $transition;
}
.drawer > div {
@@ -87,7 +89,7 @@ import { navLinks } from "../../data/nav-links";
transform: translateX(75vw);
}
@media screen and (max-width: 768px) {
@media screen and (max-width: $max-mobile-width) {
.drawer-container {
display: block;
}
+4 -2
View File
@@ -14,7 +14,9 @@ import Nav from "./Nav.astro";
</div>
</header>
<style>
<style lang="scss">
@use "../../styles/variables.scss" as *;
header {
margin-bottom: 20px;
height: 70px;
@@ -31,7 +33,7 @@ import Nav from "./Nav.astro";
flex-direction: row;
justify-content: space-between;
align-items: center;
max-width: var(--max-page-width);
max-width: $max-page-width;
margin: auto;
padding: 0 16px;
height: 100%;
+4 -2
View File
@@ -14,7 +14,9 @@ import { navLinks } from "../../data/nav-links";
</ul>
</nav>
<style>
<style lang="scss">
@use "../../styles/variables.scss" as *;
nav > ul {
display: flex;
flex-direction: row;
@@ -30,7 +32,7 @@ import { navLinks } from "../../data/nav-links";
padding: 5px 10px;
}
@media screen and (max-width: 768px) {
@media screen and (max-width: $max-mobile-width) {
nav {
display: none;
}
+4 -2
View File
@@ -37,12 +37,14 @@
</template>
</div>
<style>
<style lang="scss">
@use "../styles/variables.scss" as *;
.mastodon-post {
margin: 2rem auto;
padding: 1rem;
max-width: 600px;
border-radius: var(--radius);
border-radius: $radius;
border: var(--border);
}
+1 -1
View File
@@ -13,7 +13,7 @@ import BrushIcon from "../../assets/svg/paintbrush.svg";
</div>
</div>
<style>
<style lang="scss">
.toggles {
padding: 1rem;
display: flex;
-158
View File
@@ -1,158 +0,0 @@
@font-face {
font-family: Noto Sans;
src: url(./assets/fonts/NotoSans-VariableFont_wdth,wght.ttf)
format("truetype");
}
@font-face {
font-family: Noto Serif;
src: url(./assets/fonts/NotoSerif-VariableFont_wdth,wght.ttf)
format("truetype");
}
@font-face {
font-family: JetBrainsMono;
src: url(./assets/fonts/JetBrainsMono-VariableFont_wght.ttf)
format("truetype");
}
:root {
--blue: #1e66f5;
--sky: #04a5e5;
--red: #d20f39;
--orange: #fe640b;
--text: #40360e;
--highlight: #ffeebd;
--background: #fffdf5;
--radius: 5px;
--border: 1px solid #8f7a20;
--max-page-width: 800px;
--transition: all 0.3s ease-in-out;
--font: "Noto Sans", sans-serif;
}
.theme-dark {
--blue: #5da7fb;
--sky: #00b0f5;
--red: #f38ba8;
--orange: #fab387;
--text: #c4caed;
--background: #2a2c32;
--border: 1px solid #505160;
}
.serif-text {
--font: "Noto Serif", serif;
}
body {
color: var(--text);
background-color: var(--background);
font-family: var(--font);
font-size: 1.1rem;
margin: 0;
padding: 0;
}
main {
max-width: 800px;
margin: auto;
padding: 0 1rem;
margin-top: 100px;
}
a {
color: var(--blue);
text-decoration: none;
}
a:hover {
opacity: 0.75;
}
main p {
/* text-align: justify; */
line-height: 1.5;
}
/* Article image style */
article img {
border-radius: var(--radius);
display: block;
margin: auto;
max-width: var(--max-page-width);
height: auto;
}
/* Typography */
.footnotes {
font-size: 1rem;
}
.footnotes p {
display: inline;
}
blockquote {
border-left: 4px solid;
border-color: var(--text);
margin-left: 1rem;
padding-left: 2rem;
font-style: italic;
}
code {
color: var(--orange);
padding: 1px 4px;
margin: 0 2px;
user-select: all;
}
kbd {
border: var(--border);
border-radius: var(--radius);
padding: 1px 4px;
white-space: nowrap;
}
code,
kbd {
font-size: 0.85rem;
}
/* Icon button */
.icon-button {
background: none;
padding: 2px 2px -2px;
border: none;
line-height: 1;
aspect-ratio: square;
height: 24px;
width: 24px;
}
.icon-button:active {
opacity: 0.3;
}
.icon-button > svg {
color: var(--text);
}
/* shiki */
.astro-code,
.astro-code span {
background-color: var(--background) !important;
/* Optional, if you also want font styles */
font-style: var(--shiki-light-font-style);
font-weight: var(--shiki-light-font-weight);
text-decoration: var(--shiki-light-text-decoration);
}
.theme-dark .astro-code,
.theme-dark .astro-code span {
color: var(--shiki-dark) !important;
}
+2 -2
View File
@@ -1,7 +1,7 @@
---
import { ClientRouter } from "astro:transitions";
import "../global.css";
import "../styles/global.scss";
import Footer from "@components/Footer.astro";
import Header from "@components/Header/Header.astro";
@@ -50,7 +50,7 @@ const title = Astro.props.title || Astro.props.frontmatter?.title || "Unknown";
</body>
</html>
<style>
<style lang="scss">
/* Prevent scrolling when drawer (located in Header) is open */
.lock-scroll {
overflow: hidden;
+4 -2
View File
@@ -14,7 +14,9 @@ import DataGif from "../assets/it-does-not-exist.gif";
/>
</Layout>
<style>
<style lang="scss">
@use "../styles/variables.scss" as *;
h2 {
text-align: center;
}
@@ -22,7 +24,7 @@ import DataGif from "../assets/it-does-not-exist.gif";
.gif {
display: block;
margin: auto;
border-radius: var(--radius);
border-radius: $radius;
box-shadow: var(--shadow);
}
</style>
+3 -3
View File
@@ -1,7 +1,7 @@
---
import { getCollection, render } from "astro:content";
import BlogHeader from "@components/BlogHeader.astro";
import Tags from "@components/Tags.astro";
import BlogHeader from "@components/Blog/BlogHeader.astro";
import Tags from "@components/Blog/Tags.astro";
import Layout from "@layouts/Layout.astro";
export async function getStaticPaths() {
@@ -30,7 +30,7 @@ const { Content } = await render(post);
</article>
</Layout>
<style>
<style lang="scss">
.not-by-ai {
display: block;
width: 134px;
+2 -2
View File
@@ -1,6 +1,6 @@
---
import { type CollectionEntry, getCollection } from "astro:content";
import PostPreview from "@components/PostPreview.astro";
import PostPreview from "@components/Blog/PostPreview.astro";
import Layout from "@layouts/Layout.astro";
import type { Page } from "astro";
@@ -44,7 +44,7 @@ const { page } = Astro.props;
</div>
</Layout>
<style>
<style lang="scss">
ul {
list-style: none;
}
+1 -1
View File
@@ -65,7 +65,7 @@ posts.sort(
</ul>
</Layout>
<style>
<style lang="scss">
ul {
list-style: none;
}
+1 -1
View File
@@ -68,7 +68,7 @@ const latestPost = posts.sort(
<LatestPost />
</Layout>
<style>
<style lang="scss">
a > svg {
transform: translateY(0.1rem);
}
+1 -1
View File
@@ -31,7 +31,7 @@ const title = "Projects";
</div>
</Layout>
<style>
<style lang="scss">
.projects-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
+14
View File
@@ -0,0 +1,14 @@
@font-face {
font-family: Noto Sans;
src: url(./fonts/NotoSans-VariableFont_wdth,wght.ttf) format("truetype");
}
@font-face {
font-family: Noto Serif;
src: url(./fonts/NotoSerif-VariableFont_wdth,wght.ttf) format("truetype");
}
@font-face {
font-family: JetBrainsMono;
src: url(./fonts/JetBrainsMono-VariableFont_wght.ttf) format("truetype");
}
+140
View File
@@ -0,0 +1,140 @@
@use "./variables.scss" as *;
@use "fonts.scss";
:root {
--blue: #1e66f5;
--sky: #04a5e5;
--red: #d20f39;
--orange: #fe640b;
--text: #40360e;
--highlight: #ffeebd;
--background: #fffdf5;
--border: #{$border-style} #8f7a20;
--font: "Noto Sans", sans-serif;
}
.theme-dark {
--blue: #5da7fb;
--sky: #00b0f5;
--red: #f38ba8;
--orange: #fab387;
--text: #c4caed;
--background: #2a2c32;
--border: #{$border-style} #505160;
}
.serif-text {
--font: "Noto Serif", serif;
}
body {
color: var(--text);
background-color: var(--background);
font-family: var(--font);
font-size: 1.1rem;
margin: 0;
padding: 0;
}
main {
max-width: 800px;
margin: auto;
padding: 0 1rem;
margin-top: 100px;
}
a {
color: var(--blue);
text-decoration: none;
}
a:hover {
opacity: 0.75;
}
main p {
/* text-align: justify; */
line-height: 1.5;
}
/* Article image style */
article img {
border-radius: $radius;
display: block;
margin: auto;
max-width: $max-page-width;
height: auto;
}
/* Typography */
.footnotes {
font-size: 1rem;
}
.footnotes p {
display: inline;
}
blockquote {
border-left: 4px solid;
border-color: var(--text);
margin-left: 1rem;
padding-left: 2rem;
font-style: italic;
}
code {
color: var(--orange);
padding: 1px 4px;
margin: 0 2px;
user-select: all;
}
kbd {
border: var(--border);
border-radius: $radius;
padding: 1px 4px;
white-space: nowrap;
}
code,
kbd {
font-size: 0.85rem;
}
/* Icon button */
.icon-button {
background: none;
padding: 2px 2px -2px;
border: none;
line-height: 1;
aspect-ratio: square;
height: 24px;
width: 24px;
}
.icon-button:active {
opacity: 0.3;
}
.icon-button > svg {
color: var(--text);
}
/* shiki */
.astro-code,
.astro-code span {
background-color: var(--background) !important;
/* Optional, if you also want font styles */
font-style: var(--shiki-light-font-style);
font-weight: var(--shiki-light-font-weight);
text-decoration: var(--shiki-light-text-decoration);
}
.theme-dark .astro-code,
.theme-dark .astro-code span {
color: var(--shiki-dark) !important;
}
+5
View File
@@ -0,0 +1,5 @@
$max-mobile-width: 768px;
$max-page-width: 800px;
$radius: 5px;
$border-style: 1px solid;
$transition: all 0.3s ease-in-out;