button sizes
This commit is contained in:
parent
af0c5c11c0
commit
9b4bb9f0a3
@ -1,3 +1,3 @@
|
|||||||
<button [attr.data-appearance]="appearance">
|
<button [attr.data-appearance]="appearance" [attr.data-size]="size">
|
||||||
<ng-content></ng-content>
|
<ng-content></ng-content>
|
||||||
</button>
|
</button>
|
||||||
|
@ -2,11 +2,9 @@
|
|||||||
display: block;
|
display: block;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
padding: var(--sk-gap-m) var(--sk-gap-xl);
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: var(--sk-gap-m);
|
gap: var(--sk-gap-m);
|
||||||
border-radius: var(--sk-br-m);
|
|
||||||
border: none;
|
border: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
@ -18,6 +16,7 @@
|
|||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Appearance
|
||||||
&[data-appearance="default"], &[data-appearance="primary"] {
|
&[data-appearance="default"], &[data-appearance="primary"] {
|
||||||
background-color: var(--sk-primary-accent);
|
background-color: var(--sk-primary-accent);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@ -38,13 +37,33 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Size
|
||||||
|
&[data-size="small"] {
|
||||||
|
padding: var(--sk-gap-s) var(--sk-gap-l);
|
||||||
|
border-radius: var(--sk-br-m);
|
||||||
|
}
|
||||||
|
&[data-size="default"] {
|
||||||
|
padding: var(--sk-gap-m) var(--sk-gap-xl);
|
||||||
|
border-radius: var(--sk-br-m);
|
||||||
|
}
|
||||||
|
&[data-size="medium"] {
|
||||||
|
padding: var(--sk-gap-l) var(--sk-gap-xl);
|
||||||
|
border-radius: var(--sk-br-l);
|
||||||
|
gap: var(--sk-gap-l);
|
||||||
|
}
|
||||||
|
&[data-size="large"] {
|
||||||
|
padding: var(--sk-gap-xl) var(--sk-gap-xxxl);
|
||||||
|
border-radius: var(--sk-br-xl);
|
||||||
|
gap: var(--sk-gap-xl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
:host::ng-deep {
|
:host::ng-deep {
|
||||||
|
|
||||||
button {
|
button {
|
||||||
&[data-appearance="default"], &[data-appearance="primary"] {
|
&[data-appearance="default"], &[data-appearance="primary"], &[data-appearance="secondary"] {
|
||||||
|
|
||||||
skirda-icon ng-icon {
|
skirda-icon ng-icon {
|
||||||
color: #fff!important;
|
color: #fff!important;
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, ContentChild, Input } from '@angular/core';
|
||||||
|
import { IconComponent } from '../icon/icon.component';
|
||||||
|
import { ButtonAppearance, ButtonSize } from './button.interface'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'skirda-button',
|
selector: 'skirda-button',
|
||||||
@ -6,7 +8,10 @@ import { Component, Input, OnInit } from '@angular/core';
|
|||||||
styleUrls: ['./button.component.scss'],
|
styleUrls: ['./button.component.scss'],
|
||||||
})
|
})
|
||||||
export class ButtonComponent {
|
export class ButtonComponent {
|
||||||
@Input() appearance: string = 'default';
|
@ContentChild(IconComponent) icon!: IconComponent
|
||||||
|
@Input() appearance: ButtonAppearance = 'default';
|
||||||
|
@Input() size: ButtonSize = 'default'
|
||||||
|
|
||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,2 @@
|
|||||||
export type ButtonAppearance =
|
export type ButtonAppearance = 'default' | 'primary' | 'secondary' | 'outline' | 'flat';
|
||||||
| 'default'
|
export type ButtonSize = 'default' | 'small' | 'medium' | 'large';
|
||||||
| 'primary'
|
|
||||||
| 'secondary'
|
|
||||||
| 'outline'
|
|
||||||
| 'flat';
|
|
||||||
|
@ -145,4 +145,5 @@
|
|||||||
--sk-br-s: 0.25rem;
|
--sk-br-s: 0.25rem;
|
||||||
--sk-br-m: 0.5rem;
|
--sk-br-m: 0.5rem;
|
||||||
--sk-br-l: 0.75rem;
|
--sk-br-l: 0.75rem;
|
||||||
|
--sk-br-xl: 1rem;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,10 @@
|
|||||||
<skirda-avatar *ngFor="let friend of friends" [username]="friend"></skirda-avatar>
|
<skirda-avatar *ngFor="let friend of friends" [username]="friend"></skirda-avatar>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<skirda-button size="large" appearance="secondary">
|
||||||
|
<skirda-icon name="play" size="32"></skirda-icon>
|
||||||
<skirda-heading size="1">Play</skirda-heading>
|
<skirda-heading size="1">Play</skirda-heading>
|
||||||
|
</skirda-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user