當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript DOM.injectStyles方法代碼示例

本文整理匯總了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;
   }
 }
開發者ID:aurelia,項目名稱:templating-resources,代碼行數:11,代碼來源:css-resource.ts

示例2: fixupCSSUrls

 .then(text => {
   text = fixupCSSUrls(this.address, text);
   this._scoped.css = text;
   if (this._global) {
     this._alreadyGloballyInjected = true;
     DOM.injectStyles(text);
   }
 });
開發者ID:aurelia,項目名稱:templating-resources,代碼行數:8,代碼來源:css-resource.ts

示例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);
 });
開發者ID:HIRANO-Satoshi,項目名稱:dialog,代碼行數:10,代碼來源:dialog-renderer.spec.ts

示例4: injectAureliaHideStyleAtHead

export function injectAureliaHideStyleAtHead() {
  DOM.injectStyles(aureliaHideClass);
}
開發者ID:aurelia,項目名稱:templating-resources,代碼行數:3,代碼來源:aurelia-hide-style.ts

示例5: injectAureliaHideStyleAtBoundary

export function injectAureliaHideStyleAtBoundary(domBoundary: any) {
  if (FEATURE.shadowDOM && domBoundary && !domBoundary.hasAureliaHideStyle) {
    domBoundary.hasAureliaHideStyle = true;
    DOM.injectStyles(aureliaHideClass, domBoundary);
  }
}
開發者ID:aurelia,項目名稱:templating-resources,代碼行數:6,代碼來源:aurelia-hide-style.ts


注:本文中的aurelia-pal.DOM.injectStyles方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。