-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 8 blog article #373
Comments
Is |
It looks like |
There should be a mention of the other breaking change of Thank you very much for emotion, an absolute joy to work with |
Worth to mention this (very upsetting) side effect of removing "component as selector" - #370 |
I think removal of component as a selector encourages to better css component isolation. BEM offers some great suggestions of proper ways to do sub elements. Is there away to use the generated class name in as a selector with itself? Perhaps that is worth mentioning.
My suggestion would be to also mention the new CDN packages and a link to a Jsfiddle with hello world type example! 😊 |
Here's my shot at a concise BEM ( http://getbem.com/introduction/ ) example: https://codesandbox.io/s/wk2vo6zx87 import React from "react";
import { render } from "react-dom";
import { css } from "emotion";
const cssHotDog = css`
&--hotdog-button, &--not-hotdog-button {
border: solid 1px black;
padding: 5px;
margin-left: 5px
}
&--hotdog-button {
background: red;
color: white;
}
&--not-hotdog-button {
background: yellow;
color: black;
}
`;
const cssHotDog__hotdog_button = cssHotDog + "--hotdog-button";
const cssHotDog__not_hotdog_button = cssHotDog + "--not-hotdog-button";
const Hotdog = () => (
<div className={cssHotDog}>
🌭
<button className={cssHotDog__hotdog_button}>Hotdog</button>
<button className={cssHotDog__not_hotdog_button}>Not Hotdog</button>
</div>
);
render(<Hotdog />, document.getElementById("root"));; |
Any help reviewing and editing would be appreciated. Please let me know what you think and if I should cover any topics.
Draft Link
https://medium.com/@tkh44/css-in-js-has-arrived-9f892346d0af
Thanks!
The text was updated successfully, but these errors were encountered: