Log inSign up
CSS Hooks
65 posts
Image
user avatar
CSS Hooks
@CSSHooks
css-hooks.com
Joined August 2023
76
Following
474
Followers
  • user avatar
    CSS Hooks
    @CSSHooks
    Dec 11, 2023
    We recently published v1.4 featuring a new "recommended" hooks API that offers a convenient way to configure pseudo-class and media query hooks - with more options to come! All hooks are now opt-in, further reducing the size of your style sheet. Ours went from ~3.5kB to ~0.6kB!
    Image
    12K
  • user avatar
    CSS Hooks
    @CSSHooks
    Feb 23, 2024
    v2 has landed with a more composable model for hooks, adding flexibility and promoting reuse. With locally-defined combinational logic, you can invert a hook or combine it with other hooks using and/or operators. Check out the details on the new website!
    css-hooks.com
    CSS Hooks
    2.3K
  • user avatar
    CSS Hooks
    @CSSHooks
    Jan 2, 2024
    Are you a @QwikDev in need of a simple styling solution? We've got you covered with our latest framework integration. Visit our website to get started...quick. 🙃 css-hooks.com
    Image
    6.1K
  • user avatar
    CSS Hooks
    @CSSHooks
    Dec 2, 2023
    1/6 In response to community feedback, we'll soon be making some small changes in our recommended format for defining hooks. Don't worry: We aren't breaking compatibility in any way!
    6.1K
  • user avatar
    CSS Hooks
    @CSSHooks
    Nov 30, 2023
    This is now possible as of v1.3.0. All you need to do is name the hook accordingly.
    Image
    Image
    user avatar
    Nick Saunders
    @agilecoder
    Nov 30, 2023
    I'm an instant fan of this naming convention @markdalgleish.
    9.4K
  • user avatar
    CSS Hooks
    @CSSHooks
    Jan 13, 2024
    v1.7 is out! The `css` function now accepts a variable number of style object arguments, merging them in a more predictable manner than spreading. Enabling the new `sort` option ensures that the last declaration in input order always has the highest priority. Default in v2?
    643
  • user avatar
    CSS Hooks
    @CSSHooks
    Dec 11, 2023
    Replying to @CSSHooks
    We'd like to extend a special thanks to @markdalgleish for the general design of this API!
    637
  • user avatar
    CSS Hooks
    @CSSHooks
    Sep 30, 2023
    Did you know that the #HTML `style` attribute was supposed to permit #CSS rulesets (think `:hover`, `:focus`, and so on), but the #web browser vendors were unable to support this? CSS Hooks helps you recover this extremely useful feature. Get started at css-hooks.com.
    Image
    1.7K
  • user avatar
    CSS Hooks
    @CSSHooks
    Nov 2, 2023
    As of v1.2.0, it's now possible to create hooks with complex "and/or" logic. One interesting use case is creating an advanced dark mode that respects both application- and browser-level preferences.
    Image
    1.4K
  • user avatar
    CSS Hooks
    @CSSHooks
    Dec 2, 2023
    Replying to @CSSHooks
    2/6 First, we'll now suggest that you name the function `css` instead of `hooks`. That means you can simply use the `hooks` variable for your style sheet instead.
    user avatar
    Mark Dalgleish
    @markdalgleish
    Dec 1, 2023
    Replying to @agilecoder and @peduarte
    I like “css” too. Maybe the variables that you destructure from “createHooks” should just be flipped? It makes sense to me that “hooks” is the string for setting up the hooks in a style tag, and “css” is how you define your styles. To me the “css” function *uses* the hooks.
    670
  • user avatar
    CSS Hooks
    @CSSHooks
    Dec 2, 2023
    Replying to @CSSHooks
    6/6 Thanks Pedro, Mark, Sam, and everyone else for your input!
    user avatar
    Pedro Duarte
    Raycast
    @peduarte
    Dec 1, 2023
    Replying to @markdalgleish and @agilecoder
    True, easy rename. Typing `css` will prob be much easier, specially when doing it multiple times over and over. But also I'm super used to using Stitches' `css`
    4.3K
  • user avatar
    CSS Hooks
    @CSSHooks
    Dec 2, 2023
    Replying to @CSSHooks
    3/6 Next, we'll just skip the default export. Aside from requiring a little more code, it's simply not to everyone's taste.
    user avatar
    Samuel Cook
    @samuelcook
    Dec 1, 2023
    Replying to @agilecoder @markdalgleish and @peduarte
    I’m a fan of named only for sure. But I wouldn’t hold it against anyone that disagrees
    649
  • user avatar
    CSS Hooks
    @CSSHooks
    Dec 3, 2023
    Oof, just noticed an outdated section of the API docs. If you were wondering whether you can use "and" hooks, or nest hook specs to implement complex boolean logic, the answer is YES. Will get the doc update pushed out soon.
    1.8K
  • user avatar
    CSS Hooks
    @CSSHooks
    Nov 30, 2023
    Seems like a useful hook...
    user avatar
    Jamie Kyle is on 🦋
    @buildsghost
    Nov 15, 2023
    CSS :intent please. Tired of `&:hover, &:focus`
    4.9K

New to X?

Sign up now to get your own personalized timeline!

Create account

By signing up, you agree to the Terms of Service and Privacy Policy, including Cookie Use.

Terms·Privacy·Cookies·Accessibility·Ads Info·© 2026 X Corp.
Don't miss what's happening
People on X are the first to know.
Log inSign up