Skip to content
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

Css customization #48

Open
valeri879 opened this issue Sep 29, 2017 · 6 comments
Open

Css customization #48

valeri879 opened this issue Sep 29, 2017 · 6 comments

Comments

@valeri879
Copy link

I can't customize css inline styles

@diegofsza
Copy link
Member

diegofsza commented Oct 4, 2017

What are you precisely trying to do?

@valeri879
Copy link
Author

For ex. change border color or shadows

@diegofsza
Copy link
Member

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.

@saithis
Copy link
Collaborator

saithis commented Oct 5, 2017

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.

@valeri879
Copy link
Author

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

@saithis
Copy link
Collaborator

saithis commented Oct 9, 2017

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants