Make it possible to pass in margin to Thumbprint React components
See original GitHub issueAs @tomgenoni builds out revamped Thumbprint Utility classes and Jon K. revisits our spacing system, I think this would be a good opportunity to make it possible to add margins to our Thumbprint React components.
This has been a common pain point that folks have worked around by:
a. Adding a wrapper div
.
b. Avoiding the React components and using their Sass counterparts
Proposal:
<Button u="mb2 s:ms2">
Click Me
</Button>
The prop u
(for “utility”), added to all of our React components, will allow developers to pass in a whitelisted set of utility classes.
We’d start with margin classes, potentially expanding this to support other classes that affect the space around the component.
Issue Analytics
- State:
- Created 5 years ago
- Comments:22 (17 by maintainers)
Top Results From Across the Web
How to add style - like margin - to react component?
I think I understand. 1) Applying CSS directly to React Components does not work--I can confirm that. 2) Passing props down to the...
Read more >Using Atomic - Thumbprint Design System
Our spacing units go from 4px , 8px , 16px and so on and is used by the margin and padding classes. Note...
Read more >How to style margin with React - DEV Community
First of all, child component should not know the "layout style" of its parent component. For example, let's say there is a component...
Read more >Passing shorthand margin as a prop throw an error on react ...
As a workaround you can call the prop m , ex: <Styled m="50 0" /> and it will work fine.
Read more >Component Style - Chakra UI
This is a consistent theming API that makes component styling easy to understand and maintain. ... import { defineStyleConfig } from '@chakra-ui/react'.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
mt4
is Tachyons, thes:
prefix is Tailwind and indicates breakpoints. https://tailwindcss.com/docs/what-is-tailwind/Not sure if I understand this part. How would a margin prop on Thumbprint components encourage more DOM?