sendou.ink/app/styles/common.css

367 lines
6.9 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-accent);
scrollbar-gutter: stable;
}
body {
width: 100%;
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(--input-focus-ring);
outline-offset: 1px;
}
}
/* :not([name="text"]) workaround not to select textarea on map planner */
textarea:not([name="text"]) {
width: 100%;
min-height: 5rem;
padding: var(--input-padding-block) var(--input-padding-inline);
line-height: var(--input-line-height);
border: 2px solid var(--color-border);
border-radius: var(--rounded-sm);
background-color: var(--color-bg);
outline: none;
resize: vertical;
&:focus-within {
outline: var(--input-focus-ring);
outline-offset: 1px;
}
}
input:not(.in-container) {
width: 100%;
box-sizing: border-box;
border: 2px solid var(--color-border);
border-radius: var(--rounded-sm);
background: var(--color-bg);
padding: 0 var(--input-padding-inline);
height: var(--input-height);
line-height: var(--input-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(--input-focus-ring);
outline-offset: 1px;
}
}
input[type="checkbox"] {
appearance: none;
cursor: pointer;
padding: 0;
width: var(--toggle-height-small);
height: var(--toggle-height-small);
border-radius: 5px;
background-color: var(--color-bg);
border: 2px solid var(--color-border);
&::after {
content: "";
display: none;
width: 100%;
height: 100%;
font-size: 1rem;
line-height: 0.75;
background-color: var(--color-text-inverse);
border-width: 0 2px 2px 0;
margin: 0;
clip-path: polygon(20% 100%, 20% 80%, 50% 80%, 50% 0%, 70% 0%, 70% 100%);
rotate: 45deg;
}
&:focus-within {
outline: none;
}
&:focus-visible {
outline: var(--input-focus-ring);
outline-offset: 1px;
}
&:checked {
border-color: var(--color-text-accent);
background-color: var(--color-text-accent);
&::after {
display: block;
}
}
}
input[type="radio"] {
appearance: none;
cursor: pointer;
vertical-align: middle;
width: var(--toggle-height-small);
height: var(--toggle-height-small);
background-color: var(--color-bg);
border: 2px solid var(--color-border);
border-radius: 999999px;
padding: 0;
&:focus-within {
outline: none;
}
&:focus-visible {
outline: var(--input-focus-ring);
outline-offset: 1px;
}
&::after {
content: "";
display: block;
width: 50%;
height: 50%;
border-radius: 999999px;
background-color: var(--color-bg);
margin: auto;
margin-top: 25%;
}
&:checked {
border-color: var(--color-text-accent);
&::after {
background-color: var(--color-text-accent);
}
}
}
[list]::-webkit-calendar-picker-indicator {
display: none !important;
}
label {
display: block;
font-size: var(--fonts-xs);
font-weight: var(--bold);
margin-block-end: var(--label-margin);
}
fieldset {
border: none;
border-radius: var(--rounded);
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(--rounded-sm);
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: 2px solid var(--color-border);
border-radius: var(--rounded-sm);
background: var(--color-bg);
background-image: url('data:image/svg+xml;utf8,<svg width="17px" color="rgb(255 255 255 / 55%)" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M19 9l-7 7-7-7" /></svg>');
background-position: center right 15px;
background-repeat: no-repeat;
cursor: pointer;
padding: 0 var(--input-padding-inline);
padding-right: 2.25rem;
height: var(--input-height);
line-height: var(--input-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(--input-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: 2px solid var(--color-border);
border-radius: var(--rounded-sm);
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(--rounded-sm);
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);
}
}
}
.light select {
background-image: url('data:image/svg+xml;utf8,<svg width="17px" color="rgb(0 0 0 / 55%)" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /></svg>');
}
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);
}
/* 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;
}
.top-leaderboard {
min-height: 130px;
margin: 10px 0;
}
@media screen and (min-width: 601px) {
.top-leaderboard {
min-height: 120px;
}
}