Skip to content

Commit 45f2596

Browse files
committed
Add styling for error-containers components
* Because of the structure that `practical-error-handling` needs, we need some custom CSS to hide `wa-callouts` used for error message containers * Also added polish to make single-item field errors bold, and remove the multi-line blurb * The fallback error section always retains its list styling, even if there is only 1 error
1 parent caa9f9a commit 45f2596

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
wa-callout > [data-pf-error-container] > ul > li {
2+
font-weight: var(--wa-font-weight-body);
3+
}
4+
5+
wa-callout:has(> [data-pf-error-container]):not(:has([data-pf-error-visible])) {
6+
display: none;
7+
}
8+
9+
wa-callout:has(> [data-pf-error-container] > ul > li:not([data-pf-error-visible])) {
10+
display: none;
11+
}
12+
13+
wa-callout:not(:has(> [data-pf-fallback-error-section])){
14+
&:has(> [data-pf-error-container] > ul > li[data-pf-error-visible]:only-child) {
15+
[data-pf-field-multiple-errors-blurb] {
16+
display: none;
17+
}
18+
19+
[data-pf-error-container] > ul {
20+
list-style: none;
21+
margin-inline-start: 0;
22+
23+
> li {
24+
font-weight: unset;
25+
}
26+
}
27+
}
28+
}

css/components/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@use 'toast';
2+
@use 'error-containers';
23
@use 'wa-component-with-fallback';
34
@use 'dropdown-navigation';
45
@use 'icon-text';

0 commit comments

Comments
 (0)