How to remove the padding on a dropdown-menu

Viewed 6139

I am looking for a way to remove a padding on "dropdown-menu" <ul> tag when the list is empty, so nothing shows instead of narrow space corresponding to the padding. I don't want to do .dropdown{padding: 0}, because it will remove the necessary padding when it's not empty. But .dropdown:empty{padding:0} doesn't work since the content is not empty, only filtered by an *ngIf (I guess, though I know that Angular removes the element from the DOM).

<ul role="menu" class="dropdown-menu">
    <li *ngFor="let option of options">
      <span *ngIf="option.condition;then template1 else template2">
      </span>
      <ng-template #template1>some content</ng-template>
      <ng-template #template2>some content</ng-template>
  </li>
</ul>
1 Answers
Related