File tree Expand file tree Collapse file tree 7 files changed +40
-19
lines changed
theme-default/src/client/styles Expand file tree Collapse file tree 7 files changed +40
-19
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,4 @@ module.exports = {
52
52
53
53
You can customize the style of the popup via CSS variables:
54
54
55
- ``` css
56
- :root {
57
- --pwa-popup-color : #3eaf7c ;
58
- }
59
- ```
55
+ @[ code css] ( @vuepress/plugin-pwa-popup/src/client/styles/vars.css )
Original file line number Diff line number Diff line change @@ -52,8 +52,4 @@ module.exports = {
52
52
53
53
你可以通过 CSS 变量来自定义弹窗的样式:
54
54
55
- ``` css
56
- :root {
57
- --pwa-popup-color : #3eaf7c ;
58
- }
59
- ```
55
+ @[ code css] ( @vuepress/plugin-pwa-popup/src/client/styles/vars.css )
Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ import { useRouteLocale } from '@vuepress/client'
4
4
import { usePwaEvent , useSkipWaiting } from '@vuepress/plugin-pwa/lib/client'
5
5
import type { LocaleConfig } from '@vuepress/shared'
6
6
7
- import './PwaPopup.css'
7
+ import '../styles/vars.css'
8
+ import '../styles/pwa-popup.css'
8
9
9
10
export type PwaPopupLocales = LocaleConfig < {
10
11
message : string
Original file line number Diff line number Diff line change 1
1
export * from './components/PwaPopup'
2
+ export * from './components/PwaPopupWrapper'
Original file line number Diff line number Diff line change 1
- : root {
2
- --pwa-popup-color : # 3eaf7c ;
3
- }
4
-
5
1
.pwa-popup {
6
2
position : fixed;
7
3
right : 1em ;
8
4
bottom : 1em ;
9
5
padding : 1em ;
10
- border : 1px solid # 3eaf7c ;
6
+ border : 1px solid var ( --pwa-popup-border-color ) ;
11
7
border-radius : 3px ;
12
- background : # fff ;
13
- box-shadow : 0 4 px 16 px var (--pwa-popup-color );
8
+ background-color : var ( --pwa-popup-bg-color ) ;
9
+ box-shadow : var (--pwa-popup-shadow );
14
10
text-align : center;
15
- z-index : 3 ;
11
+ z-index : var ( --pwa-popup-z-index ) ;
16
12
}
17
13
18
14
.pwa-popup > button {
15
+ cursor : pointer;
19
16
margin-top : 0.5em ;
20
17
padding : 0.25em 2em ;
18
+ border : none;
19
+ color : var (--pwa-popup-btn-text-color );
20
+ background-color : var (--pwa-popup-btn-bg-color );
21
+ }
22
+
23
+ .pwa-popup > button : hover {
24
+ background-color : var (--pwa-popup-btn-hover-bg-color );
21
25
}
22
26
23
27
.pwa-popup-enter-active ,
Original file line number Diff line number Diff line change
1
+ : root {
2
+ --pwa-popup-z-index : 3 ;
3
+
4
+ --pwa-popup-text-color : # 2c3e50 ;
5
+ --pwa-popup-bg-color : # ffffff ;
6
+ --pwa-popup-border-color : # 3eaf7c ;
7
+ --pwa-popup-shadow : 0 4px 16px var (--pwa-popup-border-color );
8
+
9
+ --pwa-popup-btn-text-color : # ffffff ;
10
+ --pwa-popup-btn-bg-color : # 3eaf7c ;
11
+ --pwa-popup-btn-hover-bg-color : # 4abf8a ;
12
+ }
Original file line number Diff line number Diff line change 106
106
--docsearch-hit-shadow : 0 1px 3px 0 var (--c-border-dark );
107
107
--docsearch-footer-background : var (--c-bg );
108
108
}
109
+
110
+ // plugin-pwa-popup
111
+ .pwa-popup {
112
+ --pwa-popup-text-color : var (--c-text );
113
+ --pwa-popup-bg-color : var (--c-bg );
114
+ --pwa-popup-border-color : var (--c-brand );
115
+ --pwa-popup-shadow : 0 4px 16px var (--c-brand );
116
+ --pwa-popup-btn-text-color : var (--c-bg );
117
+ --pwa-popup-btn-bg-color : var (--c-brand );
118
+ --pwa-popup-btn-hover-bg-color : var (--c-brand-light );
119
+ }
You can’t perform that action at this time.
0 commit comments