Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've really enjoyed using jxnblk's approach to styling. I started with basscss [1], then moved on to rebass, and finally settled on axs [2]. They all take more or less the same approach, but operate differently. Rebass generates inline styles; basscss is simply a CSS file that defines a set of utility classes (like `mb2`, `p3`, `flex-none`, etc.); and axs dynamically generates CSS classnames and stylesheets.

...Or at least, that used to be the case. Looking at the most recent version of rebass, it looks as if it uses the same dynamic classname/stylesheet generation strategy. Now I'm not so sure what the difference between rebass and axs are, except that the former seems to be a comprehensive set of UI components, and the latter a tool for generating your own component library.

In any case, I'm glad jxnblk keeps experimenting with these libraries, even if it's hard to keep up with the changes. Their surface area is so small that it's easy to pick up the API and it doesn't feel like a risk or burden to stay on older versions.

[1] http://basscss.com/

[2] http://jxnblk.com/axs/



Similarly, I've been enjoying JSS[1] a lot... it works similar to inlined, but under the covers it creates classes per component and renders to styles... can pre-render via server pass too.

[1] https://github.com/cssinjs/react-jss


Yeah the newest version of rebass uses styled-components[0] under the hood which does the same thing as axs does. (generate an actual stylesheet with classnames)

See my article about styles in JavaScript and the difference to inline styles here: https://mxstbr.blog/2016/11/inline-styles-vs-css-in-js/

[0]: https://styled-components.com




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: