How to use react-base16-styling - 10 common examples

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 infinitered / reactotron / src / Theme / Colors.js View on Github external
})

// the default theme until i figure out how to customize it on the fly
// http://chriskempson.github.io/base16/
// const defaultTheme = 'atliersavanah'
// const defaultTheme = 'ocean'
// const defaultTheme = 'mocha'
// const defaultTheme = 'railscasts'
// const defaultTheme = 'greenscreen'
const defaultTheme = "twilight"

// the natural or inverted look
const invertTheme = false

// some kind of wierd factory?
const createStylingFromTheme = createStyling(getStylingFromBase16, {})

// here's where I think i should be allowing user customization?
const styling = createStylingFromTheme(defaultTheme)

// fish out the roles because I haven't committed fully to styling in the components just yet
const roles = styling("roles").style

// awkwardly expose the theme for the ObjectTree component
const theme = styling("theme").style

export default {
  ...roles,
  theme,
  invertTheme,
}
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)
  };
}
github mac-s-g / react-json-view / src / js / themes / getStyle.js View on Github external
const getStyle = theme => {
    let rjv_theme = rjv_default;
    if (theme === false || theme === 'none') {
        rjv_theme = rjv_grey;
    }

    return createStyling(getDefaultThemeStyling, { defaultBase16: rjv_theme })(
        theme
    );
};
github Dean177 / react-native-json-tree / src / createStylingFromTheme.js View on Github external
color: expanded ? colors.ITEM_STRING_EXPANDED_COLOR : colors.ITEM_STRING_COLOR,
        marginLeft: 5,
        ...style,
      },
    }),

    nestedNodeChildren: ({ style }) => ({
      style: {
        marginLeft: 10,
        ...style,
      },
    }),
  };
};

const createStylingFromTheme = createStyling(getStylingFromBase16, {
  defaultBase16: solarized,
});

export default createStylingFromTheme;
github reduxjs / redux-devtools / packages / redux-devtools-inspector / src / utils / createStylingFromTheme.js View on Github external
const getDefaultThemeStyling = theme => {
  if (themeSheet) {
    themeSheet.detach();
  }

  themeSheet = jss.createStyleSheet(
    getSheetFromColorMap(colorMap(theme))
  ).attach();

  return themeSheet.classes;
};

export const base16Themes = { ...reduxThemes, ...inspectorThemes };

export const createStylingFromTheme = createStyling(getDefaultThemeStyling, {
  defaultBase16: inspector,
  base16Themes
});
github alexkuz / react-json-tree / src / createStylingFromTheme.js View on Github external
padding: 0,
        margin: 0,
        listStyle: 'none',
        display: expanded ? 'block' : 'none'
      }
    }),

    rootNodeChildren: {
      padding: 0,
      margin: 0,
      listStyle: 'none'
    }
  };
};

export default createStyling(getDefaultThemeStyling, {
  defaultBase16: solarized
});
github alexkuz / react-input-enhancements / src / createStyling.js View on Github external
left: 0,
      top: '100%',
      zIndex: 10000,
      maxHeight: '36rem',
      minWidth: '22rem',
      backgroundColor: '#FFFFFF',
      boxShadow: '1px 1px 4px rgba(100, 100, 100, 0.3)',
      flexDirection: 'column'
    }),
    inputEnhancementsInput: {
      paddingRight: '15px'
    }
  };
}

export default createStyling(getStylingFromBase16, {
  defaultBase16: defaultTheme
});

react-base16-styling

React styling with base16 color scheme support

MIT
Latest version published 1 month ago

Package Health Score

93 / 100
Full package analysis