96 lines
3.3 KiB
CSS
96 lines
3.3 KiB
CSS
/*
|
|
* Zeichen im formatierten Text der Website (ADR-69). Die Ausgabe setzt die Zeichen ein (TextMarkers::decorate):
|
|
* - Symbol vor einem Absatz: `p.has-symbol` mit `span.text-symbol` (herausgestellt links, der Text bleibt im eigenen Block),
|
|
* - Nummern im Kreis: `ol.text-list-circle`, Farben als `--tone-bg` und `--tone-fg` (aus der Palette),
|
|
* - Symbol statt Aufzählungspunkt: `ul.text-list-symbol` mit `span.text-list-symbol__mark` je Punkt.
|
|
* Die Regeln gelten nur für die unmittelbaren Kinder, damit verschachtelte Listen ohne Zeichen unverändert bleiben.
|
|
*/
|
|
.has-symbol {
|
|
--text-symbol-size: 2.5rem;
|
|
position: relative;
|
|
min-block-size: var(--text-symbol-size);
|
|
/* Die erste Zeile steht mittig neben dem Symbol; bei mehreren Zeilen bleibt der Text als Block neben dem Symbol. */
|
|
padding-block-start: max(0px, calc((var(--text-symbol-size) - 1lh) / 2));
|
|
padding-inline-start: calc(var(--text-symbol-size) + var(--space-3, 0.75rem));
|
|
}
|
|
|
|
.has-symbol > .text-symbol {
|
|
position: absolute;
|
|
inset-block-start: 0;
|
|
inset-inline-start: 0;
|
|
display: block;
|
|
inline-size: var(--text-symbol-size);
|
|
block-size: var(--text-symbol-size);
|
|
}
|
|
|
|
.text-symbol > svg,
|
|
.text-list-symbol__mark > svg {
|
|
display: block;
|
|
inline-size: 100%;
|
|
block-size: 100%;
|
|
}
|
|
|
|
/* Nummern im Kreis: Die Zahl zählt der Browser (CSS-Zähler), die Liste bleibt für Hilfstechnik eine geordnete Liste. */
|
|
ol.text-list-circle {
|
|
--text-circle-size: 1.75rem;
|
|
counter-reset: text-circle;
|
|
padding-inline-start: 0;
|
|
}
|
|
|
|
/* list-style steht am Listenpunkt selbst: Der Grundstil der Widgets setzt es an der Liste und würde sonst Zahl und Kreis doppeln. */
|
|
.text-list-circle > li {
|
|
position: relative;
|
|
list-style: none;
|
|
min-block-size: var(--text-circle-size);
|
|
padding-block-start: max(0px, calc((var(--text-circle-size) - 1lh) / 2));
|
|
padding-inline-start: calc(var(--text-circle-size) + var(--space-3, 0.75rem));
|
|
counter-increment: text-circle;
|
|
}
|
|
|
|
.text-list-circle > li::before {
|
|
content: counter(text-circle);
|
|
position: absolute;
|
|
inset-block-start: 0;
|
|
inset-inline-start: 0;
|
|
display: grid;
|
|
place-items: center;
|
|
inline-size: var(--text-circle-size);
|
|
block-size: var(--text-circle-size);
|
|
border-radius: 50%;
|
|
background: var(--tone-bg, #032551);
|
|
color: var(--tone-fg, #f4f6f8);
|
|
font-size: 0.875rem;
|
|
font-weight: 700;
|
|
font-variant-numeric: tabular-nums;
|
|
line-height: 1;
|
|
}
|
|
|
|
/* Symbol statt Aufzählungspunkt. */
|
|
ul.text-list-symbol {
|
|
--text-list-symbol-size: 1.75rem;
|
|
padding-inline-start: 0;
|
|
}
|
|
|
|
.text-list-symbol > li {
|
|
position: relative;
|
|
list-style: none;
|
|
min-block-size: var(--text-list-symbol-size);
|
|
padding-block-start: max(0px, calc((var(--text-list-symbol-size) - 1lh) / 2));
|
|
padding-inline-start: calc(var(--text-list-symbol-size) + var(--space-3, 0.75rem));
|
|
}
|
|
|
|
.text-list-symbol > li > .text-list-symbol__mark {
|
|
position: absolute;
|
|
inset-block-start: 0;
|
|
inset-inline-start: 0;
|
|
display: block;
|
|
inline-size: var(--text-list-symbol-size);
|
|
block-size: var(--text-list-symbol-size);
|
|
}
|
|
|
|
/* Abstand zwischen zwei Punkten: Kreise und Symbole berühren sich nicht, auch wenn der Text nur eine Zeile hat. */
|
|
.text-list-circle > li + li,
|
|
.text-list-symbol > li + li {
|
|
margin-block-start: var(--space-2, 0.5rem);
|
|
}
|