Skip to content

Commit

Permalink
fix(button): fix size in theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Enlcxx committed Dec 1, 2018
1 parent a98fc36 commit 0eb348f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/lib/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const STYLE_PRIORITY = -2;

type LyButtonSize = 'small' | 'medium' | 'large';

/** @ignore */
/** @docs-private */
const Size: Record<LyButtonSize, any> = {
small: (theme: ThemeVariables) => ({
padding: '0 8px',
Expand Down Expand Up @@ -108,7 +108,7 @@ export class LyButton extends LyButtonMixinBase implements OnChanges, OnInit, Af

@ViewChild('rippleContainer') _rippleContainer: ElementRef;

/** @ignore */
/** @docs-private */
@Input('sensitive')
get rippleSensitive(): boolean {
return this._rippleSensitive;
Expand All @@ -128,7 +128,7 @@ export class LyButton extends LyButtonMixinBase implements OnChanges, OnInit, Af
this._size = val;
this._sizeClass = this._theme.addStyle(
`lyButton.size:${val}`,
Size[val as any],
(theme: ThemeVariables) => theme.button.size[val],
this._el.nativeElement,
this._sizeClass,
STYLE_PRIORITY
Expand Down
26 changes: 17 additions & 9 deletions src/lib/themes/minima/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,23 @@ export class MinimaBase extends LyStyleUtils {
direction = Dir.ltr;
button = {
size: {
small: {
fontSize: this.pxToRem(16)
},
medium: {
fontSize: this.pxToRem(16)
},
large: {
fontSize: this.pxToRem(16)
}
small: ({
padding: '0 8px',
fontSize: this.pxToRem(this.typography.lyTyp.button.fontSize - 1),
minHeight: '32px',
minWidth: '48px'
}),
medium: ({
padding: '0 14px',
minHeight: '36px',
minWidth: '64px'
}),
large: ({
padding: '0 21px',
fontSize: this.pxToRem(this.typography.lyTyp.button.fontSize + 1),
minHeight: '40px',
minWidth: '96px'
})
},
appearance: {
icon: {
Expand Down

0 comments on commit 0eb348f

Please sign in to comment.