Standardize on 4 space-indentation in CSS files

This is what we use in every other file in noVNC. It also much more
common for a CSS file in general. By standardizing on 4 spaces we can
avoid indentation mistakes.
This commit is contained in:
Samuel Mannehed 2025-01-11 17:51:02 +01:00
parent 3193f808b5
commit 4bbed1dc12
2 changed files with 575 additions and 575 deletions

File diff suppressed because it is too large Load Diff

View File

@ -9,19 +9,19 @@
* Common for all inputs * Common for all inputs
*/ */
input, input::file-selector-button, button, select, textarea { input, input::file-selector-button, button, select, textarea {
/* Respect standard font settings */ /* Respect standard font settings */
font: inherit; font: inherit;
/* Disable default rendering */ /* Disable default rendering */
appearance: none; appearance: none;
background: none; background: none;
padding: 5px; padding: 5px;
border: 1px solid rgb(192, 192, 192); border: 1px solid rgb(192, 192, 192);
border-radius: 5px; border-radius: 5px;
color: black; color: black;
--bg-gradient: linear-gradient(to top, rgb(255, 255, 255) 80%, rgb(240, 240, 240)); --bg-gradient: linear-gradient(to top, rgb(255, 255, 255) 80%, rgb(240, 240, 240));
background-image: var(--bg-gradient); background-image: var(--bg-gradient);
} }
/* /*
@ -35,151 +35,151 @@ input[type=submit],
input::file-selector-button, input::file-selector-button,
button, button,
select { select {
border-bottom-width: 2px; border-bottom-width: 2px;
/* This avoids it jumping around when :active */ /* This avoids it jumping around when :active */
vertical-align: middle; vertical-align: middle;
margin-top: 0; margin-top: 0;
padding-left: 20px; padding-left: 20px;
padding-right: 20px; padding-right: 20px;
/* Disable Chrome's touch tap highlight */ /* Disable Chrome's touch tap highlight */
-webkit-tap-highlight-color: transparent; -webkit-tap-highlight-color: transparent;
} }
/* /*
* Select dropdowns * Select dropdowns
*/ */
select { select {
--select-arrow: url('data:image/svg+xml;utf8, \ --select-arrow: url('data:image/svg+xml;utf8, \
<svg width="8" height="6" version="1.1" viewBox="0 0 8 6" \ <svg width="8" height="6" version="1.1" viewBox="0 0 8 6" \
xmlns="http://www.w3.org/2000/svg"> \ xmlns="http://www.w3.org/2000/svg"> \
<path d="m6.5 1.5 -2.5 3 -2.5 -3 5 0" stroke-width="3" \ <path d="m6.5 1.5 -2.5 3 -2.5 -3 5 0" stroke-width="3" \
stroke="rgb(31,31,31)" fill="none" \ stroke="rgb(31,31,31)" fill="none" \
stroke-linecap="round" stroke-linejoin="round" /> \ stroke-linecap="round" stroke-linejoin="round" /> \
</svg>'); </svg>');
background-image: var(--select-arrow), var(--bg-gradient); background-image: var(--select-arrow), var(--bg-gradient);
background-position: calc(100% - 7px), left top; background-position: calc(100% - 7px), left top;
background-repeat: no-repeat; background-repeat: no-repeat;
padding-right: calc(2*7px + 8px); padding-right: calc(2*7px + 8px);
padding-left: 7px; padding-left: 7px;
} }
/* FIXME: :active isn't set when the <select> is opened in Firefox: /* FIXME: :active isn't set when the <select> is opened in Firefox:
https://bugzilla.mozilla.org/show_bug.cgi?id=1805406 */ https://bugzilla.mozilla.org/show_bug.cgi?id=1805406 */
select:active { select:active {
/* Rotated arrow */ /* Rotated arrow */
background-image: url('data:image/svg+xml;utf8, \ background-image: url('data:image/svg+xml;utf8, \
<svg width="8" height="6" version="1.1" viewBox="0 0 8 6" \ <svg width="8" height="6" version="1.1" viewBox="0 0 8 6" \
xmlns="http://www.w3.org/2000/svg" transform="rotate(180)" > \ xmlns="http://www.w3.org/2000/svg" transform="rotate(180)" > \
<path d="m6.5 1.5 -2.5 3 -2.5 -3 5 0" stroke-width="3" \ <path d="m6.5 1.5 -2.5 3 -2.5 -3 5 0" stroke-width="3" \
stroke="rgb(31,31,31)" fill="none" \ stroke="rgb(31,31,31)" fill="none" \
stroke-linecap="round" stroke-linejoin="round" /> \ stroke-linecap="round" stroke-linejoin="round" /> \
</svg>'), var(--bg-gradient); </svg>'), var(--bg-gradient);
} }
option { option {
color: black; color: black;
background: white; background: white;
} }
/* /*
* Checkboxes * Checkboxes
*/ */
input[type=checkbox] { input[type=checkbox] {
display: inline-flex; display: inline-flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background-color: white; background-color: white;
background-image: unset; background-image: unset;
border: 1px solid dimgrey; border: 1px solid dimgrey;
border-radius: 3px; border-radius: 3px;
width: 13px; width: 13px;
height: 13px; height: 13px;
padding: 0; padding: 0;
margin-right: 6px; margin-right: 6px;
vertical-align: bottom; vertical-align: bottom;
transition: 0.2s background-color linear; transition: 0.2s background-color linear;
} }
input[type=checkbox]:checked { input[type=checkbox]:checked {
background-color: rgb(110, 132, 163); background-color: rgb(110, 132, 163);
border-color: rgb(110, 132, 163); border-color: rgb(110, 132, 163);
} }
input[type=checkbox]:checked::after { input[type=checkbox]:checked::after {
content: ""; content: "";
display: block; /* width & height doesn't work on inline elements */ display: block; /* width & height doesn't work on inline elements */
width: 3px; width: 3px;
height: 7px; height: 7px;
border: 1px solid white; border: 1px solid white;
border-width: 0 2px 2px 0; border-width: 0 2px 2px 0;
transform: rotate(40deg) translateY(-1px); transform: rotate(40deg) translateY(-1px);
} }
/* /*
* Radiobuttons * Radiobuttons
*/ */
input[type=radio] { input[type=radio] {
border-radius: 50%; border-radius: 50%;
border: 1px solid dimgrey; border: 1px solid dimgrey;
width: 12px; width: 12px;
height: 12px; height: 12px;
padding: 0; padding: 0;
margin-right: 6px; margin-right: 6px;
transition: 0.2s border linear; transition: 0.2s border linear;
} }
input[type=radio]:checked { input[type=radio]:checked {
border: 6px solid rgb(110, 132, 163); border: 6px solid rgb(110, 132, 163);
} }
/* /*
* Range sliders * Range sliders
*/ */
input[type=range] { input[type=range] {
border: unset; border: unset;
border-radius: 3px; border-radius: 3px;
height: 20px; height: 20px;
padding: 0; padding: 0;
background: transparent; background: transparent;
} }
/* -webkit-slider.. & -moz-range.. cant be in selector lists: /* -webkit-slider.. & -moz-range.. cant be in selector lists:
https://bugs.chromium.org/p/chromium/issues/detail?id=1154623 */ https://bugs.chromium.org/p/chromium/issues/detail?id=1154623 */
input[type=range]::-webkit-slider-runnable-track { input[type=range]::-webkit-slider-runnable-track {
background-color: rgb(110, 132, 163); background-color: rgb(110, 132, 163);
height: 6px; height: 6px;
border-radius: 3px; border-radius: 3px;
} }
input[type=range]::-moz-range-track { input[type=range]::-moz-range-track {
background-color: rgb(110, 132, 163); background-color: rgb(110, 132, 163);
height: 6px; height: 6px;
border-radius: 3px; border-radius: 3px;
} }
input[type=range]::-webkit-slider-thumb { input[type=range]::-webkit-slider-thumb {
appearance: none; appearance: none;
width: 18px; width: 18px;
height: 20px; height: 20px;
border-radius: 5px; border-radius: 5px;
background-color: white; background-color: white;
border: 1px solid dimgray; border: 1px solid dimgray;
margin-top: -7px; margin-top: -7px;
} }
input[type=range]::-moz-range-thumb { input[type=range]::-moz-range-thumb {
appearance: none; appearance: none;
width: 18px; width: 18px;
height: 20px; height: 20px;
border-radius: 5px; border-radius: 5px;
background-color: white; background-color: white;
border: 1px solid dimgray; border: 1px solid dimgray;
margin-top: -7px; margin-top: -7px;
} }
/* /*
* File choosers * File choosers
*/ */
input[type=file] { input[type=file] {
background-image: none; background-image: none;
border: none; border: none;
} }
input::file-selector-button { input::file-selector-button {
margin-right: 6px; margin-right: 6px;
} }
/* /*
@ -192,28 +192,28 @@ input[type=reset]:hover,
input[type=submit]:hover, input[type=submit]:hover,
input::file-selector-button:hover, input::file-selector-button:hover,
button:hover { button:hover {
background-image: linear-gradient(to top, rgb(255, 255, 255), rgb(250, 250, 250)); background-image: linear-gradient(to top, rgb(255, 255, 255), rgb(250, 250, 250));
} }
select:hover { select:hover {
background-image: var(--select-arrow), background-image: var(--select-arrow),
linear-gradient(to top, rgb(255, 255, 255), rgb(250, 250, 250)); linear-gradient(to top, rgb(255, 255, 255), rgb(250, 250, 250));
background-position: calc(100% - 7px), left top; background-position: calc(100% - 7px), left top;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
@media (any-pointer: coarse) { @media (any-pointer: coarse) {
/* We don't want a hover style after touch input */ /* We don't want a hover style after touch input */
input[type=button]:hover, input[type=button]:hover,
input[type=color]:hover, input[type=color]:hover,
input[type=image]:hover, input[type=image]:hover,
input[type=reset]:hover, input[type=reset]:hover,
input[type=submit]:hover, input[type=submit]:hover,
input::file-selector-button:hover, input::file-selector-button:hover,
button:hover { button:hover {
background-image: var(--bg-gradient); background-image: var(--bg-gradient);
} }
select:hover { select:hover {
background-image: var(--select-arrow), var(--bg-gradient); background-image: var(--select-arrow), var(--bg-gradient);
} }
} }
/* /*
@ -227,8 +227,8 @@ input[type=submit]:active,
input::file-selector-button:active, input::file-selector-button:active,
button:active, button:active,
select:active { select:active {
border-bottom-width: 1px; border-bottom-width: 1px;
margin-top: 1px; margin-top: 1px;
} }
/* /*
@ -239,11 +239,11 @@ input:focus-visible::file-selector-button,
button:focus-visible, button:focus-visible,
select:focus-visible, select:focus-visible,
textarea:focus-visible { textarea:focus-visible {
outline: 2px solid rgb(74, 144, 217); outline: 2px solid rgb(74, 144, 217);
outline-offset: 1px; outline-offset: 1px;
} }
input[type=file]:focus-visible { input[type=file]:focus-visible {
outline: none; /* We outline the button instead of the entire element */ outline: none; /* We outline the button instead of the entire element */
} }
/* /*
@ -254,7 +254,7 @@ input:disabled::file-selector-button,
button:disabled, button:disabled,
select:disabled, select:disabled,
textarea:disabled { textarea:disabled {
opacity: 0.4; opacity: 0.4;
} }
input[type=button]:disabled, input[type=button]:disabled,
input[type=color]:disabled, input[type=color]:disabled,
@ -264,18 +264,18 @@ input[type=submit]:disabled,
input:disabled::file-selector-button, input:disabled::file-selector-button,
button:disabled, button:disabled,
select:disabled { select:disabled {
background-image: var(--bg-gradient); background-image: var(--bg-gradient);
border-bottom-width: 2px; border-bottom-width: 2px;
margin-top: 0; margin-top: 0;
} }
input[type=file]:disabled { input[type=file]:disabled {
background-image: none; background-image: none;
} }
select:disabled { select:disabled {
background-image: var(--select-arrow), var(--bg-gradient); background-image: var(--select-arrow), var(--bg-gradient);
} }
input[type=image]:disabled { input[type=image]:disabled {
/* See Firefox bug: /* See Firefox bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1798304 */ https://bugzilla.mozilla.org/show_bug.cgi?id=1798304 */
cursor: default; cursor: default;
} }