button: Reduce gap between icon and label for small, xsmall button. (#285)
This commit is contained in:
parent
69e94cce1c
commit
2b134e47a1
2 changed files with 5 additions and 4 deletions
|
|
@ -332,6 +332,7 @@ impl Render for ButtonStory {
|
||||||
.child(
|
.child(
|
||||||
Button::new("button-6")
|
Button::new("button-6")
|
||||||
.label("Primary Button")
|
.label("Primary Button")
|
||||||
|
.icon(IconName::Check)
|
||||||
.primary()
|
.primary()
|
||||||
.small()
|
.small()
|
||||||
.loading(true)
|
.loading(true)
|
||||||
|
|
@ -402,6 +403,7 @@ impl Render for ButtonStory {
|
||||||
Button::new("button-xs-1")
|
Button::new("button-xs-1")
|
||||||
.label("Primary Button")
|
.label("Primary Button")
|
||||||
.primary()
|
.primary()
|
||||||
|
.icon(IconName::Check)
|
||||||
.xsmall()
|
.xsmall()
|
||||||
.disabled(disabled)
|
.disabled(disabled)
|
||||||
.selected(selected)
|
.selected(selected)
|
||||||
|
|
|
||||||
|
|
@ -425,11 +425,10 @@ impl RenderOnce for Button {
|
||||||
.id("label")
|
.id("label")
|
||||||
.items_center()
|
.items_center()
|
||||||
.justify_center()
|
.justify_center()
|
||||||
.gap_2()
|
|
||||||
.map(|this| match self.size {
|
.map(|this| match self.size {
|
||||||
Size::XSmall => this.text_xs(),
|
Size::XSmall => this.gap_1().text_xs(),
|
||||||
Size::Small => this.text_sm(),
|
Size::Small => this.gap_1().text_sm(),
|
||||||
_ => this.text_base(),
|
_ => this.gap_2().text_base(),
|
||||||
})
|
})
|
||||||
.when(!self.loading, |this| {
|
.when(!self.loading, |this| {
|
||||||
this.when_some(self.icon, |this, icon| {
|
this.when_some(self.icon, |this, icon| {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue