Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
postcss-animations
Advanced tools
Changelog
8.0.0
10.0.0
Readme
PostCSS plugin that adds @keyframes
from:
yarn add -D postcss-animations
# and the animation data set you need
yarn add -D postcss-animation.css-data postcss-magic.css-data postcss-mimic.css-data postcss-tuesday.css-data
Input:
:root {
--fade-in-animation-name: tdFadeOut; /* add css variables support (Disabled default) */
}
.tdFadeIn {
animation-name: tdFadeIn;
}
.tdFadeOut {
animation-name: var(--fade-in-animation-name); /* or css variables */
}
Output:
:root {
--fade-in-animation-name: tdFadeOut;
}
.tdFadeIn {
animation-name: tdFadeIn;
}
.tdFadeOut {
animation-name: var(--fade-in-animation-name);
}
@keyframes tdFadeIn {
/* ... */
}
@keyframes tdFadeOut {
/* will be added if 'disableCheckCssVariables: false' */
/* ... */
}
const fs = require("fs");
const postcss = require("postcss");
const postcssAnimations = require("postcss-animations");
const [from, to] = ["./src/style.css", "./dist/style.css"];
const CSS = fs.readFileSync(from);
const PLUGINS = [
postcssAnimations({
data: [
require("postcss-animation.css-data"),
require("postcss-magic.css-data"),
require("postcss-mimic.css-data"),
require("postcss-tuesday.css-data"),
],
checkDuplications: true,
disableCheckCssVariables: true,
}),
];
(async () => {
try {
const { css, messages } = await postcss(PLUGINS).process(CSS, { from, to });
messages
.filter(({ type }) => type === "warning")
.map((msg) => console.log(msg.toString()));
console.log(css);
fs.writeFileSync(to, css);
} catch (e) {
console.error(e);
}
})();
data: Array<{[animationName: string]: string}> | {[animationName: string]: string}
data
is a simple object where:
key
: animation namevalue
: css code of animation// Plain object
const data = {
myAnimationName: `@keyframes myAnimationName { 0%{opacity:1;} 100%{opacity:0;} }`,
};
// or Array
const data = [
{
myAnimationName: `@keyframes myAnimationName { 0%{opacity:1;} 100%{opacity:0;} }`,
},
require("postcss-animation.css-data"),
];
disableCheckCssVariables: boolean
Disable checking and search variables css var(--name)
(default: true
)
checkDuplications: boolean
Display a warning if find duplicate name of the animation (default: true
)
const {
css: parseFromCss,
files: parseFromFile,
} = require("css-parse-keyframes");
postcss([
require("postcss-animations")({
data: [
// your Generated code
parseFromCss(
"@keyframes scale-up-center {0% { transform: scale(0.5); } 100% { transform: scale(1); }}"
),
// or saved
parseFromFile("./animista-demo.css"),
parseFromFile(["./animista-text.css", "./animista-base.css"]),
],
}),
]);
FAQs
PostCSS plugin that adds `@keyframes` from animate.css, tuesday.css, magic.css, mimic.css
The npm package postcss-animations receives a total of 107 weekly downloads. As such, postcss-animations popularity was classified as not popular.
We found that postcss-animations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.