mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-06 22:29:44 +08:00
feat(item): add styles for disabled state in ionic theme (#29583)
Issue number: internal --------- ## What is the new behavior? - Added scss for the disabled state of `ion-item` for the Ionic theme - Added disabled elements to test page ## Does this introduce a breaking change? - [ ] Yes - [x] No --------- Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com> Co-authored-by: ionitron <hi@ionicframework.com> Co-authored-by: Brandy Carney <brandyscarney@gmail.com>
This commit is contained in:
@ -91,9 +91,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Item: Disabled
|
||||||
|
// --------------------------------------------------
|
||||||
|
:host(.item-disabled) {
|
||||||
|
cursor: default;
|
||||||
|
pointer-events: none;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
@include globals.position(0, 0, 0, 0);
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
|
||||||
|
background: #{globals.$ionic-state-disabled};
|
||||||
|
|
||||||
|
content: "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Item: Activated
|
// Item: Activated
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
:host(.ion-activated) .item-native {
|
:host(.ion-activated) .item-native {
|
||||||
background: var(--background-activated);
|
background: var(--background-activated);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { configs, test } from '@utils/test/playwright';
|
|||||||
/**
|
/**
|
||||||
* This behavior does not vary across directions
|
* This behavior does not vary across directions
|
||||||
*/
|
*/
|
||||||
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
configs({ modes: ['ionic-md', 'md', 'ios'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
||||||
test.describe(title('item: disabled state'), () => {
|
test.describe(title('item: disabled state'), () => {
|
||||||
test('should not have visual regressions', async ({ page }) => {
|
test('should not have visual regressions', async ({ page }) => {
|
||||||
await page.goto(`/src/components/item/test/disabled`, config);
|
await page.goto(`/src/components/item/test/disabled`, config);
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@ -134,14 +134,6 @@
|
|||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
||||||
<ion-item>
|
|
||||||
<ion-label>
|
|
||||||
<h1>Heading</h1>
|
|
||||||
<p>Normal paragraph</p>
|
|
||||||
</ion-label>
|
|
||||||
<ion-button slot="end" fill="outline">Outline</ion-button>
|
|
||||||
</ion-item>
|
|
||||||
|
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label slot="start">Start</ion-label>
|
<ion-label slot="start">Start</ion-label>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
@ -150,13 +142,23 @@
|
|||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
||||||
<ion-item>
|
<ion-text color="primary">
|
||||||
|
<h2>Disabled Item</h2>
|
||||||
|
</ion-text>
|
||||||
|
|
||||||
|
<ion-item disabled>
|
||||||
|
<ion-label>
|
||||||
|
<h1>Heading</h1>
|
||||||
|
<p>Normal paragraph</p>
|
||||||
|
</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item disabled>
|
||||||
<ion-label slot="start">Start</ion-label>
|
<ion-label slot="start">Start</ion-label>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<h1>Heading</h1>
|
<h1>Heading</h1>
|
||||||
<p>Normal paragraph</p>
|
<p>Normal paragraph</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
<ion-button slot="end" fill="outline">Outline</ion-button>
|
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item-divider>
|
<ion-item-divider>
|
||||||
<ion-label>Item activatable</ion-label>
|
<ion-label>Item activatable</ion-label>
|
||||||
|
|||||||
Reference in New Issue
Block a user