Skip to content

v0.0.6

Compare
Choose a tag to compare
@cristicretu cristicretu released this 21 Aug 13:03
· 8 commits to main since this release
5bc30da

What's new

Added support for all frameworks ✨
You can now use meshgrad with Svelte, React, Vanilla Javascript and more!

New usage

JSX

import { generateJSXMeshGradient } from 'meshgrad'
// same syntax (generateJSXMeshGradient(6))

Svelte

<script>
import { generateMeshGradient } from 'meshgrad';

// Number of color stops
const ELEMENTS = 6;
</script>

<div style={generateMeshGradient(ELEMENTS)} class="..."/>

Vanilla

// Add cdn from skypack
<script type="module">
  import { generateMeshGradient } from "https://cdn.skypack.dev/meshgrad";

  // Number of color stops
  const ELEMENTS = 6;

  document.getElementById("box");
  box.style = generateMeshGradient(ELEMENTS);
</script>

<div id="box" class="..." />