TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Rebass – Functional React UI component library built with styled-components

146 pointsby mxstbralmost 8 years ago

10 comments

ptglodenalmost 8 years ago
I&#x27;ve really enjoyed using jxnblk&#x27;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.<p>...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&#x2F;stylesheet generation strategy. Now I&#x27;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.<p>In any case, I&#x27;m glad jxnblk keeps experimenting with these libraries, even if it&#x27;s hard to keep up with the changes. Their surface area is so small that it&#x27;s easy to pick up the API and it doesn&#x27;t feel like a risk or burden to stay on older versions.<p>[1] <a href="http:&#x2F;&#x2F;basscss.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;basscss.com&#x2F;</a><p>[2] <a href="http:&#x2F;&#x2F;jxnblk.com&#x2F;axs&#x2F;" rel="nofollow">http:&#x2F;&#x2F;jxnblk.com&#x2F;axs&#x2F;</a>
评论 #14707364 未加载
评论 #14727871 未加载
krainboltgreenealmost 8 years ago
The shortening of properties is very much a bad idea and should be avoided. &quot;What the hell is `mb`?&quot; is going to come up a lot.
评论 #14707311 未加载
评论 #14705684 未加载
subpixelalmost 8 years ago
If the rebass approach to css is interesting to you, i recommend checking out tachyons.io<p>It plays nicely with React as well. Sadly most of the discussion around Tachyons is hidden away from the web in a burrow of Slack channels, but it&#x27;s an active community and there&#x27;s a lot of help and show+tell to be found.
imjaredalmost 8 years ago
Didn&#x27;t dive in too much yet but heads up that your hero animation is a bit funky in Chrome (stable). Here&#x27;s a screencap: <a href="https:&#x2F;&#x2F;cl.ly&#x2F;0D031Z0p3v26" rel="nofollow">https:&#x2F;&#x2F;cl.ly&#x2F;0D031Z0p3v26</a>. The glitch happens towards the end of the recording.
k__almost 8 years ago
I prefer glamorous, CSS properties as JSX props is so much nicer.
评论 #14707370 未加载
charris0almost 8 years ago
I do really like a lot of things about the styled-components approach and general CSS in JS approach.<p>I do though have a few concerns that stem from loosing the abstraction of ascetics vs function of a component, mainly though - ease of designer collaboration;<p>It seems harder to have a designer collaborate on your styles. (Maybe they are more used to CSS more than JS, or an external contractor, or just more specialised etc). You can&#x27;t have somebody change your design without them having full access and knowledge of your entire component source and architecture.<p>I notice that styled-components can automatically generate a style sheet with nice names, it would be good if this could be a step at build time. And maybe a step that can also reverse the process? adding any changed styles back into your JS files? (syncing it with an externally edited stylesheet) Does anyone else see value to this?
alttabalmost 8 years ago
Why the hell are we now putting CSS in Javascript? I&#x27;m losing my mind with web developers trying to control everything in the world with client-side javascript.<p>What a mess.
评论 #14706048 未加载
评论 #14705805 未加载
评论 #14705763 未加载
评论 #14705840 未加载
评论 #14705778 未加载
评论 #14705835 未加载
评论 #14705647 未加载
评论 #14707134 未加载
评论 #14706280 未加载
评论 #14744360 未加载
评论 #14706049 未加载
morenoh149almost 8 years ago
This might be good for react native apps as well.
rmetzleralmost 8 years ago
The &quot;hello&quot; in the bottom right corner seems like it was put there by accident. It causes a small problem on mobile.
评论 #14709234 未加载
ristonalmost 8 years ago
Seems like you are reinventing HTML and CSS, what&#x27;s the benefit of using such component library?
评论 #14708136 未加载
评论 #14705868 未加载