Improve styles and compatibility

This commit is contained in:
Andras Schmelczer 2022-09-22 10:28:49 +02:00
parent d246dddbf5
commit 4ab6a5c5b0
No known key found for this signature in database
GPG key ID: 0EA1BC97D0AB076E
10 changed files with 46 additions and 46 deletions

View file

@ -1,9 +0,0 @@
html[animations='off'] {
&,
*,
*::before,
*::after {
transition: none !important;
animation: none !important;
}
}

View file

@ -1,5 +0,0 @@
export const turnOnAnimations = () =>
document.documentElement.setAttribute('animations', 'on');
export const turnOffAnimations = () =>
document.documentElement.setAttribute('animations', 'off');

View file

@ -1,5 +0,0 @@
@mixin in-dark-mode() {
html[theme='dark'] {
@content;
}
}

View file

@ -1,8 +0,0 @@
export const isSystemLevelDarkModeEnabled = (): boolean =>
matchMedia && matchMedia('(prefers-color-scheme: dark)').matches;
export const turnOnDarkMode = () =>
document.documentElement.setAttribute('theme', 'dark');
export const turnOnLightMode = () =>
document.documentElement.setAttribute('theme', 'light');

View file

@ -12,6 +12,22 @@ $breakpoint-width: 925px !default;
}
}
@mixin in-dark-mode() {
html[theme='dark'] {
@content;
}
}
html[animations='off'] {
&,
*,
*::before,
*::after {
transition: none !important;
animation: none !important;
}
}
@mixin image-button($icon-size) {
display: block;
box-sizing: content-box;
@ -45,7 +61,12 @@ $breakpoint-width: 925px !default;
@mixin blurred-background() {
backdrop-filter: blur(var(--blur-radius));
@supports not (backdrop-filter: blur(var(--blur-radius))) {
-webkit-backdrop-filter: blur(var(--blur-radius));
@supports not (
(backdrop-filter: blur(var(--blur-radius))) or
(-webkit-backdrop-filter: blur(var(--blur-radius)))
) {
background-color: var(--card-color);
}
}

View file

@ -1,6 +1,4 @@
@use 'mixins' as *;
@use 'dark-mode/dark-mode' as *;
@use 'animations/animations' as *;
:root {
--transition-time: 150ms;
@ -27,7 +25,7 @@
--shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1), 0 0 1px rgba(0, 0, 0, 0.2);
--inset-shadow: inset 0 -9px 7px -7px rgb(0, 0, 0, 0.15);
--icon-size: 45px;
--large-icon-size: 80px;
--large-icon-size: 60px;
--body-width: 765px;
}
}