File tree 6 files changed +35
-32
lines changed
plugin-medium-zoom/src/client
theme-default/src/client/styles
6 files changed +35
-32
lines changed Original file line number Diff line number Diff line change @@ -45,12 +45,7 @@ Integrate [medium-zoom](https://github.com/francoischalifour/medium-zoom#readme)
45
45
46
46
You can customize most of the zoom styles via [ zoomOptions] ( #zoomoptions ) , while this plugin also provides some CSS variables for additional customization:
47
47
48
- ``` css
49
- :root {
50
- /* z-index of the zoom overlay */
51
- --medium-zoom-z-index : 100 ;
52
- }
53
- ```
48
+ @[ code css] ( @vuepress/plugin-medium-zoom/src/client/styles/vars.css )
54
49
55
50
## Composition API
56
51
Original file line number Diff line number Diff line change 45
45
46
46
你可以通过 [ zoomOptions] ( #zoomoptions ) 对大部分的缩放样式进行自定义,不过作为补充,该插件同样提供了一些 CSS 变量:
47
47
48
- ``` css
49
- :root {
50
- /* zoom 遮罩的 z-index */
51
- --medium-zoom-z-index : 100 ;
52
- }
53
- ```
48
+ @[ code css] ( @vuepress/plugin-medium-zoom/src/client/styles/vars.css )
54
49
55
50
## Composition API
56
51
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import type { ZoomOptions } from 'medium-zoom'
3
3
import { defineClientAppEnhance } from '@vuepress/client'
4
4
import { mediumZoomSymbol } from './composables'
5
5
6
+ import './styles/vars.css'
6
7
import './styles/medium-zoom.css'
7
8
8
9
declare const __MZ_SELECTOR__ : string
Original file line number Diff line number Diff line change 1
- : root {
2
- --medium-zoom-z-index : 100 ;
3
- }
4
-
5
1
.medium-zoom-overlay {
2
+ /* override element style set by medium-zoom script */
3
+ background-color : var (--medium-zoom-bg-color ) !important ;
6
4
z-index : var (--medium-zoom-z-index );
7
5
}
8
6
9
7
.medium-zoom-overlay ~ img {
10
8
z-index : calc (var (--medium-zoom-z-index ) + 1 );
11
9
}
10
+
11
+ .medium-zoom--opened .medium-zoom-overlay {
12
+ opacity : var (--medium-zoom-opacity );
13
+ }
Original file line number Diff line number Diff line change
1
+ : root {
2
+ --medium-zoom-z-index : 100 ;
3
+ --medium-zoom-bg-color : # ffffff ;
4
+ --medium-zoom-opacity : 1 ;
5
+ }
Original file line number Diff line number Diff line change 73
73
--back-to-top-color-hover : var (--c-brand-light );
74
74
}
75
75
76
- // plugin-nprogress
77
- #nprogress {
78
- --nprogress-color : var (--c-brand );
79
- }
80
-
81
- // plugin-search
82
- .search-box {
83
- --search-bg-color : var (--c-bg );
84
- --search-accent-color : var (--c-brand );
85
- --search-text-color : var (--c-text );
86
- --search-border-color : var (--c-border );
87
-
88
- --search-item-text-color : var (--c-text-lighter );
89
- --search-item-focus-bg-color : var (--c-bg-light );
90
- }
91
-
92
76
// plugin-docsearch
93
77
.DocSearch {
94
78
--docsearch-primary-color : var (--c-brand );
107
91
--docsearch-footer-background : var (--c-bg );
108
92
}
109
93
94
+ // plugin-medium-zoom
95
+ .medium-zoom-overlay {
96
+ --medium-zoom-bg-color : var (--c-bg );
97
+ }
98
+
99
+ // plugin-nprogress
100
+ #nprogress {
101
+ --nprogress-color : var (--c-brand );
102
+ }
103
+
110
104
// plugin-pwa-popup
111
105
.pwa-popup {
112
106
--pwa-popup-text-color : var (--c-text );
117
111
--pwa-popup-btn-bg-color : var (--c-brand );
118
112
--pwa-popup-btn-hover-bg-color : var (--c-brand-light );
119
113
}
114
+
115
+ // plugin-search
116
+ .search-box {
117
+ --search-bg-color : var (--c-bg );
118
+ --search-accent-color : var (--c-brand );
119
+ --search-text-color : var (--c-text );
120
+ --search-border-color : var (--c-border );
121
+
122
+ --search-item-text-color : var (--c-text-lighter );
123
+ --search-item-focus-bg-color : var (--c-bg-light );
124
+ }
You can’t perform that action at this time.
0 commit comments