Give containers brighter color than canvas (#2220)

* Give deck browser table an elevated container look

* Tweak colors of elevated containers (e.g. in deck options)

* Prepare editor fields for custom backgrounds

* Tweak field margin and add explanatory comment
This commit is contained in:
Matthias Metelka 2022-11-29 08:54:42 +01:00 committed by GitHub
parent 65b8b8c69b
commit 43ce4cacc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 51 additions and 16 deletions

View file

@ -3,6 +3,20 @@
@use "sass/root-vars"; @use "sass/root-vars";
@use "sass/vars" as *; @use "sass/vars" as *;
@use "sass/card-counts"; @use "sass/card-counts";
@use "sass/elevation" as *;
table {
padding: 1rem;
background: var(--canvas-elevated);
border: 1px solid var(--border-subtle);
border-radius: var(--border-radius-large);
@include elevation(1, $opacity-boost: -0.08);
&:hover {
@include elevation(2);
}
transition: box-shadow 0.2s ease-in-out;
}
a.deck { a.deck {
color: color(fg); color: color(fg);
@ -44,7 +58,7 @@ body {
.current, .current,
tr:hover:not(.top-level-drag-row) { tr:hover:not(.top-level-drag-row) {
td { td {
background: color(canvas-inset); background: color(border-subtle);
&:first-child { &:first-child {
border-top-left-radius: prop(border-radius-large); border-top-left-radius: prop(border-radius-large);
border-bottom-left-radius: prop(border-radius-large); border-bottom-left-radius: prop(border-radius-large);

View file

@ -19,11 +19,12 @@
@include button.base($with-hover: false, $with-active: false); @include button.base($with-hover: false, $with-active: false);
overflow: hidden; overflow: hidden;
padding: 0; padding: 0;
@include elevation(1, $opacity-boost: -0.08); @include elevation(1, $opacity-boost: -0.08);
&:hover { &:hover {
@include elevation(2); @include elevation(2);
transition: box-shadow 0.2s linear;
} }
transition: box-shadow 0.2s ease-in-out;
} }
body { body {

View file

@ -80,17 +80,17 @@ $vars: (
), ),
), ),
elevated: ( elevated: (
"Slightly brighter than window background", "Background of containers",
( (
light: white, light: white,
dark: palette(darkgray, 4), dark: palette(darkgray, 4),
), ),
), ),
inset: ( inset: (
"Slightly darker than window background", "Background of inputs inside containers",
( (
light: palette(lightgray, 3), light: white,
dark: palette(darkgray, 6), dark: palette(darkgray, 5),
), ),
), ),
overlay: ( overlay: (

View file

@ -6,11 +6,11 @@
@mixin night-mode { @mixin night-mode {
input, input,
select { select {
background-color: var(--canvas-elevated); background-color: var(--canvas-inset);
border-color: var(--border); border-color: var(--border);
&:focus { &:focus {
background-color: var(--canvas); background-color: var(--canvas-inset);
} }
} }
} }

View file

@ -2,10 +2,10 @@
* 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 */
@mixin input { @mixin input {
background-color: var(--canvas-elevated); background-color: var(--canvas-inset);
border-color: var(--border); border-color: var(--border);
&:focus { &:focus {
background-color: var(--canvas); background-color: var(--canvas-inset);
} }
} }

View file

@ -151,7 +151,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
input { input {
width: 100%; width: 100%;
padding: 0.2rem 1.5rem 0.2rem 0.75rem; padding: 0.2rem 1.5rem 0.2rem 0.75rem;
background: var(--canvas-elevated); background: var(--canvas-inset);
color: var(--fg); color: var(--fg);
border: none; border: none;
outline: none; outline: none;

View file

@ -36,12 +36,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
@use "sass/elevation" as *; @use "sass/elevation" as *;
.container { .container {
width: 100%; width: 100%;
background: var(--canvas-elevated);
border: 1px solid var(--border-subtle);
border-radius: var(--border-radius-large, 10px); border-radius: var(--border-radius-large, 10px);
padding: 1rem 1.75rem 0.75rem 1.25rem; padding: 1rem 1.75rem 0.75rem 1.25rem;
&.rtl { &.rtl {
padding: 1rem 1.25rem 0.75rem 1.75rem; padding: 1rem 1.25rem 0.75rem 1.75rem;
} }
border: var(--border-subtle);
&:hover, &:hover,
&:focus-within { &:focus-within {
.help-badge { .help-badge {
@ -49,11 +50,20 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
} }
} }
&.light { &.light {
@include elevation(2); @include elevation(2, $opacity-boost: -0.08);
&:hover,
&:focus-within {
@include elevation(3);
}
} }
&.dark { &.dark {
@include elevation(3); @include elevation(3, $opacity-boost: -0.08);
&:hover,
&:focus-within {
@include elevation(4);
}
} }
transition: box-shadow 0.2s ease-in-out;
} }
h1 { h1 {
border-bottom: 1px solid var(--border); border-bottom: 1px solid var(--border);

View file

@ -120,9 +120,17 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<style lang="scss"> <style lang="scss">
@use "sass/elevation" as *; @use "sass/elevation" as *;
/* Make sure labels are readable on custom Qt backgrounds */
.field-container {
background: var(--canvas);
border-radius: var(--border-radius);
overflow: hidden;
}
.editor-field { .editor-field {
overflow: hidden; overflow: hidden;
margin: 1px 3px 0 3px; /* make room for thicker focus border */
margin: 1px;
border-radius: 5px; border-radius: 5px;
border: 1px solid var(--border); border: 1px solid var(--border);

View file

@ -39,6 +39,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
background: var(--canvas); background: var(--canvas);
border-top-right-radius: var(--border-radius);
border-top-left-radius: var(--border-radius);
padding: 0 3px 1px; padding: 0 3px 1px;
position: sticky; position: sticky;

View file

@ -55,7 +55,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
tr { tr {
&:nth-child(even) { &:nth-child(even) {
background: var(--canvas-elevated); background: var(--canvas);
} }
} }