@skerbis/nativecss 0.0.0-stage → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/LICENSE +28 -0
- package/README.md +145 -2
- package/dist/base.css +225 -0
- package/dist/browser-fixes.css +32 -0
- package/dist/colors.css +288 -0
- package/dist/components/accordion-split.css +269 -0
- package/dist/components/alert.css +179 -0
- package/dist/components/app-shell.css +266 -0
- package/dist/components/audio-player.css +697 -0
- package/dist/components/audio.css +35 -0
- package/dist/components/aurora.css +132 -0
- package/dist/components/avatar.css +102 -0
- package/dist/components/back-to-top.css +120 -0
- package/dist/components/backdrop.css +94 -0
- package/dist/components/badge.css +95 -0
- package/dist/components/breadcrumb.css +58 -0
- package/dist/components/card.css +721 -0
- package/dist/components/code-block.css +234 -0
- package/dist/components/combobox.css +103 -0
- package/dist/components/command-palette.css +351 -0
- package/dist/components/comments.css +243 -0
- package/dist/components/compare.css +218 -0
- package/dist/components/count-up.css +140 -0
- package/dist/components/countdown.css +74 -0
- package/dist/components/cover.css +45 -0
- package/dist/components/curtain.css +116 -0
- package/dist/components/dialog-close.css +44 -0
- package/dist/components/disclosure.css +37 -0
- package/dist/components/downloads.css +47 -0
- package/dist/components/dropdown.css +260 -0
- package/dist/components/dropzone.css +181 -0
- package/dist/components/effects.css +236 -0
- package/dist/components/empty-state.css +74 -0
- package/dist/components/events.css +165 -0
- package/dist/components/expand-panels.css +220 -0
- package/dist/components/filter.css +179 -0
- package/dist/components/floating-label.css +69 -0
- package/dist/components/footer.css +56 -0
- package/dist/components/hero.css +139 -0
- package/dist/components/hovercard.css +146 -0
- package/dist/components/input-group.css +67 -0
- package/dist/components/kbd.css +44 -0
- package/dist/components/leaders.css +99 -0
- package/dist/components/lightbox.css +165 -0
- package/dist/components/lists.css +221 -0
- package/dist/components/livesearch.css +106 -0
- package/dist/components/map.css +245 -0
- package/dist/components/marginnote.css +109 -0
- package/dist/components/marquee.css +119 -0
- package/dist/components/modal.css +385 -0
- package/dist/components/morph.css +317 -0
- package/dist/components/nav-drilldown.css +190 -0
- package/dist/components/nav-priority.css +157 -0
- package/dist/components/nav.css +600 -0
- package/dist/components/notification.css +290 -0
- package/dist/components/off-canvas.css +107 -0
- package/dist/components/overlay.css +122 -0
- package/dist/components/pagination.css +139 -0
- package/dist/components/pill-group.css +143 -0
- package/dist/components/placeholder.css +28 -0
- package/dist/components/preferences-fonts.css +65 -0
- package/dist/components/preferences.css +283 -0
- package/dist/components/pricing.css +220 -0
- package/dist/components/rating.css +121 -0
- package/dist/components/reveal-pin.css +165 -0
- package/dist/components/roadmap.css +173 -0
- package/dist/components/scroll-frames.css +97 -0
- package/dist/components/scroll-horizontal.css +141 -0
- package/dist/components/scroll-progress.css +63 -0
- package/dist/components/scroll-stack.css +363 -0
- package/dist/components/scroll-video.css +172 -0
- package/dist/components/scrolly.css +190 -0
- package/dist/components/search.css +52 -0
- package/dist/components/segmented.css +209 -0
- package/dist/components/select.css +186 -0
- package/dist/components/slideshow.css +441 -0
- package/dist/components/sortable.css +186 -0
- package/dist/components/sparkline.css +50 -0
- package/dist/components/spinner.css +50 -0
- package/dist/components/split.css +85 -0
- package/dist/components/spotlight.css +111 -0
- package/dist/components/stat.css +82 -0
- package/dist/components/stepper.css +217 -0
- package/dist/components/subnav.css +151 -0
- package/dist/components/table-sort.css +111 -0
- package/dist/components/tabs.css +304 -0
- package/dist/components/tag.css +130 -0
- package/dist/components/testimonial.css +188 -0
- package/dist/components/text-reveal.css +141 -0
- package/dist/components/theme-toggle.css +62 -0
- package/dist/components/tile.css +53 -0
- package/dist/components/timeline.css +211 -0
- package/dist/components/toolbar.css +139 -0
- package/dist/components/tooltip.css +89 -0
- package/dist/components/topbar.css +92 -0
- package/dist/components/video-bg.css +176 -0
- package/dist/components/video-card.css +145 -0
- package/dist/components/video-float.css +142 -0
- package/dist/components/video-player.css +1116 -0
- package/dist/components/video-text.css +91 -0
- package/dist/components/video.css +65 -0
- package/dist/fonts/README.md +29 -0
- package/dist/fonts/atkinson-hyperlegible-next/OFL.txt +93 -0
- package/dist/fonts/atkinson-hyperlegible-next/atkinson-hyperlegible-next.woff2 +0 -0
- package/dist/fonts/lexend/OFL.txt +93 -0
- package/dist/fonts/lexend/lexend.woff2 +0 -0
- package/dist/fonts/opendyslexic/OFL.txt +94 -0
- package/dist/fonts/opendyslexic/OpenDyslexic-Bold.woff2 +0 -0
- package/dist/fonts/opendyslexic/OpenDyslexic-Regular.woff2 +0 -0
- package/dist/helpers/a11y.css +71 -0
- package/dist/helpers/animations.css +206 -0
- package/dist/helpers/elevation.css +87 -0
- package/dist/helpers/float.css +135 -0
- package/dist/helpers/forms.css +503 -0
- package/dist/helpers/icons.css +130 -0
- package/dist/helpers/layout.css +549 -0
- package/dist/helpers/media.css +77 -0
- package/dist/helpers/reveal.css +172 -0
- package/dist/helpers/scroll-shadow.css +129 -0
- package/dist/helpers/scroll.css +163 -0
- package/dist/helpers/surfaces.css +87 -0
- package/dist/helpers/tables.css +85 -0
- package/dist/helpers/typography.css +347 -0
- package/dist/helpers/visibility.css +134 -0
- package/dist/integrations/fontawesome-font-display-fix.css +67 -0
- package/dist/integrations/webawesome-bridge.css +195 -0
- package/dist/js/audio-player.js +942 -0
- package/dist/js/backdrop.js +119 -0
- package/dist/js/code-block.js +238 -0
- package/dist/js/combobox.js +382 -0
- package/dist/js/command-fallback.js +35 -0
- package/dist/js/command-palette.js +477 -0
- package/dist/js/compare.js +73 -0
- package/dist/js/content-observer.js +82 -0
- package/dist/js/count-up.js +150 -0
- package/dist/js/countdown.js +185 -0
- package/dist/js/dialog-light-dismiss.js +123 -0
- package/dist/js/dismiss.js +144 -0
- package/dist/js/downloads.js +181 -0
- package/dist/js/dropdown.js +300 -0
- package/dist/js/dropzone.js +304 -0
- package/dist/js/events.js +501 -0
- package/dist/js/filter.js +177 -0
- package/dist/js/hero-video-motion.js +37 -0
- package/dist/js/hide-on-scroll-fallback.js +102 -0
- package/dist/js/hovercard.js +228 -0
- package/dist/js/icon.js +166 -0
- package/dist/js/ics.js +290 -0
- package/dist/js/lightbox.js +144 -0
- package/dist/js/livesearch.js +253 -0
- package/dist/js/map.js +625 -0
- package/dist/js/marquee.js +108 -0
- package/dist/js/modal-router.js +298 -0
- package/dist/js/nav-drilldown.js +250 -0
- package/dist/js/nav-priority.js +221 -0
- package/dist/js/nav.js +242 -0
- package/dist/js/ncss-container.js +117 -0
- package/dist/js/notification.js +372 -0
- package/dist/js/page-transitions-quiet.js +44 -0
- package/dist/js/preferences-early.js +51 -0
- package/dist/js/preferences.js +346 -0
- package/dist/js/reveal.js +79 -0
- package/dist/js/scroll-frames.js +284 -0
- package/dist/js/scroll-horizontal.js +121 -0
- package/dist/js/scroll-stack-fallback.js +250 -0
- package/dist/js/scroll-video.js +332 -0
- package/dist/js/scrolly.js +109 -0
- package/dist/js/slideshow.js +416 -0
- package/dist/js/sortable.js +530 -0
- package/dist/js/sparkline.js +199 -0
- package/dist/js/spotlight.js +104 -0
- package/dist/js/subnav.js +163 -0
- package/dist/js/table-sort.js +312 -0
- package/dist/js/tabs.js +243 -0
- package/dist/js/text-reveal.js +108 -0
- package/dist/js/theme-toggle-early.js +28 -0
- package/dist/js/theme-toggle.js +135 -0
- package/dist/js/toolbar.js +130 -0
- package/dist/js/tooltip.js +214 -0
- package/dist/js/video-bg.js +193 -0
- package/dist/js/video-card.js +80 -0
- package/dist/js/video-float.js +119 -0
- package/dist/js/video-player.js +1267 -0
- package/dist/js/view-transitions.js +118 -0
- package/dist/js/wa-close-on-scroll.js +56 -0
- package/dist/ncss.css +165 -0
- package/dist/page-transitions.css +150 -0
- package/dist/reset.css +196 -0
- package/dist/theme.css +112 -0
- package/dist/tokens.css +238 -0
- package/package.json +52 -4
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ncss - Pillen-Gruppe (Layer "components"): mehrere Buttons/Links als EINE Pille mit
|
|
3
|
+
* feinen Trennstrichen - z.B. Werkzeuge in einer Kopfleiste (Suche · Sprache ·
|
|
4
|
+
* Darstellung), Ansichts-Aktionen (Teilen · Drucken · Merken) oder eine kompakte Toolbar.
|
|
5
|
+
*
|
|
6
|
+
* Abgrenzung: .ncss-segmented ist eine AUSWAHL (Radio-Gruppe, genau eins aktiv) - die
|
|
7
|
+
* Pillen-Gruppe bündelt dagegen unabhängige Aktionen/Links, jedes Teil bleibt ein ganz
|
|
8
|
+
* normaler Button bzw. Link mit eigenem Tab-Stopp. Kein JS.
|
|
9
|
+
*
|
|
10
|
+
* Markup:
|
|
11
|
+
* <div class="ncss-pill-group" role="group" aria-label="Werkzeuge">
|
|
12
|
+
* <button type="button">Suchen</button>
|
|
13
|
+
* <a href="/en/">English</a>
|
|
14
|
+
* <button type="button" aria-label="Teilen"><span class="ncss-icon ncss-icon-share" aria-hidden="true"></span></button>
|
|
15
|
+
* </div>
|
|
16
|
+
* role="group" + aria-label, sobald die Gruppe eine gemeinsame Bedeutung hat.
|
|
17
|
+
* Reine Icon-Teile brauchen einen Namen (aria-label oder visuell versteckter Text).
|
|
18
|
+
* Beliebige Elemente (auch Custom Elements wie <ncss-preferences>) sind als Teil
|
|
19
|
+
* möglich - ihr innerer Button wird wie die direkten Kinder gestylt (.ncss-pill-group-item
|
|
20
|
+
* an den inneren Button setzen, wenn das Element nicht selbst der Button ist).
|
|
21
|
+
*
|
|
22
|
+
* Varianten:
|
|
23
|
+
* --sm kompakter (dichte Toolbars)
|
|
24
|
+
* --solid kräftigere Fläche statt der dezenten Hintergrundtönung
|
|
25
|
+
* --plain ohne Rahmen und Fläche, nur die Trennstriche
|
|
26
|
+
* --no-dividers ohne Trennstriche
|
|
27
|
+
*
|
|
28
|
+
* Parameter: --ncss-pill-group-height, --ncss-pill-group-gap (Innenabstand der Pille).
|
|
29
|
+
*
|
|
30
|
+
* Abhängigkeiten (Cherry-Picking): colors.css/tokens.css (+ reset/base).
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
.ncss-pill-group {
|
|
34
|
+
--_ncss-pg-h: var(--ncss-pill-group-height, 2.25rem);
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
max-inline-size: 100%;
|
|
38
|
+
padding: var(--ncss-pill-group-gap, 2px);
|
|
39
|
+
border: var(--ncss-border-width, 1px) solid var(--ncss-color-border);
|
|
40
|
+
border-radius: var(--ncss-radius-full, 999px);
|
|
41
|
+
background-color: var(--ncss-color-bg-subtle);
|
|
42
|
+
vertical-align: middle;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ncss-pill-group > * {
|
|
46
|
+
position: relative;
|
|
47
|
+
flex: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Trennstrich VOR jedem Teil ausser dem ersten - als Pseudo-Element, damit die Teile
|
|
51
|
+
selbst runde Hover-Flächen behalten können. */
|
|
52
|
+
.ncss-pill-group > * + *::before {
|
|
53
|
+
content: "";
|
|
54
|
+
position: absolute;
|
|
55
|
+
inset-inline-start: 0;
|
|
56
|
+
inset-block: 25%;
|
|
57
|
+
border-inline-start: var(--ncss-border-width, 1px) solid var(--ncss-color-border);
|
|
58
|
+
pointer-events: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Teile: Buttons/Links direkt in der Gruppe oder markierte innere Buttons */
|
|
62
|
+
.ncss-pill-group > :is(a, button),
|
|
63
|
+
.ncss-pill-group .ncss-pill-group-item {
|
|
64
|
+
display: inline-flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
gap: 0.4em;
|
|
68
|
+
min-block-size: var(--_ncss-pg-h);
|
|
69
|
+
min-inline-size: var(--_ncss-pg-h);
|
|
70
|
+
margin: 0;
|
|
71
|
+
padding: 0 0.75rem;
|
|
72
|
+
border: 0;
|
|
73
|
+
border-radius: var(--ncss-radius-full, 999px);
|
|
74
|
+
background: transparent;
|
|
75
|
+
box-shadow: none;
|
|
76
|
+
color: var(--ncss-color-text);
|
|
77
|
+
font: inherit;
|
|
78
|
+
font-size: var(--ncss-font-size-sm);
|
|
79
|
+
font-weight: var(--ncss-font-weight-medium, 500);
|
|
80
|
+
line-height: 1.2;
|
|
81
|
+
text-decoration: none;
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
transition: background-color var(--ncss-motion-duration, 0.15s) var(--ncss-motion-easing, ease);
|
|
85
|
+
}
|
|
86
|
+
.ncss-pill-group > :is(a, button):active,
|
|
87
|
+
.ncss-pill-group .ncss-pill-group-item:active {
|
|
88
|
+
background-color: color-mix(in oklch, var(--ncss-color-text) 14%, transparent);
|
|
89
|
+
}
|
|
90
|
+
@media (hover: hover) and (pointer: fine) {
|
|
91
|
+
.ncss-pill-group > :is(a, button):hover:not(:active),
|
|
92
|
+
.ncss-pill-group .ncss-pill-group-item:hover:not(:active) {
|
|
93
|
+
background-color: color-mix(in oklch, var(--ncss-color-text) 8%, transparent);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/* Fokus-Ring nach innen - die Pille schneidet sonst nichts ab, Nachbarn bleiben sichtbar */
|
|
97
|
+
.ncss-pill-group > :is(a, button):focus-visible,
|
|
98
|
+
.ncss-pill-group .ncss-pill-group-item:focus-visible {
|
|
99
|
+
outline: var(--ncss-focus-ring-width, 2px) solid var(--ncss-color-focus-ring, var(--ncss-color-brand));
|
|
100
|
+
outline-offset: calc(var(--ncss-focus-ring-width, 2px) * -1);
|
|
101
|
+
}
|
|
102
|
+
/* Aktueller Zustand (z.B. aktive Sprache, eingeschaltete Option) */
|
|
103
|
+
.ncss-pill-group > :is([aria-current]:not([aria-current="false"]), [aria-pressed="true"]),
|
|
104
|
+
.ncss-pill-group .ncss-pill-group-item:is([aria-current]:not([aria-current="false"]), [aria-pressed="true"]) {
|
|
105
|
+
background-color: var(--ncss-color-surface, var(--ncss-color-bg));
|
|
106
|
+
box-shadow: var(--ncss-shadow-sm);
|
|
107
|
+
}
|
|
108
|
+
.ncss-pill-group > :is(button:disabled, [aria-disabled="true"]) {
|
|
109
|
+
color: var(--ncss-color-text-muted);
|
|
110
|
+
cursor: not-allowed;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* --- Varianten ----------------------------------------------------------------------- */
|
|
114
|
+
.ncss-pill-group--sm {
|
|
115
|
+
--_ncss-pg-h: var(--ncss-pill-group-height, 1.85rem);
|
|
116
|
+
}
|
|
117
|
+
.ncss-pill-group--sm > :is(a, button),
|
|
118
|
+
.ncss-pill-group--sm .ncss-pill-group-item {
|
|
119
|
+
padding-inline: 0.55rem;
|
|
120
|
+
font-size: var(--ncss-font-size-xs, 0.8rem);
|
|
121
|
+
}
|
|
122
|
+
.ncss-pill-group--solid {
|
|
123
|
+
background-color: color-mix(in oklch, var(--ncss-color-text) 8%, var(--ncss-color-bg));
|
|
124
|
+
}
|
|
125
|
+
.ncss-pill-group--plain {
|
|
126
|
+
padding: 0;
|
|
127
|
+
border-color: transparent;
|
|
128
|
+
background: transparent;
|
|
129
|
+
}
|
|
130
|
+
.ncss-pill-group--no-dividers > * + *::before {
|
|
131
|
+
display: none;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* Hochkontrast: Trennstriche und Fokus in Systemfarben */
|
|
135
|
+
@media (forced-colors: active) {
|
|
136
|
+
.ncss-pill-group > * + *::before {
|
|
137
|
+
border-color: CanvasText;
|
|
138
|
+
}
|
|
139
|
+
.ncss-pill-group > :is([aria-current]:not([aria-current="false"]), [aria-pressed="true"]) {
|
|
140
|
+
outline: 2px solid Highlight;
|
|
141
|
+
outline-offset: -2px;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ncss - Placeholder-Komponente (Layer "components"). Neutrale Flaeche fuer fehlende
|
|
3
|
+
* Bilder/Inhalte (Prototyping, "Bild folgt"-Zustand, Skeleton-artiger Platzhalter) - ein
|
|
4
|
+
* generisch nuetzlicher Baustein, kein Demo-only-Hilfsmittel.
|
|
5
|
+
*
|
|
6
|
+
* Kombinierbar mit den Aspect-Ratio-Helpers aus helpers/media.css statt eigene
|
|
7
|
+
* aspect-ratio-Werte mitzubringen:
|
|
8
|
+
* <div class="ncss-placeholder ncss-ratio-video">...</div>
|
|
9
|
+
* und mit .ncss-card-media, wenn eine Card noch kein echtes Bild hat:
|
|
10
|
+
* <div class="ncss-card-media ncss-placeholder"></div>
|
|
11
|
+
*/
|
|
12
|
+
.ncss-placeholder {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
background-color: var(--ncss-color-bg-subtle);
|
|
17
|
+
border-radius: var(--ncss-radius-md);
|
|
18
|
+
color: var(--ncss-color-text-muted);
|
|
19
|
+
font-size: var(--ncss-font-size-sm);
|
|
20
|
+
padding: var(--ncss-space-sm);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* Variante fuer Kontexte, die selbst schon auf bg-subtle sitzen (z.B. innerhalb eines
|
|
24
|
+
.ncss-modal--dark) - etwas gegen den Umgebungshintergrund abgesetzt statt darin zu
|
|
25
|
+
verschwinden. */
|
|
26
|
+
.ncss-placeholder--surface {
|
|
27
|
+
background-color: var(--ncss-color-surface);
|
|
28
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ncss - Lese-Schriften für die Darstellungs-Einstellungen (Layer "components"), opt-in,
|
|
3
|
+
* NICHT in ncss.css enthalten - bewusst eigene Datei, damit eine Seite ohne Schriftwahl
|
|
4
|
+
* keine @font-face-Zeile ausliefert:
|
|
5
|
+
* <link rel="stylesheet" href="ncss/components/preferences-fonts.css">
|
|
6
|
+
* Selbst gehostet unter fonts/ (Lizenzen + Größen: fonts/README.md), kein CDN-Request.
|
|
7
|
+
*
|
|
8
|
+
* Gewählt wird über <html data-ncss-font="hyperlegible|lexend|opendyslexic"> (gesetzt von
|
|
9
|
+
* js/preferences-early.js / js/preferences.js, Einstellung "font" in <ncss-preferences>).
|
|
10
|
+
* Ein @font-face lädt seine Datei erst, wenn ein Element die Familie tatsächlich nutzt -
|
|
11
|
+
* ohne Wahl wird also keine einzige Schriftdatei angefragt.
|
|
12
|
+
*
|
|
13
|
+
* Gewirkt wird über die Tokens --ncss-font-family-base/-heading (Fließtext + Überschriften),
|
|
14
|
+
* NICHT über --ncss-font-family-mono - Code bleibt in Festbreitenschrift. Die eigene
|
|
15
|
+
* Seitenschrift bleibt als Fallback in der Liste (font-display: swap: Text ist sofort
|
|
16
|
+
* lesbar, die gewählte Schrift tauscht nach dem Laden ein). !important aus demselben Grund
|
|
17
|
+
* wie beim Kontrast (colors.css): theme.css setzt die Schrift-Tokens unlayered.
|
|
18
|
+
*/
|
|
19
|
+
@font-face {
|
|
20
|
+
font-family: "Atkinson Hyperlegible Next";
|
|
21
|
+
src: url("../fonts/atkinson-hyperlegible-next/atkinson-hyperlegible-next.woff2") format("woff2");
|
|
22
|
+
font-weight: 200 800;
|
|
23
|
+
font-style: normal;
|
|
24
|
+
font-display: swap;
|
|
25
|
+
}
|
|
26
|
+
@font-face {
|
|
27
|
+
font-family: "Lexend";
|
|
28
|
+
src: url("../fonts/lexend/lexend.woff2") format("woff2");
|
|
29
|
+
font-weight: 100 900;
|
|
30
|
+
font-style: normal;
|
|
31
|
+
font-display: swap;
|
|
32
|
+
}
|
|
33
|
+
@font-face {
|
|
34
|
+
font-family: "OpenDyslexic";
|
|
35
|
+
src: url("../fonts/opendyslexic/OpenDyslexic-Regular.woff2") format("woff2");
|
|
36
|
+
font-weight: 400;
|
|
37
|
+
font-style: normal;
|
|
38
|
+
font-display: swap;
|
|
39
|
+
}
|
|
40
|
+
@font-face {
|
|
41
|
+
font-family: "OpenDyslexic";
|
|
42
|
+
src: url("../fonts/opendyslexic/OpenDyslexic-Bold.woff2") format("woff2");
|
|
43
|
+
font-weight: 700;
|
|
44
|
+
font-style: normal;
|
|
45
|
+
font-display: swap;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:root[data-ncss-font="hyperlegible"] {
|
|
49
|
+
--ncss-font-family-base: "Atkinson Hyperlegible Next", system-ui, sans-serif !important;
|
|
50
|
+
--ncss-font-family-heading: "Atkinson Hyperlegible Next", system-ui, sans-serif !important;
|
|
51
|
+
}
|
|
52
|
+
:root[data-ncss-font="lexend"] {
|
|
53
|
+
--ncss-font-family-base: "Lexend", system-ui, sans-serif !important;
|
|
54
|
+
--ncss-font-family-heading: "Lexend", system-ui, sans-serif !important;
|
|
55
|
+
}
|
|
56
|
+
:root[data-ncss-font="opendyslexic"] {
|
|
57
|
+
--ncss-font-family-base: "OpenDyslexic", system-ui, sans-serif !important;
|
|
58
|
+
--ncss-font-family-heading: "OpenDyslexic", system-ui, sans-serif !important;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Vorschau im Bedienfeld: jeder Optionsname in seiner eigenen Schrift (lädt die Datei erst,
|
|
62
|
+
wenn das Panel offen ist - das Panel ist bis dahin display:none). */
|
|
63
|
+
.ncss-preferences-options [data-font-preview="hyperlegible"] { font-family: "Atkinson Hyperlegible Next", system-ui, sans-serif; }
|
|
64
|
+
.ncss-preferences-options [data-font-preview="lexend"] { font-family: "Lexend", system-ui, sans-serif; }
|
|
65
|
+
.ncss-preferences-options [data-font-preview="opendyslexic"] { font-family: "OpenDyslexic", system-ui, sans-serif; }
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ncss - <ncss-preferences>: Darstellungs-Einstellungen für Besucher (Layer "components").
|
|
3
|
+
* KEIN Barrierefreiheits-Overlay - es macht keine Seite barrierefrei, sondern lässt Besucher
|
|
4
|
+
* eine bereits barrierefreie Seite an ihre Bedürfnisse anpassen. Systemeinstellungen bleiben
|
|
5
|
+
* Default ("System") und werden nie stillschweigend überschrieben.
|
|
6
|
+
*
|
|
7
|
+
* Markup (den Rest baut js/preferences.js):
|
|
8
|
+
* <script src="js/preferences-early.js"></script> im <head>, vor den Stylesheets
|
|
9
|
+
* <ncss-preferences></ncss-preferences> Button "Darstellung" + Popover
|
|
10
|
+
* <ncss-preferences inline></ncss-preferences> Bedienfeld direkt (z.B. eigene Seite)
|
|
11
|
+
* <ncss-preferences settings="theme text links"></ncss-preferences> nur eine Auswahl
|
|
12
|
+
* <script src="js/preferences.js" defer></script>
|
|
13
|
+
* Wirkung der Einstellungen: colors.css (Farbschema, Kontrast) und reset.css (Bewegung,
|
|
14
|
+
* Schriftgröße, Textabstände, Links, Fokus) - diese Datei stylt nur das Bedienfeld.
|
|
15
|
+
*
|
|
16
|
+
* Ohne JS bleibt das Element verborgen, es gelten die Systemeinstellungen.
|
|
17
|
+
* Abhängigkeiten (Cherry-Picking): colors.css/tokens.css/reset.css (+ base). Keine andere
|
|
18
|
+
* Komponente nötig (eigenes Icon, eigene Segment-/Schalter-Optik).
|
|
19
|
+
*/
|
|
20
|
+
ncss-preferences:not(:defined) {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
ncss-preferences {
|
|
24
|
+
display: inline-block;
|
|
25
|
+
}
|
|
26
|
+
ncss-preferences[inline] {
|
|
27
|
+
display: block;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* --- Button ----------------------------------------------------------------------------- */
|
|
31
|
+
.ncss-preferences-toggle {
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: var(--ncss-space-3xs, 0.25rem);
|
|
35
|
+
min-block-size: 2.75rem;
|
|
36
|
+
padding-inline: var(--ncss-space-xs);
|
|
37
|
+
border: var(--ncss-border-width) solid color-mix(in oklch, currentColor 25%, transparent);
|
|
38
|
+
border-radius: var(--ncss-radius-sm);
|
|
39
|
+
color: inherit;
|
|
40
|
+
font-weight: var(--ncss-font-weight-semibold);
|
|
41
|
+
white-space: nowrap;
|
|
42
|
+
}
|
|
43
|
+
.ncss-preferences-toggle:active {
|
|
44
|
+
background-color: color-mix(in oklch, currentColor 12%, transparent);
|
|
45
|
+
}
|
|
46
|
+
@media (hover: hover) and (pointer: fine) {
|
|
47
|
+
.ncss-preferences-toggle:hover:not(:active) {
|
|
48
|
+
background-color: color-mix(in oklch, currentColor 6%, transparent);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
.ncss-preferences-icon {
|
|
52
|
+
inline-size: 1.25em;
|
|
53
|
+
block-size: 1.25em;
|
|
54
|
+
flex: 0 0 auto;
|
|
55
|
+
background-color: currentColor;
|
|
56
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='12' cy='6.8' r='1.3' fill='black' stroke='none'/%3E%3Cpath d='M6.8 9.6c3.5 0.9 6.9 0.9 10.4 0M12 10.3v4.2M12 14.5l-2.4 3.9M12 14.5l2.4 3.9'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
57
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='12' cy='6.8' r='1.3' fill='black' stroke='none'/%3E%3Cpath d='M6.8 9.6c3.5 0.9 6.9 0.9 10.4 0M12 10.3v4.2M12 14.5l-2.4 3.9M12 14.5l2.4 3.9'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* --- Bedienfeld ------------------------------------------------------------------------- */
|
|
61
|
+
.ncss-preferences-panel {
|
|
62
|
+
display: grid;
|
|
63
|
+
gap: var(--ncss-space-xs);
|
|
64
|
+
color: var(--ncss-color-text);
|
|
65
|
+
background-color: var(--ncss-color-surface);
|
|
66
|
+
text-align: start;
|
|
67
|
+
}
|
|
68
|
+
/* Als Popover: unter dem Button (Anchor Positioning), sonst rechnet das Script. */
|
|
69
|
+
.ncss-preferences-panel[popover] {
|
|
70
|
+
inset: auto;
|
|
71
|
+
margin: 0;
|
|
72
|
+
margin-block-start: var(--ncss-space-2xs);
|
|
73
|
+
position-area: bottom span-left;
|
|
74
|
+
position-try-fallbacks: flip-block, flip-inline;
|
|
75
|
+
inline-size: min(24rem, calc(100vw - 2 * var(--ncss-space-xs)));
|
|
76
|
+
max-block-size: calc(100svh - 2 * var(--ncss-space-xs));
|
|
77
|
+
overflow-y: auto;
|
|
78
|
+
padding: var(--ncss-space-sm);
|
|
79
|
+
border: var(--ncss-border-width) solid var(--ncss-color-border);
|
|
80
|
+
border-radius: var(--ncss-radius-lg);
|
|
81
|
+
box-shadow: var(--ncss-shadow-lg);
|
|
82
|
+
}
|
|
83
|
+
/* Mit Anchor Positioning ist der Bezugsrahmen die position-area (vom Button bis zum
|
|
84
|
+
Viewport-Rand) - 100 % hält das Panel darin, längerer Inhalt scrollt im Panel statt
|
|
85
|
+
unter den Viewport-Rand zu ragen (bei 130 % Schrift wird es sonst höher als der Platz). */
|
|
86
|
+
@supports (position-area: bottom) {
|
|
87
|
+
.ncss-preferences-panel[popover]:not([data-ncss-preferences-fallback]) {
|
|
88
|
+
max-block-size: calc(100% - var(--ncss-space-2xs));
|
|
89
|
+
/* Mindesthöhe, damit bei wenig Platz unter dem Button die Fallback-Position (darüber)
|
|
90
|
+
greift, statt das Panel auf ein paar Zeilen zusammenzudrücken. */
|
|
91
|
+
min-block-size: min(20rem, calc(100svh - 2 * var(--ncss-space-xs)));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
.ncss-preferences-panel[popover]:not(:popover-open) {
|
|
95
|
+
display: none;
|
|
96
|
+
}
|
|
97
|
+
.ncss-preferences-panel[data-ncss-preferences-fallback] {
|
|
98
|
+
position: fixed;
|
|
99
|
+
margin: 0;
|
|
100
|
+
}
|
|
101
|
+
ncss-preferences[inline] .ncss-preferences-panel {
|
|
102
|
+
padding: var(--ncss-space-sm);
|
|
103
|
+
border: var(--ncss-border-width) solid var(--ncss-color-border);
|
|
104
|
+
border-radius: var(--ncss-radius-lg);
|
|
105
|
+
}
|
|
106
|
+
.ncss-preferences-panel > * {
|
|
107
|
+
margin: 0;
|
|
108
|
+
}
|
|
109
|
+
.ncss-preferences-title {
|
|
110
|
+
font-size: var(--ncss-font-size-md);
|
|
111
|
+
}
|
|
112
|
+
.ncss-preferences-intro,
|
|
113
|
+
.ncss-preferences-hint {
|
|
114
|
+
font-size: var(--ncss-font-size-sm);
|
|
115
|
+
color: var(--ncss-color-text-muted);
|
|
116
|
+
}
|
|
117
|
+
.ncss-preferences-group {
|
|
118
|
+
margin: 0;
|
|
119
|
+
padding: 0;
|
|
120
|
+
border: 0;
|
|
121
|
+
min-inline-size: 0;
|
|
122
|
+
}
|
|
123
|
+
.ncss-preferences-group legend {
|
|
124
|
+
padding: 0;
|
|
125
|
+
margin-block-end: var(--ncss-space-3xs, 0.25rem);
|
|
126
|
+
font-weight: var(--ncss-font-weight-semibold);
|
|
127
|
+
font-size: var(--ncss-font-size-sm);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Segmente: echte Radios, optisch als Schaltfläche (Radio selbst nur visuell versteckt -
|
|
131
|
+
bleibt fokussierbar, Pfeiltasten wechseln wie bei jeder Radiogruppe). */
|
|
132
|
+
.ncss-preferences-options {
|
|
133
|
+
display: flex;
|
|
134
|
+
flex-wrap: wrap;
|
|
135
|
+
gap: 2px;
|
|
136
|
+
padding: 2px;
|
|
137
|
+
border: var(--ncss-border-width) solid var(--ncss-color-border);
|
|
138
|
+
border-radius: var(--ncss-radius-sm);
|
|
139
|
+
}
|
|
140
|
+
.ncss-preferences-options label {
|
|
141
|
+
position: relative;
|
|
142
|
+
flex: 1 1 auto;
|
|
143
|
+
display: flex;
|
|
144
|
+
}
|
|
145
|
+
.ncss-preferences-options input {
|
|
146
|
+
position: absolute;
|
|
147
|
+
inset: 0;
|
|
148
|
+
inline-size: 100%;
|
|
149
|
+
block-size: 100%;
|
|
150
|
+
margin: 0;
|
|
151
|
+
opacity: 0;
|
|
152
|
+
cursor: pointer;
|
|
153
|
+
}
|
|
154
|
+
.ncss-preferences-options span {
|
|
155
|
+
flex: 1 1 auto;
|
|
156
|
+
display: grid;
|
|
157
|
+
place-items: center;
|
|
158
|
+
min-block-size: 2.5rem;
|
|
159
|
+
padding-inline: var(--ncss-space-2xs);
|
|
160
|
+
border-radius: calc(var(--ncss-radius-sm) - 2px);
|
|
161
|
+
font-size: var(--ncss-font-size-sm);
|
|
162
|
+
font-weight: var(--ncss-font-weight-medium);
|
|
163
|
+
white-space: nowrap;
|
|
164
|
+
}
|
|
165
|
+
.ncss-preferences-options input:checked + span {
|
|
166
|
+
background-color: var(--ncss-color-brand);
|
|
167
|
+
color: var(--ncss-color-brand-contrast);
|
|
168
|
+
}
|
|
169
|
+
.ncss-preferences-options input:focus-visible + span {
|
|
170
|
+
outline: var(--ncss-focus-ring-width, 2px) solid var(--ncss-color-focus-ring);
|
|
171
|
+
outline-offset: 2px;
|
|
172
|
+
}
|
|
173
|
+
@media (hover: hover) and (pointer: fine) {
|
|
174
|
+
.ncss-preferences-options input:not(:checked):hover + span {
|
|
175
|
+
background-color: color-mix(in oklch, currentColor 8%, transparent);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* Schalter: echte Checkbox mit role="switch". */
|
|
180
|
+
.ncss-preferences-switch {
|
|
181
|
+
display: flex;
|
|
182
|
+
align-items: center;
|
|
183
|
+
justify-content: space-between;
|
|
184
|
+
gap: var(--ncss-space-xs);
|
|
185
|
+
min-block-size: 2.75rem;
|
|
186
|
+
cursor: pointer;
|
|
187
|
+
}
|
|
188
|
+
.ncss-preferences-switch input {
|
|
189
|
+
appearance: none;
|
|
190
|
+
flex: 0 0 auto;
|
|
191
|
+
order: 2;
|
|
192
|
+
position: relative;
|
|
193
|
+
inline-size: 2.75rem;
|
|
194
|
+
block-size: 1.5rem;
|
|
195
|
+
margin: 0;
|
|
196
|
+
border: var(--ncss-border-width) solid var(--ncss-color-text-muted);
|
|
197
|
+
border-radius: var(--ncss-radius-full);
|
|
198
|
+
background-color: var(--ncss-color-bg-subtle);
|
|
199
|
+
cursor: pointer;
|
|
200
|
+
transition: background-color var(--ncss-motion-duration-fast) var(--ncss-motion-easing);
|
|
201
|
+
}
|
|
202
|
+
.ncss-preferences-switch input::before {
|
|
203
|
+
content: "";
|
|
204
|
+
position: absolute;
|
|
205
|
+
inset-block-start: 50%;
|
|
206
|
+
inset-inline-start: 3px;
|
|
207
|
+
inline-size: 1.05rem;
|
|
208
|
+
block-size: 1.05rem;
|
|
209
|
+
translate: 0 -50%;
|
|
210
|
+
border-radius: 50%;
|
|
211
|
+
background-color: var(--ncss-color-text-muted);
|
|
212
|
+
transition: inset-inline-start var(--ncss-motion-duration-fast) var(--ncss-motion-easing);
|
|
213
|
+
}
|
|
214
|
+
.ncss-preferences-switch input:checked {
|
|
215
|
+
border-color: var(--ncss-color-brand);
|
|
216
|
+
background-color: var(--ncss-color-brand);
|
|
217
|
+
}
|
|
218
|
+
.ncss-preferences-switch input:checked::before {
|
|
219
|
+
inset-inline-start: calc(100% - 1.05rem - 3px);
|
|
220
|
+
background-color: var(--ncss-color-brand-contrast);
|
|
221
|
+
}
|
|
222
|
+
.ncss-preferences-switch input:focus-visible {
|
|
223
|
+
outline: var(--ncss-focus-ring-width, 2px) solid var(--ncss-color-focus-ring);
|
|
224
|
+
outline-offset: 2px;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.ncss-preferences-actions {
|
|
228
|
+
display: flex;
|
|
229
|
+
flex-wrap: wrap;
|
|
230
|
+
justify-content: space-between;
|
|
231
|
+
gap: var(--ncss-space-2xs);
|
|
232
|
+
}
|
|
233
|
+
.ncss-preferences-actions button {
|
|
234
|
+
min-block-size: 2.75rem;
|
|
235
|
+
padding-inline: var(--ncss-space-sm);
|
|
236
|
+
border: var(--ncss-border-width) solid color-mix(in oklch, currentColor 25%, transparent);
|
|
237
|
+
border-radius: var(--ncss-radius-sm);
|
|
238
|
+
font-weight: var(--ncss-font-weight-semibold);
|
|
239
|
+
}
|
|
240
|
+
.ncss-preferences-actions button:active {
|
|
241
|
+
background-color: color-mix(in oklch, currentColor 12%, transparent);
|
|
242
|
+
}
|
|
243
|
+
@media (hover: hover) and (pointer: fine) {
|
|
244
|
+
.ncss-preferences-actions button:hover:not(:active) {
|
|
245
|
+
background-color: color-mix(in oklch, currentColor 6%, transparent);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/* Ansage-Region: optisch versteckt (eigene Regel, Datei läuft allein). */
|
|
249
|
+
.ncss-preferences-status {
|
|
250
|
+
position: absolute;
|
|
251
|
+
inline-size: 1px;
|
|
252
|
+
block-size: 1px;
|
|
253
|
+
overflow: hidden;
|
|
254
|
+
clip-path: inset(50%);
|
|
255
|
+
white-space: nowrap;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
@media (forced-colors: active) {
|
|
259
|
+
.ncss-preferences-icon {
|
|
260
|
+
forced-color-adjust: none;
|
|
261
|
+
background-color: ButtonText;
|
|
262
|
+
}
|
|
263
|
+
.ncss-preferences-options input:checked + span {
|
|
264
|
+
forced-color-adjust: none;
|
|
265
|
+
background-color: Highlight;
|
|
266
|
+
color: HighlightText;
|
|
267
|
+
}
|
|
268
|
+
.ncss-preferences-switch input {
|
|
269
|
+
forced-color-adjust: none;
|
|
270
|
+
border-color: ButtonText;
|
|
271
|
+
background-color: Canvas;
|
|
272
|
+
}
|
|
273
|
+
.ncss-preferences-switch input::before {
|
|
274
|
+
background-color: ButtonText;
|
|
275
|
+
}
|
|
276
|
+
.ncss-preferences-switch input:checked {
|
|
277
|
+
background-color: Highlight;
|
|
278
|
+
border-color: Highlight;
|
|
279
|
+
}
|
|
280
|
+
.ncss-preferences-switch input:checked::before {
|
|
281
|
+
background-color: HighlightText;
|
|
282
|
+
}
|
|
283
|
+
}
|