
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
open-styleable
Advanced tools
A proof-of-concept implementation of open-styleable shadow-roots, using a combination of:
A proof-of-concept implementation of open-styleable shadow-roots, using a combination of:
attachShadowView the hosted examples:
Edit the code live:
(See standalone setup instructions below if you're trying to use this in your own project) 👀
The access for open styles is controlled at the shadow-root level. Every shadow-root needs to explicitly opt-in using one of the following ways.
For declarative shadow DOM (DSD):
Add the adopthoststyles attribute to the DSD template. This shadow-root will now automatically inherit all styles from the host context (i.e. the document or a parent shadow-root).
<template shadowrootmode="open" adopthoststyles>…</template>
Alternatively, if you only want to adopt styles from the document and not from the parent shadow-root, then you can use adoptpagestyles.
<template shadowrootmode="open" adoptpagestyles>…</template>
For client-rendered shadow-roots, use the adoptPageStyles and adoptHostStyles options when calling attachShadow.
adoptHostStyles to adopt all styles from the host context.
this.attachShadow({
mode: "open",
adoptHostStyles: true,
});
adoptPageStyles to adopt all styles from the page/document only.
this.attachShadow({
mode: "open",
adoptPageStyles: true,
});
[!IMPORTANT] There are some known limitations/caveats that you should be aware of.
To use this "polyfill" in your own project:
open-styleable from npm (or use import maps).
npm add open-styleable
.eleventy.js for an example). This should ideally be executed after all bundling steps.
import { transformHtml } from "open-styleable";
// assuming `htmlContent` is the original page content
htmlContent = transformHtml(htmlContent);
/client script in your <head> before any custom elements are registered.
<script>
import "open-styleable/client";
</script>
or from a CDN:
<script src="https://esm.sh/open-styleable/client"></script>
[!NOTE] You do not always need to use both the build-time transform and the client-side script. They are completely independent and do different things.
This demo is built with 11ty. All test pages go in the pages/ directory.
To run it locally, clone the repo and follow these steps:
Install dependencies.
npm install
Start the dev server.
npm run dev
Open up localhost:1174 in your browser.
FAQs
A proof-of-concept implementation of open-styleable shadow-roots, using a combination of:
The npm package open-styleable receives a total of 1 weekly downloads. As such, open-styleable popularity was classified as not popular.
We found that open-styleable 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.