{}gss
GPU Style Sheets

Style sheets
for the GPU.

If you can write CSS, you can write GSS. Your 3D scene is a style sheet, and the GPU draws it.

d = 0.4 0.8 1.6
01

Your selectors

Classes, ids, :last-child and the cascade pick the objects, like the elements of a page.

@scene { cube.key * 4; }
.key:last-child { color: #ff5a36; }
02

Your animations

:hover, transition and @keyframes move the scene the way they move a page.

.key { transition: 0.2s ease-out; }
.key:hover { translate: 0 0.2 0; }
03

Your variables

var(), calc(), @media and light-dark() fit the scene to the page around it.

scene { --accent: #ff5a36; }
cube { color: var(--accent); }
Live

Edit it. It compiles as you type.

open in the playground →
loading drag to orbit · scroll to zoom
Install · v0.0.8

npm package

Compile and render GSS in your application, with TypeScript types included.

npm install gss-lang@0.0.8
package setup →
Build time

Vite plugin

Included in gss-lang. Import .gss files and ship the runtime with the compiled scene.

import gss from "gss-lang/vite";
Vite setup →
No build step

CDN

Load the versioned browser module, then add a <gss-scene> to your page.

<script type="module" src="https://cdn.jsdelivr.net/npm/gss-lang@0.0.8/lib/embed.js"></script>
CDN setup →