vercel/styled-jsx

CSS `content` property no longer renders encoded characters

Open

#589 aberto em 15 de out. de 2019

Ver no GitHub
 (17 comments) (1 reaction) (0 assignees)JavaScript (310 forks)batch import
bughelp wanted

Métricas do repositório

Stars
 (7.547 stars)
Métricas de merge de PR
 (Mesclagem média 25d 23h) (1 fundiu PR em 30d)

Description

Do you want to request a feature or report a bug?

bug

What is the current behavior?

Old behavior now must be done through string-literal instead of standard string.

If the current behavior is a bug, please provide the steps to reproduce and possibly a minimal demo or testcase in the form of a Next.js app, CodeSandbox URL or similar

The following no longer works in NextJS 9.1.1 to render a encoded character:

<style jsx>{`
.whatever-class:after { content: "\\0025B6"; };
</style>

We now have to do:

.whatever-class:after { content: ${`"\\0025B6"`}; }

What is the expected behavior?

Standard way of rendering content should still work.

Environment (include versions)

  • OS: macOS Catalina
  • Browser: Chrome 77
  • styled-jsx (version): NextJS 9.1 bundled (styled-jsx@3.2.2)

Did this work in previous versions?

Yes

Guia do colaborador