Taalselectie
Een taalselectie element biedt een verticale keuzelijst die openklapt.
Benodigde stappen:
- Voeg de benodigde bestanden toe aan het project. Voor een overzicht van de benodigde en optionele bestanden zie: Bijbehorende bestanden.
- Voeg de benodigde HTML toe. Voor meer informatie zie: Voorbeelden.
Voorbeelden:
Paragraaf
Visueel voorbeeld:
Kies een taal:
HTML-voorbeeld:
<div class="language-selector">
<p id="language-selector-description">Kies een taal:</p>
<div class="language-selector-options" aria-describedby="language-selector-description" aria-expanded="false">
<button aria-haspopup="listbox" aria-current="true">
Papiamentu
</button>
<ul role="listbox">
<li role="option" aria-selected="false">
<a hreflang="nl" href="#" data-value="Nederlands" lang="nl">Nederlands</a>
</li>
<li role="option" aria-selected="false">
<a hreflang="en" href="#" data-value="English" lang="en">English</a>
</li>
<li role="option" aria-selected="false">
<a hreflang="fy" href="#" data-value="Frysk" lang="fy">Frysk</a>
</li>
<li role="option" aria-selected="true" aria-current="true">
<a hreflang="pap-CW" href="#" data-value="Papiamentu" lang="pap-CW">Papiamentu</a>
</li>
<li role="option" aria-selected="false">
<a hreflang="pap-AW" href="#" data-value="Papiamento" lang="pap-AW">Papiamento</a>
</li>
</ul>
</div>
</div>
Structuurvoorbeeld:
<header>
<nav aria-label="Hoofdnavigatie">
<!-- Navigatie items -->
<!-- Taalselectie -->
</nav>
</header>
Bijbehorende bestanden
Voor meer informatie over importeren en instellen van componenten. Zie: Componenten gebruiken en styling toevoegen
Importeer component via npm
CSS-voorbeeld:
@use "@minvws/manon/language-selector"
Instelbare variabelen
Variabele | CSS-attribuut | Manon ingestelde waarde | Breekpunt | Class |
---|---|---|---|---|
--language-selector-list-label-font-size | font-size | var(--de-emphasized-font-size) | - | language |
--language-selector-list-label-text-color | text-color | var(--de-emphasized-text-color, inherit) | - | |
--language-selector-list-font-size | font-size | var(--de-emphasized-font-size) | - | |
--language-selector-list-font-weight | font-weight | var(--application-base-font-weight) | - | |
--language-selector-list-width | width | 100% | - | |
--language-selector-list-max-width | max-width | 100% | - | |
--language-selector-list-border-width | border-width | 1px | - | |
--language-selector-list-border-style | border-style | solid | - | |
--language-selector-list-border-color | border-color | var(--grey-2) | - | |
--language-selector-list-border-radius | border-radius | 0px | - | |
--language-selector-list-item-background-color | background-color | var(--application-base-background-color) | - | |
--language-selector-list-item-text-color | text-color | var(--application-base-text-color) | - | |
--language-selector-list-item-link-border-width | border-width | 1px | - | |
--language-selector-list-item-link-border-style | border-style | solid | - | |
--language-selector-list-item-link-border-color | border-color | var(--grey-2) | - | |
--language-selector-list-item-hover-background-color | background-color | var(--branding-color-1-background-color) | - | |
--language-selector-list-item-hover-text-color | text-color | var(--branding-color-1-text-color) | - | |
--language-selector-list-item-hover-font-size | font-size | var(--language-selector-list-font-size) | - | |
--language-selector-list-item-hover-font-weight | font-weight | var(--language-selector-list-font-weight) | - | |
--language-selector-list-item-active-background-color | background-color | var(--branding-color-2-background-color) | - | |
--language-selector-list-item-active-text-color | text-color | var(--branding-color-2-text-color) | - | |
--language-selector-list-item-active-font-size | font-size | var(--language-selector-list-font-size) | - | |
--language-selector-list-item-active-font-weight | font-weight | var(--language-selector-list-font-weight) | - | |
--language-selector-list-button-background-color | background-color | transparent | - | |
--language-selector-list-button-text-color | text-color | var(--de-emphasized-text-color) | - | |
--language-selector-list-button-font-size | font-size | var(--de-emphasized-font-size) | - | |
--language-selector-list-button-border-width | border-width | 1px | - | |
--language-selector-list-button-border-style | border-style | solid | - | |
--language-selector-list-button-border-color | border-color | var(--grey-2) | - | |
--language-selector-list-button-padding-top | padding-top | 0.125rem | - | |
--language-selector-list-button-padding-right | padding | 0.5rem | - | |
--language-selector-list-button-padding-bottom | padding-bottom | 0.125rem | - | |
--language-selector-list-button-padding-left | padding | 0.5rem | - | |
--language-selector-list-button-line-height | line-height | 1.5rem | - |
CSS
Overzicht van de beschikbare variabelen om te kunnen gebruiken binnen de CSS van jouw project. Kies en gebruik de benodigde variabelen.
:root {
/* Label */
--language-selector-list-label-font-size: ;
--language-selector-list-label-text-color: ;
/* List */
--language-selector-list-font-size: ;
--language-selector-list-font-weight: ;
--language-selector-list-width: ;
--language-selector-list-max-width: ;
--language-selector-list-border-width: ;
--language-selector-list-border-style: ;
--language-selector-list-border-color: ;
--language-selector-list-border-radius: ;
/* List item */
--language-selector-list-item-background-color: ;
--language-selector-list-item-text-color: ;
/* List item link */
--language-selector-list-item-link-border-width: ;
--language-selector-list-item-link-border-style: ;
--language-selector-list-item-link-border-color: ;
/* List item hover */
--language-selector-list-item-hover-background-color: ;
--language-selector-list-item-hover-text-color: ;
--language-selector-list-item-hover-font-size: ;
--language-selector-list-item-hover-font-weight: ;
/* List item active */
--language-selector-list-item-active-background-color: ;
--language-selector-list-item-active-text-color: ;
--language-selector-list-item-active-font-size: ;
--language-selector-list-item-active-font-weight: ;
/* Dropdown button */
--language-selector-list-button-background-color: ;
--language-selector-list-button-text-color: ;
--language-selector-list-button-font-size: ;
--language-selector-list-button-border-width: ;
--language-selector-list-button-border-style: ;
--language-selector-list-button-border-color: ;
--language-selector-list-button-padding-top: ;
--language-selector-list-button-padding-right: ;
--language-selector-list-button-padding-bottom: ;
--language-selector-list-button-padding-left: ;
--language-selector-list-button-line-height: ;
}