Skip to content

Commit

Permalink
fix: default dark mode css classes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasvinclav committed Jan 18, 2023
1 parent e70a9b0 commit 9d798c0
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/unfold/static/unfold/css/styles.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/unfold/templates/admin/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div id="main" class="flex-grow">
{% if not is_popup %}
{% block header %}
<div class="border-b mb-6 px-4 lg:px-12 dark:border-gray-800">
<div class="border-b border-gray-200 mb-6 px-4 lg:px-12 dark:border-gray-800">
<div class="container flex items-center h-16 mx-auto py-4">
<div id="header-inner" class="flex items-center w-full">
<div class="flex items-center w-full">
Expand Down
2 changes: 1 addition & 1 deletion src/unfold/templates/admin/change_list_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% endif %}

{% if results %}
<table id="result_list" class="border-spacing-none border-separate text-gray-700 w-full lg:border lg:rounded-md lg:shadow-sm lg:dark:border-gray-800">
<table id="result_list" class="border-gray-200 border-spacing-none border-separate text-gray-700 w-full dark:text-gray-400 lg:border lg:rounded-md lg:shadow-sm lg:dark:border-gray-800">
<thead class="hidden lg:table-header-group">
<tr>
{% for header in result_headers %}
Expand Down
14 changes: 7 additions & 7 deletions src/unfold/templates/admin/delete_confirmation.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@

{% block content %}
{% if perms_lacking %}
<div class="border rounded-md shadow-sm dark:border-gray-800">
<div class="border border-gray-200 rounded-md shadow-sm dark:border-gray-800">
<p class="font-medium p-4 text-sm">
{% blocktranslate with escaped_object=object %}Deleting the {{ object_name }} '{{ escaped_object }}' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktranslate %}
</p>

<div class="border-t p-4 dark:border-gray-800">
<div class="border-gray-200 border-t p-4 dark:border-gray-800">
<ul class="leading-relaxed text-gray-500 text-sm dark:text-gray-400">
{% for obj in perms_lacking %}
<li>
Expand All @@ -48,12 +48,12 @@
</div>
</div>
{% elif protected %}
<div class="border rounded-md shadow-sm dark:border-gray-800">
<div class="border border-gray-200 rounded-md shadow-sm dark:border-gray-800">
<p class="font-medium p-4 text-sm">
{% blocktranslate with escaped_object=object %}Deleting the {{ object_name }} '{{ escaped_object }}' would require deleting the following protected related objects:{% endblocktranslate %}
</p>

<div class="border-t p-4 dark:border-gray-800">
<div class="bborder-gray-200 order-t p-4 dark:border-gray-800">
<ul class="leading-relaxed text-gray-500 text-sm dark:text-gray-400">
{% for obj in protected %}
<li>
Expand All @@ -64,14 +64,14 @@
</div>
</div>
{% else %}
<div class="border rounded-md shadow-sm dark:border-gray-800">
<div class="border border-gray-200 rounded-md shadow-sm dark:border-gray-800">
<p class="font-medium p-4 text-sm">
{% blocktranslate with escaped_object=object %}Are you sure you want to delete the {{ object_name }} "{{ escaped_object }}"? All of the following related items will be deleted:{% endblocktranslate %}
</p>

{% include "admin/includes/object_delete_summary.html" %}

<div class="border-t p-4 dark:border-gray-800">
<div class="border-gray-200 border-t p-4 dark:border-gray-800">
<h2 class="font-medium mb-2 text-sm">
{% translate "Objects" %}
</h2>
Expand All @@ -81,7 +81,7 @@ <h2 class="font-medium mb-2 text-sm">
</ul>
</div>

<form method="post" class="border-t px-4 py-3 dark:border-gray-800">
<form method="post" class="border-gray-200 border-t px-4 py-3 dark:border-gray-800">
{% csrf_token %}

