Add option for label formatting#566
Conversation
Codecov Report
|
|
Thank you for your contribution! I took a quick look and it looks fine, but I'd like to have @mitchellhamilton look at it as well. |
|
@tkh44 Thanks for the feedback! I'm currently thinking about how to handle cases when label format does not include One way would be to print warning and append What do you think? |
|
@sgal Collisions won't matter since there will be a hash as well and if the hash is the same then the style will be the same. |
|
|
||
| `string`, defaults to `null`. | ||
|
|
||
| This option automatically adds the `label` property (same as `autoLabel`), but allows to |
There was a problem hiding this comment.
Should "but allows to" be "but allows you to"?
|
@mitchellhamilton Ah, thanks for clarifying the hashing. I fixed the phrasing in the docs. |
|
I've been thinking about this more and maybe the |
|
@mitchellhamilton That does sound reasonable and I think it is easier to understand as well. I'll update the PR tonight. |
|
@sgal, Hi! maybe also add path/folder or getLocalIdent function? In our project we use component/index.js, so filename - doesn't help here |
|
@matpaul Which arguments do you think |
|
@sgal |
What:
New option for
babel-plugin-emotionthat allows to configure label format in generated class names. Implements #563Why:
Details are in #563, but in general when debugging it is nice to have the file name in the class names (especially, for composed styles). The potential of the format is quite big. The feature and solution itself are inspired by
localIdentNameoption in webpack's css-loader.How:
New function that handles label generation for all cases (autoLabel, labelFormat, nothing).
Checklist: