How to use the emotion.injectGlobal function in emotion

To help you get started, we’ve selected a few emotion 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 patternfly / patternfly-react / packages / patternfly-4 / react-docs / src / layouts / example.js View on Github external
import PropTypes from 'prop-types';
import { withPrefix } from 'gatsby-link';

// This is a gatsby limitation will be fixed in newer version
let globalStyles = require(`!raw-loader!@patternfly/react-core/../dist/styles/base.css`);
globalStyles = globalStyles.replace(/\.\/assets\//g, withPrefix('/assets/'));
const localStyles = require(`!raw-loader!./index.css`);
import { injectGlobal } from 'emotion';

injectGlobal(globalStyles);
injectGlobal(localStyles);

const propTypes = {
  children: PropTypes.func.isRequired
};

const Layout = ({ children }) => children();

Layout.propTypes = propTypes;

export default Layout;
github patternfly / patternfly-react / packages / patternfly-4 / react-docs / src / layouts / example.js View on Github external
import PropTypes from 'prop-types';
import { withPrefix } from 'gatsby-link';

// This is a gatsby limitation will be fixed in newer version
let globalStyles = require(`!raw-loader!@patternfly/react-core/../dist/styles/base.css`);
globalStyles = globalStyles.replace(/\.\/assets\//g, withPrefix('/assets/'));
const localStyles = require(`!raw-loader!./index.css`);
import { injectGlobal } from 'emotion';

injectGlobal(globalStyles);
injectGlobal(localStyles);

const propTypes = {
  children: PropTypes.func.isRequired
};

const Layout = ({ children }) => children();

Layout.propTypes = propTypes;

export default Layout;
github contiamo / operational-ui / packages / components / src / OperationalUI / OperationalUI.tsx View on Github external
componentDidMount() {
    this.props.withBaseStyles && injectGlobal(baseStylesheet(constants))
  }
github reactbkk / 3.0.0 / src / design / index.js View on Github external
}`
  }

  injectGlobal`
    ${fontFace(require('./vendor/fonts/Metropolis-Light.woff2'), 'Metropolis', 300)}
    ${fontFace(require('./vendor/fonts/Metropolis-Regular.woff2'), 'Metropolis', 400)}
    ${fontFace(require('./vendor/fonts/Metropolis-Medium.woff2'), 'Metropolis', 500)}
    ${fontFace(require('./vendor/fonts/Metropolis-SemiBold.woff2'), 'Metropolis', 600)}
    ${fontFace(require('./vendor/fonts/Metropolis-Bold.woff2'), 'Metropolis', 700)}
    ${fontFace(require('./vendor/fonts/NotoSans-Light-Latin.woff2'), 'Noto Sans', 300)}
    ${fontFace(require('./vendor/fonts/NotoSans-SemiBold-Latin.woff2'), 'Noto Sans', 600)}
    ${fontFace(require('./vendor/fonts/NotoSansThaiUI-Light.woff2'), 'Noto Sans Thai UI', 300)}
    ${fontFace(require('./vendor/fonts/NotoSansThaiUI-SemiBold.woff2'), 'Noto Sans Thai UI', 600)}
  `

  injectGlobal({
    'html, body': {
      fontFamily: Fonts.body,
      fontWeight: 300,
      fontSize: BASE_FONT_SIZE_MD,
      color: Colors.brightest,
      margin: 0,
      padding: 0,
      background: `linear-gradient(${Colors.darkest}, ${Colors.reactBright})`,
      [ViewType.mobile]: {
        fontSize: BASE_FONT_SIZE_XS,
      },
    },
    a: {
      textDecoration: 'none',
      color: Colors.brightest,
    },
github nitin42 / Elements-of-physics / src / module-build.js View on Github external
return document
    .getElementById(id)
    .animate(
      [
        { opacity: 1, transform: 'translateX(0px)' },
        { opacity: 0, transform: 'translateX(400px)' }
      ],
      {
        duration: 600,
        iterations: 1,
        easing: 'ease-in-out'
      }
    )
}

injectGlobal('body{background:', hexToRgba('#4f4f4f', 4.2), '}')

var Layout = (function(_React$Component) {
  inherits(Layout, _React$Component)

  function Layout() {
    var _ref

    var _temp, _this, _ret

    classCallCheck(this, Layout)

    for (
      var _len = arguments.length, args = Array(_len), _key = 0;
      _key < _len;
      _key++
    ) {
github anarock / pebble / packages / pebble-web / src / components / Slider.tsx View on Github external
function overrideRheostatStyles() {
  if (rheostatStylesOverriden) return;
  injectGlobal(rheostatOverrides);
  rheostatStylesOverriden = true;
}