File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed 
packages/components/form/src Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 1+ --- 
2+ ' @sl-design-system/form ' patch 
3+ --- 
4+ 
5+ Fixed alignment of warning icon when an error spans over more than 2 lines.
Original file line number Diff line number Diff line change 11:host  {
2-   align-items center ;
2+   align-items start ;
33  color var (--sl-color-foreground-negative-plain );
44  display flex ;
55  font-weight var (--sl-text-new-typeset-fontWeight-semiBold );
66  gap var (--sl-size-050 );
77  padding-block-start var (--sl-size-050 );
88}
9+ 
10+ slot  {
11+   display inline-block ;
12+ }
13+ 
14+ sl-icon  {
15+   //  Vertically center the icon with the text when the error message is a multi line and we can't center it with flexbox.
16+   //  The icon needs to be centered in the line-height of the text (1lh) and the size of the icon calculated with max() (same as in the icon component).
17+   margin-block-start calc ((1 lh -  max (0.8em  , var (--sl-icon-size ))) /  2 );
18+ }
19+ 
20+ //  There are some really old browsers that don't support `cap` yet, so we use a fallback with `em`.
21+ @supports  (inline-size 1 cap) {
22+   sl-icon  {
23+     margin-block-start calc ((1 lh -  max (1 cap , var (--sl-icon-size ))) /  2 );
24+   }
25+ }
Original file line number Diff line number Diff line change @@ -184,7 +184,10 @@ export const CustomError: Story = {
184184  args : { 
185185    slot : ( )  =>  html ` 
186186      < sl-text-field  required  show-validity ="invalid "> </ sl-text-field >  
187-       < sl-error > This is a < strong > custom</ strong >  error</ sl-error >  
187+       < sl-error  
188+         > This is a < strong > custom</ strong >  error with a lot of text so we can see what happens when you have a lot to 
189+         explain. Because forms are hard!</ sl-error  
190+       >  
188191    ` 
189192  } 
190193} ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments