Closed goodmind closed 5 years ago
See discussion in https://github.com/missive/emoji-mart/pull/274#issuecomment-470969125, this feature is not necessary because you can style using selectors based on parent elements.
@nolanlawson but how about using with styled-components?
I don't know much about styled-components. Is there something about their approach that is incompatible with using CSS selectors?
@nolanlawson, no, but passing className
is more convenient
const StyledPicker = styled(Picker)`
background-color: #000;
`
would pass generated className
to Picker
With selectors you would need to do it like this
const Wrapper = styled.div`
.emoji-mart { your styles }
`
const MyPicker = (props) => <Wrapper><Picker {...props} /></Wrapper>
Also, styled-wrappers leads to unnecessary DOM nodes. In case when there are too many, for example Emoji
components, that could be an issue.
Using them in this style would be quite handy:
import styled from 'styled-components';
import { Emoji as EmojiMart } from 'emoji-mart';
export const Emoji = styled(EmojiMart)`
vertical-align: middle;
// any other styles
`;
Add forwarding of
className
prop to root div onPicker
component