code: function getAncestorThemeName(component) {
    if (!component) {
      return null;
    }
  
    let name = component.mdTheme;
  
    if (!name && component.$options._componentTag === 'md-theme') {
      name = component.mdName;
    }
  
    return name || getAncestorThemeName(component.$parent);
  }
docs: Grab the closest ancestor component's `md-theme` attribute OR grab the `md-name` attribute from an `<md-theme>` component.