Skip to content

Commit

Permalink
darkmode selector for tailwind
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac-Flath committed Feb 10, 2025
1 parent 1736168 commit f73a011
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
5 changes: 5 additions & 0 deletions monsterui/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ def _create_headers(self, urls, mode='auto', daisy=True, highlightjs=False, kate
fh.Script(type="module", src=urls['franken_js_core']),
fh.Script(type="module", src=urls['franken_icons']),
fh.Script(src=urls['tailwind']),
fh.Script("""
tailwind.config = {
darkMode: 'selector',
}
"""),
_headers_theme(self.value, mode=mode),
scrollspy_style]

Expand Down
32 changes: 32 additions & 0 deletions nbs/01_core.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,33 @@
" ''')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"```html\n",
"<script>\n",
" tailwind.config = {\n",
" darkMode: &#x27;selector&#x27;,\n",
" }\n",
" </script>\n",
"```"
],
"text/plain": [
"script((\"\\n tailwind.config = {\\n darkMode: 'selector',\\n }\\n \",),{})"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -302,6 +329,11 @@
" fh.Script(type=\"module\", src=urls['franken_js_core']),\n",
" fh.Script(type=\"module\", src=urls['franken_icons']),\n",
" fh.Script(src=urls['tailwind']),\n",
" fh.Script(\"\"\"\n",
" tailwind.config = {\n",
" darkMode: 'selector',\n",
" }\n",
" \"\"\"),\n",
" _headers_theme(self.value, mode=mode),\n",
" scrollspy_style]\n",
"\n",
Expand Down

0 comments on commit f73a011

Please sign in to comment.