question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to set margin:0?

See original GitHub issue

I’ve tried multiple ways to remove the margins with no luck. I need to render the emojis without the margin, otherwise, it creates layout problem for responsive.

I’ve tried the following: <Emoji text={name} style={{ margin: 0 }} /> and

import styled from "styled-components";

const StyledAEmoji = styled(Emoji)`
  margin: 0;
`;

Can you provide an alternative way to remove margin when using one Emoji?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ShimiSuncommented, Mar 5, 2019

So I don’t think styled-components are accepting class. and I ended up not using onlyEmojiClassName and just doing:

const StyledEmoji = styled(Emoji)`
  span {
    margin: 0px !important;
  }
`;

...
<StyledEmoji text=":+1:" />

and the !important was a mustin order to override the inline style.

0reactions
ShimiSuncommented, Jul 3, 2019

@tommoor feel free to close this issue, I was able to work around it.

Just an FYI, in case you are interested to see the React.js+ Grommet example that uses the react-emoji-render library, take a look at Demo: https://l1klxkjwm.codesandbox.io/ Source: https://codesandbox.io/s/l1klxkjwm

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS Margin: 0 is not setting to 0 - Stack Overflow
I'm a new comer to web designing. I created my web page layout using CSS and HTML as below. The problem is even...
Read more >
Use CSS to Zero Out Your Margins and Borders - ThoughtCo
The best way to solve the problem of an inconsistent box model is to set all the margins and padding values of HTML...
Read more >
{ margin: 0; padding: 0; } No Longer Cool | CSS-Tricks
I use a main container div to wrap all my content and then add a maincontainer * {padding:0;margin:0;}. I think it ends up...
Read more >
margin - CSS: Cascading Style Sheets - MDN Web Docs
This property can be used to set a margin on all four sides of an element. Margins create extra space around an element,...
Read more >
Using the CSS Star Selector to Zero Out Margins and Paddings
You can run over default browser styles with * { margin: 0; padding: 0; }, but be cautious. A simple Google search for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found