feat: add dasyui for backpex
This commit is contained in:
parent
5d0e8b5f78
commit
a958b49a7c
7 changed files with 35 additions and 3 deletions
|
|
@ -2,6 +2,10 @@
|
|||
@import "tailwindcss/components";
|
||||
@import "tailwindcss/utilities";
|
||||
|
||||
@plugin "daisyui" {
|
||||
themes: light, dark;
|
||||
}
|
||||
|
||||
@source "../../deps/backpex/**/*.*ex";
|
||||
@source '../../deps/backpex/assets/js/**/*.*js'
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ import {LiveSocket} from "phoenix_live_view"
|
|||
import { Hooks as BackpexHooks } from 'backpex'
|
||||
import topbar from "../vendor/topbar"
|
||||
|
||||
// Set stored theme as soon as possible
|
||||
BackpexHooks.BackpexThemeSelector.setStoredTheme()
|
||||
|
||||
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
|
||||
let liveSocket = new LiveSocket("/live", Socket, {
|
||||
longPollFallbackMs: 2500,
|
||||
|
|
|
|||
20
assets/package-lock.json
generated
Normal file
20
assets/package-lock.json
generated
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name": "assets",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"daisyui": "^5.0.43"
|
||||
}
|
||||
},
|
||||
"node_modules/daisyui": {
|
||||
"version": "5.0.43",
|
||||
"resolved": "https://registry.npmjs.org/daisyui/-/daisyui-5.0.43.tgz",
|
||||
"integrity": "sha512-2pshHJ73vetSpsbAyaOncGnNYL0mwvgseS1EWy1I9Qpw8D11OuBoDNIWrPIME4UFcq2xuff3A9x+eXbuFR9fUQ==",
|
||||
"funding": {
|
||||
"url": "https://github.com/saadeghi/daisyui?sponsor=1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
5
assets/package.json
Normal file
5
assets/package.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"daisyui": "^5.0.43"
|
||||
}
|
||||
}
|
||||
|
|
@ -19,7 +19,6 @@ module.exports = {
|
|||
},
|
||||
},
|
||||
plugins: [
|
||||
require("@tailwindcss/forms"),
|
||||
// Allows prefixing tailwind classes with LiveView classes to add rules
|
||||
// only when LiveView classes are applied, for example:
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" class="[scrollbar-gutter:stable]">
|
||||
<html lang="en" class="[scrollbar-gutter:stable]" data-theme={assigns[:theme] || "light"}>
|
||||
<head>
|
||||
{Application.get_env(:live_debugger, :live_debugger_tags)}
|
||||
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
|
||||
</script>
|
||||
</head>
|
||||
<body class="bg-white">
|
||||
<body>
|
||||
{@inner_content}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ defmodule MvWeb.Router do
|
|||
plug :put_root_layout, html: {MvWeb.Layouts, :root}
|
||||
plug :protect_from_forgery
|
||||
plug :put_secure_browser_headers
|
||||
plug Backpex.ThemeSelectorPlug
|
||||
end
|
||||
|
||||
pipeline :api do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue