Skip to main content

Today's npm package: theming

Updated 1 min readMarkdown
Part of seriesPackage of the Day
Today's npm package: theming

Today's npm package is theming

With rise of CSS-in-JS, managing and maintaining the design tokens can be hard.

Today's package theming will help you manage the design tokens for your React project with CSS-in-JS in consistent way.

Here is a small example of injecting and using design tokens as theme to React App.

import React from 'react';
import { ThemeProvider, withTheme } from 'theming';

const DemoBox = props => {
  console.log(props.theme);
  return (<div />);
}

const ThemedDemoBox = withTheme(DemoBox);

const theme = {
  color: 'black',
  background: 'white',
};

const App = () => (
  <ThemeProvider theme={theme}>
    <ThemedDemoBox /> {/* { color: 'black', background: 'white' } */}
  </ThemeProvider>
)

export default App;

Stay tuned for tomorrow's package of the Day.

About the author

  • I am developer from India currently based in Berlin, Germany.

    I am very interested in Design, though I don't design 😉 I take care of it while making my apps.

    Photography, videography and having random conversation over beer are my activities of spare time. Timelapses and hyperlapses make me wonder all the time 😊

No comments yet. Be the first to comment.

More from this blog