ionic-team / ionic-team/ionic-framework

bug: top padding incorrectly cleared on ion-card-content

Đang mở
#24,808 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
package: core type: bug
Ngôn ngữ chính
TypeScript
Star
52.7k
Fork
13.3k
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
51

Mô tả

### Prerequisites

- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#creating-an-issue).
- [X] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [X] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.

### Ionic Framework Version

- [ ] v4.x
- [ ] v5.x
- [X] v6.x

### Current Behavior

When an `ion-card-content` immediately follows an `ion-card-header`, its `padding-top` is removed to avoid excess vertical space between the header text and content (via CSS in [card-content.md.scss](https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/card-content/card-content.md.scss#L48) and [card-content.ios.scss](https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/card-content/card-content.ios.scss#L45)).

This works well if both have the same background colour, but when one of them has its `Color` property set, the lack of padding between the content text and the coloured background looks wrong:

![image](https://user-images.githubusercontent.com/1843264/154475834-8a880940-cbe5-41b3-aa06-e1a7fde24c62.png)

### Expected Behavior

Ideally, leave the default padding if the background colour of the header and content are different:

![image](https://user-images.githubusercontent.com/1843264/154476373-4d82307d-af70-4b90-a3f3-0020cae7925f.png)

In practical terms, it would probably be acceptable if, say, the padding is only cleared if the header does not have its `color` attribute set, e.g.

``` css
ion-card-header:not([color]) + .card-content-ios {
padding-top: 0;
}
```

### Steps to Reproduce

Create a simple page with the following HTML:

``` html



Something Is Rotten


...in the state of Denmark!

```

### Code Reproduction URL

_No response_

### Ionic Info

Ionic:

Ionic CLI : 6.18.1 (C:\Users\David\AppData\Roaming\nvm\v16.13.0\node_modules\@ionic\cli)
Ionic Framework : @ionic/angular 6.0.5
@angular-devkit/build-angular : 13.2.2
@angular-devkit/schematics : 13.2.2
@angular/cli : 13.2.2
@ionic/angular-toolkit : 6.0.0

Capacitor:

Capacitor CLI : 3.4.0
@capacitor/android : 3.4.0
@capacitor/core : 3.4.0
@capacitor/ios : 3.4.0

Utility:

cordova-res : not installed globally
native-run : 1.5.0

System:

NodeJS : v16.13.0 (C:\Program Files\nodejs\node.exe)
npm : 8.1.0
OS : Windows 10

### Additional Information

_No response_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.