Skip to content

Hook into advanced CSS features from native inline styles.

License

Notifications You must be signed in to change notification settings

wobsoriano/css-hooks

 
 

Repository files navigation

CSS Hooks CSS Hooks

Build Status Latest Release License


Overview

Hooks bring CSS features to native inline styles, enabling you to target various states such as hover, focus, and active, all without leaving the style prop. For example, hooks can easily solve the common use case of applying state-driven styles to a link:

<a
  href="https://css-hooks.com/"
  style={css({
    color: "#03f",
    fontSize: "1rem",
    "&:hover": {
      color: "#09f",
    },
    "&:active": {
      color: "#e33",
    },
    "@media (1000px <= width)": {
      fontSize: "1.25rem",
    },
  })}
>
  Hooks
</a>

Notably, the css function is pure. It simply returns a flat style object that is compatible with the style prop, creating dynamic property values that change under various conditions through CSS variables.

Documentation

Please visit css-hooks.com to get started.

Packages

Contributing

Contributions are welcome. Please see the contributing guidelines for more information.

License

CSS Hooks is offered under the MIT license.

About

Hook into advanced CSS features from native inline styles.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 86.7%
  • MDX 10.3%
  • JavaScript 3.0%