Skip to content

Commit e07a4a7

Browse files
committed
feat: enhance CSS specificity and improve line-height consistency across headings and paragraphs
1 parent f9f9b01 commit e07a4a7

File tree

1 file changed

+53
-101
lines changed

1 file changed

+53
-101
lines changed

packages/nimiq-css/src/css/static-content.css

Lines changed: 53 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,35 @@ body:not(.nq-raw) {
55

66
--nq-max-width: 73rem;
77

8-
&:not(:where(.nq-no-color, [nq-no-color], .nq-prose, [nq-prose])) {
8+
&:not(:where(.nq-no-color, [nq-no-color], .nq-prose, [nq-prose], .nq-prose-compact, [nq-prose-compact])) {
99
color: rgb(var(--nq-neutral-800));
1010
}
1111

12-
:not(:has(:is(.nq-raw, [nq-raw], .nq-prose, [nq-prose]) *)):not(:is(.nq-raw, [nq-raw], .nq-prose, [nq-prose]) *) {
12+
:not(:has(:is(.nq-raw, [nq-raw], .nq-prose, [nq-prose], .nq-prose-compact, [nq-prose-compact]) *)):not(:is(.nq-raw, [nq-raw], .nq-prose, [nq-prose], .nq-prose-compact, [nq-prose-compact]) *) {
1313
&:where(h1) {
1414
font-weight: 700;
15-
16-
*:not(.nq-no-color):not([nq-no-color]):not(.nq-no-color *):not([nq-no-color] *) & {
17-
color: rgb(var(--nq-neutral));
18-
}
19-
2015
max-width: 26ch;
2116
text-align: left;
2217
margin: 0;
18+
line-height: 1.3;
2319

24-
--f-font-line-height: 1.2;
2520
--font-size-min: 40;
2621
--font-size-max: 48;
2722

2823
&:where(.nq-heading-lg, [nq-heading-lg]) {
29-
--font-size-min: 44;
24+
--font-size-min: 36;
3025
--font-size-max: 64;
3126
}
3227

3328
@media screen and (min-width: 768px) {
3429
text-align: center;
3530
}
3631

37-
& + p {
32+
&+p {
3833
margin-top: 24px;
3934
max-width: 42ch;
4035

41-
--line-height: 1.5;
36+
line-height: 1.5;
4237
--font-size-min: 20;
4338
--font-size-max: 22;
4439

@@ -60,21 +55,21 @@ body:not(.nq-raw) {
6055

6156
--font-size-min: 32;
6257
--font-size-max: 40;
63-
--line-height: 1.3;
58+
line-height: 1.3;
6459

6560
text-align: left;
6661

6762
@media screen and (min-width: 768px) {
6863
text-align: center;
6964
}
7065

71-
& + p {
66+
&+p {
7267
margin-top: 16px;
7368
color: rgb(var(--nq-neutral-800) / 0.85);
7469

7570
max-width: 70ch;
7671

77-
--line-height: 1.5;
72+
line-height: 1.5;
7873
--font-size-min: 20;
7974
--font-size-max: 22;
8075

@@ -86,26 +81,26 @@ body:not(.nq-raw) {
8681

8782
&:where(h3) {
8883
font-weight: 600;
89-
--line-height: 1.3;
84+
line-height: 1.3;
9085
--font-size-min: 22;
9186
--font-size-max: 28;
9287

9388
*:not(.nq-no-color):not([nq-no-color]):not(.nq-no-color *):not([nq-no-color] *) & {
9489
color: rgb(var(--nq-neutral));
9590
}
9691

97-
& + p {
92+
&+p {
9893
margin-top: 16px;
9994

100-
--line-height: 1.5;
95+
line-height: 1.5;
10196
--font-size-min: 18;
10297
--font-size-max: 20;
10398
}
10499
}
105100

106101
&:where(h4) {
107102
font-weight: 600;
108-
--line-height: 1.3;
103+
line-height: 1.3;
109104
--font-size-min: 20;
110105
--font-size-max: 22;
111106

@@ -114,11 +109,6 @@ body:not(.nq-raw) {
114109
color: rgb(var(--nq-neutral));
115110
}
116111
}
117-
118-
&:where(h1, h2, h3, h4, h1 + p, h2 + p, h3 + p, h4 + p) {
119-
font-size: var(--font-size);
120-
line-height: var(--line-height);
121-
}
122112
}
123113

124114
:where(section, [data-section]) {
@@ -173,7 +163,7 @@ body:not(.nq-raw) {
173163

174164
padding: var(--pt, 0) var(--px, 0) var(--pb, 0) var(--px, 0);
175165

176-
> * {
166+
>* {
177167
max-width: var(--nq-max-width);
178168
}
179169

@@ -183,32 +173,14 @@ body:not(.nq-raw) {
183173
--f-pt-min: 160;
184174
--f-pt-max: 200;
185175

186-
:is(
187-
&:where(.bg-darkblue, [bg-darkblue]):has(
188-
+ :where(section, [data-section]):not(:where(.nq-section-gap, [nq-section-gap])):where(
189-
.bg-darkblue,
190-
[bg-darkblue]
191-
)
192-
),
193-
&:where(.bg-darkerblue, [bg-darkerblue]):has(
194-
+ :where(section, [data-section]):not(:where(.nq-section-gap, [nq-section-gap])):where(
195-
.bg-darkerblue,
196-
[bg-darkerblue]
197-
)
198-
),
199-
&:where(.bg-neutral-100, [bg-neutral-100]):has(
200-
+ :where(section, [data-section]):not(:where(.nq-section-gap, [nq-section-gap])):where(
201-
.bg-neutral-100,
202-
[bg-neutral-100]
203-
)
204-
),
205-
&:where(.bg-neutral-0, [bg-neutral-0]):has(
206-
+ :where(section, [data-section]):not(:where(.nq-section-gap, [nq-section-gap])):where(
207-
.bg-neutral-0,
208-
[bg-neutral-0]
209-
)
210-
)
211-
) {
176+
:is(&:where(.bg-darkblue, [bg-darkblue]):has(+ :where(section, [data-section]):not(:where(.nq-section-gap, [nq-section-gap])):where(.bg-darkblue,
177+
[bg-darkblue])),
178+
&:where(.bg-darkerblue, [bg-darkerblue]):has(+ :where(section, [data-section]):not(:where(.nq-section-gap, [nq-section-gap])):where(.bg-darkerblue,
179+
[bg-darkerblue])),
180+
&:where(.bg-neutral-100, [bg-neutral-100]):has(+ :where(section, [data-section]):not(:where(.nq-section-gap, [nq-section-gap])):where(.bg-neutral-100,
181+
[bg-neutral-100])),
182+
&:where(.bg-neutral-0, [bg-neutral-0]):has(+ :where(section, [data-section]):not(:where(.nq-section-gap, [nq-section-gap])):where(.bg-neutral-0,
183+
[bg-neutral-0]))) {
212184
--f-pb-min: 36;
213185
--f-pb-max: 48;
214186

@@ -218,56 +190,36 @@ body:not(.nq-raw) {
218190
}
219191
}
220192

221-
&:where(.bg-darkblue, [bg-darkblue], .bg-darkerblue, [bg-darkerblue]):has(
222-
+ :where(section, [data-section]):where(
223-
.bg-neutral-100,
224-
.bg-neutral-0,
225-
[bg-neutral-100],
226-
[bg-neutral-0],
227-
.nq-section-gap,
228-
[nq-section-gap]
229-
)
230-
),
231-
&:where(.bg-neutral-0, [bg-neutral-0], .bg-neutral-100, [bg-neutral-100]):has(
232-
+ :where(section, [data-section]):where(
233-
.bg-darkblue,
234-
[bg-darkblue],
235-
.bg-darkerblue,
236-
[bg-darkerblue],
237-
.nq-section-gap,
238-
[nq-section-gap]
239-
)
240-
),
241-
&:where(.bg-neutral-0, [bg-neutral-0]):has(
242-
+ :where(section, [data-section]):where(
243-
.bg-neutral-100,
244-
[bg-neutral-100],
245-
.bg-darkblue,
246-
[bg-darkblue],
247-
.bg-darkerblue,
248-
[bg-darkerblue],
249-
.nq-section-gap,
250-
[nq-section-gap]
251-
)
252-
),
253-
&:where(.bg-darkblue, [bg-darkblue], .bg-neutral-100, [bg-neutral-100], .bg-darkerblue, [bg-darkerblue]):has(
254-
+ :where(section, [data-section]):where(.bg-neutral-0, [bg-neutral-0], .nq-section-gap, [nq-section-gap])
255-
),
256-
&:where(.bg-neutral-100, [bg-neutral-100]):has(
257-
+ :where(section, [data-section]):where(
258-
.bg-darkblue,
259-
[bg-darkblue],
260-
.bg-neutral-0,
261-
[bg-neutral-0],
262-
.bg-darkerblue,
263-
[bg-darkerblue],
264-
.nq-section-gap,
265-
[nq-section-gap]
266-
)
267-
),
268-
&:where(.bg-neutral-0, [bg-neutral-0], .bg-darkblue, [bg-darkblue], .bg-darkerblue, [bg-darkerblue]):has(
269-
+ :where(section, [data-section]):where(.bg-neutral-100, [bg-neutral-100], .nq-section-gap, [nq-section-gap])
270-
) {
193+
&:where(.bg-darkblue, [bg-darkblue], .bg-darkerblue, [bg-darkerblue]):has(+ :where(section, [data-section]):where(.bg-neutral-100,
194+
.bg-neutral-0,
195+
[bg-neutral-100],
196+
[bg-neutral-0],
197+
.nq-section-gap,
198+
[nq-section-gap])),
199+
&:where(.bg-neutral-0, [bg-neutral-0], .bg-neutral-100, [bg-neutral-100]):has(+ :where(section, [data-section]):where(.bg-darkblue,
200+
[bg-darkblue],
201+
.bg-darkerblue,
202+
[bg-darkerblue],
203+
.nq-section-gap,
204+
[nq-section-gap])),
205+
&:where(.bg-neutral-0, [bg-neutral-0]):has(+ :where(section, [data-section]):where(.bg-neutral-100,
206+
[bg-neutral-100],
207+
.bg-darkblue,
208+
[bg-darkblue],
209+
.bg-darkerblue,
210+
[bg-darkerblue],
211+
.nq-section-gap,
212+
[nq-section-gap])),
213+
&:where(.bg-darkblue, [bg-darkblue], .bg-neutral-100, [bg-neutral-100], .bg-darkerblue, [bg-darkerblue]):has(+ :where(section, [data-section]):where(.bg-neutral-0, [bg-neutral-0], .nq-section-gap, [nq-section-gap])),
214+
&:where(.bg-neutral-100, [bg-neutral-100]):has(+ :where(section, [data-section]):where(.bg-darkblue,
215+
[bg-darkblue],
216+
.bg-neutral-0,
217+
[bg-neutral-0],
218+
.bg-darkerblue,
219+
[bg-darkerblue],
220+
.nq-section-gap,
221+
[nq-section-gap])),
222+
&:where(.bg-neutral-0, [bg-neutral-0], .bg-darkblue, [bg-darkblue], .bg-darkerblue, [bg-darkerblue]):has(+ :where(section, [data-section]):where(.bg-neutral-100, [bg-neutral-100], .nq-section-gap, [nq-section-gap])) {
271223
--f-pb-min: 160;
272224
--f-pb-max: 200;
273225
}
@@ -280,7 +232,7 @@ body:not(.nq-raw) {
280232
&[nq-overlaps] {
281233
--pb: 0;
282234

283-
> * {
235+
>* {
284236
position: relative;
285237
z-index: 2;
286238

0 commit comments

Comments
 (0)