Skip to content

Media queries are removed after applying changes from the HTML code editor #57

@federicopasquarelli

Description

@federicopasquarelli

When using the HTML section of the grapesjs-component-code-editor plugin, clicking the 'Apply' button removes all @media queries from the CSS.

STEPS TO REPRODUCE:

  • Open the following CodePen link in a browser: https://codepen.io/ju99ernaut/pen/RwaqwPQ
  • Select the text block with the class .description on the canvas.
  • On the right-side panel, open the Typography sector and choose a custom color.
  • Change the canvas device view to Mobile portrait and repeat the previous step, choosing a different custom color. This action creates a media query.
  • Open the code editor panel and navigate to the HTML section.
  • Click the "Apply" button without making any changes to the code.
  • Observe that the media query is now gone from the Style Manager and the exported CSS.

Expected Behavior:
The media queries should be preserved and not be removed when applying changes from the HTML code editor.

Actual Behavior:
The media queries are deleted from the styles, causing the responsive design to be lost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions