Skip to content

bug: "ion-no-padding" does not work, until "!important" (ion-list) #22266

@infacto

Description

@infacto

Bug Report

Ionic version:
5.3.2

Current behavior:

Adding the class name ion-no-padding has not effect. It's overwritten by .list-md (padding-top, padding-bottom).

Expected behavior:
ion-no-padding should work on ion-list. Remove the padding.

Steps to reproduce:
Use the ion-list with ion-no-padding. See that the padding is not removed.

Related code:

<ion-content>
  <ion-list class="ion-no-padding">
    <ion-item-group>
      <ion-item-divider sticky><ion-label>Demo</ion-label></ion-item-divider>
      <ion-item>
        <ion-icon name="bug"slot="start"></ion-icon>
        <ion-label>Demo</ion-label>
      </ion-item>
    </ion-item-group>
  </ion-list>
</ion-content>

Chrome inspect:
image

You can see that the .md-list is dominant. .ion-no-padding should have !important.

image

Maybe it has to do with the order of css load. I cannot reproduce in Stackblitz. But I have nothing special in my workspace. I going insane, what's wrong? Any idea? Should we use !important? ... I have no other custom styles on it. I have no idea. It's weird. Any guess may help. ↓ Demo project below. ↓

image

Ionic info:
Ionic Angular (without Ionic CLI)

Demo Project

(I cannot reproduce it in Stackblitz) So please download this zip. It's a minimalist project (Angular Multi-App).
Download issue-demo.zip
Use ng serve --project=demo-app to run this app.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions