summaryrefslogtreecommitdiff
path: root/src/components/shared/ThemeSwitcher.module.scss
diff options
context:
space:
mode:
authorHaishan <[email protected]>2022-03-06 17:23:14 +0800
committerGitHub <[email protected]>2022-03-06 17:23:14 +0800
commit8b2e4b6609deea56fdcafdf88172e577e5fadc38 (patch)
tree9eae0c4359bbdced9afef25f67de799dcb50ac92 /src/components/shared/ThemeSwitcher.module.scss
parent3e87d8b52e62c6f8da48176c81267bacd36e3965 (diff)
parentd87cc00fc83bb2bc5c1ffa69b4dad71d51e1cc66 (diff)
Merge pull request #675 from haishanh/automatic-color-scheme
Diffstat (limited to 'src/components/shared/ThemeSwitcher.module.scss')
-rw-r--r--src/components/shared/ThemeSwitcher.module.scss58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/components/shared/ThemeSwitcher.module.scss b/src/components/shared/ThemeSwitcher.module.scss
new file mode 100644
index 0000000..c5de126
--- /dev/null
+++ b/src/components/shared/ThemeSwitcher.module.scss
@@ -0,0 +1,58 @@
+.iconWrapper {
+ --sz: 40px;
+
+ width: var(--sz);
+ height: var(--sz);
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+ outline: none;
+ padding: 5px;
+ color: var(--color-text);
+ border-radius: 100%;
+ border: 1px solid transparent;
+}
+.iconWrapper:hover {
+ opacity: 0.6;
+}
+.iconWrapper:focus {
+ border-color: var(--color-focus-blue);
+}
+
+.themeSwitchContainer {
+ --sz: 40px;
+
+ position: relative;
+ display: flex;
+ align-items: center;
+ height: var(--sz);
+ select {
+ cursor: pointer;
+ padding-left: var(--sz);
+ width: var(--sz);
+ height: var(--sz);
+ appearance: none;
+ outline: none;
+ border-radius: 100%;
+ border: 1px solid transparent;
+ background: var(--color-bg-sidebar);
+ &:focus {
+ border-color: var(--color-focus-blue);
+ }
+ option {
+ // this has effect in Firefox
+ // Chrome and Safari use the native menu
+ background: var(--color-bg-sidebar);
+ }
+ }
+ .iconWrapper {
+ pointer-events: none;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ position: absolute;
+ left: 0;
+ top: 0;
+ }
+}