Skip to content

Commit df0e18a

Browse files
committed
fix(sanity): use correct color scheme in image input overlay
1 parent 8a80ef2 commit df0e18a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/sanity/src/core/form/inputs/files/ImageInput/ImagePreview.styled.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {Card, type CardTone, Flex, rgba, studioTheme} from '@sanity/ui'
2+
import {useColorSchemeValue} from 'sanity'
23
import {css, styled} from 'styled-components'
34

45
export const RatioBox = styled(Card)`
@@ -20,8 +21,9 @@ export const RatioBox = styled(Card)`
2021
export const Overlay = styled(Flex)<{
2122
$tone: Exclude<CardTone, 'inherit'>
2223
}>(({$tone}) => {
23-
const textColor = studioTheme.color.light[$tone].card.enabled.fg
24-
const backgroundColor = rgba(studioTheme.color.light[$tone].card.enabled.bg, 0.8)
24+
const colorScheme = useColorSchemeValue()
25+
const textColor = studioTheme.color[colorScheme][$tone].card.enabled.fg
26+
const backgroundColor = rgba(studioTheme.color[colorScheme][$tone].card.enabled.bg, 0.8)
2527

2628
return css`
2729
position: absolute;

0 commit comments

Comments
 (0)