File tree Expand file tree Collapse file tree 4 files changed +40
-25
lines changed
packages/theme-default/src
components/SwitchAppearance Expand file tree Collapse file tree 4 files changed +40
-25
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ .rp-switch-appearance {
2
+ cursor : pointer ;
3
+ width : 24px ;
4
+ height : 24px ;
5
+ position : relative ;
6
+ display : flex ;
7
+ justify-content : center ;
8
+ align-items : center ;
9
+ color : var (--rp-c-text-2 );
10
+
11
+ & :hover {
12
+ color : var (--rp-c-text-1 );
13
+ }
14
+
15
+ & __icon {
16
+ & --sun {
17
+ display : block ;
18
+ }
19
+
20
+ & --moon {
21
+ display : none ;
22
+ }
23
+ }
24
+ }
25
+
26
+ .rp-dark .rp-switch-appearance {
27
+ & __icon {
28
+ & --sun {
29
+ display : none ;
30
+ }
31
+
32
+ & --moon {
33
+ display : block ;
34
+ }
35
+ }
36
+ }
Original file line number Diff line number Diff line change @@ -4,8 +4,7 @@ import SunSvg from '@theme-assets/sun';
4
4
import { type MouseEvent , useContext } from 'react' ;
5
5
import { SvgWrapper } from '../SvgWrapper' ;
6
6
import './global.scss' ;
7
- import { cls } from '../../utils' ;
8
- import * as styles from './index.module.scss' ;
7
+ import './index.scss' ;
9
8
10
9
const supportAppearanceTransition = ( ) => {
11
10
return (
@@ -87,17 +86,14 @@ export function SwitchAppearance({ onClick }: { onClick?: () => void }) {
87
86
} ;
88
87
89
88
return (
90
- < div
91
- onClick = { handleClick }
92
- className = { cls ( 'rspress-nav-appearance' , styles . switchAppearance ) }
93
- >
89
+ < div onClick = { handleClick } className = "rp-switch-appearance" >
94
90
< SvgWrapper
95
- className = "dark: rp-hidden "
91
+ className = "rp-switch-appearance__icon rp-switch-appearance__icon--sun "
96
92
icon = { SunSvg }
97
93
fill = "currentColor"
98
94
/>
99
95
< SvgWrapper
100
- className = "rp-hidden dark: rp-block "
96
+ className = "rp-switch-appearance__icon rp-switch-appearance__icon--moon "
101
97
icon = { MoonSvg }
102
98
fill = "currentColor"
103
99
/>
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments