mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(components): apply translucent if backdrop-filter is supported (#18832)
This updates the components and the docs so that translucent is only applied when backdrop filter is supported, this prevents it from being applied when viewing iOS in Chrome, for example. closes ionic-team/ionic-docs#666
This commit is contained in:
@ -8,7 +8,9 @@
|
||||
@include padding($card-ios-header-padding-top, $card-ios-header-padding-end, $card-ios-header-padding-bottom, $card-ios-header-padding-start);
|
||||
}
|
||||
|
||||
:host(.card-header-translucent) {
|
||||
background-color: $card-ios-header-translucent-background-color;
|
||||
backdrop-filter: $card-ios-header-translucent-filter;
|
||||
}
|
||||
@supports (backdrop-filter: blur(0)) {
|
||||
:host(.card-header-translucent) {
|
||||
background-color: $card-ios-header-translucent-background-color;
|
||||
backdrop-filter: $card-ios-header-translucent-filter;
|
||||
}
|
||||
}
|
||||
@ -25,6 +25,8 @@ export class CardHeader implements ComponentInterface {
|
||||
|
||||
/**
|
||||
* If `true`, the card header will be translucent.
|
||||
* Only applies when the mode is `"ios"` and the device supports
|
||||
* [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility).
|
||||
*/
|
||||
@Prop() translucent = false;
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
| ------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ----------- |
|
||||
| `color` | `color` | The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics). | `string \| undefined` | `undefined` |
|
||||
| `mode` | `mode` | The mode determines which platform styles to use. | `"ios" \| "md"` | `undefined` |
|
||||
| `translucent` | `translucent` | If `true`, the card header will be translucent. | `boolean` | `false` |
|
||||
| `translucent` | `translucent` | If `true`, the card header will be translucent. Only applies when the mode is `"ios"` and the device supports [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility). | `boolean` | `false` |
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user