Any way to disable the default styles completely?
See original GitHub issuePlease fill below information if issuing a bug report.
Expected behaviour
I’m not using Bootstrap. I’m not using Material Design. I’d expect to be able to completely style ng-select without having to worry about overriding default styles (some with deeply nested classes).
Actual behaviour
The plugin seems to inject a style
tag on the head
of the page enforcing some default styles.
The docs says: If you are not happy with default styles you can **easily override them** with increased selector specificity.
. This is fine if we just need to change a few minor details, but if we need something quite different, then it’s quite frustrating to have to reset/override everything.
More Info
ng-select version: latest
browser: Chrome
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Reset/remove CSS styles for element only - Stack Overflow
No, such a thing does not exist. Once an element has received a certain CSS style via a rule, it can not be...
Read more >How to remove default block styles - Full Site Editing
To remove a block style from the front of the website, you can use wp_dequeue_style() with wp_enqueue_scripts(). The style handle to remove is...
Read more >Remove all styling with one line of CSS - YouTube
Happy Friday! To celebrate the coming weekend, let's learn how we can remove all styling from an element with a single line of...
Read more >How to reset/remove CSS styles for element ? - GeeksforGeeks
Example 1: Here you will see how to use unset property by HTML and CSS. This example remove only the default browser style....
Read more >How to Disable Website CSS Style (Chrome, Firefox, Edge, ...)
View Webpage With “No Style” Menu Option, Firefox, All Styles (only), Easy ; Disable All CSS of a Specific Element, All Browsers, All...
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 FreeTop 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
Top GitHub Comments
Best approach should be. Instead of adding CSS by default in Head>Style tag why can’t ng-select refer to css/scss file so that if we need customization we can go and change css/scss file. Right now it is hardcoded and appended into head as style tag that is incorrect. If you append it to Style tag this becomes inline style which has 1st priority and it becomes difficult to change as this is hardcoded in the ng-select package.
hi @anjmao thank you for the quick reply.
Yes, that’s what I ended up doing (
@ng-select/ng-select/themes/default.theme.css
, converted to.scss
and adjusted as needed).While doing that, I kinda understood the reasons for the
<style>
added to the<head>
, ie.: required styles for.ng-dropdown-panel
and.ng-overlay-container
.I got there because the
z-index
set for.ng-dropdown-panel
,.ng-overlay-container
and.ng-overlay
were higher than a fixed nav that we have on the project, which caused problems.I’m not sure yet, but it may be better to have all these styles grouped together, in a single place, for discoverability purposes.