-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat(css): Accept custom css styles on control level * fix(css) : Pushed style to parent selector from child. * feat(css): Added ability to set css class on highest level component * fix(css): Close mark alignment * chore(css): Updated readme file * fix(css): Updated `klass` to `cssClass` * feat(demo): Added style component for custom css class and style * chore(docs): Updated readme for custom css class * chore(docs): Updated read me
- Loading branch information
1 parent
098febd
commit a1aa8f4
Showing
10 changed files
with
247 additions
and
18 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
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,18 @@ | ||
.customClass{ | ||
background-color: #dd3; | ||
border-radius: 5px; | ||
margin:5px; | ||
width: 500px; | ||
} | ||
.customClass .img-ul-upload{ | ||
background-color: #000 !important; | ||
} | ||
.customClass .img-ul-clear{ | ||
background-color: #B819BB !important; | ||
} | ||
.customClass .img-ul-drag-box-msg { | ||
color: purple !important; | ||
} | ||
.customClass .img-ul-container{ | ||
background-color: #FF6CAD !important; | ||
} |
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,61 @@ | ||
<h4 class="mb-3 mt-5">Styles</h4> | ||
|
||
<h5 class="mb-3 mt-3">Custom CSS Class</h5> | ||
|
||
<image-upload url="https://httpbin.org/status/200" class="customClass"></image-upload> | ||
|
||
<pre><code class="language-markup"><![CDATA[<image-upload url="https://httpbin.org/status/200" class="customClass"></image-upload>]]></code></pre> | ||
|
||
<pre><code class="language-css"><![CDATA[.customClass{ | ||
background-color: #dd3; | ||
border-radius: 5px; | ||
margin:5px; | ||
width: 500px; | ||
} | ||
.customClass .img-ul-upload{ | ||
background-color: #000 !important; | ||
} | ||
.customClass .img-ul-clear{ | ||
background-color: #B819BB !important; | ||
} | ||
.customClass .img-ul-drag-box-msg { | ||
color: purple !important; | ||
} | ||
.customClass .img-ul-container{ | ||
background-color: #FF6CAD !important; | ||
} | ||
]]></code></pre> | ||
|
||
<h5 class="mb-3 mt-3">Custom Style</h5> | ||
|
||
<image-upload url="https://httpbin.org/status/200" [style]="customStyle"></image-upload> | ||
|
||
<pre><code class="language-markup"><![CDATA[<image-upload url="https://httpbin.org/status/200" [style]="customStyle"></image-upload>]]></code></pre> | ||
|
||
<pre><code class="language-typescript"><![CDATA[customStyle = { | ||
selectButton: { | ||
"background-color": "yellow", | ||
"border-radius": "25px", | ||
"color": "#000" | ||
}, | ||
clearButton: { | ||
"background-color": "#FFF", | ||
"border-radius": "25px", | ||
"color": "#000", | ||
"margin-left": "10px" | ||
}, | ||
layout: { | ||
"background-color": "purple", | ||
"border-radius": "25px", | ||
"color": "#FFF", | ||
"font-size": "15px", | ||
"margin": "10px", | ||
"padding-top": "5px", | ||
"width": "500px" | ||
}, | ||
previewPanel: { | ||
"background-color": "#894489", | ||
"border-radius": "0 0 25px 25px", | ||
} | ||
} | ||
]]></code></pre> |
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,40 @@ | ||
import { Component, ViewEncapsulation } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'styles', | ||
templateUrl: './style.component.html', | ||
styleUrls: ['./style.component.css'], | ||
encapsulation: ViewEncapsulation.None | ||
}) | ||
export class StyleComponent { | ||
|
||
constructor() { } | ||
|
||
customStyle = { | ||
selectButton: { | ||
"background-color": "yellow", | ||
"border-radius": "25px", | ||
"color": "#000" | ||
}, | ||
clearButton: { | ||
"background-color": "#FFF", | ||
"border-radius": "25px", | ||
"color": "#000", | ||
"margin-left": "10px" | ||
}, | ||
layout: { | ||
"background-color": "purple", | ||
"border-radius": "25px", | ||
"border": "none", | ||
"color": "#FFF", | ||
"font-size": "15px", | ||
"margin": "10px", | ||
"padding-top": "5px", | ||
"width": "500px" | ||
}, | ||
previewPanel: { | ||
"background-color": "#894489", | ||
"border-radius": "0 0 25px 25px", | ||
} | ||
} | ||
} |
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,53 @@ | ||
/** | ||
* @internal | ||
*/ | ||
export type StyleProps = { [key: string]: string } | ||
/** | ||
* @whatItDoes Represents custom style for various elements and controls. | ||
*/ | ||
export interface Style { | ||
/** | ||
* Sets custom style for select button. | ||
* | ||
* ``` | ||
* selectButton: { | ||
* "background-color": "#800080", | ||
* "color": "#FFF" | ||
* } | ||
* ``` | ||
*/ | ||
selectButton?: StyleProps; | ||
/** | ||
* Sets custom style for clear button. | ||
* | ||
* ``` | ||
* clearButton: { | ||
* "background-color": "#FFFF00", | ||
* "color": "#FFF" | ||
* } | ||
* ``` | ||
*/ | ||
clearButton?: StyleProps; | ||
/** | ||
* Sets custom style for entire layout. | ||
* | ||
* ``` | ||
* layout: { | ||
* "border": "#d0d0d0 dashed 1px", | ||
* "margin": "5px" | ||
* } | ||
* ``` | ||
*/ | ||
layout?: StyleProps; | ||
/** | ||
* Sets custom style for entire layout. | ||
* | ||
* ``` | ||
* previewPanel: { | ||
* "background-color": "#FFFF00", | ||
* "padding": "5px" | ||
* } | ||
* ``` | ||
*/ | ||
previewPanel?: StyleProps; | ||
} |