mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 15:51:16 +08:00
feat(base-components): add ability to remove ios and md theme (#26669)
This commit is contained in:
@ -23,6 +23,7 @@
|
||||
--width: auto;
|
||||
--min-height: auto;
|
||||
--height: auto;
|
||||
--backdrop-opacity: 0;
|
||||
|
||||
@include font-smoothing();
|
||||
@include position(0, 0, 0, 0);
|
||||
|
||||
@ -2,7 +2,7 @@ import type { ComponentInterface, EventEmitter } from '@stencil/core';
|
||||
import { Watch, Component, Element, Event, Host, Method, Prop, h } from '@stencil/core';
|
||||
|
||||
import { config } from '../../global/config';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { getIonStylesheet, getIonBehavior } from '../../global/ionic-global';
|
||||
import type {
|
||||
AnimationBuilder,
|
||||
FrameworkDelegate,
|
||||
@ -32,11 +32,13 @@ import { mdLeaveAnimation } from './animations/md.leave';
|
||||
// TODO(FW-2832): types
|
||||
|
||||
/**
|
||||
* @virtualProp {true | false} useBase - useBase determines if base components is enabled.
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
||||
*/
|
||||
@Component({
|
||||
tag: 'ion-loading',
|
||||
styleUrls: {
|
||||
base: 'loading.scss',
|
||||
ios: 'loading.ios.scss',
|
||||
md: 'loading.md.scss',
|
||||
},
|
||||
@ -206,8 +208,8 @@ export class Loading implements ComponentInterface, OverlayInterface {
|
||||
|
||||
componentWillLoad() {
|
||||
if (this.spinner === undefined) {
|
||||
const mode = getIonMode(this);
|
||||
this.spinner = config.get('loadingSpinner', config.get('spinner', mode === 'ios' ? 'lines' : 'crescent'));
|
||||
const platform = getIonBehavior(this);
|
||||
this.spinner = config.get('loadingSpinner', config.get('spinner', platform === 'ios' ? 'lines' : 'crescent'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -302,14 +304,13 @@ export class Loading implements ComponentInterface, OverlayInterface {
|
||||
|
||||
render() {
|
||||
const { message, spinner, htmlAttributes, overlayIndex } = this;
|
||||
const mode = getIonMode(this);
|
||||
const mode = getIonStylesheet(this);
|
||||
const msgId = `loading-${overlayIndex}-msg`;
|
||||
/**
|
||||
* If the message is defined, use that as the label.
|
||||
* Otherwise, don't set aria-labelledby.
|
||||
*/
|
||||
const ariaLabelledBy = message !== undefined ? msgId : null;
|
||||
|
||||
return (
|
||||
<Host
|
||||
role="dialog"
|
||||
|
||||
Reference in New Issue
Block a user