Skip to content

OPTI-11125 add nested shadow dom with style rule example #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/serve.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const ctx = await esbuild.context(settings);
await ctx.watch();

const { port } = await ctx.serve({
port: 5000,
port: 8000,
servedir: 'www',
fallback: 'index.html',
});
Expand Down
2 changes: 1 addition & 1 deletion dist/index.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/src/data-collector/data-collector.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ export declare class DataCollector {
private removeDefaultStyles;
private getAttributesList;
private cleanUpText;
private escapeQuotation;
}
14 changes: 12 additions & 2 deletions www/data-collector.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}
customElements.define('my-element', MyElement);
</script>
<script type="module">
<script type="module">
import { DataCollector } from './index.js';

async function collectData () {
Expand All @@ -56,7 +56,17 @@ <h2>Data collector</h2>
<pre id="data_collector_output"></pre>
<my-element>
<div slot="main">This is a custom element</div>
<p class="nest-text-red">with some content</p>
</my-element>
<my-element>
<div slot="main">
<my-element>
<style>.nest-text-red { color: red; }</style>
<div slot="main" class="nest-text-red">This is a nested custom element</div>
<p>with some content</p>
</my-element>
</div>
<p>with some content</p>
</my-element>
</body>
</html>
</html>