Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI Component Shadowing #781

Closed
marcwiest opened this issue Mar 18, 2020 · 3 comments
Closed

UI Component Shadowing #781

marcwiest opened this issue Mar 18, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@marcwiest
Copy link
Contributor

marcwiest commented Mar 18, 2020

Howdy, I've been busy all morning long trying to shadow the AspectRatio UI component as I need to add width:100% to the wrapping element.

To not make this more complex than necessary I'm now going to replace this component with a component of my own. However, since I'm using the theme-ui Gatsby theme gatsby-plugin-theme-ui, shouldn't I be able to also shadow theme-ui's UI components?

I'm not sure I'm missing something as I'm still a bit new to Gatsby, but I tried a few different approaches and couldn't get the component shadowed.
Thanks

@jxnblk
Copy link
Member

jxnblk commented Mar 19, 2020

You shouldn't need to use Gatsby's shadowing API for components unless you're using a theme (though technically the gatsby-plugin-theme-ui uses shadowing for configuration). You can use the sx prop or a variant on the AspectRatio component, if you need to adjust the styles

@marcwiest
Copy link
Contributor Author

marcwiest commented Mar 19, 2020

Yes, I'm aware that I can modify the UI components via the sx prop. The thing is though, the AspectRatio component does not offer a way to address the (outer most) wrapping element, only the inner element that wraps the {children}.

@lachlanjc lachlanjc added the enhancement New feature or request label Dec 3, 2020
@lachlanjc
Copy link
Member

Closing as a duplicate of #706—we definitely want to put sx on the container tags of components

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants