Skip to content
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

Closed
tkh44 opened this issue Oct 2, 2017 · 6 comments
Closed

Version 8 blog article #373

tkh44 opened this issue Oct 2, 2017 · 6 comments

Comments

@tkh44
Copy link
Member

tkh44 commented Oct 2, 2017

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!

@quantizor
Copy link
Contributor

Is __PURE__ still a thing? I thought that was removed in favor of the side-effects package.json flag

@tkh44
Copy link
Member Author

tkh44 commented Oct 3, 2017

It looks like __PURE__ is actually an Uglify feature. I'll clear that up. Thanks @probablyup

@utopiaio
Copy link
Contributor

utopiaio commented Oct 3, 2017

There should be a mention of the other breaking change of nested class selectors. My switch from emotion 6 to 7 caused a bit of a bump (no pun intended 😁)


Thank you very much for emotion, an absolute joy to work with

@smashercosmo
Copy link

Worth to mention this (very upsetting) side effect of removing "component as selector" - #370

@richardanaya
Copy link

richardanaya commented Oct 3, 2017

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.

css' %generated-name%-subelement { color: blue; } '

My suggestion would be to also mention the new CDN packages and a link to a Jsfiddle with hello world type example! 😊

@richardanaya
Copy link

richardanaya commented Oct 4, 2017

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"));;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants