Skip to content

Avoid automatically adding the @keyframes within <GlobalStyles /> #295

Answered by ben-rogerson
kelvindecosta asked this question in Q&A
Discussion options

You must be logged in to vote

Hey there!

You've probably worked out by now that purging doesn't work in this environment.
Those keyframes are there so you can use the animate classes - but if you're not using those it's a little extra cruft.

I guess you could avoid using the GlobalStyles import but you'd miss out on setting default colors/borders/fonts and things.

If you're comfortable with that, here are the base styles that you can add yourself via the globalStyles import from styled-components:

`
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  
  :root {
    -moz-tab-size: 4;
    tab-size: 4;
  }

  html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
  }

  body {
    margin: 0;
  }

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@kelvindecosta
Comment options

Answer selected by kelvindecosta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants