Skip to content

Commit

Permalink
changes necessary to get rid of sass deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
flq committed Nov 24, 2024
1 parent 2f29236 commit d49b7cc
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 42 deletions.
9 changes: 9 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ import expressiveCode from "astro-expressive-code";
// https://astro.build/config
export default defineConfig({
site: "https://realfiction.net",
vite: {
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler' // or "modern"
}
}
}
},
integrations: [
expressiveCode({ themes: ["dracula"] }),
mdx({
Expand Down
18 changes: 9 additions & 9 deletions src/components/Date.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const [date, month, year] = [
---

<style lang="scss">
@import "../styles/imports.scss";
@use "../styles/_common.scss" as common;

time {
font-size: 1rem;
Expand All @@ -25,12 +25,12 @@ const [date, month, year] = [
grid-template-rows: repeat(3, auto);
border: 1px solid var(--linkColorMain);
border-radius: 5px;
@media (min-width: $mobile) {
@media (min-width: common.$mobile) {
grid-template-columns: 1.5rem 3rem;
}

&:not(.page) {
@media (min-width: $desktop) {
@media (min-width: common.$desktop) {
grid-template-columns: repeat(3, auto);
}
}
Expand All @@ -44,15 +44,15 @@ const [date, month, year] = [
background-color: var(--linkColorMain);
color: white;

@media (min-width: $mobile) {
@media (min-width: common.$mobile) {
grid-row: 1;
grid-column: 2;
background-color: initial;
color: var(--text);
}

&:not(.page) {
@media (min-width: $desktop) {
@media (min-width: common.$desktop) {
background-color: var(--linkColorMain);
color: white;
grid-row: 1;
Expand All @@ -73,7 +73,7 @@ const [date, month, year] = [
justify-content: center;
align-items: center;

@media (min-width: $mobile) {
@media (min-width: common.$mobile) {
background-color: var(--linkColorMain);
color: white;
grid-column: 2;
Expand All @@ -82,7 +82,7 @@ const [date, month, year] = [
}

&:not(.page) {
@media (min-width: $desktop) {
@media (min-width: common.$desktop) {
background-color: var(--background);
color: var(--text);
grid-column: 3;
Expand All @@ -99,14 +99,14 @@ const [date, month, year] = [
align-self: center;
justify-self: center;

@media (min-width: $mobile) {
@media (min-width: common.$mobile) {
writing-mode: vertical-lr;
grid-column: 1;
grid-row: 1 / span 2;
}

&:not(.page) {
@media (min-width: $desktop) {
@media (min-width: common.$desktop) {
writing-mode: inherit;
grid-column: 1;
grid-row: 1;
Expand Down
8 changes: 4 additions & 4 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { Image } from 'astro:assets';
---
<style lang="scss">
@import "../styles/imports.scss";
@use "../styles/_common.scss" as common;
footer {
width: 100%;
display: flex;
Expand All @@ -14,13 +14,13 @@ import { Image } from 'astro:assets';
font-size: 1rem;
border-top: var(--lightSeparator);

@media (min-width: $iPad) {
@media (min-width: common.$iPad) {
width: 90%;
}
@media (min-width: $desktop) {
@media (min-width: common.$desktop) {
width: 70%;
}
@media (min-width: $largeDesktop) {
@media (min-width: common.$largeDesktop) {
width: 55%;
}

Expand Down
10 changes: 5 additions & 5 deletions src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { title } = Astro.props;
---

<style lang="scss">
@import "../styles/imports.scss";
@use "../styles/_common.scss" as common;
nav {
display: flex;
align-items: stretch;
Expand All @@ -26,7 +26,7 @@ const { title } = Astro.props;
flex-direction: row;
justify-content: space-between;
align-items: center;
@include widths;
@include common.widths;
}

h1 {
Expand All @@ -47,7 +47,7 @@ const { title } = Astro.props;
color: var(--linkColorMain);
& span {
display: none;
@media (min-width: $iPad) {
@media (min-width: common.$iPad) {
display: inline;
width: inherit;
}
Expand All @@ -73,7 +73,7 @@ const { title } = Astro.props;

.hide-mobile {
display: none;
@media (min-width: $iPad) {
@media (min-width: common.$iPad) {
display: inline-block;
}
}
Expand All @@ -84,7 +84,7 @@ const { title } = Astro.props;
width: 2.2rem;
box-shadow: none;
vertical-align: middle;
@media (min-width: $iPad) {
@media (min-width: common.$iPad) {
display: none;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/HomePageEntry.astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const {
---

<style lang="scss">
@import "../styles/imports.scss";
@use "../styles/_common.scss" as common;
article {
margin-bottom: 3rem;
}
Expand All @@ -31,7 +31,7 @@ const {
flex-direction: row;
align-items: center;

@media (min-width: $desktop) {
@media (min-width: common.$desktop) {
justify-content: space-between;
}
}
Expand All @@ -40,7 +40,7 @@ const {
font-size: 1.7rem;
line-height: 2rem;
margin: 0 0 0 0.5rem;
@media (min-width: $desktop) {
@media (min-width: common.$desktop) {
margin: 0;
}
}
Expand All @@ -60,7 +60,7 @@ const {
}

.order {
@media (min-width: $desktop) {
@media (min-width: common.$desktop) {
order: 2;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/SimpleLinkList.astro
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ const groups = groupBy(entries, grouper);
---

<style lang="scss">
@import "../styles/imports.scss";
@use "../styles/_common.scss" as common;

h1 {
margin-bottom: 3rem;
}

h2 a,
ul a {
@include underlined-links;
@include common.underlined-links;
}

ul:has(ul) {
Expand All @@ -55,7 +55,7 @@ const groups = groupBy(entries, grouper);
column-gap: 2rem;
row-gap: 3rem;
list-style: none;
@media (min-width: $iPad) {
@media (min-width: common.$iPad) {
grid-template-columns: repeat(2, 1fr);
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/mdx/Ai.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface Props {
const { inline = false } = Astro.props;
---
<style lang="scss">
@import "../../styles/imports.scss";
@use "../../styles/_common.scss" as common;
blockquote {
display: inline-block;
margin: 0;
Expand Down Expand Up @@ -40,7 +40,7 @@ const { inline = false } = Astro.props;
line-height: 1rem;
border-left: 2px solid rgba(0,0,0,0.2);

@media (min-width:$iPad) {
@media (min-width: common.$iPad) {
top: -1.1rem;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/mdx/MastoPost.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { url } = Astro.props;
---

<style lang="scss">
@import "../../styles/imports.scss";
@use "../../styles/_common.scss" as common;
div {
display: flex;
align-items: center;
Expand All @@ -17,7 +17,7 @@ const { url } = Astro.props;
height: 200px;
box-shadow: var(--standardShadow);

@media (min-width: $desktop) {
@media (min-width: common.$desktop) {
width: 50%;
height: 300px;
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/mdx/Math.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const math = katex.renderToString(exp);
---

<style lang="scss">
@import "../../styles/imports.scss";
@use "../../styles/_common.scss" as common;
:global(.katex-html) {
clip: rect(0 0 0 0);
clip-path: inset(50%);
Expand All @@ -25,7 +25,7 @@ const math = katex.renderToString(exp);
.has-caption {
display: grid;
grid-template-rows: auto;
@media (min-width: $mobile) {
@media (min-width: common.$mobile) {
grid-template-columns: 1fr 1fr;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/layouts/main.astro
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const { meta = [], title: pageTitle, skipFooter } = Astro.props;
rel="stylesheet"
/>
<style lang="scss">
@import "../styles/imports.scss";
@use "../styles/_common.scss" as common;

body {
display: flex;
Expand All @@ -51,20 +51,20 @@ const { meta = [], title: pageTitle, skipFooter } = Astro.props;
:global(ul), :global(ol) {
padding: 0 1rem;
:global(ul), :global(ol) {
@media (min-width:$iPad) {
@media (min-width: common.$iPad) {
padding: 0 1rem;
}
}

@media (min-width:$iPad) {
@media (min-width: common.$iPad) {
padding: 0;
}
}
}

main {
padding: 5rem 0 1rem 0;
@include widths;
@include common.widths;
}
</style>
</head>
Expand Down
8 changes: 4 additions & 4 deletions src/pages/about.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import Info from "../components/mdx/Info.astro";
---

<style lang="scss">
@import "../styles/imports.scss";
@use "../styles/_common.scss" as common;
main {
display: grid;
grid-template-columns: 1fr auto;
gap: 1.5rem;

@media (max-width: $iPad) {
@media (max-width: common.$iPad) {
grid-template-columns: 1fr;
}
}
Expand All @@ -24,14 +24,14 @@ import Info from "../components/mdx/Info.astro";
gap: 1rem;
font-size: smaller;

@media (max-width: $iPad) {
@media (max-width: common.$iPad) {
display: grid;
grid-template-columns: repeat(2, 1fr);
}
}

a.badge {
@include underlined-links;
@include common.underlined-links;
padding: 0.25rem 0.25rem;
display: block;
text-align: center;
Expand Down
6 changes: 3 additions & 3 deletions src/pages/archive/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ const allYears = articles.reduce((agg, val) => {
---

<style lang="scss">
@import "../../styles/imports.scss";
@use "../../styles/_common.scss" as common;
ul {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 1rem;
list-style: none;
@media (min-width: $iPad) {
@media (min-width: common.$iPad) {
grid-template-columns: repeat(3, 1fr);
}
@media (min-width: $desktop) {
@media (min-width: common.$desktop) {
grid-template-columns: repeat(4, 1fr);
}
}
Expand Down
File renamed without changes.

0 comments on commit d49b7cc

Please sign in to comment.