<div class="flex items-center">
Expand Down
12 changes: 6 additions & 6 deletions src/unfold/templates/admin/delete_selected_confirmation.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@
{% blocktranslate %}Deleting the selected {{ objects_name }} would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktranslate %}
</p>

<div class="border-t p-4 dark:border-gray-800">
<div class="border-t border-gray-200 p-4 dark:border-gray-800">
<ul class="leading-relaxed text-gray-500 text-sm dark:border-gray-800 dark:text-gray-400">
{% for obj in perms_lacking %}
<li>{{ obj }}</li>
{% endfor %}
</ul>
</div>
{% elif protected %}
<div class="border rounded-md shadow-sm dark:border-gray-800">
<div class="border border-gray-200 rounded-md shadow-sm dark:border-gray-800">
<p class="font-medium p-4 text-sm">
{% blocktranslate %}Deleting the selected {{ objects_name }} would require deleting the following protected related objects:{% endblocktranslate %}
</p>

<div class="border-t p-4 dark:border-gray-800">
<div class="border-t border-gray-200 p-4 dark:border-gray-800">
<ul class="leading-relaxed text-gray-500 text-sm dark:text-gray-400">
{% for obj in protected %}
<li>{{ obj }}</li>
Expand All @@ -59,14 +59,14 @@
</div>
</div>
{% else %}
<div class="border rounded-md shadow-sm dark:border-gray-800">
<div class="border border-gray-200 rounded-md shadow-sm dark:border-gray-800">
<p class="font-medium p-4 text-sm">
{% blocktranslate %}Are you sure you want to delete the selected {{ objects_name }}? All of the following objects and their related items will be deleted:{% endblocktranslate %}
</p>

{% include "admin/includes/object_delete_summary.html" %}

<div class="border-t p-4 dark:border-gray-800">
<div class="border-t border-gray-200 p-4 dark:border-gray-800">
<h2 class="font-medium mb-2 text-sm">
{% translate "Objects" %}
</h2>
Expand All @@ -78,7 +78,7 @@ <h2 class="font-medium mb-2 text-sm">
{% endfor %}
</div>

<form method="post" class="border-t px-4 py-3 dark:border-gray-800">
<form method="post" class="border-t border-gray-200 px-4 py-3 dark:border-gray-800">
{% csrf_token %}

<div class="flex items-center">
Expand Down
2 changes: 1 addition & 1 deletion src/unfold/templates/admin/edit_inline/stacked.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
<div class="border mb-6 overflow-hidden rounded-md shadow-sm text-gray-700 w-full dark:border-gray-800">
{% for inline_admin_form in inline_admin_formset %}
<div class="inline-related group inline-stacked {% if inline_admin_form.original or inline_admin_form.show_url %} has_original{% endif %}{% if forloop.last and inline_admin_formset.has_add_permission %} empty-form last-related{% endif %}" id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
<h3 class="border-b {% if not forloop.first %}border-t{% endif %} flex font-medium items-center mb-3 px-3 py-2 text-gray-400 text-sm dark:border-gray-800">
<h3 class="border-b {% if not forloop.first %}border-t{% endif %} border-gray-200 flex font-medium items-center mb-3 px-3 py-2 text-gray-400 text-sm dark:border-gray-800">
<span class="mr-2">
{{ inline_admin_formset.opts.verbose_name|capfirst }}:
</span>
Expand Down
10 changes: 5 additions & 5 deletions src/unfold/templates/admin/edit_inline/tabular.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
{% trans "No records found." %}
</p>
{% else %}
<table class="border border-spacing-none border-separate mb-6 rounded-md shadow-sm text-gray-700 w-full dark:border-gray-800">
<table class="border border-gray-200 border-spacing-none border-separate mb-6 rounded-md shadow-sm text-gray-700 w-full dark:border-gray-800">
<thead class="hidden lg:table-header-group">
<tr>
{% for field in inline_admin_formset.fields %}
{% if not field.widget.is_hidden %}
<th class="column-{{ field.name }}{% if field.required %} required{% endif %} align-middle border-b font-medium px-3 py-2 text-left text-gray-400 text-sm dark:border-gray-800">
<th class="column-{{ field.name }}{% if field.required %} required{% endif %} align-middle border-b border-gray-200 font-medium px-3 py-2 text-left text-gray-400 text-sm dark:border-gray-800">
<span class="flex flex-row items-center">
{{ field.label|capfirst }}

