Rebass: boxShadow from theme

Created on 19 Jun 2019  路  4Comments  路  Source: rebassjs/rebass

Hi! huge fan of rebass, but I'm confused about the interaction between the styled-system ThemeProvider and rebass as it is currently documented, specifically regarding shadows.

I have my root element wrapped in a ThemeProvider that gets the following object in the theme prop:

{
  //...
  fonts: {
    sans: "Proxima-Nova, Helvetica, Lato, Arial, Dropdown, sans-serif",
  },
  shadows: {
    small: "0 2px 4px -2px rgba(11, 39, 65, 0.3)",
  },
  //...
}

so I thought that would make this work, but it doesn't:

<Box boxShadow="small">{children}</Box>

What am I doing wrong? Thanks in advance.

Most helpful comment

I'm trying to use this solution but it doesn't work for me
<Card display="flex" boxShadow="small">

The card element doesn't have a shadow, Am I missing something?

All 4 comments

The Card component is a Box with visual style props like boxShadow, so you鈥檇 probably wanna use that one instead

Interesting, thanks. I think I understand the separation of concerns.

I'm trying to use this solution but it doesn't work for me
<Card display="flex" boxShadow="small">

The card element doesn't have a shadow, Am I missing something?

No, it seems like a bug @cruzlutor

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jckw picture jckw  路  6Comments

mrcoles picture mrcoles  路  4Comments

jamesknelson picture jamesknelson  路  4Comments

luftywiranda13 picture luftywiranda13  路  4Comments

karland picture karland  路  7Comments