Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

v2.0.0

Compare
Choose a tag to compare
@joe-bell joe-bell released this 11 Jun 10:35
· 307 commits to main since this release
3bae515

Key Changes

  • πŸ”₯ 90% less CSS by default
  • 🌐 Remote image support
  • πŸ“ Size customisation
  • 🧹 Improvements to DX and docs
  • πŸ†• A brand new Tailwind JIT plugin

See the new plaiceholder.co/docs for more

Migration

@plaiceholder/css

-- import { getPixelsCSS } from "@plaiceholder/css";
-- import { getImage } from "@plaiceholder/next";
--
-- const src = "/assets/images/preview/preview.jpg";
-- const img = await getImage(src);
-- const pixelsCSS = await getPixelsCSS(img);

++ import { getPlaiceholder } from "plaiceholder";
++ const { css } = getPlaiceholder("/assets/images/preview/preview.jpg");

@plaiceholder/svg

-- import { getPixelsSVG } from "@plaiceholder/svg";
-- import { getImage } from "@plaiceholder/next";
--
-- const src = "/assets/images/preview/preview.jpg";
-- const img = await getImage(src);
-- const pixelsSVG= await getPixelsSVG(img);

++ import { getPlaiceholder } from "plaiceholder";
++ const { svg } = getPlaiceholder("/assets/images/preview/preview.jpg");

@plaiceholder/base64

-- import { getBase64 } from "@plaiceholder/base64";
-- import { getImage } from "@plaiceholder/next";
--
-- const src = "/assets/images/preview/preview.jpg";
-- const img = await getImage(src);
-- const base64= await getBase64(img);

++ import { getPlaiceholder } from "plaiceholder";
++ const { base64 } = getPlaiceholder("/assets/images/preview/preview.jpg");

@plaiceholder/blurhash

-- import { getBlurhash } from "@plaiceholder/blurhash";
-- import { getImage } from "@plaiceholder/next";
--
-- const src = "/assets/images/preview/preview.jpg";
-- const img = await getImage(src);
-- const blurhash= await getBlurhash(img);

++ import { getPlaiceholder } from "plaiceholder";
++ const { blurhash } = getPlaiceholder("/assets/images/preview/preview.jpg");