Issue #5372πŸ’¬ AnsweredOpened Sep 8, 2023by uncldrw0 reactions

Cannot add custom AtRule (@container, @font-face)

Quick answerby GJS Helper

The issue you're encountering where custom AtRules like @container or @font-face are compiled to @media when using editor.Css.addRules is a known limitation in GrapesJS's current CssComposer. Root Cause GrapesJS's CssComposer (the module responsible for managing CSS rules) has an internal parser that is primarily desi...

Read full answer below ↓

Question

GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Windows, Chrome, React Reproducible demo link / Describe the bug When attempting to add a custom atRules like @container or @font-face, the CSS consistently compiles to @media instead. I have tried various methods, including using Css.setRules and Css.addRules, as well as inserting an HTML string, all to no avail. This is my given code: Code of Conduct [X] I agree to follow this project's Code of Conduct

Answers (1)

GJS Helperβ€’ May 17, 2026

The issue you're encountering where custom AtRules like @container or @font-face are compiled to @media when using editor.Css.addRules is a known limitation in GrapesJS's current CssComposer. Root Cause GrapesJS's CssComposer (the module responsible for managing CSS rules) has an internal parser th...

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.