Skip to content

Commit

Permalink
Ensure inputs have the same height
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilkybarkid committed Jun 10, 2024
1 parent e0f7538 commit 6c423c0
Show file tree
Hide file tree
Showing 183 changed files with 453 additions and 410 deletions.
51 changes: 43 additions & 8 deletions assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1370,22 +1370,57 @@ notification-banner {
}
}

select {
.select {
display: grid;
grid-template-areas: 'select';
align-items: center;
max-inline-size: 100%;
padding-block: var(--space-3xs);
padding-inline: var(--space-2xs);
border: var(--width-divider) solid currentcolor;
border-radius: 0;
background-color: var(--color-background);
color: inherit;
font: inherit;

&:not([hidden]) {
display: block;
&:focus-within {
@media screen {
outline: var(--color-focus) solid var(--width-divider);
outline-offset: 0;

@media (forced-colors: active) {
outline-color: Highlight;
}
}
}

&:focus-visible {
outline-offset: 0;
& > select {
z-index: 1;
grid-area: select;
inline-size: 100%;
margin: 0;
padding-block: 0;
padding-inline: 0 calc(var(--space-2xs) + 0.8em);
border: none;
outline: none;
background-color: transparent;
color: inherit;
font: inherit;
cursor: inherit;
appearance: none;
}

&::after {
content: '';
grid-area: select;
justify-self: end;
block-size: 0.5em;
inline-size: 0.8em;
background-color: currentcolor;
clip-path: polygon(100% 0%, 0 0%, 50% 100%);

@media screen {
@media (forced-colors: active) {
background-color: CanvasText;
}
}
}

label + & {
Expand Down
46 changes: 25 additions & 21 deletions src/review-requests-page/review-requests-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,30 +155,34 @@ const form = ({ field, language }: Pick<ReviewRequests, 'field' | 'language'>) =
<input type="hidden" name="page" value="1" />
<div>
<label for="language">Language</label>
<select name="language" id="language">
<option value="" ${language === undefined ? html`selected` : ''}>Any</option>
${pipe(
['en', 'pt', 'es'] satisfies ReadonlyArray<LanguageCode>,
RA.map(language => [language, iso6391.getName(language)] as const),
RA.sort(Ord.contramap(snd)(ordString('en'))),
RA.map(
([code, name]) =>
html` <option value="${code}" ${code === language ? html`selected` : ''}>${name}</option>`,
),
)}
</select>
<div class="select">
<select name="language" id="language">
<option value="" ${language === undefined ? html`selected` : ''}>Any</option>
${pipe(
['en', 'pt', 'es'] satisfies ReadonlyArray<LanguageCode>,
RA.map(language => [language, iso6391.getName(language)] as const),
RA.sort(Ord.contramap(snd)(ordString('en'))),
RA.map(
([code, name]) =>
html` <option value="${code}" ${code === language ? html`selected` : ''}>${name}</option>`,
),
)}
</select>
</div>
</div>
<div>
<label for="field">Field</label>
<select name="field" id="field">
<option value="" ${field === undefined ? html`selected` : ''}>Any</option>
${pipe(
fieldIds,
RA.map(field => [field, getFieldName(field)] satisfies [FieldId, string]),
RA.sort(Ord.contramap(snd)(ordString('en'))),
RA.map(([id, name]) => html` <option value="${id}" ${id === field ? html`selected` : ''}>${name}</option>`),
)}
</select>
<div class="select">
<select name="field" id="field">
<option value="" ${field === undefined ? html`selected` : ''}>Any</option>
${pipe(
fieldIds,
RA.map(field => [field, getFieldName(field)] satisfies [FieldId, string]),
RA.sort(Ord.contramap(snd)(ordString('en'))),
RA.map(([id, name]) => html` <option value="${id}" ${id === field ? html`selected` : ''}>${name}</option>`),
)}
</select>
</div>
</div>
<button>Filter results</button>
</form>
Expand Down
46 changes: 25 additions & 21 deletions src/reviews-page/reviews-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,30 +174,34 @@ const form = ({
: ''}
<div>
<label for="language">Language</label>
<select name="language" id="language">
<option value="" ${language === undefined ? html`selected` : ''}>Any</option>
${pipe(
['en', 'pt', 'es'] satisfies ReadonlyArray<LanguageCode>,
RA.map(language => [language, iso6391.getName(language)] as const),
RA.sort(Ord.contramap(snd)(ordString('en'))),
RA.map(
([code, name]) =>
html` <option value="${code}" ${code === language ? html`selected` : ''}>${name}</option>`,
),
)}
</select>
<div class="select">
<select name="language" id="language">
<option value="" ${language === undefined ? html`selected` : ''}>Any</option>
${pipe(
['en', 'pt', 'es'] satisfies ReadonlyArray<LanguageCode>,
RA.map(language => [language, iso6391.getName(language)] as const),
RA.sort(Ord.contramap(snd)(ordString('en'))),
RA.map(
([code, name]) =>
html` <option value="${code}" ${code === language ? html`selected` : ''}>${name}</option>`,
),
)}
</select>
</div>
</div>
<div>
<label for="field">Field</label>
<select name="field" id="field">
<option value="" ${field === undefined ? html`selected` : ''}>Any</option>
${pipe(
fieldIds,
RA.map(field => [field, getFieldName(field)] satisfies [FieldId, string]),
RA.sort(Ord.contramap(snd)(ordString('en'))),
RA.map(([id, name]) => html` <option value="${id}" ${id === field ? html`selected` : ''}>${name}</option>`),
)}
</select>
<div class="select">
<select name="field" id="field">
<option value="" ${field === undefined ? html`selected` : ''}>Any</option>
${pipe(
fieldIds,
RA.map(field => [field, getFieldName(field)] satisfies [FieldId, string]),
RA.sort(Ord.contramap(snd)(ordString('en'))),
RA.map(([id, name]) => html` <option value="${id}" ${id === field ? html`selected` : ''}>${name}</option>`),
)}
</select>
</div>
</div>
<button>Filter results</button>
</form>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6c423c0

Please sign in to comment.