本文整理匯總了TypeScript中aurelia-pal.DOM.injectStyles方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript DOM.injectStyles方法的具體用法?TypeScript DOM.injectStyles怎麽用?TypeScript DOM.injectStyles使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類aurelia-pal.DOM
的用法示例。
在下文中一共展示了DOM.injectStyles方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: beforeCompile
beforeCompile(content: DocumentFragment, resources: ViewResources, instruction: ViewCompileInstruction): void {
if (instruction.targetShadowDOM) {
DOM.injectStyles(this.css, content as any, true);
} else if (FEATURE.scopedCSS) {
let styleNode = DOM.injectStyles(this.css, content as any, true) as Element;
styleNode.setAttribute('scoped', 'scoped');
} else if (this._global && !this.owner._alreadyGloballyInjected) {
DOM.injectStyles(this.css);
this.owner._alreadyGloballyInjected = true;
}
}
示例2: fixupCSSUrls
.then(text => {
text = fixupCSSUrls(this.address, text);
this._scoped.css = text;
if (this._global) {
this._alreadyGloballyInjected = true;
DOM.injectStyles(text);
}
});
示例3: it
it('reports "true" for non zero duration transitions set in styles', () => {
const prefixes = ['-moz-', '-webkit-', '-o-', ''];
const transitionProperty = 'transition';
const testClass = 'transition-test-class';
// tslint:disable-next-line:max-line-length
const styles = `.${testClass} {${prefixes.map(prefix => `${prefix}${transitionProperty}: opacity .2s linear;`).join('')}}`;
DOM.injectStyles(styles);
element.classList.add(testClass);
expect(hasTransition(element)).toBe(true);
});
示例4: injectAureliaHideStyleAtHead
export function injectAureliaHideStyleAtHead() {
DOM.injectStyles(aureliaHideClass);
}
示例5: injectAureliaHideStyleAtBoundary
export function injectAureliaHideStyleAtBoundary(domBoundary: any) {
if (FEATURE.shadowDOM && domBoundary && !domBoundary.hasAureliaHideStyle) {
domBoundary.hasAureliaHideStyle = true;
DOM.injectStyles(aureliaHideClass, domBoundary);
}
}