Skip to content

Commit 5454843

Browse files
authored
fix: responsive improvements (#1252)
1 parent ba1ee3a commit 5454843

File tree

9 files changed

+13
-9
lines changed

9 files changed

+13
-9
lines changed

src/unfold/static/unfold/css/styles.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/unfold/styles.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@import 'tailwindcss';
22
@plugin '@tailwindcss/typography';
33
@custom-variant dark (&:where(.dark, .dark *));
4-
54
@source inline("h-3 w-3 h-[64px] w-[65px]! left-[65px] dark:hover:bg-white/[.06] translate-x-1/4 -translate-y-1/4");
65
@source inline("{-,}{top,bottom,left,right}-{0..4}");
76
@source inline("rounded-{t,r,b,l}-default");
@@ -314,6 +313,10 @@ table tr.selected th {
314313
@apply border-t border-base-200 dark:border-base-800;
315314
}
316315

316+
.tabular-table tbody.has_original:first-of-type {
317+
@apply border-t-0;
318+
}
319+
317320
.add-row {
318321
@apply align-middle bg-white px-3 py-5 font-normal text-right dark:bg-base-900;
319322
}

src/unfold/templates/admin/submit_line.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% load i18n admin_urls %}
22

33
<div {% if not is_popup %}id="submit-row"{% endif %} class="relative lg:sticky lg:bottom-0 z-40">
4-
<div class="backdrop-blur-xs bg-white/80 rounded-b-default pb-4 dark:bg-base-900/80 {% if not is_popup %}lg:border-t lg:border-base-200 relative lg:scrollable-top lg:px-8 lg:py-0 dark:border-base-800{% endif %}">
4+
<div class="backdrop-blur-xs bg-white/80 rounded-b-default pb-4 px-4 dark:bg-base-900/80 {% if not is_popup %}lg:border-t lg:border-base-200 relative lg:scrollable-top lg:py-0 dark:border-base-800{% endif %}">
55
<div class="flex flex-col-reverse gap-3 items-center mx-auto lg:flex-row-reverse container lg:h-[64px]">
66
{% block submit-row %}
77
{% if show_save %}

src/unfold/templates/unfold/helpers/edit_inline/tabular_delete.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% load i18n unfold %}
22

33
{% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission %}
4-
<td class="border-t border-base-200 dark:border-base-800 lg:border-t-0 min-h-[62.5px] delete {% if inline_admin_form.original %}p-3 lg:py-3{% else %}py-3{% endif %} text-left text-red-600 flex items-center before:capitalize before:font-semibold before:content-[attr(data-label)] before:mr-auto before:text-font-important-light before:pr-4 lg:before:hidden font-normal px-3 text-sm lg:align-top lg:table-cell lg:w-px dark:before:text-font-important-dark" data-label="{% trans "Remove" %}">
4+
<td class="lg:border-t border-base-200 dark:border-base-800 lg:border-t-0 min-h-[62.5px] delete {% if inline_admin_form.original %}p-3 lg:py-3{% else %}py-3{% endif %} text-left text-red-600 flex items-center before:capitalize before:font-semibold before:content-[attr(data-label)] before:mr-auto before:text-font-important-light before:pr-4 lg:before:hidden font-normal px-3 text-sm lg:align-top lg:table-cell lg:w-px dark:before:text-font-important-dark" data-label="{% trans "Remove" %}">
55
{% if inline_admin_form.original %}
66
<div class="flex flex-row lg:mt-3">
77
<div class="ml-auto">

