Issue #3599Opened July 7, 2021by niranjank1510 reactions

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

Question

Hi @artf,

Code SnippetTEXT
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 (1)

artfJuly 23, 20210 reactions

Use this one

editor. CssComposer.getAll().add(`@keyframes fadeTop { ... }`) // Your CSS string

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.