Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
STATIC_URL = "static/"
STATICFILES_DIRS = [
BASE_DIR / "static",
BASE_DIR / "theme" / "static", # Include Tailwind CSS built files
# theme/static is automatically discovered because 'theme' is in INSTALLED_APPS
]
STATIC_ROOT = BASE_DIR / "staticfiles"

Expand Down
64 changes: 64 additions & 0 deletions src/static/css/easymde.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/* EasyMDE styling - Compatible with DaisyUI themes */

.EasyMDEContainer .CodeMirror {
background-color: var(--color-base-100);
color: var(--color-base-content);
border-color: color-mix(in oklch, var(--color-base-content) 30%, transparent);
}

.cm-s-easymde .cm-quote {
color: color-mix(in oklch, var(--color-base-content) 70%, transparent);
}

.cm-s-easymde .cm-link {
color: var(--color-secondary);
}

.cm-s-easymde .cm-url {
color: color-mix(in oklch, var(--color-secondary) 70%, transparent);
}

.cm-s-easymde .cm-string {
color: var(--color-accent);
}

/* Apply dark styles when forest theme is active */
/* Text selection */
[data-theme="forest"] .EasyMDEContainer .CodeMirror-selected {
background-color: var(--color-neutral) !important;
}

[data-theme="forest"] .EasyMDEContainer .CodeMirror-cursor {
border-left-color: var(--color-base-content);
}

/* Editor toolbar dark mode */
[data-theme="forest"] .editor-toolbar {
background-color: var(--color-base-300);
border-color: color-mix(in oklch, var(--color-base-content) 30%, transparent);

}

[data-theme="forest"] .editor-toolbar button {
color: var(--color-base-content);
}

[data-theme="forest"] .editor-toolbar button:hover,
[data-theme="forest"] .editor-toolbar button.active {
background-color: var(--color-base-200);
border-color: color-mix(in oklch, var(--color-base-content) 30%, transparent);
}

[data-theme="forest"] .editor-toolbar i.separator {
border-left-color: var(--color-base-300);
border-right-color: var(--color-base-100);
}

/* Fullscreen mode dark */
[data-theme="forest"] .CodeMirror-fullscreen {
background-color: var(--color-base-100);
}

[data-theme="forest"] .editor-toolbar.fullscreen {
background-color: var(--color-base-300);
}
3 changes: 2 additions & 1 deletion src/static/js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ document.addEventListener("DOMContentLoaded", () => {
const applyTheme = (theme) => {
if (theme === "default") {
localStorage.removeItem("theme");
htmlElement.removeAttribute("data-theme");
} else {
localStorage.setItem("theme", theme);
htmlElement.setAttribute("value", theme);
htmlElement.setAttribute("data-theme", theme);
}
};

Expand Down
1 change: 1 addition & 0 deletions src/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
{% tailwind_css %}
{% htmx_script %}
{% block extra_css %}{% endblock extra_css %}
</head>
<body hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}' class="mx-auto">
<div>
Expand Down
3 changes: 3 additions & 0 deletions src/templates/media_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
{% translate "Add media" %}
{% endif %}
{% endblock title %}
{% block extra_css %}
<link rel="stylesheet" href="{% static 'css/easymde.css' %}">
{% endblock extra_css %}
{% block content %}
{{ form.media }}
<div class="container mx-auto px-4 py-8 max-w-4xl">
Expand Down