-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow custom styling - fixes #93 #116
Merged
UncleDave
merged 10 commits into
aberezkin:development
from
hardikpthv:feature/custom_class_and_styles
Aug 3, 2017
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a69c90c
feat(css): Accept custom css styles on control level
hardikpthv 7e45065
fix(css) : Pushed style to parent selector from child.
hardikpthv 9d1b5f4
feat(css): Added ability to set css class on highest level component
hardikpthv 7965a86
fix(css): Close mark alignment
hardikpthv bb1a960
chore(css): Updated readme file
hardikpthv 02a3c3f
fix(css): Updated `klass` to `cssClass`
hardikpthv cdf8b3b
feat(demo): Added style component for custom css class and style
hardikpthv 3b07703
Merge branch 'master' into feature/custom_class_and_styles
hardikpthv 498d3bf
chore(docs): Updated readme for custom css class
hardikpthv 61c91c2
chore(docs): Updated read me
hardikpthv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about
style
directive?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can add
[style]
directive but it will mislead user. Good to apply either[class]
or[style]
because[style]
overrides[class]
. Do you still want me to add? @aberezkinThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No since we have it in the demo, it's ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah 👍