mirror of
https://github.com/wavetermdev/docusaurus-og.git
synced 2026-08-05 13:46:35 -07:00
fix: ensure icons adapt to theme changes with CSS
This commit is contained in:
@@ -48,13 +48,11 @@ type TProps = {
|
||||
|
||||
export const Icon = (props: TProps): JSX.Element => {
|
||||
const { children, size = 'm' } = props
|
||||
const { colorMode, setColorMode } = useColorMode()
|
||||
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
styles.icon,
|
||||
colorMode === 'dark' ? styles.dark : styles.light,
|
||||
styles[size],
|
||||
props.stroke && styles.stroke,
|
||||
props.fill && styles.fill,
|
||||
|
||||
@@ -15,8 +15,10 @@
|
||||
width: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.dark {
|
||||
[data-theme='dark'] {
|
||||
.icon {
|
||||
&.fill {
|
||||
&,
|
||||
* {
|
||||
@@ -30,7 +32,10 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
&.light {
|
||||
}
|
||||
|
||||
[data-theme='light'] {
|
||||
.icon {
|
||||
&.fill {
|
||||
&,
|
||||
* {
|
||||
|
||||
Reference in New Issue
Block a user