Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions assets/sass/dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
}
}

@position-try --dropdown-align-right {
left: auto;
right: 1rem;
}

.o-dropdown {
position: relative;

Expand Down Expand Up @@ -112,7 +117,9 @@
&__menu {
z-index: 20;
display: none;
position: absolute;
position: fixed;
left: anchor(left);
position-try-fallbacks: --dropdown-align-right;
background: var(--bg-default);
border-radius: var(--border-radius-m);
list-style: none;
Expand All @@ -123,23 +130,24 @@
border: var(--border-visible);
animation-duration: 0.2s;
animation-timing-function: ease;
max-height: 20rem;
Comment thread
therobrob marked this conversation as resolved.
overflow-y: auto;

&--above {
bottom: 100%;
top: auto;
bottom: anchor(top);
animation-name: dropdown-open-above;
margin-bottom: 0.5rem;
}

&--below {
top: 100%;
bottom: auto;
top: anchor(bottom);
animation-name: dropdown-open-below;
margin-top: 0.5rem;
}

&--right {
right: 0;
right: anchor(right);
left: auto;
}
}
}
7 changes: 3 additions & 4 deletions assets/sass/navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ menu > li > menu {
margin-bottom: 1rem;
border-radius: 0;
border: none;
max-height: none;
overflow-y: visible;
}

&__button,
Expand Down Expand Up @@ -85,16 +87,13 @@ menu > li > menu {
padding: 0.4rem;
justify-items: flex-start;
z-index: 14;
max-height: calc(100dvh - 7.6rem);

display: grid;
grid-auto-flow: row;
grid-template-rows: auto;
grid-template-columns: 1fr 1fr 1fr;

@media (max-width: #{$breakpoint-lg}) {
grid-template-columns: 1fr 1fr;
}

&--vertical {
grid-template-columns: auto;
}
Expand Down
2 changes: 2 additions & 0 deletions layouts/_partials/fip-validity/issuer-dropdown.html

@therobrob therobrob Jun 28, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change these to .id here as well, just like in nav-dropdown partial?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the ids are just the identifiers of the operators here, the risk of the same id used somewhere else might be higher. But since the dropdown is the only place where the anchors are used, I'd be fine with it.

Or we use the same as the id of the element, in this case "{{ $id }}-button"? The is should be unique anyway. What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we're talking at cross-purposes.
In line 1 we already initialize $id := .id, so in L 12 and 30 we can use .id instead, couldn’t we?

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
aria-controls="{{ $id }}-dropdown"
data-fip-validity-button
title="{{ T "fipValidity.selectIssuer" }}"
style="anchor-name: --{{ $id }}-dropdown"
>
<span data-fip-validity-logo></span>
<span
Expand All @@ -26,6 +27,7 @@
class="o-dropdown__menu o-dropdown__menu--below"
role="listbox"
aria-hidden="true"
style="position-anchor: --{{ $id }}-dropdown"
>
{{- range .issuers -}}
{{- $slug := .File.ContentBaseName -}}
Expand Down
2 changes: 2 additions & 0 deletions layouts/_partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
aria-controls="language-switcher-dropdown"
title="{{ T "language-switcher.aria-label" }}"
aria-label="{{ T "language-switcher.aria-label" }}"
style="anchor-name: --language-switcher"
>
{{ partial "icon" "translate" }}
<div>{{ $.Site.Language.Label }}</div>
Expand All @@ -68,6 +69,7 @@
role="listbox"
aria-hidden="true"
aria-label="{{ T "language-switcher.dropdown-label" }}"
style="position-anchor: --language-switcher"
>
{{ range .AllTranslations }}
<li
Expand Down
2 changes: 2 additions & 0 deletions layouts/_partials/nav-dropdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
aria-controls="{{ .id }}-dropdown"
title="{{ T (printf "%s.title" .key) }}"
aria-label="{{ T (printf "%s.aria-label" .key) }}"
style="anchor-name: --{{ .id }}"
>
<span>{{ T (printf "%s.label" .key) }}</span>
<div class="o-dropdown__icon">
Expand All @@ -21,6 +22,7 @@
role="listbox"
aria-hidden="true"
aria-label="{{ T (printf "%s.dropdown-label" .key) }}"
style="position-anchor: --{{ .id }}"
>
{{ range .items }}
{{- $prefix := "" -}}
Expand Down
Loading