Expand All @@ -39,7 +39,7 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
{% endfor %}

{% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission %}
<th class="align-middle border-b font-medium px-3 py-2 text-left text-gray-400 text-sm lg:w-px dark:border-gray-800">
<th class="align-middle border-b border-gray-200 font-medium px-3 py-2 text-left text-gray-400 text-sm lg:w-px dark:border-gray-800">
{% translate "Delete?" %}
</th>
{% endif %}
Expand Down Expand Up @@ -109,7 +109,7 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
{% with is_last_col=forloop.last %}
{% for field in line %}
{% if field.is_readonly or not field.field.is_hidden %}
<td{% if field.field.name %} class="field-{{ field.field.name }}{% if field.field.errors|length > 0 %} errors{% endif %}{% if inline_admin_form.original %} p-3 lg:py-3{% else %} py-3{% endif %}{% if field.is_checkbox %} align-middle{% else %} align-top{% endif %} {% if is_last_row and not inline_admin_formset.has_add_permission %}{% if is_last_col %}border-0 {% else %}border-b lg:border-0{% endif %}{% else %}border-b{% endif %} flex items-center before:capitalize before:content-[attr(data-label)] before:mr-auto before:text-gray-500 before:w-72 lg:before:hidden font-normal px-3 text-left text-sm lg:table-cell dark:border-gray-800"{% endif %} data-label="{{ field.field.label }}">
<td{% if field.field.name %} class="field-{{ field.field.name }}{% if field.field.errors|length > 0 %} errors{% endif %}{% if inline_admin_form.original %} p-3 lg:py-3{% else %} py-3{% endif %}{% if field.is_checkbox %} align-middle{% else %} align-top{% endif %} {% if is_last_row and not inline_admin_formset.has_add_permission %}{% if is_last_col %}border-0 {% else %}border-b lg:border-0{% endif %}{% else %}border-b{% endif %} border-gray-200 flex items-center before:capitalize before:content-[attr(data-label)] before:mr-auto before:text-gray-500 before:w-72 lg:before:hidden font-normal px-3 text-left text-sm lg:table-cell dark:border-gray-800"{% endif %} data-label="{{ field.field.label }}">
{% if field.is_readonly %}
<p class="bg-gray-50 border font-medium px-3 py-2 rounded-md shadow-sm text-gray-500 text-sm dark:bg-gray-900 dark:border-gray-700 dark:text-gray-400 dark:bg-gray-800">
{{ field.contents }}
Expand All @@ -133,7 +133,7 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
{% endfor %}

{% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission %}
<td class="delete {% if inline_admin_form.original %}p-3 lg:py-3{% else %}py-3{% endif %} text-left font-normal px-3 text-sm text-red-600 border-b flex items-center before:capitalize before:content-[attr(data-label)] before:mr-auto before:text-gray-500 before:w-72 lg:before:hidden font-normal px-3 text-sm lg:align-top lg:table-cell lg:underline lg:w-px dark:border-gray-800" data-label="{% trans "Remove" %}">
<td class="delete {% if inline_admin_form.original %}p-3 lg:py-3{% else %}py-3{% endif %} text-left font-normal px-3 text-sm text-red-600 border-b border-gray-200 flex items-center before:capitalize before:content-[attr(data-label)] before:mr-auto before:text-gray-500 before:w-72 lg:before:hidden font-normal px-3 text-sm lg:align-top lg:table-cell lg:underline lg:w-px dark:border-gray-800" data-label="{% trans "Remove" %}">
{% if inline_admin_form.original %}
<div class="flex flex-row lg:mt-3">
<div class="ml-auto">
Expand Down
2 changes: 1 addition & 1 deletion src/unfold/templates/admin/includes/fieldset.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
</div>
{% endif %}

