Skip to content

Commit cc36f76

Browse files
committed
style: cleaner pagination style
1 parent c6060b0 commit cc36f76

File tree

3 files changed

+34
-23
lines changed

3 files changed

+34
-23
lines changed

src/components/ProjectPagination.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { Pagination } from "@ark-ui/solid";
44
import type { Page } from "astro";
55
import { type Component, For } from "solid-js";
66
import { paginationStyles } from "~/styles/pagination";
7-
import TablerChevronLeft from "~icons/tabler/chevron-left";
8-
import TablerChevronRight from "~icons/tabler/chevron-right";
7+
import TablerCaretLeftFilled from "~icons/tabler/caret-left-filled";
8+
import TablerCaretRightFilled from "~icons/tabler/caret-right-filled";
99

1010
export const ProjectPagination: Component<{
1111
page: Page<CollectionEntry<"projects">>;
@@ -19,7 +19,7 @@ export const ProjectPagination: Component<{
1919
class={paginationStyles.root}
2020
>
2121
<Pagination.PrevTrigger class={paginationStyles.trigger}>
22-
<TablerChevronLeft />
22+
<TablerCaretLeftFilled />
2323
</Pagination.PrevTrigger>
2424
<Pagination.Context>
2525
{(api) => (
@@ -39,7 +39,7 @@ export const ProjectPagination: Component<{
3939
)}
4040
</Pagination.Context>
4141
<Pagination.NextTrigger class={paginationStyles.trigger}>
42-
<TablerChevronRight />
42+
<TablerCaretRightFilled />
4343
</Pagination.NextTrigger>
4444
</Pagination.Root>
4545
);

src/styles/button.ts

+26-2
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,37 @@ export const buttonStyles = cva({
3636
backgroundColor: "fg.canvas",
3737
},
3838
},
39+
outline: {
40+
borderWidth: "base",
41+
borderColor: "fg.default",
42+
_hover: {
43+
borderColor: "fg.canvas",
44+
},
45+
_selected: {
46+
backgroundColor: "fg.default",
47+
color: "bg.canvas",
48+
},
49+
},
3950
},
4051
size: {
41-
md: {
52+
sm: {
4253
h: "8",
4354
minW: "8",
4455
textStyle: "sm",
45-
px: "2",
56+
px: "3",
57+
gap: "2",
58+
},
59+
md: {
60+
h: "9",
61+
minW: "9",
62+
px: "3.5",
63+
gap: "2",
64+
},
65+
lg: {
66+
h: "10",
67+
minW: "10",
68+
textStyle: "lg",
69+
px: "4",
4670
gap: "2",
4771
},
4872
},

src/styles/pagination.ts

+4-17
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
1-
import { css } from "styled-system/css";
2-
import { token } from "styled-system/tokens";
1+
import { css, cx } from "styled-system/css";
32
import { buttonStyles } from "./button";
43

54
export const paginationStyles = {
65
root: css({
76
display: "flex",
87
justifyContent: "center",
9-
alignItems: "stretch",
10-
gap: "6",
8+
alignItems: "center",
9+
gap: "4",
1110
}),
1211
trigger: buttonStyles({ icon: true }),
13-
item: css({
14-
cursor: "pointer",
15-
fontVariantNumeric: "tabular-nums",
16-
backgroundColor: "bg.canvas",
17-
px: "2",
18-
fontSize: "lg",
19-
"&[data-selected]": {
20-
textDecoration: "underline",
21-
textDecorationThickness: token.var("borderWidths.base"),
22-
backgroundColor: "fg.default",
23-
color: "bg.canvas",
24-
},
25-
}),
12+
item: buttonStyles({ variant: "outline", icon: true }),
2613
};

0 commit comments

Comments
 (0)