Rebass: Rebass with Radium

Created on 5 Oct 2016  路  10Comments  路  Source: rebassjs/rebass

In an effort to be truly CSS-independent, I'm trying to get Radium to work with Rebass - specifically because of pseudo classes like :hover and media queries. Unfortunately, I have not been able to get it to work because both Radium and Rebass use the style prop.

Any suggestions here?

Most helpful comment

Glamor and Aphrodite are probably front runners for being used in the library itself. As for the className prop, v0.4 supports passing custom classnames, so they should work there

All 10 comments

radium or any JSS framework/library would be superawesome

Same with Aphrodite as well.

One thing I did discover digging through the source code, is that since Aphrodite uses className, you can use _className={css(buttonStyles.base, isActive && buttonStyles.active)}>.

https://github.com/jxnblk/rebass/blob/master/src/Button.js#L46

Aphroditing the rebass, so awesome!

What appears to be a simple solution (at least for the className usecase) is to just append the className prop that gets passed in to every component.

Instead of className='Breadcrumbs', maybe just

className={`Breadcrumbs ${props.className}`}

Or just allow the className to be overridden completely with the standard className prop.

Radium is a little different because it uses style and actually modifies how the style prop works in terms of merging, etc.

Glamor and Aphrodite are probably front runners for being used in the library itself. As for the className prop, v0.4 supports passing custom classnames, so they should work there

Sounds good @jxnblk. My vote is for Aphrodite. 馃憤

When do you expect 0.4 to be out?

@jxnblk I think https://github.com/rofrischmann/fela is probably the winner. Check it.

@steida Hello, I love the suggestion you gave and read the fela documentation.

I wonder how do you use fela with rebass. Can you maybe offer an example please?

Thanks!

:wave: I'd be interested in helping move this over to Glamor.

And... I ended up using styled-components. Mostly for the community, active development, and extensibility. Thanks all for the discussion! 馃槑

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mberneti picture mberneti  路  5Comments

jckw picture jckw  路  6Comments

tpkiddle picture tpkiddle  路  3Comments

hellais picture hellais  路  7Comments

jxnblk picture jxnblk  路  5Comments