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

Problem with style escaping in inline HTML - Tailwindcss #174

Closed
enes-sahin opened this issue Aug 19, 2023 · 1 comment
Closed

Problem with style escaping in inline HTML - Tailwindcss #174

enes-sahin opened this issue Aug 19, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@enes-sahin
Copy link
Contributor

Describe the Bug

I encountered a problem with the style escaping in the inline HTML of the plugin's iframe when using @create-figma-plugin with tailwindcss. The issue seems to arise from the lack of escaping \ characters in the generated inline style.

Expected Behavior

The inline HTML style in the plugin's iframe should properly escape \ characters, ensuring correct rendering of styles with class names that contain colons and other special characters.

Actual Behavior

The inline HTML style lacks proper escaping of \ characters, resulting in incorrect rendering of styles containing class names with colons.

Code Example

<!-- ui.tsx -->

...

<span className="dark:text-red-500">Hello</span>

...
/* output.css */
...

@media (prefers-color-scheme: dark) {
  .dark\:text-red-500 {
    --tw-text-opacity: 1;
    color: rgb(239 68 68 / var(--tw-text-opacity));
  }
}

<!-- HTML in figma console -->
...

#document
  <html class="figma-dark">
    
    ...

    <head>

      ...

      <style id="0e077b10a7">

        ...

        @media (prefers-color-scheme: dark) {
          .dark:text-red-500 {
            --tw-text-opacity: 1;
            color: rgb(239 68 68 / var(--tw-text-opacity));
          }
        }
      </style>

    </head>

    ...

  </html>
@yuanqing yuanqing added the bug Something isn't working label Aug 20, 2023
@yuanqing
Copy link
Owner

Fixed in 2.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants