Skip to content

Commit cc1f7d9

Browse files
committed
styling
1 parent a2771b4 commit cc1f7d9

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

src/components/changelog/Header.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const products = await uniqueProducts(notes);
3232
---
3333

3434
<div
35-
class="bg-linear-to-r mb-16 ml-[calc(50%-50vw)] flex w-screen items-center justify-evenly border-b-2 bg-gradient-to-r from-[#FFE9CB99] to-[#FFFFFF99] p-4 dark:border-b-[#2C2C2C] dark:from-[#FBAD411F] dark:to-[#2C2C2C00] max-sm:flex-col-reverse sm:h-[18.75rem]"
35+
class="bg-linear-to-r !mt-0 mb-16 ml-[calc(50%-50vw)] flex w-screen items-center justify-evenly border-b-2 bg-gradient-to-r from-[#FFE9CB99] to-[#FFFFFF99] p-4 dark:border-b-[#2C2C2C] dark:from-[#FBAD411F] dark:to-[#2C2C2C00] max-sm:flex-col-reverse sm:h-[18.75rem]"
3636
>
3737
<div class="text-center sm:text-left">
3838
<h1>Changelog</h1>

src/components/changelog/ProductSelect.tsx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { CollectionEntry } from "astro:content";
2+
import type { StylesConfig } from "react-select";
23
import Select from "react-select";
34
import { useEffect, useState } from "react";
45

@@ -41,6 +42,47 @@ export default function ProductSelect({ products, groups }: Props) {
4142
},
4243
];
4344

45+
const selectStyles: StylesConfig<Option, false> = {
46+
control: (base, state) => ({
47+
...base,
48+
backgroundColor: "var(--sl-color-gray-6)",
49+
borderColor: state.isFocused
50+
? "var(--sl-color-gray-3)"
51+
: "var(--sl-color-gray-4)",
52+
"&:hover": {
53+
borderColor: "var(--sl-color-gray-3)",
54+
},
55+
boxShadow: state.isFocused ? "0 0 0 1px var(--sl-color-gray-3)" : "none",
56+
}),
57+
menu: (base) => ({
58+
...base,
59+
backgroundColor: "var(--sl-color-gray-6)",
60+
borderColor: "var(--sl-color-gray-4)",
61+
}),
62+
option: (base, state) => ({
63+
...base,
64+
backgroundColor: state.isFocused
65+
? "var(--sl-color-gray-5)"
66+
: "var(--sl-color-gray-6)",
67+
color: "var(--sl-color-gray-1)",
68+
"&:active": {
69+
backgroundColor: "var(--sl-color-gray-4)",
70+
},
71+
}),
72+
singleValue: (base) => ({
73+
...base,
74+
color: "var(--sl-color-gray-1)",
75+
}),
76+
input: (base) => ({
77+
...base,
78+
color: "var(--sl-color-gray-1)",
79+
}),
80+
groupHeading: (base) => ({
81+
...base,
82+
color: "var(--sl-color-gray-3)",
83+
}),
84+
};
85+
4486
useEffect(() => {
4587
const url = new URL(window.location.href);
4688
const param = url.searchParams.get("product");
@@ -78,6 +120,7 @@ export default function ProductSelect({ products, groups }: Props) {
78120
options={options}
79121
value={selectedOption}
80122
onChange={handleChange}
123+
styles={selectStyles}
81124
/>
82125
);
83126
}

0 commit comments

Comments
 (0)