From 86adcdd3a3a838b189c3f7785bed91fcc9a63c44 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Mon, 12 Dec 2022 10:56:05 +0100 Subject: [PATCH 01/23] Reorder selectors alphabetically in input.css --- app/styles/input.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/styles/input.css b/app/styles/input.css index 51990bc..0b68cd2 100644 --- a/app/styles/input.css +++ b/app/styles/input.css @@ -153,14 +153,16 @@ input[type=range]::-moz-range-thumb { input:not([type]):focus-visible, input[type=button]:focus-visible, +input[type=checkbox]:focus-visible, input[type=color]:focus-visible, -input[type=image]:focus-visible, input[type=date]:focus-visible, input[type=datetime-local]:focus-visible, input[type=email]:focus-visible, +input[type=image]:focus-visible, input[type=month]:focus-visible, input[type=number]:focus-visible, input[type=password]:focus-visible, +input[type=range]:focus-visible, input[type=reset]:focus-visible, input[type=search]:focus-visible, input[type=submit]:focus-visible, @@ -169,8 +171,6 @@ input[type=text]:focus-visible, input[type=time]:focus-visible, input[type=url]:focus-visible, input[type=week]:focus-visible, -input[type=checkbox]:focus-visible, -input[type=range]:focus-visible, button:focus-visible, select:focus-visible, textarea:focus-visible { @@ -181,10 +181,10 @@ textarea:focus-visible { input:not([type]):disabled, input[type=button]:disabled, input[type=color]:disabled, -input[type=image]:disabled, input[type=date]:disabled, input[type=datetime-local]:disabled, input[type=email]:disabled, +input[type=image]:disabled, input[type=month]:disabled, input[type=number]:disabled, input[type=password]:disabled, From 1e500883f63277f3c7debd7b10146e5a992c4913 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Thu, 8 Dec 2022 12:29:45 +0100 Subject: [PATCH 02/23] Move : - https://bugzilla.mozilla.org/show_bug.cgi?id=1798304 */ - cursor: default; } #noVNC_control_bar .noVNC_button:not(:disabled):active { padding-top: 5px; diff --git a/app/styles/input.css b/app/styles/input.css index f090577..cc4087c 100644 --- a/app/styles/input.css +++ b/app/styles/input.css @@ -280,3 +280,8 @@ input[type=file]:disabled { background-image: var(--select-arrow), linear-gradient(to top, rgb(255, 255, 255), rgb(240, 240, 240)); } +input[type=image]:disabled { + /* See Firefox bug: + https://bugzilla.mozilla.org/show_bug.cgi?id=1798304 */ + cursor: default; +} From cc703babcb1472d23239fe16a7e8213b4870aed8 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Fri, 9 Dec 2022 16:54:07 +0100 Subject: [PATCH 15/23] Remove duplicate opacity for :disable The control bar buttons can fall back on the :disable opacity from input.css. --- app/styles/base.css | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/styles/base.css b/app/styles/base.css index 1bf8064..986a6a5 100644 --- a/app/styles/base.css +++ b/app/styles/base.css @@ -395,9 +395,6 @@ html { border-color: rgba(0, 0, 0, 0.8); background-color: rgba(0, 0, 0, 0.5); } -#noVNC_control_bar .noVNC_button:disabled { - opacity: 0.4; -} #noVNC_control_bar .noVNC_button:not(:disabled):active { padding-top: 5px; padding-bottom: 3px; From 36510f7d1678e4fb29a1a018a67843896bed1e1a Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Mon, 12 Dec 2022 10:45:44 +0100 Subject: [PATCH 16/23] Clarify comment about hover state on touch devices --- app/styles/base.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/styles/base.css b/app/styles/base.css index 986a6a5..f042dfc 100644 --- a/app/styles/base.css +++ b/app/styles/base.css @@ -400,7 +400,7 @@ html { padding-bottom: 3px; } /* Android browsers don't properly update hover state if touch events are - * intercepted */ + * intercepted, like they are when clicking on the remote screen. */ :root:not(.noVNC_touch) #noVNC_control_bar .noVNC_button.noVNC_selected:not(:disabled):hover { border-color: rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.2); From 80897091e08f94661370396de936ba91655da870 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Mon, 12 Dec 2022 10:46:54 +0100 Subject: [PATCH 17/23] Put all styling for selected buttons in one place Let's not have the rules for noVNC_selected spread out. --- app/styles/base.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/styles/base.css b/app/styles/base.css index f042dfc..408da27 100644 --- a/app/styles/base.css +++ b/app/styles/base.css @@ -395,10 +395,6 @@ html { border-color: rgba(0, 0, 0, 0.8); background-color: rgba(0, 0, 0, 0.5); } -#noVNC_control_bar .noVNC_button:not(:disabled):active { - padding-top: 5px; - padding-bottom: 3px; -} /* Android browsers don't properly update hover state if touch events are * intercepted, like they are when clicking on the remote screen. */ :root:not(.noVNC_touch) #noVNC_control_bar .noVNC_button.noVNC_selected:not(:disabled):hover { @@ -408,6 +404,10 @@ html { :root:not(.noVNC_touch) #noVNC_control_bar .noVNC_button:not(:disabled):hover { background-color: rgba(255, 255, 255, 0.2); } +#noVNC_control_bar .noVNC_button:not(:disabled):active { + padding-top: 5px; + padding-bottom: 3px; +} #noVNC_control_bar .noVNC_button.noVNC_hidden { display: none !important; } From 3cf2bb9b5938fe61a7914704bbcd354a4eaa956c Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Mon, 12 Dec 2022 13:54:30 +0100 Subject: [PATCH 18/23] Change arrow direction of active select button When the select-dropdown is open, let's use an arrow pointing upwards isntead. Note that we can't easily animate the change in background-image. --- app/styles/input.css | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/styles/input.css b/app/styles/input.css index cc4087c..8ea38c2 100644 --- a/app/styles/input.css +++ b/app/styles/input.css @@ -83,7 +83,16 @@ select { padding-right: calc(2*7px + 8px); padding-left: 7px; } - +select:active { + /* Rotated arrow */ + --select-arrow: url('data:image/svg+xml;utf8, \ + \ + \ + '); +} option { color: black; background: white; From 8c1b6e19c781ea5265aec335ad134584f29402a5 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Mon, 12 Dec 2022 14:40:08 +0100 Subject: [PATCH 19/23] Combine rules for buttons in input.css It was completely unnecessary that these two were separate, lets combine them. The only difference was that the lower rule didn't apply for elements anyway. --- app/styles/input.css | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/styles/input.css b/app/styles/input.css index 8ea38c2..5985b17 100644 --- a/app/styles/input.css +++ b/app/styles/input.css @@ -47,7 +47,6 @@ select { appearance: none; background: none; - padding: 5px; border: 1px solid rgb(192, 192, 192); border-bottom-width: 2px; border-radius: 5px; @@ -56,14 +55,8 @@ select { /* This avoids it jumping around when :active */ vertical-align: middle; -} -input[type=button], -input[type=color], -input[type=reset], -input[type=submit], -input::file-selector-button, -button { + padding: 5px; padding-left: 20px; padding-right: 20px; } From 9107ae3a102ee2e3f57dd2d4d4ea1971f2bd8d14 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Mon, 12 Dec 2022 15:00:18 +0100 Subject: [PATCH 20/23] Share some properties between all input elements Some properties, like 'font', 'appearance', and 'color' are shared between all our input elements. Let's reflect that in our rules. --- app/styles/input.css | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/app/styles/input.css b/app/styles/input.css index 5985b17..faac874 100644 --- a/app/styles/input.css +++ b/app/styles/input.css @@ -8,22 +8,7 @@ input, input::file-selector-button, button, select, textarea { /* Respect standard font settings */ font: inherit; -} -input:not([type]), -input[type=date], -input[type=datetime-local], -input[type=email], -input[type=month], -input[type=number], -input[type=password], -input[type=search], -input[type=tel], -input[type=text], -input[type=time], -input[type=url], -input[type=week], -textarea { /* Disable default rendering */ appearance: none; background: none; @@ -43,20 +28,11 @@ input[type=submit], input::file-selector-button, button, select { - /* Disable default rendering */ - appearance: none; - background: none; - - border: 1px solid rgb(192, 192, 192); border-bottom-width: 2px; - border-radius: 5px; - color: black; - background-image: linear-gradient(to top, rgb(255, 255, 255), rgb(240, 240, 240)); /* This avoids it jumping around when :active */ vertical-align: middle; - padding: 5px; padding-left: 20px; padding-right: 20px; } @@ -93,8 +69,8 @@ option { input[type=checkbox] { position: relative; - appearance: none; background-color: white; + background-image: unset; border: 1px solid dimgrey; border-radius: 3px; width: 13px; @@ -133,9 +109,10 @@ input[type=radio]:checked { } input[type=range] { - appearance: none; + border: unset; border-radius: 3px; height: 20px; + padding: 0; background: transparent; } /* -webkit-slider.. & -moz-range.. cant be in selector lists: From b676122642bcc0c1cacdcf620e01412eb1b2ecae Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Mon, 12 Dec 2022 15:26:42 +0100 Subject: [PATCH 21/23] Simplify :focus-visible & :disabled selectors Since these were the same for all types now, we can omit the type from the selector. --- app/styles/input.css | 45 ++------------------------------------------ 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/app/styles/input.css b/app/styles/input.css index faac874..8bb2f99 100644 --- a/app/styles/input.css +++ b/app/styles/input.css @@ -182,27 +182,7 @@ select:active { margin-top: 1px; } -input:not([type]):focus-visible, -input[type=button]:focus-visible, -input[type=checkbox]:focus-visible, -input[type=color]:focus-visible, -input[type=date]:focus-visible, -input[type=datetime-local]:focus-visible, -input[type=email]:focus-visible, -input[type=image]:focus-visible, -input[type=month]:focus-visible, -input[type=number]:focus-visible, -input[type=password]:focus-visible, -input[type=radio]:focus-visible, -input[type=range]:focus-visible, -input[type=reset]:focus-visible, -input[type=search]:focus-visible, -input[type=submit]:focus-visible, -input[type=tel]:focus-visible, -input[type=text]:focus-visible, -input[type=time]:focus-visible, -input[type=url]:focus-visible, -input[type=week]:focus-visible, +input:focus-visible, input:focus-visible::file-selector-button, button:focus-visible, select:focus-visible, @@ -214,28 +194,7 @@ input[type=file]:focus-visible { outline: none; /* We outline the button instead of the entire element */ } -input:not([type]):disabled, -input[type=button]:disabled, -input[type=checkbox]:disabled, -input[type=color]:disabled, -input[type=date]:disabled, -input[type=datetime-local]:disabled, -input[type=email]:disabled, -input[type=file]:disabled, -input[type=image]:disabled, -input[type=month]:disabled, -input[type=number]:disabled, -input[type=password]:disabled, -input[type=radio]:disabled, -input[type=range]:disabled, -input[type=reset]:disabled, -input[type=search]:disabled, -input[type=submit]:disabled, -input[type=tel]:disabled, -input[type=text]:disabled, -input[type=time]:disabled, -input[type=url]:disabled, -input[type=week]:disabled, +input:disabled, input:disabled::file-selector-button, button:disabled, select:disabled, From 69c1d8a1b961cc5bde80514d62c07e1c44bc1320 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Mon, 12 Dec 2022 15:32:07 +0100 Subject: [PATCH 22/23] Add section comments to input.css Makes stuff easier to find. --- app/styles/input.css | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/app/styles/input.css b/app/styles/input.css index 8bb2f99..c30af88 100644 --- a/app/styles/input.css +++ b/app/styles/input.css @@ -5,6 +5,9 @@ * This file is licensed under the 2-Clause BSD license (see LICENSE.txt). */ +/* + * Common for all inputs + */ input, input::file-selector-button, button, select, textarea { /* Respect standard font settings */ font: inherit; @@ -20,6 +23,9 @@ input, input::file-selector-button, button, select, textarea { background-image: linear-gradient(to top, rgb(255, 255, 255) 80%, rgb(240, 240, 240)); } +/* + * Buttons + */ input[type=button], input[type=color], input[type=image], @@ -37,6 +43,9 @@ select { padding-right: 20px; } +/* + * Select dropdowns + */ select { --select-arrow: url('data:image/svg+xml;utf8, \ Date: Mon, 12 Dec 2022 15:35:36 +0100 Subject: [PATCH 23/23] Buttons shouldn't react to clicks when disabled Counteract the border-width and margin set by :active in the rules for :disabled buttons. --- app/styles/input.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/styles/input.css b/app/styles/input.css index c30af88..1bc4a78 100644 --- a/app/styles/input.css +++ b/app/styles/input.css @@ -243,6 +243,8 @@ textarea:disabled { :root:not(.noVNC_touch) button:disabled, :root:not(.noVNC_touch) select:disabled { background-image: linear-gradient(to top, rgb(255, 255, 255), rgb(240, 240, 240)); + border-bottom-width: 2px; + margin-top: 0; } input[type=file]:disabled { background-image: none;