1461c7b3f1
- Also slightly tweaks size and position
114 lines
3.2 KiB
CSS
114 lines
3.2 KiB
CSS
@layer components {
|
|
.search {
|
|
--gap: 4vmin;
|
|
--width: 80ch;
|
|
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--gap);
|
|
margin-inline: auto;
|
|
max-block-size: 100%;
|
|
overflow-y: auto;
|
|
overscroll-behavior: contain;
|
|
padding: var(--block-space) calc(var(--block-space-double) + var(--btn-size));
|
|
}
|
|
|
|
/* Form
|
|
/* ------------------------------------------------------------------------ */
|
|
|
|
.search__form-input {
|
|
--clear-icon-size: 1em;
|
|
--focus-ring-size: 0;
|
|
--input-border-color: var(--color-ink-light);
|
|
--input-border-radius: 0;
|
|
--input-padding: 0.1em;
|
|
|
|
border-width: 0 0 1px;
|
|
max-inline-size: 50ch;
|
|
position: relative;
|
|
|
|
&::-webkit-search-cancel-button {
|
|
--clear-icon-size: 0.66rem;
|
|
|
|
-webkit-appearance: none;
|
|
appearance: none;
|
|
background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m14.3 12.179a.25.25 0 0 1 0-.354l9.263-9.262a1.5 1.5 0 0 0 -2.124-2.121l-9.262 9.258a.25.25 0 0 1 -.354 0l-9.262-9.258a1.5 1.5 0 0 0 -2.122 2.121l9.261 9.262a.25.25 0 0 1 0 .354l-9.261 9.263a1.5 1.5 0 0 0 2.122 2.121l9.262-9.263a.25.25 0 0 1 .354 0l9.262 9.263a1.5 1.5 0 0 0 2.122-2.121z" fill="%23000"/></svg>');
|
|
background-repeat: no-repeat;
|
|
background-size: var(--clear-icon-size);
|
|
block-size: var(--clear-icon-size);
|
|
cursor: pointer;
|
|
inline-size: var(--clear-icon-size);
|
|
inset: 50% 0 auto auto;
|
|
position: absolute;
|
|
translate: 0 -50%;
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m14.3 12.179a.25.25 0 0 1 0-.354l9.263-9.262a1.5 1.5 0 0 0 -2.124-2.121l-9.262 9.258a.25.25 0 0 1 -.354 0l-9.262-9.258a1.5 1.5 0 0 0 -2.122 2.121l9.261 9.262a.25.25 0 0 1 0 .354l-9.261 9.263a1.5 1.5 0 0 0 2.122 2.121l9.262-9.263a.25.25 0 0 1 .354 0l9.262 9.263a1.5 1.5 0 0 0 2.122-2.121z" fill="%23fff"/></svg>');
|
|
}
|
|
}
|
|
}
|
|
|
|
/* Content
|
|
/* ------------------------------------------------------------------------ */
|
|
|
|
.search__header {
|
|
align-items: center;
|
|
display: flex;
|
|
inset: 0 0 auto 0;
|
|
justify-content: flex-end;
|
|
padding: var(--block-space-half) var(--block-space);
|
|
position: absolute;
|
|
}
|
|
|
|
.search__list {
|
|
display: grid;
|
|
gap: var(--block-space);
|
|
list-style: none;
|
|
margin: 0 auto;
|
|
max-inline-size: 80ch;
|
|
padding: 0;
|
|
text-align: start;
|
|
}
|
|
|
|
.search__empty {
|
|
margin-block: 3em;
|
|
opacity: 0.66;
|
|
text-align: center;
|
|
}
|
|
|
|
.search__excerpt {
|
|
color: var(--color-ink);
|
|
font-size: var(--text-small);
|
|
}
|
|
|
|
.search__excerpt--comment {
|
|
--avatar-size: var(--comment-avatar-size);
|
|
--comment-avatar-size: 32px;
|
|
--padding: 1ch;
|
|
|
|
align-items: center;
|
|
background-color: var(--color-ink-lightest);
|
|
border-radius: 1ch;
|
|
display: flex;
|
|
gap: 1ch;
|
|
margin-inline-start: calc(var(--comment-avatar-size) / 2);
|
|
padding-block: 0.5ch;
|
|
|
|
.avatar {
|
|
margin-inline-start: calc(-0.5 * var(--comment-avatar-size));
|
|
}
|
|
}
|
|
|
|
.search__result {
|
|
color: var(--color-link);
|
|
|
|
&:not(&:hover) {
|
|
box-shadow: 0 0 0 1px var(--color-ink-lighter);
|
|
}
|
|
}
|
|
|
|
.search__title {
|
|
text-decoration: underline;
|
|
}
|
|
}
|