# apple-liquid-glass-webgl
> Apple-style Liquid Glass for the web, rendered with WebGL2. A zero-dependency JavaScript
> package (MIT, npm: `apple-liquid-glass-webgl`) that gives any HTML element a glass surface
> which refracts what is actually behind that element on the page, while it scrolls, resizes
> and animates. Unlike CSS `backdrop-filter`, which can only blur and tint, it bends the
> backdrop through the shape of the glass, captures the scene at the edges, splits the colour
> channels and adds rim light, backdrop reflection, a specular highlight and a contour hairline.
>
> Two things set it apart from the other Liquid Glass libraries. **The refraction works in
> Safari and Firefox**, because it never uses `backdrop-filter: url(#filter)` — the SVG
> displacement trick that only Chromium honours, leaving Safari and Firefox with a flat blur.
> It bends the backdrop in a WebGL2 fragment shader, and WebGL2 ships in Chrome, Edge, Firefox
> and Safari 15+. **And it keeps your DOM**: only the backdrop is repainted into a canvas, so
> the element's own text stays real text — selectable, translatable and screen-reader
> accessible — which is the trade-off people usually accept when choosing WebGL glass.
The whole integration is two lines:
```js
import { LiquidGlass } from 'apple-liquid-glass-webgl';
new LiquidGlass('.navbar');
```
Key facts:
- Version 2.5.1, MIT licensed, no runtime dependencies, plain ES modules with TypeScript
declarations, no build step. Requires a browser with WebGL2 (Chrome, Edge, Firefox,
Safari 15+); falls back to CSS `backdrop-filter` everywhere else.
- No background image is required. The default `backdrop: 'auto'` repaints the real page
below the element in CSS paint order (backgrounds, borders, `
`, `