File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -43,11 +43,14 @@ export const buttonStyles = css`
43
43
44
44
.vaadin-button-container ,
45
45
[part = 'prefix' ],
46
- [part = 'suffix' ],
47
- [part = 'label' ] {
46
+ [part = 'suffix' ] {
48
47
display : contents;
49
48
}
50
49
50
+ [part = 'label' ] {
51
+ display : inline-flex;
52
+ }
53
+
51
54
: host (: is ([focus-ring ], : focus-visible )) {
52
55
outline : var (--vaadin-focus-ring-width ) solid var (--vaadin-focus-ring-color );
53
56
outline-offset : 1px ;
Original file line number Diff line number Diff line change @@ -54,22 +54,25 @@ describe('button', () => {
54
54
} ) ;
55
55
56
56
describe ( 'icon' , ( ) => {
57
- const PREFIX_ICON = '<vaadin-icon icon="vaadin:reply" slot="prefix"></vaadin-icon>' ;
58
- const SUFFIX_ICON = '<vaadin-icon icon="vaadin:reply" slot="suffix"></vaadin-icon>' ;
57
+ const getIcon = ( slot ) => `
58
+ <vaadin-icon
59
+ icon="vaadin:reply"
60
+ ${ slot ? `slot="${ slot } "` : '' }
61
+ ></vaadin-icon>
62
+ ` ;
59
63
60
64
it ( 'before text' , async ( ) => {
61
- element . insertAdjacentHTML ( 'afterbegin' , PREFIX_ICON ) ;
65
+ element . insertAdjacentHTML ( 'afterbegin' , getIcon ( 'prefix' ) ) ;
62
66
await visualDiff ( div , 'icon-before-text' ) ;
63
67
} ) ;
64
68
65
69
it ( 'after text' , async ( ) => {
66
- element . insertAdjacentHTML ( 'beforeend' , SUFFIX_ICON ) ;
70
+ element . insertAdjacentHTML ( 'beforeend' , getIcon ( 'suffix' ) ) ;
67
71
await visualDiff ( div , 'icon-after-text' ) ;
68
72
} ) ;
69
73
70
74
it ( 'without text' , async ( ) => {
71
- element . textContent = '' ;
72
- element . insertAdjacentHTML ( 'afterbegin' , PREFIX_ICON ) ;
75
+ element . innerHTML = getIcon ( '' ) ;
73
76
await visualDiff ( div , 'icon-without-text' ) ;
74
77
} ) ;
75
78
} ) ;
You can’t perform that action at this time.
0 commit comments