1.3.0 • Published 8 months ago

@sergiogc9/react-ui-theme v1.3.0

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
8 months ago

React UI Theme

npm.io npm.io npm.io

This package exports the necessary theme to work with my React UI library based on a design system using React, styled-components, styled-system and more.

See more info about the library HERE.

ℹ️ The library is still in a beta stage as I am still migrating many components here.

ℹ️ This library has been implemented by me and for me, hence it is highly opinionated.

Usage

Installation

Install the package from npm or github packages:

yarn add -S @sergiogc9/react-ui-theme

Add the provider to your app, customizing the theme if wanted and using reset config provided by the theme:

import { createGlobalStyle } from 'styled-components';
import theme, { ReactUIProvider } from '@sergiogc9/react-ui-theme';

const GlobalStyle = createGlobalStyle`
	${reset}
	// add other custom global styles here
`;

const App = () => {
   const finalTheme = merge(theme, {...}); // Customize theme if wanted

   return (
      <ReactUIProvider theme={finalTheme}>
	  	<GlobalStyle />
        {...}
      </ReactUIProvider>
   )
}

Documentation

This package basically exports the theme, its types and some helper functions. The theme is exported by default as seen in the example above.

The exported items are:

  • theme (default export): The theme itself. It should be passed to the styled-components provider.
  • Theme: The Theme typescript typing.
  • reset: A set of common CSS rules to be used globally in the app if wanted. It should be used together with createGlobalStyle provided by styled-components.
  • getColorFromTheme and getColorFromThemeWithOpacity: Returns the color value defined in the theme. Using directly the color values using styled-system approach is preferred.
  • getColorByMode: Returns the specified color depending the current mode enabled.
  • useChangeThemeMode: Custom hook to easily change the theme mode.
1.0.0

10 months ago

1.3.0

8 months ago

0.10.0

1 year ago

0.9.0

1 year ago

0.7.1-alpha.2

2 years ago

0.7.1-alpha.1

2 years ago

0.7.1-alpha.3

2 years ago

0.7.1

2 years ago

0.3.3-alpha.1

2 years ago

0.7.1-alpha.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

3 years ago

0.0.5

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.4

3 years ago

0.0.2-alpha.3

3 years ago

0.0.2-alpha.1

3 years ago

0.0.1

3 years ago