mirror of
https://github.com/vercel/commerce.git
synced 2025-05-17 23:16:59 +00:00
Requested style changes
This commit is contained in:
parent
49d713512a
commit
e222a52585
@ -3,7 +3,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
@apply h-10 px-2 rounded-md border border-accent-2 flex items-center justify-center transition-colors ease-linear;
|
@apply h-10 pl-2 pr-0.5 rounded-md border border-accent-2 flex items-center justify-center transition-colors ease-linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button:hover {
|
.button:hover {
|
||||||
|
@ -18,12 +18,21 @@ const ThemeSwitcher = () => {
|
|||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
className={
|
className={
|
||||||
'h-10 px-2 rounded-md border border-accent-2 flex items-center justify-center transition-colors ease-linear hover:border-accent-3 hover:shadow-sm'
|
'w-[110px] h-10 pl-2 pr-0.5 rounded-md border border-accent-2 flex items-center justify-between transition-colors ease-linear hover:border-accent-3 hover:shadow-sm'
|
||||||
}
|
}
|
||||||
aria-label="Theme Switcher"
|
aria-label="Theme Switcher"
|
||||||
>
|
>
|
||||||
|
<span className="flex items-center">
|
||||||
<ThemeIcon width={20} height={20} theme={theme} />
|
<ThemeIcon width={20} height={20} theme={theme} />
|
||||||
<span className="capitalize leading-none ml-2">{theme}</span>
|
<span
|
||||||
|
className={cn('capitalize leading-none', {
|
||||||
|
'text-sm ml-1.5': theme === 'system',
|
||||||
|
'ml-2': theme !== 'system',
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
{theme}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
<span className="cursor-pointer">
|
<span className="cursor-pointer">
|
||||||
<ChevronRight
|
<ChevronRight
|
||||||
className={cn('transition duration-300', {
|
className={cn('transition duration-300', {
|
||||||
|
@ -3,7 +3,8 @@ import { useEffect, useState } from 'react'
|
|||||||
|
|
||||||
export const useToggleTheme = () => {
|
export const useToggleTheme = () => {
|
||||||
const { theme, themes, setTheme } = useTheme()
|
const { theme, themes, setTheme } = useTheme()
|
||||||
const [themeValue, setThemeValue] = useState<string>()
|
const [themeValue, setThemeValue] = useState<string>('system')
|
||||||
|
|
||||||
useEffect(() => setThemeValue(theme), [theme])
|
useEffect(() => setThemeValue(theme), [theme])
|
||||||
|
|
||||||
return { theme: themeValue, setTheme, themes }
|
return { theme: themeValue, setTheme, themes }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user