question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sorry if this is more a support question but I need to override the component css. What would be the best approach in combination with Bootstrap I tried this…

   .ng-select  {
            border:0px;
            min-height: 0px;
            border-radius: 0;
        }
        .ng-control  {            
            min-height: 0px;
            border-radius: 0;
        }
        :host-context(.selectcustom) .ng-control {                    
            min-height: 0px;
            border-radius: 0;
        }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
marina-ferreiracommented, Jan 16, 2019

If you are using ViewEncapsulation, your should use special ::ng-deep selector which will prevent scoping for nested selectors.

.ng-select.custom ::ng-deep .ng-select-container  {            
    min-height: 0px;
    border-radius: 0;
}

https://www.npmjs.com/package/@ng-select/ng-select

4reactions
varnastadeuscommented, Dec 5, 2017

I think best approach would be adding custom class on ng-select and then applying your own styles. Try this:

<ng-select class="custom"></ng-select>
.ng-select.custom {
    border:0px;
    min-height: 0px;
    border-radius: 0;
}
.ng-select.custom .ng-control  {            
    min-height: 0px;
    border-radius: 0;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Override CSS Styles - W3docs
Example of overriding CSS style with the Class selector: ... Here, the Class selector overrode the ID selector because it was the last...
Read more >
CSS Overriding Variables - W3Schools
Override Global Variable With Local Variable. From the previous page we have learned that global variables can be accessed/used through the entire document, ......
Read more >
How to override the properties of a CSS class using another ...
You should override by increasing Specificity of your styling. There are different ways of increasing the Specificity. Usage of ...
Read more >
Specificity - CSS: Cascading Style Sheets - MDN Web Docs
The only way to override inline styles is by using !important . Many JavaScript frameworks and libraries add inline styles. Using !important ...
Read more >
How to override CSS style from another style
The order of specificity preference when overriding a CSS style. When multiple CSS rules reference the same HTML element, the browser needs ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found