refactor(item, list): use the same background color (#29739)

This commit is contained in:
Maria Hutt
2024-07-31 08:16:41 -07:00
committed by GitHub
parent 25e765d1f0
commit 196a7bf1b9
42 changed files with 21 additions and 12 deletions

View File

@ -75,7 +75,7 @@
</ion-label> </ion-label>
</ion-item> </ion-item>
<ion-item-options side="start" class="sliding-enabled"> <ion-item-options side="start" class="sliding-enabled">
<ion-item-option color="secondary" expandable> <ion-item-option color="primary" expandable>
<ion-icon slot="start" name="checkmark"></ion-icon> <ion-icon slot="start" name="checkmark"></ion-icon>
Unread Unread
</ion-item-option> </ion-item-option>
@ -105,7 +105,7 @@
<ion-icon slot="start" name="checkmark"></ion-icon> <ion-icon slot="start" name="checkmark"></ion-icon>
Btn 1 Btn 1
</ion-item-option> </ion-item-option>
<ion-item-option color="secondary" expandable> <ion-item-option color="primary" expandable>
<ion-icon slot="start" name="checkmark"></ion-icon> <ion-icon slot="start" name="checkmark"></ion-icon>
Btn 2 Btn 2
</ion-item-option> </ion-item-option>
@ -124,7 +124,7 @@
<ion-icon slot="start" name="mail"></ion-icon> <ion-icon slot="start" name="mail"></ion-icon>
Btn 5 Btn 5
</ion-item-option> </ion-item-option>
<ion-item-option color="secondary" expandable> <ion-item-option color="primary" expandable>
<ion-icon slot="start" name="mail"></ion-icon> <ion-icon slot="start" name="mail"></ion-icon>
Btn 6 Btn 6
</ion-item-option> </ion-item-option>

View File

@ -8,7 +8,7 @@ import { configs, dragElementBy, test } from '@utils/test/playwright';
* It is important to test all modes to ensure that the * It is important to test all modes to ensure that the
* child components are being rendered correctly. * child components are being rendered correctly.
*/ */
configs().forEach(({ title, screenshot, config }) => { configs({ modes: ['ios', 'md', 'ionic-md'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('item-sliding: basic'), () => { test.describe(title('item-sliding: basic'), () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
await page.goto(`/src/components/item-sliding/test/basic`, config); await page.goto(`/src/components/item-sliding/test/basic`, config);
@ -105,7 +105,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
* make sure the safe area padding is applied only to that side * make sure the safe area padding is applied only to that side
* regardless of direction * regardless of direction
*/ */
configs().forEach(({ title, screenshot, config }) => { configs({ modes: ['ios', 'md', 'ionic-md'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('item-sliding: basic'), () => { test.describe(title('item-sliding: basic'), () => {
test.describe('safe area left', () => { test.describe('safe area left', () => {
test('should have padding on the left only', async ({ page }) => { test('should have padding on the left only', async ({ page }) => {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -1,11 +1,12 @@
@use "./item.common";
@use "../../themes/ionic/ionic.globals.scss" as globals; @use "../../themes/ionic/ionic.globals.scss" as globals;
@use "./item.common";
@use "./item.ionic.vars" as vars;
// Item // Item
// -------------------------------------------------- // --------------------------------------------------
:host { :host {
--background: #{globals.$ionic-color-base-white}; --background: #{vars.$item-ionic-background};
--background-activated: #{globals.$ionic-color-neutral-200}; --background-activated: #{globals.$ionic-color-neutral-200};
--border-color: #{globals.$ionic-color-neutral-300}; --border-color: #{globals.$ionic-color-neutral-300};
--border-style: #{globals.$ionic-border-style-solid}; --border-style: #{globals.$ionic-border-style-solid};

View File

@ -1,5 +1,10 @@
@use "../../themes/ionic/ionic.globals.scss" as globals;
/// @prop - Padding start for the item content /// @prop - Padding start for the item content
$item-ionic-padding-start: globals.$ionic-space-400; $item-ionic-padding-start: globals.$ionic-space-400;
/// @prop - Padding end for the item content /// @prop - Padding end for the item content
$item-ionic-padding-end: globals.$ionic-space-400; $item-ionic-padding-end: globals.$ionic-space-400;
/// @prop - Background color for the item content
$item-ionic-background: globals.$ionic-color-base-white;

View File

@ -1,6 +1,6 @@
@use "../../themes/ionic/ionic.globals.scss" as globals; @use "../../themes/ionic/ionic.globals.scss" as globals;
@use "../item/item.ionic.vars" as itemVars;
@import "./list-header"; @import "./list-header";
@import "../item/item.ionic.vars";
:host { :host {
--background: transparent; --background: transparent;
@ -20,13 +20,13 @@
/* stylelint-disable */ /* stylelint-disable */
@include ltr() { @include ltr() {
padding-right: calc(var(--ion-safe-area-right, 0px) + #{$item-ionic-padding-end}); padding-right: calc(var(--ion-safe-area-right, 0px) + #{itemVars.$item-ionic-padding-end});
padding-left: calc(var(--ion-safe-area-left, 0px) + #{$item-ionic-padding-start}); padding-left: calc(var(--ion-safe-area-left, 0px) + #{itemVars.$item-ionic-padding-start});
} }
@include rtl() { @include rtl() {
padding-right: calc(var(--ion-safe-area-right, 0px) + #{$item-ionic-padding-start}); padding-right: calc(var(--ion-safe-area-right, 0px) + #{itemVars.$item-ionic-padding-start});
padding-left: calc(var(--ion-safe-area-left, 0px) + #{$item-ionic-padding-end}); padding-left: calc(var(--ion-safe-area-left, 0px) + #{itemVars.$item-ionic-padding-end});
} }
/* stylelint-enable */ /* stylelint-enable */
} }

View File

@ -1,4 +1,5 @@
@use "../../themes/ionic/ionic.globals.scss" as globals; @use "../../themes/ionic/ionic.globals.scss" as globals;
@use "../item/item.ionic.vars" as itemVars;
@import "./list.ionic.vars.scss"; @import "./list.ionic.vars.scss";
// Ionic List // Ionic List
@ -10,6 +11,8 @@ ion-list {
display: block; display: block;
background: #{itemVars.$item-ionic-background};
contain: content; contain: content;
list-style-type: none; list-style-type: none;
} }