@dyst/native
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

🏃‍♀ Dynamic Styles

Banner

Dynamic Css-in-Js styles engine, based on Emotion


Create dynamic stylesheets and link them to functional components using the React hook pattern.

  • Build on top of @emotion/react: As fast and lightweight as emotion
  • Supports all emotion features: dynamic theming, etc.
  • Fully featured TypeScript support
  • 🟨 Well tested (working on it)
// Create dynamic stylesheet that has access to the previously specified theme and parameters
const useStyles = styleSheet.create(({theme, params}) => ({
    root: /* Dynamic Styles */,
    button: /* Dynamic Styles */,
    text: /* Dynamic Styles */,
}));

const MyComponent = (props) => {
    // Access dynamic styles as class names using the created 'useStyles()' hook 
    // and specify the corresponding parameters
    const { styles } = useStyles({ color: props.color, fontSize: 10 });
    
    return (
      <div style={styles.root}>
          {/* */}
      </div>
    );
}

💻 Installation

$ yarn add @dyst/native @emotion/react @emotion/native
# or
$ npm install @dyst/native @emotion/react @emotion/native

⛳️ Code Sandbox

🪁 Basic usage

Learn more here

Package Sidebar

Install

npm i @dyst/native

Weekly Downloads

32

Version

0.0.5

License

MIT

Unpacked Size

27.4 kB

Total Files

10

Last publish

Collaborators

  • bennodev