How to use the @stencil/core.getMode function in @stencil/core

To help you get started, we’ve selected a few @stencil/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ionic-team / stencil / test / karma / test-app / shadow-dom-mode / cmp.tsx View on Github external
import { Component, h, getMode } from '@stencil/core';

/**
 * @virtualProp {string} colormode - The mode determines which platform styles to use.
 */
@Component({
  tag: 'shadow-dom-mode',
  styleUrls: {
    blue: 'mode-blue.css',
    red: 'mode-red.css'
  },
  shadow: true
})
export class ShadowDomMode {

  private mode = getMode(this);

  render() {
    return <div>{this.mode}</div>;
  }
}
github ionic-team / ionic / core / src / global / ionic-global.ts View on Github external
export const getIonMode = (ref?: any): Mode => {
  return (ref && getMode(ref)) || defaultMode;
};