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

BUG: Name of @container directive is missing a space when exporting CSS #5969

Open
2 tasks done
uncldrw opened this issue Jun 25, 2024 · 0 comments
Open
2 tasks done

Comments

@uncldrw
Copy link

uncldrw commented Jun 25, 2024

GrapesJS version

  • I confirm to use the latest version of GrapesJS

What browser are you using?

Chrome LTS

Reproducible demo link

/

Describe the bug

I noticed that the @container directive is missing a whitespace when exporting the code.

This is the code I provide:

@container portable (max-width: 639px) {
    .teaser-paa__headline {
      font-size: 24px;
      line-height: 29px;
      max-width: 272px;
      margin: 0 auto;
    }
  }

To use it in a custom block, I save the CSS into the style attribute of a block, which looks like this:

@container portable (max-width:639px){.teaser-paa__wrapper{max-width:calc(100% - 24px)}}

To ensure proper spacing, I tried adding an escaped space without success:

@container portable\u0020(max-width:639px){.teaser-paa__wrapper{max-width:calc(100% - 24px)}}

When opening the code export, there is a missing space after the @container name, which results in broken CSS that does not work in HTML.

Resulting CSS:

@container portable(max-width: 639px) { // missing whitespace after portable
    .teaser-paa__headline {
      font-size: 24px;
      line-height: 29px;
      max-width: 272px;
      margin: 0 auto;
    }
  }

This issue needs to be addressed to ensure the @container queries function correctly in the exported CSS.

Code of Conduct

  • I agree to follow this project's Code of Conduct
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

1 participant