Skip to content

Commit

Permalink
refactor admin widget & disable outline border
Browse files Browse the repository at this point in the history
  • Loading branch information
yaghoubi committed Oct 23, 2024
1 parent 9da6643 commit 6e0e393
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
19 changes: 10 additions & 9 deletions django_daisy/static/admin/css/styles.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@

/*
[dir="rtl"] .file-input::-webkit-file-upload-button {
margin-right: 0; !* For WebKit browsers in RTL *!
[dir="rtl"] .file-input-sm::file-selector-button {
margin-right: 0;
}
[dir="rtl"] .file-input::file-selector-button {
margin-right: 0; !* For modern browsers in RTL *!
[dir="rtl"] .file-input-md::file-selector-button {
margin-right: 0;
}
[dir="rtl"] .file-input-lg::file-selector-button {
margin-right: 0;
}
*/

:focus-visible {
outline: none !important;
}

.errorlist {
@apply label px-0;
Expand All @@ -18,7 +20,6 @@
@apply label-text text-error font-bold;
}


.card {
@apply rounded-md shadow-sm;
}
Expand Down
2 changes: 1 addition & 1 deletion django_daisy/static/admin/css/tailwind.css

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions django_daisy/templates/admin/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

<link rel="stylesheet" href="{% static 'admin/fonts/fontawesome-free-6.6.0-web/css/all.min.css' %}"/>
<link href="{% static "admin/css/tom-select.min.css" %}" rel="stylesheet">

{% block body_font %}
{% if LANGUAGE_BIDI %}
<style>
Expand Down Expand Up @@ -93,6 +94,7 @@ <h3 class="text-lg font-medium">
{% if message.tags %}{{ message.tags }} {% endif %} alert-info rounded mb-1">
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
{% endif %}
<br>
{% endif %}
<input type="{{ widget.type }}" class="file-input file-input-bordered file-input-sm w-full max-w-xs" data-fouc
name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>
{% include 'django/forms/widgets/file.html' %}
{% if widget.is_initial %}
</p>
<a class="link text-xs p-2" target="_blank" href="{{ widget.value.url }}">
Expand Down
5 changes: 4 additions & 1 deletion django_daisy/templates/admin/widgets/url.html
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{% if url_valid %}<p class="url">{{ current_label }} <a href="{{ widget.href }}">{{ widget.value }}</a><br>{{ change_label }} {% endif %}{% include "django/forms/widgets/input.html" %}{% if url_valid %}</p>{% endif %}
{% include "django/forms/widgets/url.html" %}
<p class="url link text-xs p-2">
{{ current_label }} <a href="{{ widget.href }}">{{ widget.value }}</a>
</p>

0 comments on commit 6e0e393

Please sign in to comment.