Skip to content

Commit 319312c

Browse files
authored
fix: vertical align content of UUI-Button anchor tag (#254)
* make anchor tag story more visible * use flexbox for content alignment
1 parent 127e036 commit 319312c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/uui-button/lib/uui-button.element.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,15 @@ export class UUIButtonElement extends FormControlMixin(
100100
text-align: inherit;
101101
border: none;
102102
cursor: inherit;
103-
display: block;
103+
104+
display: inline-flex;
105+
align-items: center;
106+
justify-content: center;
104107
105108
/* for anchor tag: */
106109
text-decoration: none;
107110
color: currentColor;
108-
line-height: normal;
111+
line-height: inherit;
109112
110113
border-width: var(--uui-button-border-width, 1px);
111114
border-style: solid;
@@ -119,7 +122,6 @@ export class UUIButtonElement extends FormControlMixin(
119122
calc(var(--uui-size-2) * var(--uui-button-padding-right-factor)) 0
120123
calc(var(--uui-size-2) * var(--uui-button-padding-left-factor));
121124
122-
vertical-align: middle;
123125
box-shadow: none;
124126
}
125127
button[disabled]:active,

packages/uui-button/lib/uui-button.story.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,14 @@ export const AnchorTag = Template.bind({});
324324
AnchorTag.args = {
325325
href: 'https://www.umbraco.com',
326326
target: '_blank',
327+
look: 'primary',
327328
};
328329
AnchorTag.parameters = {
329330
docs: {
330331
source: {
331332
code: html`
332333
<uui-button
334+
look="primary"
333335
label="Open umbraco.com"
334336
href="http://www.umbraco.com"
335337
target="_blank">

0 commit comments

Comments
 (0)