Issue #3599πŸ’¬ AnsweredOpened Jul 7, 2021by niranjank1510 reactions

@keyframes not adding even after i pass the the keyframes object

Quick answerby artf

Use this one

Read full answer below ↓

Question

Hi @artf, I have added the let cc = editor.CssComposer; cc.setRule('.fadetop-animate', { opacity: 0, 'animation-name': 'fadeTop' }, { atRuleType: 'keyframes', atRuleParams: 'fadeTop', selector: 'to', style:{ opacity: 1 } }); as per the Document [](https://grapesjs.com/docs/api/css_composer.html#setrule) however rule for keyframes is not getting added to the component. how to add keyframes to the component style?

Answers (2)

artfβ€’ Jul 23, 2021

Use this one

editor. CssComposer.getAll().add(`@keyframes fadeTop { ... }`) // Your CSS string
GJSBlockβ€’ May 17, 2026

Thanks for reporting this, @niranjank151. Great question about @keyframes not adding even after i pass the the keyframes object. The recommended approach with StyleManager is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() event l...

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.