CSSHooks's profile picture.

CSS Hooks

@CSSHooks

CSS Hooks reposted

Inline styles are the best option for most of your apps


CSS Hooks reposted

First @CSSHooks debunked some deeply-held assumptions about the functional limitations of inline styles. And now @danimal_channel challenges the widespread FUD around inline style performance. Maybe it’s time to re-evaluate your styling framework and consider a simpler approach!


What inline styles can do in 2024

Material Design-inspired text field 👉 No state 👉 No side effects 👉 Full style encapsulation 👉 2 reusable hooks (188 bytes of CSS) codesandbox.io/p/devbox/githu…



You either die writing CSS or you live long enough to see yourself writing inline styles. — @danimal_channel


When everything else has bugs, you accept the performance hit (assuming it even matters).

Because everything else has bugs and the performance hit is rarely observed (I’ve never seen it matter and I flush sync with state at the root all the time)



CSS Hooks v2 in a nutshell

This was one of the most interesting topics to me in my entire CS degree 🙌

vinnie_navi's tweet image. This was one of the most interesting topics to me in my entire CS degree 🙌


CSS Hooks reposted

How do you change an element's background color on hover with inline styles?


As of today's v1.8 release, CSS Hooks supports @supports!


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?


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

CSSHooks's tweet image. 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

CSS Hooks reposted

Yes, this is planned, but is much harder to implement than the rest of nesting, so it will happen later.


This would be great to know from a documentation perspective…

Is applying your `css` function, even when not leveraging hooks, a good future-proofing strategy?

agilecoder's tweet image. Is applying your `css` function, even when not leveraging hooks, a good future-proofing strategy?


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.


CSS Hooks reposted

That is a good point; but the hook name is type-checked, and I expect autocompletion would help people avoid the issue in the first place.

agilecoder's tweet image. That is a good point; but the hook name is type-checked, and I expect autocompletion would help people avoid the issue in the first place.

United States Trends

Loading...

Something went wrong.


Something went wrong.