Skip to content

A CSS Houdini paint worklet, that draws borders on boxes, that look similar to game UI's like StarCraft

Notifications You must be signed in to change notification settings

HolyMarcell/css-scf-border

Repository files navigation

@holymarcell/css-scf-border

A custom beveled border implemented with the CSS Paint worklet api.

demo

See: https://holymarcell.github.io/css-scf-border/

usage:

Simple: (Not currently supported with Firefox)

if ('paintWorklet' in CSS) {
  CSS.paintWorklet.addModule('"https://unpkg.com/@holymarcell/css-scf-border@0.1.1/src/scfBorder.js');
}

In React (with snowpack): Copy the source over to your workdir and use this in your index.tsx

The Polyfill makes this css feature work in firefox.

import 'css-paint-polyfill';
CSS.paintWorklet.addModule(new URL('./scfBorder.js', import.meta.url));

About

A CSS Houdini paint worklet, that draws borders on boxes, that look similar to game UI's like StarCraft

Resources

Stars

Watchers

Forks

Packages

No packages published