@keyframes not adding even after i pass the the keyframes object
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 (1)
Use this one
editor. CssComposer.getAll().add(`@keyframes fadeTop { ... }`) // Your CSS string
Related Questions and Answers
Continue research with similar issue discussions.
Issue #843
[QUESTION] - CssComposer - removes unused classes
hi @artf , I import a html , using import from grapesjs-preset-newsletter, with some css classes inside the <style> tag. After the import,...
Issue #2079
Make Css style to not be returned
How to prevent the CSS of a block/component to be not returned when we used editor.getCss(); it's like https://grapesjs.com/docs/api/compon...
Issue #4341
while adding border style for Html component css json only fetching for border selector not fetching selector of border-width, border-style, border-colorBUG:
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? chrome v101.0.4951.54 Reproducible demo li...
Issue #3413
QUESTION: Adding inline scripts and updating old events
In that case, I suggest you access the document of the iframe and to append manually the inline script (to get the document use editor.Canv...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.