-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): support for multiple themes
- Loading branch information
Showing
26 changed files
with
340 additions
and
475 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/app/components/button-demo/button-demo/button-demo.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 15 additions & 15 deletions
30
src/app/components/button-demo/button-example-03/button-example-03.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
<h4>one</h4> | ||
<button ly-button> | ||
<ly-icon-button> | ||
<button ly-button raised> | ||
<span ly-icon-button> | ||
<ly-svg src="assets/svg/Experiment"></ly-svg> | ||
</ly-icon-button> | ||
</span> | ||
</button> | ||
<h4>with text</h4> | ||
<button ly-button> | ||
<ly-icon-button> | ||
<span ly-icon-button start> | ||
<ly-svg src="assets/svg/Experiment"></ly-svg> | ||
</ly-icon-button> | ||
Experiment | ||
</span> | ||
<span end>Experiment</span> | ||
</button> | ||
<button ly-button> | ||
Experiment | ||
<ly-icon-button> | ||
<span start>Experiment</span> | ||
<span ly-icon-button end> | ||
<ly-svg src="assets/svg/Experiment.svg"></ly-svg> | ||
</ly-icon-button> | ||
</span> | ||
</button> | ||
<h4>hmm</h4> | ||
<button ly-button class="item"> | ||
Heart | ||
<ly-icon-button> | ||
<span start>Heart</span> | ||
<span ly-icon-button end> | ||
<ly-svg src="assets/svg/Heart.svg"></ly-svg> | ||
</ly-icon-button> | ||
</span> | ||
</button> | ||
<button ly-button class="item"> | ||
Snow | ||
<ly-icon-button> | ||
<span start>Snow</span> | ||
<span ly-icon-button end> | ||
<ly-svg src="assets/svg/Snow.svg"></ly-svg> | ||
</ly-icon-button> | ||
</span> | ||
</button> |
5 changes: 3 additions & 2 deletions
5
src/app/components/button-demo/button-example-03/button-example-03.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/app/components/button-demo/button-example-04/button-example-04.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/app/components/button-demo/example-01/example-01.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/app/components/button-demo/example-02/example-02.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Injectable, Inject, Renderer2, ElementRef } from '@angular/core'; | ||
import { LyTheme, LyRootService } from 'alyle-ui/core'; | ||
import { DOCUMENT } from '@angular/common'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class LyButtonService { | ||
|
||
constructor( | ||
private theme: LyTheme, | ||
@Inject(DOCUMENT) document | ||
) { } | ||
|
||
applyTheme(renderer: Renderer2, elementRef: ElementRef) { | ||
const style = this.theme.createStyle('button', this.style.bind(this)); | ||
renderer.addClass(elementRef.nativeElement, style.id); | ||
} | ||
|
||
private style() { | ||
return `font-family:${this.theme.AlyleUI.palette.typography.fontFamily.default};` + | ||
`font-size: ${this.theme.AlyleUI.palette.typography.fontSize}px;` + | ||
`color: ${this.theme.AlyleUI.palette.text.default};` + | ||
'-webkit-tap-highlight-color: transparent;' + | ||
'padding: 0;' + | ||
'background-color: rgba(0, 0, 0, 0);' + | ||
'border: none;' + | ||
'-moz-appearance: none;' + | ||
'min-height: 36px;' + | ||
'height: 36px;' + | ||
'margin: 0;' + | ||
'border-radius: 3px;' + | ||
'outline: none;' + | ||
'font-weight: 500;' + | ||
'min-width: 88px;' + | ||
'box-sizing: border-box;' + | ||
'position: relative;' + | ||
'text-align: center;' + | ||
'cursor: pointer;' + | ||
'-webkit-user-select: none;' + | ||
'-moz-user-select: none;' + | ||
'-ms-user-select: none;' + | ||
'user-select: none;' + | ||
'display: inline-block;' + | ||
'transition: all 375ms cubic-bezier(0.23, 1, 0.32, 1) 0ms;'; | ||
} | ||
|
||
} |
Oops, something went wrong.