feat(item): add styles for focus state in ionic theme (#29595)

Issue number: internal

---------

## What is the new behavior?
- Added scss for the focus state of `ion-item` for the Ionic theme
- Added item with class `ion-focused` to test page
- Added the ionic theme to the test page of item `states`

## Does this introduce a breaking change?
- [ ] Yes
- [x] No

## Other Information


[Preview](https://ionic-framework-git-rou-10782-ionic1.vercel.app/src/components/item/test/theme-ionic?ionic:theme=ionic)

---------

Co-authored-by: ionitron <hi@ionicframework.com>
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
This commit is contained in:
rug
2024-06-07 16:12:21 +02:00
committed by GitHub
parent 00a6b2dfbd
commit 00c8d5ec55
6 changed files with 25 additions and 1 deletions

View File

@@ -113,3 +113,17 @@
:host(.ion-activated) .item-native {
background: var(--background-activated);
}
// Item: Focused
// --------------------------------------------------
:host(.ion-focused) .item-native::after {
@include globals.position(0, 0, 0, 0);
position: absolute;
border-width: globals.$ionic-border-size-050;
border-style: globals.$ionic-border-style-solid;
border-color: globals.$ionic-state-focus-1;
content: "";
}

View File

@@ -4,7 +4,7 @@ import { configs, test } from '@utils/test/playwright';
/**
* This behavior does not vary across directions
*/
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
configs({ modes: ['ionic-md', 'ios', 'md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('item: states'), () => {
test('should not have visual regressions', async ({ page }) => {
await page.goto(`/src/components/item/test/states`, config);

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@@ -170,6 +170,16 @@
<p>Normal paragraph</p>
</ion-label>
</ion-item>
<ion-item-divider>
<ion-label>Item focused</ion-label>
</ion-item-divider>
<ion-item href="#" class="ion-focused">
<ion-label slot="start">Start</ion-label>
<ion-label>
<h1>Heading</h1>
<p>Normal paragraph</p>
</ion-label>
</ion-item>
</ion-content>
<ion-footer>