Skip to content

Commit cb47396

Browse files
committed
Fix gallery image layout
1 parent 5625f2c commit cb47396

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

src/BlogIndex.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ const articles = getArticles();
99
const BlogIndex: Component = () => {
1010
return (
1111
<main>
12-
<h1 class="mb-4 bg-colors-primary-500 pl-8 pr-8 text-center text-big text-colors-text-900a">
12+
<h1 class="bg-colors-primary-500 text-big text-colors-text-900a mb-4 pr-8 pl-8 text-center">
1313
Blog of a programming rabbit
1414
</h1>
1515
<ul class="flex flex-col gap-4">
1616
<For each={articles}>
1717
{(item, idx) => (
1818
<>
19-
<li class="flex flex-col hover:bg-colors-primary-100">
19+
<li class="hover:bg-colors-primary-100 flex flex-col">
2020
<a
2121
href={`${config.base}${item.url}`}
2222
class="flex flex-col p-4 no-underline">
2323
<span class="text-heading2 text-colors-primary-800">
2424
{item.title}
2525
</span>
26-
<span class="textbody mb-4 mt-1 text-colors-text-300a !no-underline">
26+
<span class="textbody text-colors-text-300a mt-1 mb-4 !no-underline">
2727
{item.date} by Matic Utsumi Gačar
2828
</span>
2929
<span

src/GallerySite.tsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import { css } from "@linaria/core";
22
import cn from "classnames";
33
import { Component, JSX } from "solid-js";
44
import DialogImage from "~/DialogImage";
5-
import { breakpoint, breakpointUntil } from "~/style/commonStyle";
5+
import {
6+
breakpoint,
7+
breakpointFrom,
8+
breakpointUntil,
9+
} from "~/style/commonStyle";
610

711
const images: Component[] = Object.values(
812
import.meta.glob("@assets/gallery/*.jpg", {
@@ -47,20 +51,21 @@ const _GallerySite = css``;
4751

4852
const Grid = css`
4953
display: grid;
50-
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
54+
grid-template-columns: repeat(3, 1fr);
5155
grid-gap: 0;
52-
${breakpointUntil("m")} {
53-
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
56+
${breakpoint("xs")} {
57+
grid-template-columns: repeat(2, 1fr);
58+
}
59+
${breakpoint("l")} {
60+
grid-template-columns: repeat(4, 1fr);
61+
}
62+
${breakpoint("xl")} {
63+
grid-template-columns: repeat(5, 1fr);
5464
}
5565
`;
5666

5767
const card = css`
58-
${breakpoint("s")} {
59-
&:nth-child(1n + 18) + div {
60-
display: none;
61-
}
62-
}
63-
${breakpoint("m")} {
68+
${breakpoint("s", "m")} {
6469
&:nth-child(1n + 18) + div {
6570
display: none;
6671
}

0 commit comments

Comments
 (0)