ng2-iq-select2 icon indicating copy to clipboard operation
ng2-iq-select2 copied to clipboard

Css customization

Open valeri879 opened this issue 7 years ago • 6 comments

I can't customize css inline styles

valeri879 avatar Sep 29 '17 12:09 valeri879

What are you precisely trying to do?

diegofsza avatar Oct 04 '17 18:10 diegofsza

For ex. change border color or shadows

valeri879 avatar Oct 05 '17 08:10 valeri879

Ok. Using the /deep/ shadow-piercing descendant combinator used to work, but I believe it is deprecated right now, and support being removed from many browsers. Anyway, this still works with chrome for example:

<iq-select2 [css]="'test'"
                    [dataSourceProvider]="dataProvider"
                    [iqSelect2ItemAdapter]="adapter"
                    [selectedProvider]="getItems"></iq-select2>

>>> .test { border: 2px solid #000; box-shadow: 0 0 5px #f00; }

I think it will be needed a whole review of the styling of the component, so that we can integrate better with the apps using it. I don´t really know right now which is the best way to do that, but will try to find it out.

diegofsza avatar Oct 05 '17 12:10 diegofsza

Other projects like angular material or primeng provide their (s)css separated from the component and you have to include it in the angular-cli.json. But then all css classes of the component must have very unique names to avoid conflicts.

This way it would also be possible to provide different (s)css themes to integrate ng2-iq-select2 with bootstrap, angular/material, primeng, etc.

saithis avatar Oct 05 '17 14:10 saithis

@saithis I know that but with custom stylesheet, I can't override inline styles without CSS !important

valeri879 avatar Oct 09 '17 09:10 valeri879

@valeri879 my comment was meant for @diegofsza. If the ng2-iq-select2 styles come in a separate (s)css file instead of being embedded into the component, then you could either extend the scss or throw it away and write your own. Thats how the above mentioned projects do it.

saithis avatar Oct 09 '17 12:10 saithis