
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
@gojek/postcss-customprop-validate
Advanced tools
validates a CSS file to validate the CSS Custom Properties' default values
PostCSS plugin to scan a CSS file and validate the CSS Custom Properties' default values.
Use CSS Custom Properties without worrying about the correctness of the default values. This plugin will either auto-correct the CSS file or return an array of all the incorrect ones.
Install with npm:
npm install @gojek/postcss-customprop-validate --save-dev
or with yarn:
yarn add @gojek/postcss-customprop-validate --dev
Add PostCSS to your build tool:
npm install postcss --save-dev
Use postcss-customprop-validate as a plugin:
import postcss from 'postcss'
import validate from '@gojek/postcss-customprop-validate'
postcss([
validate(/* options */)
])
Add Rollup Plugin PostCSS to your build tool:
npm install rollup-plugin-postcss --save-dev
Use postcss-customprop-validate in your rollup.config.js:
import postcss from 'rollup-plugin-postcss'
import validate from '@gojek/postcss-customprop-validate'
export default {
plugins: [
postcss({
plugins: [
validate(/* options */)
]
})
]
}
| Option | Required | Description | Default |
|---|---|---|---|
| variables | true | JSON containing the custom properties with their default values. The plugin will throw an error if not passed | N.A. |
| write | false | Rewrites the CSS file with correct values | false |
| callback | false | Calls callback with an array of incorrect custom properties after the plugin runs. | () => {} |
import postcss from "postcss"
import validate from "@gojek/postcss-customprop-validate"
/** CSS with incorrect default values of custom properties */
const css2 = `.Danger {
color: var(--color-red, red);
border: var(--custom-border, var(--border-radius, 8px) solid var(--color-red, hsla(292, 56%, 33%, 1)));
}`
/** CSS custom properties JSON to validate values from */
const variables = {
"--border-radius": "4px",
"--color-red": "hsla(292, 56%, 33%, 1)",
"--custom-border":
"var(--border-radius, 4px) solid var(--color-red, hsla(292, 56%, 33%, 1))"
}
const logValues = arr => console.log(arr)
const process = await postcss([
validate({ write: false, variables, callback: logValues })
]).process(css)
postcss-customprop-validate will read the CSS and log the result as:
[
{
path: { absolute path }, // the absolute path of the CSS file
line: 2,
key: '--color-red',
current: 'red',
expected: 'hsla(292, 56%, 33%, 1)'
},
{
path: { absolute path }, // the absolute path of the CSS file
line: 3,
key: '--custom-border',
current: 'var(--border-radius, 8px) solid var(--color-red, hsla(292, 56%, 33%, 1))',
expected: 'var(--border-radius, 4px) solid var(--color-red, hsla(292, 56%, 33%, 1))'
},
{
path: { absolute path }, // the absolute path of the CSS file
line: 3,
key: '--border-radius',
current: '8px',
expected: '4px'
}
]
FAQs
validates a CSS file to validate the CSS Custom Properties' default values
The npm package @gojek/postcss-customprop-validate receives a total of 2 weekly downloads. As such, @gojek/postcss-customprop-validate popularity was classified as not popular.
We found that @gojek/postcss-customprop-validate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.