How to use the react-base16-styling.invertTheme function in react-base16-styling

To help you get started, we’ve selected a few react-base16-styling 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 reduxjs / redux-devtools / packages / react-json-tree / src / index.js View on Github external
function getStateFromProps(props) {
  let theme = checkLegacyTheming(props.theme, props);
  if (props.invertTheme) {
    if (typeof theme === 'string') {
      theme = `${theme}:inverted`;
    } else if (theme && theme.extend) {
      if (typeof theme === 'string') {
        theme = { ...theme, extend: `${theme.extend}:inverted` };
      } else {
        theme = { ...theme, extend: invertTheme(theme.extend) };
      }
    } else if (theme) {
      theme = invertTheme(theme);
    }
  }
  return {
    styling: createStylingFromTheme(theme)
  };
}
github reduxjs / redux-devtools / packages / react-json-tree / src / index.js View on Github external
function getStateFromProps(props) {
  let theme = checkLegacyTheming(props.theme, props);
  if (props.invertTheme) {
    if (typeof theme === 'string') {
      theme = `${theme}:inverted`;
    } else if (theme && theme.extend) {
      if (typeof theme === 'string') {
        theme = { ...theme, extend: `${theme.extend}:inverted` };
      } else {
        theme = { ...theme, extend: invertTheme(theme.extend) };
      }
    } else if (theme) {
      theme = invertTheme(theme);
    }
  }
  return {
    styling: createStylingFromTheme(theme)
  };
}
github alexkuz / react-json-tree / src / index.js View on Github external
function getStateFromProps(props) {
  let theme = checkLegacyTheming(props.theme, props);
  if (props.invertTheme) {
    if (typeof theme === 'string') {
      theme = `${theme}:inverted`;
    } else if (theme && theme.extend) {
      if (typeof theme === 'string') {
        theme = { ...theme, extend: `${theme.extend}:inverted` };
      } else {
        theme = { ...theme, extend: invertTheme(theme.extend) };
      }
    } else if (theme) {
      theme = invertTheme(theme);
    }
  }
  return {
    styling: createStylingFromTheme(theme)
  };
}
github alexkuz / react-json-tree / src / index.js View on Github external
function getStateFromProps(props) {
  let theme = checkLegacyTheming(props.theme, props);
  if (props.invertTheme) {
    if (typeof theme === 'string') {
      theme = `${theme}:inverted`;
    } else if (theme && theme.extend) {
      if (typeof theme === 'string') {
        theme = { ...theme, extend: `${theme.extend}:inverted` };
      } else {
        theme = { ...theme, extend: invertTheme(theme.extend) };
      }
    } else if (theme) {
      theme = invertTheme(theme);
    }
  }
  return {
    styling: createStylingFromTheme(theme)
  };
}

react-base16-styling

React styling with base16 color scheme support

MIT
Latest version published 9 months ago

Package Health Score

92 / 100
Full package analysis