cannot customize style of ng-select in Angular
See original GitHub issueHi. I try to change the style of (ng-select) . I paste the revised style to the component style where ng-select is located.
ng-select > div {
border: 0!important;
outline: none;
}
ng-select > div > div.single > div.toggle {
color: #2ebaee!important;
}
ng-select > div > div.single > div.placeholder {
text-align: center;
}
select-dropdown > div .filter {
display: none;
}
But it does not work. I inspect element on developer tools and see no my revised style. Interesting is when I paste the style to Angular Global stlye.scss . It works but it does not suit my me because it overrides all ng-select in my project. How to achieve changing design of ng-select in component? Thanks in advance!
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
How to customize css for ng-select in angular? - Stack Overflow
I want to change the bottom border color when the select is opened by using ::ng-deep selector on ng-select. Thanks. css · angular...
Read more >Can't change the style of .ng-select-container #1474 - GitHub
You can't override the style of .ng-select-container in a components stylesheet. I took a look at #718, but I am pretty sure my...
Read more >SelectControlValueAccessor - Angular
Customizing option selectionlink. Angular uses object identity to select option. It's possible for the identities of items to change while the data does...
Read more >Angular ng-select custom label cannot be click - StackBlitz
<p>Custom dropdown panel option template. using <b>ng-option-tmp</b></p>. <p>Last clicked: {{itemClicked}}</p>. <ng-select. [items]="cities".
Read more >ng-select How to programmatically set a value
Topic: ng-select How to programmatically set a value ? ... Hope it fix your problem. ... import { Component, ViewChild } from '@angular/core';...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
solved this problem by adding a class to ng-select such as custom. Then in styles.scss
So again you need add those style to global styles.scss but this time it does not overwrite all ng-selects.
Using
::ng-deep
in parent component should work: For example, adding box-shadow on focus:However, I’m still wondering if is there any better approach for customizing the style.