Repository navigation
Add display name to generated class - #153
JamieDixon wants to merge 29 commits into
Conversation
|
I like it, but I really thought we were doing something like this already! |
|
is there any way to apply this for development only? |
Generated by 🚫 danger |
|
Great addition! I'm so glad that it works smoothly with my babel plugin. Although, there is minor problem. I might miss something, but in my tests two components with equal rule set displays this way. const Arguments = styled.div`
color: red;
`
const Condition = styled.div`
color: red;
`export default () => (
<div>
<Arguments>A</Arguments>
<Condition>B</Condition>
</div>
)<div data-reactid="19">
<div class="jldpnK-Arguments" data-reactid="20">A</div>
<div class="jldpnK-Arguments" data-reactid="21">B</div>
</div>I'd expect either different classes (jldpnK-Arguments, jldpnK-Condition), or one jldpnK-Arguments-Condition. I guess latter is not possible. |
|
Thanks @vdanchenkov. We've got some ideas to fix that problem. Looking into it now. |
|
@vdanchenkov Your observation should be fixed in the latest commit. I've changed the way we add the Let me know what you guys think. |
e273d63 to
dad824e
Compare
dad824e to
00d30f8
Compare
…Not sure exactly why they were failing to run the tests
gitter has been super helpful to me!
Turns off the default no-duplicate-imports because it marks import type as a duplicate. This should be ok, since import/no-duplicate covers the same cases but allows type imports. Furthermore, needed to inline disable one import/no-duplicates since it does mark import typeof as a duplicate.
|
Replaced by #160 |

I'm opening this PR more for discussion than to actually be included at this time.
I wanted to have the ability to see the
displayNameof the rendered component in the cssclasswhen using dev tools in the browser. Sometimes it can be tough to figure out which component generated which class name, especially when switching from customclassName="my-descriptive-footoclass="hbfd5".This current PR adds the
displayNameall the time however I'm sure there's a way of doing this so it only happens in Dev mode. I'll need a pointer in the right direction to do that.Here's what I have so far. Please have a look and let me know if there's a different approach which might work better. Thanks.
displayNameonto generated class whenprocess.env.NODE_ENV === 'development'displayName