CSS Mask Parallax Demo - Online Scroll Reveal Effect
Use CSS masks and fixed backgrounds to create a unique parallax reveal effect. Copy the code. No JavaScript.
UD5 Toolkit
Interactive Shadow DOM Playground â experiment with <slot> elements, named slots, and fallback content
| Slot Name | Assigned Content | Status |
|---|---|---|
| Edit templates to see slot assignments | ||
slot="name" attribute in Light DOM to target named slots. Content without a slot attribute goes to the default slot <slot></slot>.
Shadow DOM provides encapsulation for Web Components, isolating styles and markup from the main document.
Slots (<slot>) act as placeholders within the shadow DOM that allow light DOM content (content outside the shadow root)
to be projected into specific positions. This creates a composition model where the component defines structure (shadow DOM)
and the consumer provides content (light DOM).
Named slots use the name attribute (e.g., <slot name="header">) and are targeted by light DOM elements
with matching slot attributes (e.g., <div slot="header">).
The default slot has no name attribute and catches all light DOM content that doesn't specify a slot attribute.
If no default slot exists, unmatched light DOM content is not rendered.
Fallback content is placed directly inside a <slot> element. It displays only when no corresponding light DOM content
is projected into that slot. For example: <slot name="footer">Default Footer</slot> will show "Default Footer"
unless the user provides a <footer slot="footer">...</footer> element.
Yes, but with limitations. Use the ::slotted() pseudo-element inside shadow DOM styles to target slotted content.
For example: ::slotted(span) { color: red; } styles <span> elements projected into slots.
However, ::slotted() only affects top-level slotted nodes â nested children cannot be directly styled from the shadow DOM.
Light DOM styles from the main document also apply to slotted content.
Nested slots occur when a slotted element is itself a custom element with its own shadow DOM containing slots. The browser resolves slot assignments recursively: outer slots are assigned first, then inner slots within the projected content. This enables powerful composition patterns but requires careful planning of the slot hierarchy.
Shadow DOM (v1) and <slot> are supported in all modern browsers: Chrome 53+, Firefox 63+,
Safari 10+, and Edge 79+. Internet Explorer does not support Shadow DOM.
For legacy browser support, consider using polyfills like @webcomponents/webcomponentsjs.
Without any <slot> elements, the shadow DOM is fully encapsulated and light DOM content is not displayed.
The component renders only its internal shadow DOM structure. This is useful for self-contained components that don't need external content projection,
like a fully self-contained chart widget or icon component.
Use CSS masks and fixed backgrounds to create a unique parallax reveal effect. Copy the code. No JavaScript.
Register and apply a custom paint worklet to draw a background pattern dynamically. Write the paint function in the browser.
Visually create the glassmorphism effect: background blur, transparency, and border. Copy the complete CSS. Modern UI design.
Write JavaScript using element.animate() and see the result in a live preview. Compare with CSS keyframes. Debugger included.
Create CSS maskâimage effects with custom shapes, gradients, and SVGs. Visually see the mask applied to an image. Copy the CSS.
Apply contentâvisibility: auto to offâscreen sections and see the rendering cost drop. Demos for infinite scroll optimization.
Write a paint worklet in JavaScript and see it used as a CSS background instantly. Experiment with Houdini. Local.
Apply a Proxy to an object and see the get/set traps log fired in real time. Understand metaprogramming. Local.
Write or paste HTML, CSS, and JavaScript and instantly see the rendered output in a sandboxed iframe. A handy frontend prototyping tool.
See the View Transitions API in action. Crossâfade and morph between two states. Copy the JavaScript starter code.
Limit browser gestures on an element: panâx, pinchâzoom, manipulation. Draw on a canvas to test. Mobile dev helper.
Select any HTML element on a page and capture its screenshot. Download as PNG. Perfect for bug reports. JavaScript API demo.
Toggle contentâvisibility: auto on long blocks and see the rendering time difference. Understand this powerful property.
Draw shapes and experiment with globalCompositeOperation. See PorterâDuff operators in action. Great for game devs.
Render the classic Stanford Bunny with a basic WebGPU pipeline. Rotate and zoom. Check if your browser supports WebGPU.
Customize falling snow particles with pure CSS or canvas. Adjust speed, size, and wind. Copy the code for your website.
Render 1000 styled elements using inline styles vs. CSS classes and compare time. Understand CSSâinâJS tradeâoffs.
Create an animation that advances with scroll using animationâtimeline: scroll(). See the visual timeline editor. Modern CSS.
See how overflow: visible, hidden, scroll, and auto behave with real content. Clone to test with your text.
Type raw HTML and see the escaped version, then see how it renders when unescaped. Understand encoding better.
Generate a complete <head> section with meta charset, viewport, SEO, favicon, and social tags. Customize and copy.
Help the bird fly through pipes without touching them. Click or tap to flap. Track your high score in localStorage. Classic timeâwaster.
Open a modal and see how focus is trapped and restored. Copy the lightweight focusâtrap code. Accessible pattern.
Adjust root, margin, and threshold. See a live log of intersection events as you scroll. Debug lazy loading.
A beautiful fullâscreen drawing canvas with variable brush sizes, colors, and an eraser. Export your sketch as PNG. All data stays local.
Run a CPUâheavy calculation (e.g., prime numbers) in a Web Worker and see the UI stay responsive. Code snippet provided.
Define the initial scroll position for a scroll container with scrollâstart. Test with and without snapping. New feature.
Check if your site has a visible and functional skip navigation link. Key for keyboardâonly users.
Pick a random icebreaker question or activity for remote meetings. Never start a meeting awkwardly again.
Create a pure CSS scroll progress indicator using animationâtimeline: scroll(). No JavaScript. Copy the complete code.