sendou.ink/app/styles/common.css
2026-01-19 19:46:54 +01:00

814 lines
14 KiB
CSS

/** biome-ignore-all lint/style/noDescendingSpecificity: Biome v2 migration */
* {
margin: 0;
overflow-wrap: break-word;
}
html {
color-scheme: light dark;
accent-color: var(--color-text-accent);
scrollbar-gutter: stable;
}
body {
width: 100%;
min-height: 100vh;
display: flex;
line-height: 1.5;
overflow-x: hidden;
color: var(--color-text);
background-color: var(--color-bg);
font-family: lexend, sans-serif;
-moz-osx-font-smoothing: antialiased;
-webkit-font-smoothing: antialiased;
-webkit-tab-highlight-color: transparent;
-webkit-text-size-adjust: 100%;
}
h1,
h2,
h3,
h4,
h5,
h6,
p {
overflow-wrap: anywhere;
}
img,
svg,
canvas,
video,
audio,
iframe,
embed,
object {
display: block;
max-width: 100%;
}
input,
button,
textarea,
select {
font: inherit;
}
details summary {
cursor: pointer;
user-select: none;
-webkit-user-select: none;
}
a {
color: var(--color-text-accent);
font-weight: var(--semi-bold);
text-decoration: none;
border-radius: 5px;
&:focus-visible {
outline: var(--field-focus-ring);
outline-offset: 1px;
}
}
/* :not([name="text"]) workaround not to select textarea on map planner */
textarea:not([name="text"]) {
width: 100%;
min-height: 8rem;
padding: var(--field-padding-block) var(--field-padding-inline);
line-height: var(--field-line-height);
border: var(--border-style);
border-radius: var(--radius-field);
background-color: var(--color-bg);
outline: none;
resize: vertical;
&:focus-within {
outline: var(--field-focus-ring);
outline-offset: 1px;
}
}
input:not(.in-container) {
width: 100%;
box-sizing: border-box;
border: var(--border-style);
border-radius: var(--radius-field);
background: var(--color-bg);
padding: 0 var(--field-padding-inline);
height: var(--field-height);
line-height: var(--field-line-height);
outline: none;
&::placeholder {
color: var(--color-text-high);
}
&:disabled {
pointer-events: none;
cursor: not-allowed;
opacity: 0.5;
outline: none;
}
&:focus-within {
outline: var(--field-focus-ring);
outline-offset: 1px;
}
}
input[type="checkbox"] {
appearance: none;
cursor: pointer;
padding: 0;
width: var(--selector-height);
height: var(--selector-height);
border-radius: var(--radius-selector);
background-color: var(--color-bg);
border: var(--border-style);
&:focus-within {
outline: none;
}
&:focus-visible {
outline: var(--field-focus-ring);
outline-offset: 1px;
}
&:checked,
&:indeterminate {
border-color: var(--color-text-accent);
background-color: var(--color-text-accent);
background-repeat: no-repeat;
background-position: center;
background-size: var(--field-icon-width) auto;
}
&:checked {
background-image: var(--field-icon-checkbox);
}
&:indeterminate {
background-image: var(--field-icon-minus);
}
/* Hacky selector to remove the margin bottom from the container from Label.tsx */
&:has(+ div > label) + div {
margin-bottom: 0;
}
}
input[type="radio"] {
appearance: none;
cursor: pointer;
vertical-align: middle;
width: var(--selector-height);
height: var(--selector-height);
background-color: var(--color-bg);
border: var(--border-style);
border-radius: var(--radius-full);
padding: 0;
&:focus-within {
outline: none;
}
&:focus-visible {
outline: var(--field-focus-ring);
outline-offset: 1px;
}
&::after {
content: "";
display: block;
width: 50%;
height: 50%;
border-radius: var(--radius-full);
background-color: var(--color-bg);
margin: auto;
margin-top: 25%;
}
&:checked {
border-color: var(--color-text-accent);
&::after {
background-color: var(--color-text-accent);
}
}
/* Hacky selector to remove the margin bottom from the container from Label.tsx */
&:has(+ div > label) + div {
margin-bottom: 0;
}
}
label {
display: block;
font-size: var(--fonts-xs);
font-weight: var(--bold);
margin-block-end: var(--label-margin);
}
fieldset {
border: none;
border-radius: var(--radius-box);
background-color: var(--color-bg-high);
font-size: var(--fonts-sm);
padding-block-end: var(--s-3);
padding-inline: var(--s-3);
}
legend {
border-radius: var(--radius-field);
background-color: transparent;
font-size: var(--fonts-xs);
font-weight: var(--bold);
}
article {
white-space: pre-wrap;
}
select {
all: unset;
width: 100%;
box-sizing: border-box;
border: var(--border-style);
border-radius: var(--radius-field);
background-color: var(--color-bg);
cursor: pointer;
padding: 0 var(--field-padding-inline);
padding-right: calc(
var(--field-icon-width) +
var(--field-padding-inline) +
var(--s-2)
);
height: var(--field-height);
line-height: var(--field-line-height);
display: inline-flex;
align-items: center;
text-overflow: ellipsis;
white-space: nowrap;
appearance: none;
overflow: hidden;
@supports (appearance: base-select) {
appearance: base-select;
}
&:disabled {
pointer-events: none;
cursor: not-allowed;
opacity: 0.5;
outline: none;
}
&:focus-within {
outline: var(--field-focus-ring);
outline-offset: 1px;
}
/* biome-ignore lint: experimental CSS feature */
&::picker(select) {
@supports (appearance: base-select) {
appearance: base-select;
}
background-color: var(--color-bg);
border: var(--border-style);
border-radius: var(--radius-field);
padding: var(--s-1);
margin: 0.5rem;
translate: -0.5rem;
max-height: 50dvh;
}
/* biome-ignore lint: experimental CSS feature */
&::picker-icon {
display: none;
}
option {
background-color: var(--color-bg);
color: var(--color-text);
border-radius: var(--radius-field);
font-size: var(--fonts-xsm);
font-weight: var(--semi-bold);
padding: var(--s-1-5);
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
&[disabled] {
color: var(--color-text-high);
}
&:hover:not([disabled]) {
background-color: var(--color-bg-high);
}
}
}
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"],
input[type="week"],
select {
background-position: center right var(--field-padding-inline);
background-size: var(--field-icon-width) auto;
background-repeat: no-repeat;
}
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
background-image: var(--field-icon-date);
}
input[type="time"] {
background-image: var(--field-icon-time);
}
select {
background-image: var(--field-icon-chevron);
}
[type="date"]::-webkit-calendar-picker-indicator,
[type="datetime-local"]::-webkit-calendar-picker-indicator,
[type="month"]::-webkit-calendar-picker-indicator,
[type="time"]::-webkit-calendar-picker-indicator,
[type="week"]::-webkit-calendar-picker-indicator {
width: var(--field-icon-width);
opacity: 0;
}
@-moz-document url-prefix() {
[type="date"],
[type="datetime-local"],
[type="month"],
[type="time"],
[type="week"] {
background-image: none !important;
}
}
@-moz-document url-prefix() {
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"],
input[type="week"] {
background-image: none;
}
}
input[type="color"] {
padding: calc(var(--field-height) / 8) var(--field-padding-inline);
}
input[type="color"]::-webkit-color-swatch {
border: 0;
border-radius: var(--radius-field);
}
input[type="color"]::-moz-color-swatch {
border: 0;
border-radius: var(--radius-field);
}
input[type="file"] {
padding: 0;
cursor: pointer;
font-size: var(--fonts-sm);
line-height: var(--field-line-height);
color: var(--color-text-high);
overflow: hidden;
}
input[type="file"]::file-selector-button {
height: 100%;
border: none;
background-color: var(--color-bg-higher);
white-space: nowrap;
margin-right: var(--s-2);
}
input[type="range"] {
--track-color: var(--color-bg-higher);
--thumb-color: var(--color-text-high);
border: none;
padding: 0;
appearance: none;
background: 0 0;
width: 100%;
height: var(--selector-height);
&:focus {
outline: none;
}
&:focus-within {
--track-color: var(--color-bg-higher);
--thumb-color: var(--color-text-accent);
}
}
input[type="range"]::-webkit-slider-runnable-track {
width: 100%;
height: calc(var(--selector-height) / 4);
background-color: var(--track-color);
border-radius: var(--radius-full);
transition: 100ms background-color;
}
input[type="range"]::-moz-range-track {
width: 100%;
height: calc(var(--selector-height) / 4);
background-color: var(--track-color);
border-radius: var(--radius-full);
transition: 100ms background-color;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: var(--selector-height);
height: var(--selector-height);
margin-top: calc(
(calc(var(--selector-height) / 4) - var(--selector-height)) /
2
);
background-color: var(--thumb-color);
border: 2px solid var(--color-bg);
border-radius: var(--radius-full);
cursor: pointer;
transition: 100ms background-color;
}
input[type="range"]::-moz-range-thumb {
-webkit-appearance: none;
appearance: none;
width: var(--selector-height);
height: var(--selector-height);
margin-top: calc(
(calc(var(--selector-height) / 4) - var(--selector-height)) /
2
);
background-color: var(--thumb-color);
border: 2px solid var(--color-bg);
border-radius: var(--radius-full);
cursor: pointer;
transition: 100ms background-color;
}
progress {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
display: inline-block;
width: 100%;
height: var(--selector-height);
overflow: hidden;
border: none;
border-radius: var(--radius-full);
background-color: var(--color-bg-high);
color: var(--color-text-accent);
vertical-align: baseline;
}
progress::-webkit-progress-bar {
border-radius: var(--radius-full);
background: 0 0;
}
progress::-moz-progress-bar {
background-color: var(--color-text-accent);
}
progress[value]::-webkit-progress-value {
background-color: var(--color-text-accent);
transition: inline-size 0.2s ease;
}
td > input[type="checkbox"] {
vertical-align: middle;
}
hr {
border: 1px solid var(--color-bg-high);
}
abbr:not([title]) {
text-decoration: none;
}
abbr[title] {
cursor: help;
}
.article > p {
padding-block: var(--s-2-5);
}
.article img {
height: auto;
}
/* Hack to deal with Safari bug when the image is loading. See: https://stackoverflow.com/a/73466877 */
@media not all and (min-resolution: 0.001dpcm) {
img[loading="lazy"] {
clip-path: inset(0.5px);
}
}
#nprogress .bar {
background: var(--color-text-accent) !important;
}
#nprogress .spinner {
display: none !important;
}
#nprogress .peg {
display: none !important;
}
.alert.warning > svg {
fill: var(--theme-warning);
}
.alert.error > svg {
fill: var(--theme-error);
}
.alert.success > svg {
fill: var(--theme-success);
}
.form-errors {
font-size: var(--fonts-sm);
}
.form-errors > h4 {
color: var(--theme-error);
}
.section > div {
padding: var(--s-2);
border-radius: var(--radius-box);
background-color: var(--bg-darker);
}
.section > h2 {
color: var(--text-lighter);
font-size: var(--fonts-md);
}
.stack {
display: flex;
flex-direction: column;
}
.stack.xxxs {
gap: var(--s-0-5);
}
.stack.xxs {
gap: var(--s-1);
}
.stack.xs {
gap: var(--s-1-5);
}
.stack.sm {
gap: var(--s-2);
}
.stack.sm-column {
column-gap: var(--s-2);
}
.stack.sm-plus {
gap: var(--s-3);
}
.stack.md {
gap: var(--s-4);
}
.stack.md-plus {
gap: var(--s-6);
}
.stack.lg {
gap: var(--s-8);
}
.stack.xs-row {
row-gap: var(--s-1-5);
}
.stack.lg-row {
row-gap: var(--s-8);
}
.stack.xl {
gap: var(--s-12);
}
.stack.xxl {
gap: var(--s-16);
}
.stack.horizontal {
flex-direction: row;
}
.flex-same-size {
flex: 1 1 0px;
}
.lock-scroll {
overflow: hidden;
height: unset;
}
.small-icon {
width: 1.2rem;
height: 1.2rem;
}
/* https://stackoverflow.com/questions/50917016/make-a-hidden-field-required/50917245#comment117565184_50917245 */
.hidden-input-with-validation {
position: absolute;
width: 0;
height: 0;
border: none;
opacity: 0;
pointer-events: none;
}
.label__container {
display: flex;
align-items: flex-end;
gap: var(--s-2);
margin-block-end: var(--label-margin);
}
.label__container > label {
margin: 0;
}
.label__value {
color: var(--text-lighter);
font-size: var(--fonts-xxs);
margin-block-start: -5px;
}
.label__value.warning {
color: var(--theme-warning);
}
.label__value.error {
color: var(--theme-error);
}
.error-message {
display: block;
color: var(--theme-error);
font-size: var(--fonts-xs);
margin-block-start: var(--label-margin);
}
.info-message {
display: block;
color: var(--text-lighter);
font-size: var(--fonts-xs);
margin-block-start: var(--label-margin);
}
.no-margin {
margin: 0;
}
.small-icon {
width: 1.2rem;
height: 1.2rem;
}
.small-text {
font-size: var(--fonts-xxs) !important;
}
.colors__summary {
padding: var(--s-2) var(--s-3);
border: 2px solid var(--border);
border-radius: var(--radius-field);
background-color: var(--bg-input);
font-weight: var(--bold);
font-size: var(--fonts-xs);
& div {
display: inline-flex;
}
& svg {
width: 24px;
color: var(--theme);
position: absolute;
right: 20px;
top: 14px;
}
& + div {
margin-block-start: var(--s-4);
}
}
.colors__container {
width: 100%;
font-size: var(--fonts-sm);
font-weight: var(--bold);
padding: var(--s-3);
border: 2px solid var(--border);
border-radius: var(--radius-field);
background-color: var(--bg-input);
margin-bottom: var(--s-3);
overflow-x: auto;
}
.colors__grid {
display: grid;
justify-content: space-between;
grid-template-columns: repeat(3, max-content);
gap: var(--s-3);
}
.colors__table {
width: 100%;
border-spacing: 0;
text-indent: 0;
text-align: left;
font-size: var(--fonts-xs);
& svg {
width: 1rem;
height: 1rem;
display: inline;
vertical-align: sub;
margin-right: 2px;
}
& td {
padding-block: var(--s-2);
}
& tr:last-child td {
border-bottom: none;
padding-bottom: 0;
}
}
.colors__contrast {
text-wrap-mode: nowrap;
&.fail {
color: var(--theme-error);
}
&.success {
color: var(--theme-success);
}
}
.playwire__img {
display: block;
width: 200px;
margin-right: auto;
margin-left: auto;
}
.playwire__text {
font-size: var(--fonts-sm);
text-align: center;
}
.top-leaderboard {
min-height: 130px;
margin: 10px 0;
}
@media screen and (min-width: 601px) {
.top-leaderboard {
min-height: 120px;
}
}