File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6464 applyColors ( cfg . primary , cfg . accent ) ;
6565 }
6666
67- function getSourceForCurrentPage ( ) {
68- const content = document . querySelector ( ".md-content" ) ;
69- const code = content ?. querySelector ( "pre > code" ) ?. textContent ?. trim ( ) ;
70- return code || "" ;
71- }
72-
7367 function createHeaderButton ( ) {
7468 const btn = document . createElement ( "button" ) ;
7569 btn . type = "button" ;
76- btn . className = "md-button theme-palette-header-button" ;
77- btn . textContent = "配色" ;
70+ btn . className = "md-header__button md-icon theme-palette-header-button" ;
7871 btn . title = "配色设置" ;
7972 btn . setAttribute ( "aria-label" , btn . title ) ;
73+ btn . innerHTML =
74+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">' +
75+ '<path d="M12 22a10 10 0 1 1 10-10c0 1.1-.9 2-2 2h-1a2 2 0 0 0-2 2c0 2.2-1.8 4-4 4Zm0-18a8 8 0 0 0 0 16c1.1 0 2-.9 2-2 0-1.7 1.3-3 3-3h1c0-2.2-1.8-4-4-4H9a4 4 0 0 1 0-8h3Zm-5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm3-3a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm4 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm3 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"/>' +
76+ "</svg>" ;
8077 return btn ;
8178 }
8279
Original file line number Diff line number Diff line change 11.theme-palette-header-button {
2- margin-right : 0.5rem ;
3- padding : 0.25rem 0.6rem ;
4- font-size : 0.7rem ;
5- line-height : 1.2 ;
6- white-space : nowrap;
2+ display : inline-flex;
3+ align-items : center;
4+ justify-content : center;
5+ margin-right : 0.25rem ;
76}
87
98.theme-palette-overlay {
1716 padding : 4rem 1rem 1rem ;
1817}
1918
19+ .theme-palette-overlay [hidden ] {
20+ display : none !important ;
21+ }
22+
23+ .theme-palette-header-button svg {
24+ width : 1.2rem ;
25+ height : 1.2rem ;
26+ }
27+
2028.theme-palette-panel {
2129 width : min (720px , 100% );
2230 background : var (--md-default-bg-color );
You can’t perform that action at this time.
0 commit comments