How to use the theming.withTheme function in theming

To help you get started, we’ve selected a few theming 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 kiwicom / orbit-components / src / Theming / ThemedSample.js View on Github external
colorTextPrimary: {theme.colorTextPrimary}
    <br>
    fontFamily: {theme.fontFamily}
    <br>
    lineHeightText: {theme.lineHeightText}
    <br>
  
);

// We're passing a default theme for Component that aren't wrapped in the ThemeProvider
ComponentWithTheme.defaultProps = {
  theme: tokens,
};

// Themed component cannot be used without ThemeProvider
const ThemedComponent = withTheme(ComponentWithTheme);
ThemedComponent.displayName = "ThemedComponent";

export { ThemedComponent as default, ComponentWithTheme as RawComponent };
github DefinitelyTyped / DefinitelyTyped / types / theming / theming-tests.tsx View on Github external
const customTheme = {
  color: {
    primary: "red",
    secondary: "blue"
  }
};
type CustomTheme = typeof customTheme;

interface DemoBoxProps {
  text: string;
  theme: CustomTheme;
}
const DemoBox = ({ text, theme }: DemoBoxProps) =&gt; {
  return <div style="{{">{text}</div>;
};
const ThemedDemoBox = withTheme(DemoBox);
const renderDemoBox = () =&gt; ;

const App = () =&gt; {
  return (
    
      
    
  );
};

const AugmentedApp = () =&gt; {
  return (
    
       ({ ...outerTheme, augmented: true })}&gt;
github jxnblk / axs / docs / Button.js View on Github external
import React from 'react'
import Base from '../src'
import { withTheme } from 'theming'

const Button = withTheme(({ theme, ...props }) =&gt;