mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 06:14:48 +00:00
feat(tailwind): port theme change event
This commit is contained in:
1 parent
c432620c14
commit
3d7a5172af
3 files changed
+9
-2
No files matched your search
@@ -40,6 +40,10 @@ function addThemeToggleListener() {
|
||||
}
|
||||
}
|
||||
el.dataset.theme = document.documentElement.classList.contains("dark") ? "dark" : "light";
|
||||
|
||||
// Dispatch `hbThemeChange` event to support themeable user plugins.
|
||||
const themeChangeEvent = new CustomEvent('hbThemeChange', {detail: {isDarkTheme: () => document.documentElement.classList.contains("dark")}});
|
||||
document.dispatchEvent(themeChangeEvent);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ graduation-cap: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0
|
||||
</svg>
|
||||
arxiv: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><g style="stroke-width:.645161"><path fill="currentColor" d="M119.65 351.996a14.333 14.333 0 0 1-13.502-8.676c-2.196-5.27-.62-8.967 4.197-15.865 7.055-10.38 78.824-96.562 78.824-96.562l-15.882-14.864c-13.381-13.378-13.956-31.333-1.51-43.775l18.492-17.613-51.598-63.377c-4.005-4.268-6.485-11.756-4.248-17.131a14.643 14.643 0 0 1 13.684-9.07 13.05 13.05 0 0 1 9.838 4.86l61.369 57.057 94.576-90.07A17.51 17.51 0 0 1 325.773 32c1.604.004 3.198.245 4.732.715a17.844 17.844 0 0 1 11.871 12.252 16.52 16.52 0 0 1-4.181 15.283l-83.086 100.012 14.879 13.834c11.096 10.003 11.154 27.39.127 37.469l-16.295 15.63 56.256 66.444.074.086.066.09c5.028 6.531 7.432 11.561 4.84 17.94a23.335 23.335 0 0 1-15.256 11.85c-.676.092-1.36.137-2.043.138l-.004-.012a18.402 18.402 0 0 1-11.775-5.24l-.13-.108-.124-.111-65.207-59.127-89.896 86.24s-5.334 6.478-10.971 6.611zm178.104-33.041a11.33 11.33 0 0 0 1.432-.096 18.907 18.907 0 0 0 11.431-8.91c1.45-3.562 1.003-6.457-4.197-13.215l-56.059-66.218-26.375 25.302 64.955 58.906a14.045 14.045 0 0 0 8.813 4.217v.014zm-105.318-91.553 142.01-170.158c2.787-3.49 4.53-6.98 3.342-10.912a13.062 13.062 0 0 0-8.686-9.057 11.366 11.366 0 0 0-3.336-.506 12.77 12.77 0 0 0-8.576 3.588L175.157 175.642c-11.172 11.172-9.482 26.02 1.393 36.895z" style="stroke-width:.416233" transform="matrix(1.55 0 0 -1.55 -123.2 553.6)"/></g></svg>
|
||||
google-scholar: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="currentColor" d="M343.759 106.662V79.43L363.524 64h-213.89L20.476 176.274h85.656a82.339 82.339 0 0 0-.219 6.225c0 20.845 7.22 38.087 21.672 51.861 14.453 13.797 32.252 20.648 53.327 20.648 4.923 0 9.75-.368 14.438-1.024-2.907 6.5-4.374 12.523-4.374 18.142 0 9.875 4.499 20.43 13.467 31.642-39.234 2.67-68.061 9.732-86.437 21.163-10.531 6.5-19 14.704-25.39 24.531-6.391 9.9-9.578 20.515-9.578 31.962 0 9.648 2.062 18.336 6.219 26.062 4.156 7.726 9.578 14.07 16.312 18.984 6.718 4.968 14.469 9.101 23.219 12.469 8.734 3.344 17.406 5.718 26.061 7.062A167.052 167.052 0 0 0 180.555 448c13.469 0 26.953-1.734 40.547-5.187 13.562-3.485 26.28-8.642 38.171-15.493 11.86-6.805 21.515-16.086 28.922-27.718 7.39-11.68 11.094-24.805 11.094-39.336 0-11.016-2.25-21.039-6.75-30.14-4.468-9.073-9.938-16.542-16.452-22.345-6.501-5.813-13-11.155-19.516-15.968-6.5-4.845-12-9.75-16.468-14.813-4.485-5.046-6.735-10.054-6.735-14.984 0-4.921 1.734-9.672 5.216-14.265 3.455-4.61 7.674-9.048 12.61-13.306 4.937-4.25 9.875-8.968 14.796-14.133 4.922-5.147 9.141-11.827 12.61-20.008 3.485-8.18 5.203-17.445 5.203-27.757 0-13.453-2.547-24.46-7.547-33.314-.594-1.022-1.218-1.803-1.875-3.022l56.907-46.672v17.119c-7.393.93-6.624 5.345-6.624 10.635V245.96c0 5.958 4.875 10.834 10.834 10.834h3.989c5.958 0 10.833-4.875 10.833-10.834V117.293c0-5.277.778-9.688-6.561-10.63zm-107.36 222.48c1.14.75 3.704 2.78 7.718 6.038 4.05 3.243 6.797 5.695 8.266 7.414a443.553 443.553 0 0 1 6.376 7.547c2.813 3.375 4.718 6.304 5.718 8.734 1 2.477 2.016 5.461 3.047 8.946a38.27 38.27 0 0 1 1.485 10.562c0 17.048-6.564 29.68-19.656 37.859-13.125 8.18-28.767 12.274-46.938 12.274-9.187 0-18.203-1.093-27.063-3.196-8.843-2.116-17.311-5.336-25.39-9.601-8.078-4.258-14.577-10.204-19.5-17.797-4.938-7.64-7.407-16.415-7.407-26.25 0-10.32 2.797-19.29 8.422-26.906 5.594-7.625 12.938-13.391 22.032-17.315 9.063-3.946 18.25-6.742 27.562-8.398a157.865 157.865 0 0 1 28.438-2.555c4.47 0 7.936.25 10.405.696.455.219 3.032 2.07 7.735 5.563 4.704 3.462 7.625 5.595 8.75 6.384zm-3.359-100.579c-7.406 8.86-17.734 13.288-30.953 13.288-11.86 0-22.298-4.764-31.266-14.312-9-9.523-15.422-20.328-19.344-32.43-3.937-12.109-5.906-23.984-5.906-35.648 0-13.694 3.596-25.352 10.781-34.976 7.187-9.65 17.5-14.485 30.938-14.485 11.875 0 22.374 5.038 31.437 15.157 9.094 10.085 15.61 21.413 19.517 33.968 3.922 12.54 5.873 24.53 5.873 35.984 0 13.446-3.702 24.61-11.076 33.454z" style="stroke-width:.0647871"/></svg>
|
||||
orcid: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M336.62 194.538c-7.13-3.328-13.866-5.56-20.253-6.614-6.365-1.095-16.574-1.612-30.71-1.612h-36.704v152.747h37.634c14.673 0 26.081-1.013 34.224-3.017 8.142-2.004 14.921-4.526 20.356-7.626a69.448 69.448 0 0 0 14.942-11.388c14.488-14.714 21.742-33.273 21.742-55.717 0-22.052-7.44-40.052-22.341-53.982-5.498-5.166-11.822-9.444-18.89-12.793zM256 8C119.022 8 8 119.042 8 256s111.022 248 248 248 248-111.042 248-248S392.978 8 256 8Zm-82.336 357.513h-29.389V160.148h29.389zM158.95 138.696c-11.14 0-20.213-9.01-20.213-20.212 0-11.118 9.052-20.191 20.213-20.191 11.18 0 20.232 9.052 20.232 20.191a20.194 20.194 0 0 1-20.232 20.212zm241.386 163.597c-5.29 12.545-12.834 23.581-22.65 33.088-9.982 9.837-21.597 17.194-34.844 22.196-7.75 3.017-14.839 5.063-21.307 6.117-6.49 1.013-18.828 1.509-37.076 1.509h-64.956V160.148h69.233c27.962 0 50.034 4.154 66.32 12.545 16.265 8.37 29.181 20.728 38.792 36.972 9.61 16.265 14.425 34.018 14.425 53.196.023 13.765-2.666 26.908-7.936 39.432z" style="stroke-width:.07717"/></svg>
|
||||
orcid: <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 512 512"><path d="M336.62 194.538c-7.13-3.328-13.866-5.56-20.253-6.614-6.365-1.095-16.574-1.612-30.71-1.612h-36.704v152.747h37.634c14.673 0 26.081-1.013 34.224-3.017 8.142-2.004 14.921-4.526 20.356-7.626a69.448 69.448 0 0 0 14.942-11.388c14.488-14.714 21.742-33.273 21.742-55.717 0-22.052-7.44-40.052-22.341-53.982-5.498-5.166-11.822-9.444-18.89-12.793zM256 8C119.022 8 8 119.042 8 256s111.022 248 248 248 248-111.042 248-248S392.978 8 256 8Zm-82.336 357.513h-29.389V160.148h29.389zM158.95 138.696c-11.14 0-20.213-9.01-20.213-20.212 0-11.118 9.052-20.191 20.213-20.191 11.18 0 20.232 9.052 20.232 20.191a20.194 20.194 0 0 1-20.232 20.212zm241.386 163.597c-5.29 12.545-12.834 23.581-22.65 33.088-9.982 9.837-21.597 17.194-34.844 22.196-7.75 3.017-14.839 5.063-21.307 6.117-6.49 1.013-18.828 1.509-37.076 1.509h-64.956V160.148h69.233c27.962 0 50.034 4.154 66.32 12.545 16.265 8.37 29.181 20.728 38.792 36.972 9.61 16.265 14.425 34.018 14.425 53.196.023 13.765-2.666 26.908-7.936 39.432z" style="stroke-width:.07717"/></svg>
|
||||
|
||||
# Email
|
||||
send: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
<body class="dark:bg-gray-800 dark:text-white-800 page-wrapper">
|
||||
<div id="page-bg"></div>
|
||||
<div class="page-header">
|
||||
{{/* Load header block */}}
|
||||
{{/* Load header block */}}
|
||||
{{ $show_navbar := ((site.Params.header.navbar.enable | default true) | and (ne .Params.header.navbar.enable false)) | or .Params.header.navbar.enable }}
|
||||
{{ if $show_navbar }}
|
||||
{{ $block_name := .Params.header.navbar.blox | default site.Params.header.navbar.blox | default "navbar" }}
|
||||
{{ $block_path := printf "components/headers/%s.html" $block_name }}
|
||||
{{ if not (templates.Exists (printf "partials/%s" $block_path)) }}
|
||||
@@ -16,6 +18,7 @@
|
||||
{{ else }}
|
||||
{{ partial $block_path . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="page-body {{if ne .Type "landing"}} my-10{{end}}">
|
||||
{{ block "main" . }}{{ end }}
|
||||
|
||||
Reference in new issue
Block a user