mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Merge pull request #1038 from hgiesel/imgmaxwidth
Fix scrollbar issue in anki-editable component in two ways
This commit is contained in:
commit
c9992e395f
4 changed files with 53 additions and 37 deletions
|
@ -2,7 +2,8 @@
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
||||||
|
|
||||||
@use 'ts/sass/core';
|
@use 'ts/sass/core';
|
||||||
@use 'buttons';
|
@use 'ts/sass/scrollbar';
|
||||||
|
@use 'ts/sass/buttons';
|
||||||
|
|
||||||
// core.scss sets border-box, but we need to
|
// core.scss sets border-box, but we need to
|
||||||
// keep the old behaviour for now to avoid breaking
|
// keep the old behaviour for now to avoid breaking
|
||||||
|
@ -20,29 +21,6 @@ h1 {
|
||||||
margin-bottom: 0.2em;
|
margin-bottom: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.nightMode {
|
.nightMode {
|
||||||
&::-webkit-scrollbar {
|
@include scrollbar.night-mode;
|
||||||
background: var(--window-bg);
|
|
||||||
|
|
||||||
&:horizontal {
|
|
||||||
height: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:vertical {
|
|
||||||
width: 12px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&::-webkit-scrollbar-thumb {
|
|
||||||
background: buttons.$fusion-button-hover-bg;
|
|
||||||
border-radius: 8px;
|
|
||||||
|
|
||||||
&:horizontal {
|
|
||||||
min-width: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:vertical {
|
|
||||||
min-height: 50px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
@use 'ts/sass/scrollbar';
|
||||||
|
|
||||||
anki-editable {
|
anki-editable {
|
||||||
display: block;
|
display: block;
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
|
@ -8,16 +10,20 @@ anki-editable {
|
||||||
content: "\a";
|
content: "\a";
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
:host-context(.nightMode) * {
|
||||||
max-width: 100%;
|
@include scrollbar.night-mode;
|
||||||
|
}
|
||||||
|
|
||||||
&.drawing {
|
img.drawing {
|
||||||
zoom: 50%;
|
zoom: 50%;
|
||||||
|
|
||||||
.nightMode & {
|
.nightMode & {
|
||||||
filter: unquote("invert() hue-rotate(180deg)");
|
filter: unquote("invert() hue-rotate(180deg)");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
32
ts/sass/scrollbar.scss
Normal file
32
ts/sass/scrollbar.scss
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
/* Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
||||||
|
|
||||||
|
@use 'vars';
|
||||||
|
@use 'buttons';
|
||||||
|
|
||||||
|
@mixin night-mode {
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
background: var(--window-bg);
|
||||||
|
|
||||||
|
&:horizontal {
|
||||||
|
height: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:vertical {
|
||||||
|
width: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-thumb {
|
||||||
|
background: buttons.$fusion-button-hover-bg;
|
||||||
|
border-radius: 8px;
|
||||||
|
|
||||||
|
&:horizontal {
|
||||||
|
min-width: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:vertical {
|
||||||
|
min-height: 50px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue