1
0
mirror of https://github.com/excalidraw/excalidraw.git synced 2024-11-10 11:35:52 +01:00

refactor: Media queries (#2680)

This commit is contained in:
Jed Fox 2020-12-27 16:27:25 -05:00 committed by GitHub
parent 6f82a88b79
commit b8d13c98b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 21 additions and 17 deletions

@ -218,7 +218,7 @@
left: 2px;
}
@media #{$media-query} {
@media #{$is-mobile-query} {
display: none;
}
}

@ -74,7 +74,7 @@
z-index: 1;
}
@media #{$media-query} {
@media #{$is-mobile-query} {
.context-menu-option {
display: block;

@ -18,7 +18,7 @@
margin: 0;
}
@media #{$media-query} {
@media #{$is-mobile-query} {
.Dialog {
--metric: calc(var(--space-factor) * 4);
--inset-left: #{"max(var(--metric), var(--sal))"};

@ -37,7 +37,7 @@
}
}
@media (max-width: 550px) {
@media #{$is-mobile-query} {
.ExportDialog {
display: flex;
flex-direction: column;
@ -51,9 +51,7 @@
.ExportDialog__actions > * {
margin-bottom: calc(var(--space-factor) * 3);
}
}
@media #{$media-query} {
.ExportDialog__preview canvas {
max-height: 30vh;
}

@ -1,5 +1,8 @@
@import "../css/_variables";
// this is loosely based on the longest hint text
$wide-viewport-width: 1000px;
.excalidraw {
.HintViewer {
pointer-events: none;
@ -16,12 +19,9 @@
color: $oc-gray-6;
font-size: 0.8rem;
@media (min-width: 1200px) {
white-space: pre;
}
@media #{$media-query} {
@media #{$is-mobile-query} {
position: static;
padding-right: 2em;
}
> span {

@ -110,7 +110,7 @@
:root[dir="rtl"] & {
left: 2px;
}
@media #{$media-query} {
@media #{$is-mobile-query} {
display: none;
}
}

@ -40,7 +40,7 @@
background: var(--bg-color-island);
backdrop-filter: none;
@media #{$media-query} {
@media #{$is-mobile-query} {
max-width: 100%;
}
}
@ -74,7 +74,7 @@
top: calc(var(--space-factor) * 5);
}
@media #{$media-query} {
@media #{$is-mobile-query} {
.Modal {
padding: 0;
}

@ -142,6 +142,7 @@
user-select: none;
}
// shrink shape icons on small viewports to make them fit
@media (max-width: 425px) {
.Shape .ToolIcon__icon {
width: 2rem;
@ -153,6 +154,8 @@
}
}
// move the lock button out of the way on small viewports
// it begins to collide with the GitHub icon before we switch to mobile mode
@media (max-width: 760px) {
.ToolIcon.ToolIcon__lock {
display: inline-block;
@ -162,6 +165,7 @@
margin-left: 0;
border-radius: 20px 0 0 20px;
z-index: 1;
background-color: var(--button-gray-1);
@ -189,7 +193,7 @@
margin-left: 5px;
margin-top: 1px;
@media #{$media-query} {
@media #{$is-mobile-query} {
display: none;
}
}

@ -1,3 +1,4 @@
@import "open-color/open-color.scss";
$media-query: "(max-width: 600px), (max-height: 500px) and (max-width: 1000px)";
// keep up to date with is-mobile.tsx
$is-mobile-query: "(max-width: 600px), (max-height: 500px) and (max-width: 1000px)";

@ -441,7 +441,7 @@
}
}
@media #{$media-query} {
@media #{$is-mobile-query} {
aside {
display: none;
}

@ -11,6 +11,7 @@ export const IsMobileProvider = ({
if (!query.current) {
query.current = window.matchMedia
? window.matchMedia(
// keep up to date with _variables.scss
"(max-width: 640px), (max-height: 500px) and (max-width: 1000px)",
)
: (({