/* * noVNC general input element CSS * Copyright (C) 2025 The noVNC authors * noVNC is licensed under the MPL 2.0 (see LICENSE.txt) * This file is licensed under the 2-Clause BSD license (see LICENSE.txt). */ /* ------- SHARED BETWEEN INPUT ELEMENTS -------- */ :root { --input-xpadding: 1em; } input, textarea, button, select, input::file-selector-button { padding: 0.5em var(--input-xpadding); border-radius: 6px; appearance: none; /* Respect standard font settings */ font: inherit; } input:disabled, textarea:disabled, button:disabled, select:disabled, label[disabled] { opacity: 0.4; } input:focus-visible, textarea:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible::file-selector-button { outline: 2px solid var(--novnc-lightblue); outline-offset: 1px; } /* ------- TEXT INPUT -------- */ 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 { border: 1px solid var(--novnc-lightgrey); /* Account for borders on text inputs, buttons dont have borders */ padding: calc(0.5em - 1px) var(--input-xpadding); } input:not([type]):focus-visible, input[type=date]:focus-visible, input[type=datetime-local]:focus-visible, input[type=email]:focus-visible, input[type=month]:focus-visible, input[type=number]:focus-visible, input[type=password]:focus-visible, input[type=search]: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, textarea:focus-visible { outline-offset: -1px; } textarea { margin: unset; /* Remove Firefox's built in margin */ /* Prevent layout from shifting when scrollbars show */ scrollbar-gutter: stable; /* Make textareas show at minimum one line. This does not work when using box-sizing border-box, in which case, vertical padding and border width needs to be taken into account. */ min-height: 1em; vertical-align: baseline; /* Firefox gives "text-bottom" by default */ } /* ------- BUTTON ACTIVATIONS -------- */ /* A color overlay that depends on the activation level. The level can then be set for different states on an element, for example hover and click on a