
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
@plotdb/csscope
Advanced tools
add custom scope to any css. Use browser thus only works in browsers.
install via npm:
npm install --save @plotdb/csscope
then, include csscope.js, and convert css as follow:
scopedCSS = csscope("desired-scope-name", "your-css-code")
or, with object as option:
scopedCSS = csscope({css: "your css code", name: "desired-scope-name", scopeTest: "..."})
or, create a converter to convert:
scope = new csscope.converter({ scopeTest: '...' });
var scopedCSS = scope.convert({ ... });
options:
.your-scope-namescopeTest is a css selector rule for which if certain node matches then it's the root of a scope.
This is used to identify scope boundary in DOM, according how users label and identify the root element of scopes by their implementation.
For example, following DOM ( in Pug ) use [ld-scope] to separate each scope:
div(ld-scope,scope-id="0a2c92a0e7e82")
h2 This is the root scope.
div(ld-scope,scope-id="4c26846e44f68")
h2 This is a child scope.
when we specify scopeTest option, we can ensure that the style for h2 element in the parent won't affect h2 element in its child.
scopeTest is by default undefined (or by default the value specified in option when calling csscope.converter constructor), in this case there is no scope boundary so all parent rules penetrate into their children.
To style element of scope root, simply use :scope pseudo class:
:scope { background: #000; color: #fff}
csscope will replace :scope with the corresponding scope selector.
Generate js / css files and use csscope.cache to preload assets.
Load from JS:
csscope.cache({inited: false, code: 'scoped-css-code', scope: 'scope-name'});
Load from CSS:
script csscope.cache({inited: true, scope: 'scope-name'});
style: include bundle.css
Test against all major browsers.
MIT
FAQs
add scope to any css code
The npm package @plotdb/csscope receives a total of 21 weekly downloads. As such, @plotdb/csscope popularity was classified as not popular.
We found that @plotdb/csscope demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.