點燈坊

失くすものさえない今が強くなるチャンスよ

Playing daisyUI with CDN

Sam Xiao's Avatar 2021-12-26

We can play daisyUI by CDN just like TailwindCSS.

Version

TailwindCSS 3.0
daisyUI 1.19

CDN

cdn000

<button> is styled by daisyUI.

<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script src="https://unpkg.com/alpinejs" defer></script>
  <script src="https://cdn.tailwindcss.com"></script>
  <link href="https://cdnjs.cloudflare.com/ajax/libs/daisyui/1.19.0/full.min.css" rel="stylesheet"/>
  <title>daisyUI</title>
</head>

<body>
  <button class="btn">Button</button>
</body>
</html>

Line 8

<link href="https://cdnjs.cloudflare.com/ajax/libs/daisyui/1.19.0/full.min.css" rel="stylesheet"/>

daisyUI is enabled by CDN.

Line 10

<button class="btn">Button</button>
  • btn : style <button> with default style

Conclusion

  • The official site of daisyUI doesn’t mention the usage of CDN. But we can use CDN provided by Cloudflare to play daisyUI