You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could you explain why you prefer className={css``}? One of the main reasons for emotion-js/next was to move style insertion into the React tree and this can't happen by using className={css``}.
// wrong because it's global... or we can just use it as global<Stylecss={`.abc { color: red; }`}><divclassName="abc">123</div></Style><Stylecss={`background:blue; & .abc { color: red; }`}>{css=><divclassName={css.default}><divclassName={css.abc}>123</div></div>}</Style>
// or
<Stylecss={`background:blue; & .abc { color: red; }`}>{className=><divclassName={className}><divclassName="abc">123</div></div>}</Style>
I don't like jsx is just because I don't think jsx function is not clean.
I don't like styled.xxx is because I need to define extra Component.
I don't think the API you're proposing would be very good and I think that they would cause problems because both of your examples force you to name a class which is something that we're trying to avoid. Also, the first example would cause problems if you use the same class name down further down the tree. The second example would be difficult to implement well because of the way emotion works and supporting that would make it less performant. It would also create many edge cases, for example what if the selector is #some-id?
Activity
emmatown commentedon May 8, 2018
Could you explain why you prefer
className={css``}? One of the main reasons for emotion-js/next was to move style insertion into the React tree and this can't happen by usingclassName={css``}.xialvjun commentedon May 8, 2018
Well, I see,
className={css``}is impossible.Then how about:
I don't like
jsxis just because I don't thinkjsxfunction is not clean.I don't like
styled.xxxis because I need to define extra Component.emmatown commentedon May 8, 2018
I don't think the API you're proposing would be very good and I think that they would cause problems because both of your examples force you to name a class which is something that we're trying to avoid. Also, the first example would cause problems if you use the same class name down further down the tree. The second example would be difficult to implement well because of the way emotion works and supporting that would make it less performant. It would also create many edge cases, for example what if the selector is
#some-id?Could explain why you think
jsxis not clean?