axept / prejss

Get the power of PostCSS with plugins in your JSS styles. 🎨 Just put CSS into JS and get it as JSS object.
MIT License
248 stars 13 forks source link

Nested selectors not hashed #15

Closed noahehall closed 7 years ago

noahehall commented 7 years ago

notice the hashed selector is app-0-0, while the nested styles are app

image

export default preJSS`
  /*@import './src/containers/app/theme/reset.css';*/
  @import './src/containers/app/theme/popups.css';

  /* background-color: hsla( 0, 50%, 96%, 0.5); */
  app {
    max-width: 100%;
    height: 100%;
    margin: 0 auto;
    position: relative;

    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background-attachment: fixed;
    background-blend-mode: overlay;
    background-image: url(/images/crossword.png);

    & h1,
    & h2,
    & h3,
    & h4,
    & h5,
    & h6 {
      font-family: Syncopate;
    }
}
noahehall commented 7 years ago

looks like this issue was caused possibly by a collision with postcss-cssnext and jss-plugins-default, i've updated my postcssrc to this and its working fine:

{
  "plugins": {
    "postcss-import": {},
    "postcss-url": {},
    "cssnano": {},
    "postcss-browser-reporter": {},
    "postcss-reporter": {},
  }
}
DenisIzmaylov commented 7 years ago

Thanks for detailed report! Could you please share your original postcssrc?

noahehall commented 7 years ago
{
  "plugins": {
    "postcss-import": {},
    "postcss-url": {},
    "postcss-advanced-variables": {},
    "postcss-custom-properties": {},
    "postcss-minify-selectors": {},
    "postcss-cssnext": {},
    "cssnano": {},
    "postcss-browser-reporter": {},
    "postcss-reporter": {},
  }
}
DenisIzmaylov commented 7 years ago

Would be nice to debug/investigate why jss-preset-default is not compatible with PreJSS.

DenisIzmaylov commented 7 years ago

@noahehall Is the problem solved by removing postcss-cssnext?

noahehall commented 7 years ago

@DenisIzmaylov yes

DenisIzmaylov commented 7 years ago

Let's close it. Thanks for your effort. Feel free to make Pull Request or a new issue!