button icons

This commit is contained in:
2020-04-26 13:27:27 +02:00
committed by smuddy
parent 148621f358
commit 3b6bebcbac
28 changed files with 133 additions and 26 deletions

View File

@@ -4,13 +4,13 @@ input {
font-size: 16px;
background: transparent;
border: none;
border-bottom: 1px solid #ccc;
border-bottom: 1px solid #888;
color: #888;
transition: all 300ms ease-in-out;
&:focus {
outline: none;
border-bottom: 2px solid @primary-color;
margin-bottom: -1px;
border-bottom: 1px solid @primary-color;
}
@media screen and (max-width: 500px) {

View File

@@ -2,4 +2,5 @@
display: flex;
flex-direction: row-reverse;
width: 100%;
flex-wrap: wrap;
}

View File

@@ -0,0 +1,6 @@
<button mat-button>
<span *ngIf="icon"><fa-icon [icon]="icon"></fa-icon><span class="content">&nbsp;</span></span>
<span class="content">
<ng-content></ng-content>
</span>
</button>

View File

@@ -0,0 +1,12 @@
button {
color: #373b44;
@media screen and (max-width: 860px) {
font-size: 30px;
}
}
.content {
@media screen and (max-width: 860px) {
display: none ;
}
}

View File

@@ -0,0 +1,25 @@
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {ButtonComponent} from './button.component';
describe('ButtonComponent', () => {
let component: ButtonComponent;
let fixture: ComponentFixture<ButtonComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ButtonComponent]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ButtonComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,12 @@
import {Component, Input} from '@angular/core';
import {IconProp} from '@fortawesome/fontawesome-svg-core';
@Component({
selector: 'app-button',
templateUrl: './button.component.html',
styleUrls: ['./button.component.less']
})
export class ButtonComponent {
@Input() icon: IconProp;
}

View File

@@ -0,0 +1,20 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {ButtonComponent} from './button.component';
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
import {MatButtonModule} from '@angular/material/button';
@NgModule({
declarations: [ButtonComponent],
exports: [
ButtonComponent
],
imports: [
CommonModule,
FontAwesomeModule,
MatButtonModule
]
})
export class ButtonModule {
}