Skip to content

Commit 69e72c9

Browse files
authored
fix: site dropdown truncate (#1064)
1 parent 65dc4a6 commit 69e72c9

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
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/templates/unfold/helpers/navigation_header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="border-b border-base-200 flex gap-3 items-center h-[65px] mb-5 dark:border-base-800 px-3" {% if site_dropdown %}x-data="{ openDropdown: false }"{% endif %}>
2-
<div class="bg-transparent border border-transparent flex font-semibold gap-3 grow -mx-px h-[48px] items-center px-3 {% if site_dropdown %}cursor-pointer rounded transition-all hover:bg-white hover:border-base-200 hover:shadow-sm hover:dark:bg-base-800 hover:dark:border-base-700{% endif %}"
2+
<div class="bg-transparent border border-transparent flex font-semibold gap-3 grow min-w-0 -mx-px h-[48px] items-center px-3 {% if site_dropdown %}cursor-pointer rounded transition-all hover:bg-white hover:border-base-200 hover:shadow-sm hover:dark:bg-base-800 hover:dark:border-base-700{% endif %}"
33
x-on:click="openDropdown = !openDropdown"
44
x-bind:class="{'bg-white border-base-200 shadow-sm dark:bg-base-800 dark:border-base-700': openDropdown, 'bg-transparent border-transparent': !openDropdown}">
55
{% if site_logo %}

src/unfold/templates/unfold/helpers/site_dropdown.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% if site_dropdown %}
44
<div class="absolute bg-white border flex flex-col left-3 py-1 rounded shadow-lg top-[73px] w-[264px] z-50 dark:bg-base-800 dark:border-base-700" x-cloak x-show="openDropdown" x-transition x-on:click.outside="openDropdown = false">
55
{% for item in site_dropdown %}
6-
<a href="{{ item.link }}" class="flex items-center gap-3 max-h-[30px] mx-1 px-2 py-2 rounded hover:bg-base-100 hover:text-base-700 dark:hover:bg-base-700 dark:hover:text-base-200">
6+
<a href="{{ item.link }}" class="flex flex-row items-center gap-3 max-h-[30px] mx-1 px-2 py-2 rounded hover:bg-base-100 hover:text-base-700 dark:hover:bg-base-700 dark:hover:text-base-200">
77
{% if item.icon %}
88
<span class="material-symbols-outlined">
99
{{ item.icon }}

src/unfold/templates/unfold/helpers/site_icon.html

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
{% load i18n %}
22

33
{% if site_icon %}
4-
<a href="{% url "admin:index" %}">
5-
{% if site_icon.light and site_icon.dark %}
6-
<img src="{{ site_icon.dark }}" alt="{% trans 'Home' %}" class="h-8 hidden dark:block"/>
4+
<div class="shrink-0">
5+
<a href="{% url "admin:index" %}">
6+
{% if site_icon.light and site_icon.dark %}
7+
<img src="{{ site_icon.dark }}" alt="{% trans 'Home' %}" class="h-8 hidden dark:block"/>
78

8-
<img src="{{ site_icon.light }}" alt="{% trans 'Home' %}" class="block h-8 dark:hidden" />
9-
{% else %}
10-
<img src="{{ site_icon }}" class="h-8" alt="{% trans 'Home' %}" />
11-
{% endif %}
12-
</a>
9+
<img src="{{ site_icon.light }}" alt="{% trans 'Home' %}" class="block h-8 dark:hidden" />
10+
{% else %}
11+
<img src="{{ site_icon }}" class="h-8" alt="{% trans 'Home' %}" />
12+
{% endif %}
13+
</a>
14+
</div>
1315
{% else %}
1416
<a href="{% url "admin:index" %}" class="bg-primary-600 flex h-8 items-center justify-center rounded text-white text-xs w-8">
1517
<span class="material-symbols-outlined md-18">{% if site_symbol %}{{ site_symbol }}{% else %}settings{% endif %}</span>
1618
</a>
1719
{% endif %}
1820

19-
<div class="flex flex-col gap-1">
20-
<div class="text-font-important-light leading-none tracking-tight dark:text-font-important-dark *:leading-none {% if site_subheader %}xl:text-sm{% else %}xl:text-base{% endif %}">
21+
<div class="flex flex-col grow min-w-0">
22+
<div class="text-font-important-light leading-normal tracking-tight dark:text-font-important-dark *:leading-none {% if site_subheader %}xl:text-sm{% else %}xl:text-base{% endif %}">
2123
{{ branding }}
2224
</div>
2325

2426
{% if site_subheader %}
25-
<div class="font-normal leading-none text-font-subtle-light text-xs dark:text-font-subtle-dark">
27+
<div class="font-normal leading-normal text-font-subtle-light text-xs truncate dark:text-font-subtle-dark">
2628
{{ site_subheader }}
2729
</div>
2830
{% endif %}

0 commit comments

Comments
 (0)