@pitcher/theme
v1.0.2
Published
This is the JavaScript API to apply DaisyUI theme and expose basic theme CSS variables for Pitcher applications.
Downloads
243
Maintainers
Keywords
Readme
@pitcher/theme
This is the JavaScript API to apply DaisyUI theme and expose basic theme CSS variables for Pitcher applications.
Usage
In the browser
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/[email protected]/dist/tailwind.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/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>