On this page
@keyframes is defined in cssx.global.
cssx.global({ '@keyframes fade': { from: { opacity: 0, }, to: { opacity: 1, }, }, '@keyframes move': { '0%': { transform: 'translate(0px)' }, '100%': { transform: 'translate(100px)' }, }, });
@keyframes fade { from { opacity: 0; } to { opacity: 1; } } @keyframes move { 0% { transform: translate(0px); } 100% { transform: translate(100px); } }
The created animation can be used with cssx.create, cssx.set, etc.
const css = cssx.create({ box: { padding: '20px', animation: 'move 2s' }, heading: { fontSize: 24, animation: 'fade 3s infinite' } });