Skip to content

Commit 9228b16

Browse files
committed
fix: border color
Signed-off-by: Innei <[email protected]>
1 parent d2d2806 commit 9228b16

File tree

9 files changed

+54
-20
lines changed

9 files changed

+54
-20
lines changed

cssAsPlugin.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// https://github.com/tailwindlabs/tailwindcss-intellisense/issues/227#issuecomment-1462034856
2+
// cssAsPlugin.js
3+
const postcss = require('postcss')
4+
const postcssJs = require('postcss-js')
5+
const { readFileSync } = require('fs')
6+
7+
require.extensions['.css'] = function (module, filename) {
8+
module.exports = ({ addBase, addComponents, addUtilities }) => {
9+
const css = readFileSync(filename, 'utf8')
10+
const root = postcss.parse(css)
11+
const jss = postcssJs.objectify(root)
12+
13+
if ('@layer base' in jss) {
14+
addBase(jss['@layer base'])
15+
}
16+
if ('@layer components' in jss) {
17+
addComponents(jss['@layer components'])
18+
}
19+
if ('@layer utilities' in jss) {
20+
addUtilities(jss['@layer utilities'])
21+
}
22+
}
23+
}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@
149149
"lint-staged": "15.2.2",
150150
"postcss": "8.4.38",
151151
"postcss-import": "16.1.0",
152+
"postcss-js": "4.0.1",
152153
"postcss-nested": "6.0.1",
153154
"postcss-preset-env": "9.5.2",
154155
"postcss-prune-var": "1.1.2",

pnpm-lock.yaml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/ui/input/Input.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const Input = forwardRef<
2020
className={clsxm(
2121
'min-w-0 flex-auto appearance-none rounded-lg border ring-accent/20 duration-200 sm:text-sm',
2222
'bg-base-100 px-3 py-[calc(theme(spacing.2)-1px)] placeholder:text-zinc-400 focus:outline-none focus:ring-2',
23-
'border-zinc-900/10 dark:border-zinc-700',
23+
'border-border',
2424
'focus:border-accent/80 dark:bg-zinc-700/[0.15] dark:text-zinc-200 dark:placeholder:text-zinc-500',
2525
props.type === 'password' ? 'font-mono' : 'font-[system-ui]',
2626
className,

src/components/ui/modal/stacked/modal.tsx

+8-10
Original file line numberDiff line numberDiff line change
@@ -207,21 +207,19 @@ export const Modal: Component<{
207207
)}
208208
onClick={stopPropagation}
209209
>
210-
<Dialog.Title className="shrink-0 px-4 py-2 text-lg font-medium">
211-
{title}
212-
</Dialog.Title>
210+
<div className="relative flex flex-1 items-center">
211+
<Dialog.Title className="shrink-0 grow items-center px-4 py-1 text-lg font-medium">
212+
{title}
213+
</Dialog.Title>
214+
<Dialog.DialogClose className="p-2" onClick={close}>
215+
<CloseIcon />
216+
</Dialog.DialogClose>
217+
</div>
213218
<Divider className="my-2 shrink-0 border-slate-200 opacity-80 dark:border-neutral-800" />
214219

215220
<div className="min-h-0 shrink grow overflow-auto px-4 py-2">
216221
{finalChildren}
217222
</div>
218-
219-
<Dialog.DialogClose
220-
onClick={close}
221-
className="absolute right-0 top-0 z-[9] p-5"
222-
>
223-
<CloseIcon />
224-
</Dialog.DialogClose>
225223
</m.div>
226224
</div>
227225
</Dialog.Content>

src/components/ui/select/Select.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ export const Select = function Select<T>(
4343
>
4444
<SelectImpl.Trigger
4545
className={clsxm(
46-
'inline-flex w-full items-center justify-between gap-1 rounded-lg border border-neutral-400/50 dark:border-neutral-700',
46+
'border-border inline-flex w-full items-center justify-between gap-1 rounded-lg border',
4747
'p-2',
4848
'text-[0.9em]',
4949

5050
className,
5151
)}
5252
>
5353
<SelectImpl.Value placeholder={placeholder} />
54-
<SelectImpl.Icon>
54+
<SelectImpl.Icon className="flex items-center">
5555
{isLoading ? (
5656
<i className="icon-[mingcute--loading-line] animate-spin" />
5757
) : (

src/styles/tailwindcss.css

-7
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,6 @@ a {
9999
}
100100
}
101101

102-
@layer components {
103-
.scrollbar-none::-webkit-scrollbar {
104-
width: 0 !important;
105-
height: 0 !important;
106-
}
107-
}
108-
109102
.prose p:last-child {
110103
margin-bottom: 0;
111104
}

src/styles/theme.css

+12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
@layer components {
2+
/* Extend Tailwind classnames */
3+
.border-border {
4+
@apply border-zinc-900/10 dark:border-zinc-700;
5+
}
6+
}
7+
8+
@layer components {
9+
.scrollbar-none::-webkit-scrollbar {
10+
width: 0 !important;
11+
height: 0 !important;
12+
}
13+
214
.shiro-link--underline,
315
.shiro-timeline a {
416
color: currentColor;

tailwind.config.ts

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import type { CSSRuleObject, PluginAPI } from 'tailwindcss/types/config'
66
import { addDynamicIconSelectors } from '@iconify/tailwind'
77
import typography from '@tailwindcss/typography'
88

9+
require('./cssAsPlugin')
10+
911
const UIKitColors = {
1012
red: {
1113
light: '#FF3B30',
@@ -297,6 +299,8 @@ const twConfig: Config = {
297299

298300
require('tailwind-scrollbar'),
299301
require('@tailwindcss/container-queries'),
302+
require('./src/styles/theme.css'),
303+
require('./src/styles/uikit.css'),
300304
],
301305
}
302306

0 commit comments

Comments
 (0)