
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
inline-style-editor
Advanced tools
Lightweight (~55KB, ~22KB gzipped) tool to graphically change style and CSS (on classes or inline) using a graphical interface.
See demo.
npm install inline-style-editor
Then, to use it:
<script>
import InlineStyleEditor from "inline-style-editor";
</script>
<InlineStyleEditor />
import InlineStyleEditor from "node_modules/inline-style-editor/dist/inline-style-editor.mjs";
new InlineStyleEditor();
Also don't forget to import the css in: node_modules/inline-style-editor/dist/inline-style-editor.css
.
<link rel="stylesheet" type="text/css" href="https://unpkg.com/inline-style-editor@1.0.0/dist/inline-style-editor.css" />
<script src="https://unpkg.com/inline-style-editor@1.0.0/dist/inline-style-editor.js"></script>
Manual opening of editor:
const editor = new InlineStyleEditor();
document.body.addEventListener('click', (e) => {
const target = e.target;
editor.open(target, e.pageX, e.pageY);
});
Or automatic (in which case it automatically listen to the <body>
element for clicks):
new InlineStyleEditor({
listenOnClick: true,
});
option | type | Description |
---|---|---|
listenOnClick | Boolean | Default to false. If true, click events will be listened on the <body> element, and the editor opened where clicked |
getAdditionalElems | Function | A function called everytime the editor is opened. Should return a list of HTMLElement, that will be editable as well |
FAQs
Update CSS rules or add inline style to elements visualy
The npm package inline-style-editor receives a total of 4 weekly downloads. As such, inline-style-editor popularity was classified as not popular.
We found that inline-style-editor 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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.