Skip to content

Commit

Permalink
Do not dim SVG images in dark mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarty committed Apr 9, 2024
1 parent 5da9128 commit 113bf40
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default defineConfig({
name: 'preset-default',
params: {
overrides: {
minifyStyles: false,
inlineStyles: false, // Preserve the class attributes.
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/ListPostCover.astro
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const {
alt={title}
widths={[300, 600, 1000]}
sizes="(max-width: 767px) 100vw, 300px"
class="object-cover object-left absolute inset-0 w-full h-full z-0"
class="object-cover absolute inset-0 w-full h-full z-0"
format="webp"
/>
)
Expand Down
4 changes: 2 additions & 2 deletions src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ body {
}
}

/* Slightly dim the images to avoid heavy contrast. */
.dark img {
/* Slightly dim the images (except SVG) to avoid heavy contrast. */
.dark img:not([src$='.svg' i]) {
filter: brightness(0.8) contrast(1.2);
}

Expand Down

0 comments on commit 113bf40

Please sign in to comment.