<div class="aligned border mb-8 rounded-md pt-3 px-3 shadow-sm dark:border-gray-800">
<div class="aligned border border-gray-200 mb-8 rounded-md pt-3 px-3 shadow-sm dark:border-gray-800">
{% for line in fieldset %}
<div class="block {% if line.fields|length_is:'1' and line.errors %} group errors{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
{% for field in line %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load i18n %}

<div class="border-t p-4 dark:border-gray-800">
<div class="border-gray-200 border-t p-4 dark:border-gray-800">
<h2 class="font-medium mb-2 text-sm">
{% translate "Summary" %}
</h2>
Expand Down
2 changes: 1 addition & 1 deletion src/unfold/templates/unfold/helpers/app_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="overflow-auto">
{% for group in sidebar_navigation %}
{% if group.separator %}
<hr class="border-t mx-6 my-2 dark:border-gray-800" />
<hr class="border-t border-gray-200 mx-6 my-2 dark:border-gray-800" />
{% endif %}

{% if group.title %}
Expand Down
4 changes: 2 additions & 2 deletions src/unfold/templates/unfold/helpers/navigation.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% load i18n %}

<div class="relative min-w-sidebar transition-width w-sidebar z-30">
<nav id="nav-sidebar" class="bg-gray-50 border-r flex flex-col fixed max-h-screen min-h-screen min-w-sidebar transition-width w-sidebar dark:bg-gray-900 dark:border-gray-800">
<div class="border-b mb-5 py-3 dark:border-gray-800">
<nav id="nav-sidebar" class="bg-gray-50 border-r border-gray-200 flex flex-col fixed max-h-screen min-h-screen min-w-sidebar transition-width w-sidebar dark:bg-gray-900 dark:border-gray-800">
<div class="border-b border-gray-200 mb-5 py-3 dark:border-gray-800">
<div class="flex font-medium h-10 items-center px-6 text-gray-700 dark:text-gray-200">
{% if logo %}
<img src="{{ logo }}" alt="{% trans "Home" %}"/>
Expand Down
7 changes: 4 additions & 3 deletions src/unfold/templatetags/unfold_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def link_in_col(is_first, field_name, cl):
"align-middle",
"flex",
"border-t",
"border-gray-200",
"font-normal",
"px-3",
"py-2",
Expand All @@ -68,7 +69,6 @@ def link_in_col(is_first, field_name, cl):
"lg:py-3",
"lg:table-cell",
"dark:border-gray-800",
"dark:text-gray-400",
]

try:
Expand All @@ -95,11 +95,12 @@ def link_in_col(is_first, field_name, cl):
"before:content-[attr(data-label)]",
"before:mr-auto",
"before:text-gray-500",
"dark:before:text-gray-400",
"lg:before:hidden",
"lg:border-t",
"lg:border-gray-200",
"lg:table-cell",
"dark:border-gray-800",
"dark:before:text-gray-400",
"dark:lg:border-gray-800",
]
boolean = getattr(attr, "boolean", False)
label = getattr(attr, "label", False)
Expand Down
2 changes: 1 addition & 1 deletion styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ table tr.selected {
}

[data-inline-type="stacked"] .add-row {
@apply border-t overflow-hidden dark:border-gray-800;
@apply border-t border-gray-200 overflow-hidden dark:border-gray-800;
}

.add-row td {
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module.exports = {
"./src/**/*.{html,py,js}",
],
media: false,
darkMode: "class",
theme: {
extend: {
colors: {
Expand Down Expand Up @@ -53,7 +54,6 @@ module.exports = {
textColor: ["hover"]
}
},
darkMode: "class",
plugins: [
require('@tailwindcss/typography'),
]
Expand Down

0 comments on commit 9d798c0

Please sign in to comment.