feat(list-header): add ionic theme styles to ionic-link and labels (#29613)
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
5
core/src/components/item/item.ionic.vars.scss
Normal file
@@ -0,0 +1,5 @@
|
||||
/// @prop - Padding start for the item content
|
||||
$item-ionic-padding-start: globals.$ionic-space-400;
|
||||
|
||||
/// @prop - Padding end for the item content
|
||||
$item-ionic-padding-end: globals.$ionic-space-400;
|
||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
55
core/src/components/list-header/list-header.ionic.scss
Normal file
@@ -0,0 +1,55 @@
|
||||
@use "../../themes/ionic/ionic.globals.scss" as globals;
|
||||
@import "./list-header";
|
||||
@import "../item/item.ionic.vars";
|
||||
|
||||
:host {
|
||||
--background: transparent;
|
||||
|
||||
min-height: 58px;
|
||||
|
||||
font-size: globals.$ionic-font-size-350;
|
||||
|
||||
line-height: globals.$ionic-line-height-600;
|
||||
|
||||
/**
|
||||
* The focus rings from components like buttons and links
|
||||
* are being cut off. This style ensures that the focus ring
|
||||
* is completely visible.
|
||||
*/
|
||||
overflow: visible;
|
||||
|
||||
/* stylelint-disable */
|
||||
@include ltr() {
|
||||
padding-right: calc(var(--ion-safe-area-right, 0px) + #{$item-ionic-padding-end});
|
||||
padding-left: calc(var(--ion-safe-area-left, 0px) + #{$item-ionic-padding-start});
|
||||
}
|
||||
|
||||
@include rtl() {
|
||||
padding-right: calc(var(--ion-safe-area-right, 0px) + #{$item-ionic-padding-start});
|
||||
padding-left: calc(var(--ion-safe-area-left, 0px) + #{$item-ionic-padding-end});
|
||||
}
|
||||
/* stylelint-enable */
|
||||
}
|
||||
|
||||
// List Header: Slotted Components
|
||||
// --------------------------------------------------
|
||||
|
||||
// Label
|
||||
::slotted(ion-label) {
|
||||
--color: #{globals.$ionic-color-neutral-1200};
|
||||
|
||||
font-weight: globals.$ionic-font-weight-medium;
|
||||
}
|
||||
|
||||
::slotted(ion-label) ::slotted(p) {
|
||||
font-weight: globals.$ionic-font-weight-regular;
|
||||
}
|
||||
|
||||
// Link
|
||||
::slotted(a.ionic-link) {
|
||||
// Needs to be !important to override the default link color
|
||||
// that is set by the ionic theme at a global level.
|
||||
//
|
||||
/* stylelint-disable declaration-no-important */
|
||||
color: globals.$ionic-color-primary-base !important;
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import type { Color } from '../../interface';
|
||||
styleUrls: {
|
||||
ios: 'list-header.ios.scss',
|
||||
md: 'list-header.md.scss',
|
||||
ionic: 'list-header.md.scss',
|
||||
ionic: 'list-header.ionic.scss',
|
||||
},
|
||||
shadow: true,
|
||||
})
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
|
||||
/>
|
||||
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet" />
|
||||
<link href="../../../../../css/ionic/link.ionic.css" rel="stylesheet" />
|
||||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
|
||||
<script src="../../../../../scripts/testing/scripts.js"></script>
|
||||
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
|
||||
@@ -25,7 +26,10 @@
|
||||
<ion-content id="content">
|
||||
<ion-list>
|
||||
<ion-list-header lines="inset">
|
||||
<ion-label>With list + button</ion-label>
|
||||
<ion-label>
|
||||
Title
|
||||
<p>With list + button</p>
|
||||
</ion-label>
|
||||
<ion-button>Clear</ion-button>
|
||||
</ion-list-header>
|
||||
<ion-item lines="none">
|
||||
@@ -34,7 +38,22 @@
|
||||
</ion-list>
|
||||
<ion-list>
|
||||
<ion-list-header lines="inset">
|
||||
<ion-label>With list, no button</ion-label>
|
||||
<ion-label>
|
||||
Title
|
||||
<p>With list + link</p>
|
||||
</ion-label>
|
||||
<a class="ionic-link" href="#">Clear</a>
|
||||
</ion-list-header>
|
||||
<ion-item lines="none">
|
||||
<ion-label color="primary">List item</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
<ion-list>
|
||||
<ion-list-header lines="inset">
|
||||
<ion-label>
|
||||
Title
|
||||
<p>With list, no button, no link</p>
|
||||
</ion-label>
|
||||
</ion-list-header>
|
||||
<ion-item>
|
||||
<ion-label color="primary">List item</ion-label>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
configs().forEach(({ title, screenshot, config }) => {
|
||||
configs({ modes: ['ionic-md', 'md', 'ios'] }).forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('list-header: basic'), () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/list-header/test/basic`, config);
|
||||
@@ -18,7 +18,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
* make sure the safe area padding is applied only to that side
|
||||
* regardless of direction
|
||||
*/
|
||||
configs().forEach(({ title, screenshot, config }) => {
|
||||
configs({ modes: ['ionic-md', 'md', 'ios'] }).forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('list-header: basic'), () => {
|
||||
test.describe('safe area', () => {
|
||||
test('should have padding added by the safe area', async ({ page }) => {
|
||||
|
||||
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.4 KiB |