-
-
Notifications
You must be signed in to change notification settings - Fork 902
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
Feature: Have an API to allow developers to add extra class names to customise look and feel and reuse styles #434
Comments
Hi @classicmike, I guess ngx-datatable adds rowClass so you can add custom styling for rows. But adding custom classes for different internal html parts sounds like a not the best idea because you can do the following:
|
Hey @anjmao thanks for your reply, I guess it seems like what you're advocating is overriding the default theme and use the selectors you have available through CSS. I guess I'll probably have to live with that for now but the duplication in the CSS properties is essentially what I wanted to avoid all along. Anyway just going to put the example scenario down anyway just for some thought: The scenario would be I have my component library of CSS styles, which is then consumed by product A, an angular app. Currently my component library, for example, would have a set of styles as follows(Not my proper styles, Only demo purposes):
Now in Product A, I would then have to style the ng-selects as follows:
As you can see, I will have to repeat those styles again. Anyway, it is what it is, thanks for your feedback. |
It is make sense to add new Input |
* feat: transfer classes to dropdown-panel closes ng-select#434, closes ng-select#476
Just to give a little context. I'm currently implementing a CSS components library that will have a predefined set of css styles that developers can use and reuse.
Your select dropdown library seems to address most of our requirements but I would like to see if this feature request could be part of your roadmap.
As far as I know you have these css classes such as .ng-option, .ng-option-label.
It would be nice if the ng-select component provides an API that would allow me to inject some CSS classes as Angular @input() parameters. This would add these classes to specific parts of the component such as options, labels, tags input elements, to further customise our dropdowns.
One example of this is Swimlane's ngx data-table allows us add rowClass as part of their @input() to further customise the data-table's row. E.g: https://github.com/swimlane/ngx-datatable/blob/master/demo/basic/css.component.ts
Benefits:
Here's what I envison the code to look like after the change:
<ng-select class="custom-select" [(ngModel)]="selectedUserIds" [items]="item" dropdownClass="dropdown" dropdownOptionClass="dropdown-item"....></ng-select>
If you can let me know on your 2 cents on it and perhaps that would be great.
Thanks.
The text was updated successfully, but these errors were encountered: