This is the JavaScript API to apply DaisyUI theme and expose basic theme CSS variables for Pitcher applications.
Just include @pitcher/theme
after @pitcher/js-api
and theme will be applied automatically. You can optionally
initialize it manually at any time if you want.
<!doctype html>
<html>
<head>
<title>My app</title>
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.0.4/dist/tailwind.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/daisyui@4.10.2/dist/styled.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/@pitcher/js-api"></script>
<script src="https://cdn.jsdelivr.net/npm/@pitcher/theme"></script>
</head>
<body>
<script>
// optionally initialize the theme manually
pitcherTheme.applyTheme(() => pitcher.usePitcherApi().getEnv())
</script>
</body>
</html>