mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
fix(components): include mode classes on components for use in shadow (#17838)
- removes mode-less component classes from the internal CSS, use element instead - adds mode specific classes `md` or `ios` for styling inside of shadow components - adds e2e test that verifies mode classes exist on all ionic components, plus checks for specific classes that the components need for internal styling fixes #17608
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { Component, ComponentInterface, Element, Event, EventEmitter, Method, Prop } from '@stencil/core';
|
||||
|
||||
import { Side } from '../../interface';
|
||||
import { Mode, Side } from '../../interface';
|
||||
import { isEndSide } from '../../utils/helpers';
|
||||
|
||||
@Component({
|
||||
@ -11,6 +11,8 @@ import { isEndSide } from '../../utils/helpers';
|
||||
}
|
||||
})
|
||||
export class ItemOptions implements ComponentInterface {
|
||||
mode!: Mode;
|
||||
|
||||
@Element() el!: HTMLElement;
|
||||
|
||||
@Prop({ context: 'window' }) win!: Window;
|
||||
@ -38,6 +40,11 @@ export class ItemOptions implements ComponentInterface {
|
||||
const isEnd = isEndSide(this.win, this.side);
|
||||
return {
|
||||
class: {
|
||||
[`${this.mode}`]: true,
|
||||
|
||||
// Used internally for styling
|
||||
[`item-options-${this.mode}`]: true,
|
||||
|
||||
'item-options-start': !isEnd,
|
||||
'item-options-end': isEnd
|
||||
}
|
||||
|
Reference in New Issue
Block a user