src/unfold/templates/unfold/helpers/edit_inline/tabular_row.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{% for line in fieldset %}
1616
{% for field in line %}
1717
{% if field.is_readonly or not field.field.is_hidden %}
18-
<td{% if field.field.name %} class="min-h-[62.5px] field-{{ field.field.name }} group field-tabular {% 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 %} flex items-center before:capitalize before:font-semibold before:content-[attr(data-label)] before:mr-auto before:font-text before:pr-4 lg:before:hidden font-normal px-3 lg:first:pl-3 lg:last:pr-3 lg:px-1.5 text-left lg:table-cell {% if field.field.is_hidden %} hidden!{% endif %} {% if inline_admin_formset.opts.ordering_field and field.field.name == inline_admin_formset.opts.ordering_field and inline_admin_formset.opts.hide_ordering_field %}hidden!{% endif %}"{% endif %} data-label="{{ field.field.label }}">
18+
<td{% if field.field.name %} class="min-h-[62.5px] border-b max-md:border-b border-base-200 dark:border-base-800 field-{{ field.field.name }} group field-tabular {% 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 %} flex items-center before:capitalize before:font-semibold before:content-[attr(data-label)] before:text-font-important-light dark:before:text-font-important-dark before:mr-auto before:font-text before:pr-4 lg:before:hidden font-normal px-3 lg:first:pl-3 lg:last:pr-3 lg:px-1.5 text-left lg:table-cell {% if field.field.is_hidden %} hidden!{% endif %} {% if inline_admin_formset.opts.ordering_field and field.field.name == inline_admin_formset.opts.ordering_field and inline_admin_formset.opts.hide_ordering_field %}hidden!{% endif %}"{% endif %} data-label="{{ field.field.label }}">
1919
{% include "unfold/helpers/edit_inline/tabular_field.html" %}
2020
</td>
2121
{% endif %}

src/unfold/templates/unfold/helpers/tab_actions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% if actions_list or actions_detail or actions_items or nav_global %}
2-
<ul class="flex flex-col font-medium mb-4 ml-auto mt-2 shadow-xs md:flex-row md:mb-2 md:mt-0 max-md:w-full">
2+
<ul class="flex flex-col font-medium mb-4 ml-auto mt-2 md:flex-row md:mb-2 md:mt-0 max-md:w-full">
33
{% if actions_items %}
44
{{ actions_items }}
55
{% endif %}

src/unfold/templates/unfold/widgets/clearable_file_input.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<input type="text" aria-label="{% trans 'Choose file to upload' %}" value="{% if widget.value %}{{ widget.value.url }}{% else %}{% trans 'Choose file to upload' %}{% endif %}" disabled class="bg-white grow font-medium min-w-0 px-3 py-2 text-ellipsis dark:bg-base-900">
2525

2626
<div class="bg-white flex flex-none items-center leading-none self-stretch dark:bg-base-900">
27-
<div class="opacity-0">
27+
<div class="opacity-0 w-[0px]">
2828
<input type="{{ widget.type }}" name="{{ widget.name }}" {% include "django/forms/widgets/attrs.html" %} />
2929
</div>
3030

src/unfold/templates/unfold/widgets/clearable_file_input_small.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<input type="text" aria-label="{% trans 'Choose file to upload' %}" value="{% if widget.value %}{{ widget.value.url }}{% else %}{% trans 'Choose file to upload' %}{% endif %}" disabled class="bg-white grow font-medium min-w-0 px-3 py-2 text-ellipsis dark:bg-base-900">
1818

1919
<div class="flex flex-none items-center leading-none self-stretch">
20-
<div class="opacity-0">
20+
<div class="opacity-0 w-[0px]">
2121
<input type="{{ widget.type }}" name="{{ widget.name }}" {% include "django/forms/widgets/attrs.html" %} />
2222
</div>
2323

src/unfold/templatetags/unfold.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,10 @@ def action_item_classes(context: Context, action: UnfoldAction) -> str:
436436
classes = [
437437
"border",
438438
"border-base-200",
439-
"-ml-px",
439+
"max-md:-mt-px",
440440
"max-md:first:rounded-t-default",
441441
"max-md:last:rounded-b-default",
442+
"md:-ml-px",
442443
"md:first:rounded-l-default",
443444
"md:last:rounded-r-default",
444445
]

0 commit comments

Comments
 (0)