TelegramPWA/src/styles/index.scss
2022-01-05 17:45:33 +01:00

269 lines
4.8 KiB
SCSS

@import 'reboot';
@import 'variables';
@import 'mixins';
@import 'spacing';
@import 'forms';
@import 'icons';
@import 'common';
@import '../assets/fonts/roboto.css';
html, body {
width: 100%;
height: 100%;
background: var(--color-background);
margin: 0;
padding: 0;
font-size: 16px;
font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Apple Color Emoji", "Segoe UI", Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
color: var(--color-text);
font-weight: 400;
line-height: 1.5;
text-align: left;
overflow: hidden;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@media (max-width: 600px) {
height: calc(var(--vh, 1vh) * 100);
}
}
body.is-ios,
body.is-macos {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Roboto", "Apple Color Emoji", "Helvetica Neue", sans-serif;
}
html[lang=fa],
html[lang=fa] body {
font-family: "Vazir", "Roboto", -apple-system, BlinkMacSystemFont, "Apple Color Emoji", "Segoe UI", Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
&.is-ios,
&.is-macos {
font-family: "Vazir", -apple-system, BlinkMacSystemFont, "Roboto", "Apple Color Emoji", "Segoe UI", Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
}
}
body.is-ios {
--border-radius-messages: 1rem;
--border-radius-messages-small: 0.5rem;
}
body.cursor-grabbing, body.cursor-grabbing * {
cursor: grabbing !important;
}
body.cursor-ew-resize {
cursor: ew-resize !important;
}
#root {
height: 100%;
@media (max-width: 600px) {
height: calc(var(--vh, 1vh) * 100);
}
}
#middle-column-portals,
#portals {
position: absolute;
top: 0;
left: 0;
right: 0;
}
.hidden {
visibility: hidden;
}
.no-selection {
user-select: none;
-webkit-user-select: none !important;
}
.resize-handle {
display: none;
position: absolute;
top: 0;
right: -.25rem;
bottom: 0;
width: .25rem;
z-index: var(--z-resize-handle);
cursor: ew-resize;
@media (min-width: 926px) {
display: block;
}
}
/*
See the article for more information on this visually-hidden pattern.
https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
*/
.visually-hidden {
position: absolute !important;
width: 0;
height: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
z-index: -1;
}
.not-implemented {
opacity: 0.5;
&, & * {
cursor: not-allowed !important;
}
}
* {
box-sizing: border-box;
}
.no-animations #root *,
.no-animations #root *::before,
.no-animations #root *::after {
transition: none !important;
}
.custom-scroll,
.custom-scroll-x {
scrollbar-width: thin;
scrollbar-color: rgba(90, 90, 90, 0) transparent;
transition: scrollbar-color .3s ease;
-webkit-overflow-scrolling: touch;
// Fix scroll lock on iOS
pointer-events: auto;
&::-webkit-scrollbar-thumb {
background-color: rgba(90, 90, 90, 0);
border-radius: 0.375rem;
// `box-shadow` prevents repaint on macOS when hovering out of scrollable container
box-shadow: 0 0 1px rgba(255, 255, 255, .01);
}
&:hover, &:focus, &:focus-within {
scrollbar-color: rgba(90, 90, 90, 0.3) transparent;
&::-webkit-scrollbar-thumb {
background-color: rgba(90, 90, 90, 0.3);
}
}
}
body:not(.is-ios) {
.custom-scroll {
&::-webkit-scrollbar {
width: .375rem;
}
}
.custom-scroll-x {
&::-webkit-scrollbar {
height: .35rem;
}
}
}
.no-scrollbar {
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
}
.emoji-small {
background: no-repeat;
background-size: 1.25rem;
color: transparent;
display: inline-block;
width: 1.25rem;
height: 1.25rem;
margin-inline-end: 1px;
overflow: hidden;
flex-shrink: 0;
&::selection {
background-color: var(--color-selection-highlight-emoji);
color: transparent;
}
}
div[role="button"] {
outline: none !important;
cursor: pointer;
}
.opacity-transition {
opacity: 1;
transition: opacity .15s ease;
&:not(.open) {
opacity: 0;
}
&:not(.shown) {
display: none;
}
&.slow {
transition-duration: .3s;
}
}
.color-primary {
color: var(--color-primary) !important;
}
.color-danger {
color: var(--color-error) !important;
}
.text-muted {
color: var(--color-text-secondary) !important;
}
.protector {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 2;
}
.for-ios-autocapitalization-fix {
position: fixed;
font-size: 16px;
opacity: 0;
bottom: 1rem;
z-index: -1;
}
@keyframes grow-icon {
0% {
transform: scale(0.5);
opacity: .8;
}
50% {
transform: scale(1.1);
opacity: 1;
}
100% {
transform: scale(1);
}
}
@keyframes hide-icon {
from {
transform: scale(1);
opacity: .4;
}
to {
transform: scale(.5);
opacity: 0;
}
}