akveo / nebular

:boom: Customizable Angular UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/nebular
MIT License
8.06k stars 1.51k forks source link

How to change class style of overlay component such as nb-option-list, nb-option of NbAutocompleteComponent, etc? #2459

Open aksth opened 4 years ago

aksth commented 4 years ago

I want to change the style such as height, padding, justify-content, etc. of the <nb-option-list> and <nb-option> of the auto-complete component. I have a long list and the overlay options list's (<nb-option-list>) height is very large occupying everything below. I am also looking to change the padding and other properties of the individual option (<nb-option>). How can I achieve this? Since the overlay is created outside of the component scope, how can I control its style? Selector such as ::ng-deep is not achieving this too.

<nb-autocomplete
    #auto
    (selectedChange)="onSelectionChange($event)"
    [size]="'large'"
  >
    <nb-option
      *ngFor="let option of filteredOptions$ | async"
      [value]="option.name"
      class="country-select-option"
    >
      <span class="country-option-name">{{ option.name }}</span>
      <span class="country-option-dial">{{ option.dial }}</span>
    </nb-option>
</nb-autocomplete>

I want to change the style by using selector 'country-select-option' such as:

::ng-deep .country-select-option {
      justify-content: space-between;
  }

How to make it work? This can be done if I use the style property directly in the HTML. But is there a CSS/SCSS way?

aksth commented 4 years ago

@outstandyy @yggg

Tatametheus commented 4 years ago

I want to know it too!

swbradshaw commented 3 years ago

I would like to know as well. I really want to expand the width of the nb-options, and don't see any way to do this.

Tharrington86 commented 2 years ago

Was this ever resolved? I am trying to accomplish something similar and I am unable to overcome this.

jesuscc98 commented 7 months ago

same here.