prepareTemplate(template, elementName, typeExtension) {
    if (template._prepared) {
      return;
    }
    template._prepared = true;
    template.name = elementName;
    template.extends = typeExtension;
    templateMap[elementName] = template;
    let cssBuild = this._getCssBuild(template);
    let cssText = this._gatherStyles(template);
    let info = {
      is: elementName,
      extends: typeExtension,
      __cssBuild: cssBuild,
    };
    if (!nativeShadow) {
      StyleTransformer.dom(template.content, elementName);
    }
    // check if the styling has mixin definitions or uses
    this._ensure();
    let hasMixins = detectMixin(cssText)
    let ast = parse(cssText);
    // only run the applyshim transforms if there is a mixin involved
    if (hasMixins && nativeCssVariables && this._applyShim) {
      this._applyShim['transformRules'](ast, elementName);
    }
    template['_styleAst'] = ast;
    template._cssBuild = cssBuild;

    let ownPropertyNames = [];
    if (!nativeCssVariables) {
      ownPropertyNames = StyleProperties.decorateStyles(template['_styleAst']);
    }
    if (!ownPropertyNames.length || nativeCssVariables) {
      let root = nativeShadow ? template.content : null;
      let placeholder = placeholderMap[elementName];
      let style = this._generateStaticStyle(info, template['_styleAst'], root, placeholder);
      template._style = style;
    }
    template._ownPropertyNames = ownPropertyNames;
  }
/**
   * Prepare the styling and template for the given element type
   *
   * @param {HTMLTemplateElement} template
   * @param {string} elementName
   * @param {string=} typeExtension
   */
Prepare the styling and template for the given element type
@param {HTMLTemplateElement} template
@param {string} elementName
@param {string=} typeExtension
Prepare the styling and template for the given element type @param { HTMLTemplateElement } template @param { string } elementName @param { string = } typeExtension
prepareTemplate(template, elementName, typeExtension) {
    if (template._prepared) {
      return;
    }
    template._prepared = true;
    template.name = elementName;
    template.extends = typeExtension;
    templateMap[elementName] = template;
    let cssBuild = this._getCssBuild(template);
    let cssText = this._gatherStyles(template);
    let info = {
      is: elementName,
      extends: typeExtension,
      __cssBuild: cssBuild,
    };
    if (!nativeShadow) {
      StyleTransformer.dom(template.content, elementName);
    }
    this._ensure();
    let hasMixins = detectMixin(cssText)
    let ast = parse(cssText);
    if (hasMixins && nativeCssVariables && this._applyShim) {
      this._applyShim['transformRules'](ast, elementName);
    }
    template['_styleAst'] = ast;
    template._cssBuild = cssBuild;
    let ownPropertyNames = [];
    if (!nativeCssVariables) {
      ownPropertyNames = StyleProperties.decorateStyles(template['_styleAst']);
    }
    if (!ownPropertyNames.length || nativeCssVariables) {
      let root = nativeShadow ? template.content : null;
      let placeholder = placeholderMap[elementName];
      let style = this._generateStaticStyle(info, template['_styleAst'], root, placeholder);
      template._style = style;
    }
    template._ownPropertyNames = ownPropertyNames;
  }
prepareTemplate ( template , elementName , typeExtension ) { if ( template . _prepared ) { return ; } template . _prepared = true ; template . name = elementName ; template . extends = typeExtension ; templateMap [ elementName ] = template ; let cssBuild = this . _getCssBuild ( template ) ; let cssText = this . _gatherStyles ( template ) ; let info = { is : elementName , extends : typeExtension , __cssBuild : cssBuild , } ; if ( ! nativeShadow ) { StyleTransformer . dom ( template . content , elementName ) ; } this . _ensure ( ) ; let hasMixins = detectMixin ( cssText ) let ast = parse ( cssText ) ; if ( hasMixins && nativeCssVariables && this . _applyShim ) { this . _applyShim [ 'transformRules' ] ( ast , elementName ) ; } template [ '_styleAst' ] = ast ; template . _cssBuild = cssBuild ; let ownPropertyNames = [ ] ; if ( ! nativeCssVariables ) { ownPropertyNames = StyleProperties . decorateStyles ( template [ '_styleAst' ] ) ; } if ( ! ownPropertyNames . length || nativeCssVariables ) { let root = nativeShadow ? template . content : null ; let placeholder = placeholderMap [ elementName ] ; let style = this . _generateStaticStyle ( info , template [ '_styleAst' ] , root , placeholder ) ; template . _style = style ; } template . _ownPropertyNames = ownPropertyNames ; }
Prepare the styling and template for the given element type
 @param {HTMLTemplateElement} template
 @param {string} elementName
 @param {string=} typeExtension
Prepare the styling and template for the given element type @param { HTMLTemplateElement } template @param { string } elementName @param { string = } typeExtension
// check if the styling has mixin definitions or uses // only run the applyshim transforms if there is a mixin involved