-
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
feat: allow custom styling - fixes #93 #116
Conversation
FYI I haven't forgotten about this, I just haven't had the time to review it yet. |
@@ -83,6 +135,7 @@ In the final state it should look something like this: | |||
[buttonCaption]="'Select Images!'" | |||
[dropBoxMessage]="'Drop your images here!'" | |||
[extensions]="['jpg','png','gif']" | |||
[class]="'customClass'" |
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? @aberezkin
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.
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 👍
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.
Could you add a relevant demo?
@@ -26,6 +26,7 @@ export class ImageUploadComponent implements OnInit { | |||
|
|||
@Input() beforeUpload: (UploadMetadata) => UploadMetadata | Promise<UploadMetadata> = data => data; | |||
@Input() buttonCaption: string = 'Select Images'; | |||
@Input('class') klass: string = 'img-ul'; |
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.
Personally I don't like the name klass
, it doesn't really tell me what the variable is - perhaps cssClass
or customClass
fit better.
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.
Okay @UncleDave i will change it to cssClass
. Sure i will add demo for the same.
src/image-upload/style.ts
Outdated
* | ||
* ``` | ||
* layout: { | ||
* "border": " #d0d0d0 dashed 1px", |
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.
Sneaky little space here " #d0d0d0 dashed 1px"
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.
Noted 👍
README.md
Outdated
|
||
**Note:** | ||
- `.img-ul-*` is class overridden with new styles. | ||
- Also set `encapsulation: ViewEncapsulation.Native/None` in your component. |
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 is this for?
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.
It was for avoiding scope to override. Needn't be required any more because "deep" selector (>>>) performs well.
feat(css): Added ability to set custom css class and accept custom styles. (#93)