zefoy / ngx-dropzone-wrapper

Angular wrapper library for Dropzone
MIT License
174 stars 51 forks source link

how to custom css of element dropzone #51

Closed dungvan closed 7 years ago

dungvan commented 7 years ago

how to custom css of element dropzone

My app has config maxFiles = 1, so the dropzone has view like this screenshot from 2017-09-22 14-29-03

but i want to show view like this if i reset css of class .dz-text to

.dz-text {
  margin-top: 0px;
  transform: none;
}

screenshot from 2017-09-22 14-30-52

how cant i config the dropzone with my style on class .dz-text?

sorry for my bad english and big thanks.

dungvan commented 7 years ago

i resole this problem with

[useDropzoneClass]="false"

thanks!

sconix commented 7 years ago

Yeah using that input its possible to disable the default styles when you can always provide your own. But of course you can override styles even if that true, then you just need to learn how CSS works and how to make selectors overpower existing selectors.

fergalmoran commented 7 years ago

This method removes all styling though? I'm having the same issue but when I try .dz-text { margin-top: 0px!important; } It has no effect?

djanesch commented 7 years ago

@fergalmoran you have to insert a space between values and !important. your code should look like the following: .dz-text { margin-top: 0px !important; }

fergalmoran commented 7 years ago

@djanesch Sorry but that's just a typo - I did have a space in my actual CSS. Thanks for the tip though!!

sconix commented 7 years ago

Are you using some old version of the library? The latest does not use margin-top to position the text.

fergalmoran commented 7 years ago

@sconix I'm pretty sure I tried it recently with the latest version and found the same behaviour. I've moved on to something else just now - I'll get back to this soon and if I see the same problem, I'll open a new issue with full details. Thanks for your input guys!

sconix commented 7 years ago

The point being was that if you set margin-top: 0 !important it wont help anything with the new version since the margin is 0 as a default. The position of the text is set using transform.

fergalmoran commented 7 years ago

Ok, well that definitely explains the behaviour I was seeing. Thanks for the explanation.