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.

remove `chakra-*` class names from prod builds

See original GitHub issue

I’ve noticed that in Prod builds chakra- classes are being added, but they are not being used. So why would we need them especially in Prod builds?

I think having an option to remove them make sense, i feel now that cluttering html classes with this, especially considering they are not being used and just there.

Screen Shot 2020-12-01 at 20 56 51

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
with-heartcommented, Dec 1, 2020

does this help to target them when in this example i already see two elements with same class name

Yes, this is fairly traditional css behavior. Like most other things, we can’t predict what users will or won’t need to target or how they do the targeting, but this at least gives them the option to do so.

Gonna close this as a duplicate of #2229. You should be able to achieve this in your own build process using babel-plugin-react-remove-classname or something similar.

3reactions
bbcntolgacommented, Aug 18, 2022

@with-heart Maybe this should be a issue to think about. There should be an easy integrated way in chakra to replace the “chakra” prefix with some other string.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced techniques in Chakra UI - LogRocket Blog
Dive deeper into the functionality of Chakra UI with these tips and tricks explained with an example tutorial.
Read more >
How to override Chakra UI (or Emotion CSS-in-JS) styling with ...
Any CSS classnames I write will not override Chakra UI component styles, even when passing them directly as className, ...
Read more >
Upgrading to v1 - Chakra UI
Install the framer-motion package. We use this to manage animations and transitions within components. · Remove the emotion-theming package. · Rename the @emotion ......
Read more >
chakra-ui/package.json - UNPKG
1, {. 2, "name": "chakra-ui",. 3, "version": "0.3.9",. 4, "description": "Responsive and accessible React UI components built with React and Emotion",.
Read more >
emotion/babel-plugin
Contextual Class Names, ✓, Generated class names include the name of the ... default in @emotion/babel-plugin but they will be removed in production...
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