refactor: recommend using data-theme without html element selector (#6668)

* refactor: recommend using data-theme without html element selector

* simplify site CSS

* refactor
This commit is contained in:
Joshua Chen 2022-02-14 10:23:42 +08:00 committed by GitHub
parent 4b7bea950f
commit b89d93fab5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 88 additions and 64 deletions

View file

@ -17,7 +17,7 @@
}
/* For readability concerns, you should choose a lighter palette in dark mode. */
html[data-theme='dark'] {
[data-theme='dark'] {
--ifm-color-primary: #25c2a0;
--ifm-color-primary-dark: #21af90;
--ifm-color-primary-darker: #1fa588;
@ -34,6 +34,6 @@ html[data-theme='dark'] {
padding: 0 var(--ifm-pre-padding);
}
html[data-theme='dark'] .docusaurus-highlight-code-line {
[data-theme='dark'] .docusaurus-highlight-code-line {
background-color: rgba(0, 0, 0, 0.3);
}

View file

@ -26,7 +26,7 @@
}
/* For readability concerns, you should choose a lighter palette in dark mode. */
html[data-theme='dark'] {
[data-theme='dark'] {
--ifm-color-primary: #25c2a0;
--ifm-color-primary-dark: #21af90;
--ifm-color-primary-darker: #1fa588;

View file

@ -24,7 +24,7 @@
box-shadow: 0 4px 8px 0 rgb(0 0 0 / 20%);
}
html[data-theme='dark'] .cardContainer.cardContainerLink:hover {
[data-theme='dark'] .cardContainer.cardContainerLink:hover {
--ifm-card-background-color: #2d2d2d; /* original, non-hovered color is #242526 */
}

View file

@ -69,12 +69,12 @@
transform: rotate(0);
}
html[dir='rtl'] .expandSidebarButtonIcon {
[dir='rtl'] .expandSidebarButtonIcon {
transform: rotate(180deg);
}
html[data-theme='dark'] .collapsedDocSidebar:hover,
html[data-theme='dark'] .collapsedDocSidebar:focus {
[data-theme='dark'] .collapsedDocSidebar:hover,
[data-theme='dark'] .collapsedDocSidebar:focus {
background-color: var(--collapse-button-bg-color-dark);
}

View file

@ -72,16 +72,16 @@
margin-top: 4px;
}
html[dir='rtl'] .collapseSidebarButtonIcon {
[dir='rtl'] .collapseSidebarButtonIcon {
transform: rotate(0);
}
html[data-theme='dark'] .collapseSidebarButton {
[data-theme='dark'] .collapseSidebarButton {
background-color: var(--collapse-button-bg-color-dark);
}
html[data-theme='dark'] .collapseSidebarButton:hover,
html[data-theme='dark'] .collapseSidebarButton:focus {
[data-theme='dark'] .collapseSidebarButton:hover,
[data-theme='dark'] .collapseSidebarButton:focus {
background-color: var(--ifm-color-emphasis-200);
}
}

View file

@ -9,10 +9,10 @@
display: none;
}
html[data-theme='light'] .themedImage--light {
[data-theme='light'] .themedImage--light {
display: initial;
}
html[data-theme='dark'] .themedImage--dark {
[data-theme='dark'] .themedImage--dark {
display: initial;
}