styled-jsx: Pseudo classes and elements broken in recent version

Since upgrading next@3.0.0-beta6 to next@3.0.0-beta8, chained pseudo classes such as :not() and :disabled are broken. I assume this is due to a newer version of styled-jsx. I tried the same styles using https://stylis.js.org without the issue appearing, so it must be something to do with styled-jsx?

With this contrived example:

const Textarea = props => (
  <div>
    <textarea {...props} />
    <style jsx>{`
      textarea:not(:focus) {
        border-color: blue;
      }
      textarea:not(:focus):disabled {
        opacity: 0.5;
      }
    `}</style>
  </div>
)

Before update (correct):

textarea[data-jsx="451418276"]:not(:focus) {
  border-color: blue;
}

textarea[data-jsx="451418276"]:not(:focus):disabled {
  opacity: 0.5;
}

After update (incorrect):

textarea[data-jsx="451418276"]:not([data-jsx="451418276"]:focus) {
  border-color: blue;
}

textarea[data-jsx="451418276"]:not([data-jsx="451418276"]:focus) [data-jsx="451418276"]:disabled {
  opacity: 0.5
}

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 3
  • Comments: 15 (12 by maintainers)

Most upvoted comments

patched in v3.0.14

@krisztianpuska directly related to #29 patched in v3.0.15

I’ll look into this

@sidorares How does your input vs output look like? @jaydenseric https://stylis.js.org Does not use cascade isolation so it might not show there.

having same issue ( hi @jaydenseric ! ) :before selector not working since updating to next@2.4.1 today