Skip to content

Commit 975b4a8

Browse files
authored
feat: polished action border colors (#1180)
1 parent dbc330d commit 975b4a8

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
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/tab_action.html

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,23 @@
1515
{{ title }}
1616

1717
{% if not link %}
18-
<span class="material-symbols-outlined ml-auto rotate-90">
19-
chevron_right
18+
<span class="border-l border-base-200 flex items-center select-none self-stretch ml-1 -mr-1 -my-2 pl-2
19+
{% if action.variant.value == "primary" %}
20+
border-primary-700 dark:border-primary-500
21+
{% elif action.variant.value == "danger" %}
22+
border-red-700 dark:border-red-500
23+
{% elif action.variant.value == "success" %}
24+
border-green-700 dark:border-green-500
25+
{% elif action.variant.value == "info" %}
26+
border-blue-700 dark:border-blue-500
27+
{% elif action.variant.value == "warning" %}
28+
border-orange-700 dark:border-orange-500
29+
{% else %}
30+
border-base-200 dark:border-base-700
31+
{% endif %}">
32+
<span class="material-symbols-outlined ml-auto rotate-90 transition-transform" x-bind:class="{'!-rotate-90': actionDropdownOpen }">
33+
chevron_right
34+
</span>
2035
</span>
2136
{% endif %}
2237
</a>

src/unfold/templatetags/unfold.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,48 +438,54 @@ def action_item_classes(context: Context, action: UnfoldAction) -> str:
438438
if variant == ActionVariant.PRIMARY:
439439
classes.extend(
440440
[
441-
"border-primary-600",
441+
"border-primary-700",
442442
"bg-primary-600",
443443
"text-white",
444+
"dark:border-primary-500",
444445
]
445446
)
446447
elif variant == ActionVariant.DANGER:
447448
classes.extend(
448449
[
449-
"border-red-600",
450+
"border-red-700",
450451
"bg-red-600",
451452
"text-white",
453+
"dark:border-red-500",
452454
]
453455
)
454456
elif variant == ActionVariant.SUCCESS:
455457
classes.extend(
456458
[
457-
"border-green-600",
459+
"border-green-700",
458460
"bg-green-600",
459461
"text-white",
462+
"dark:border-green-500",
460463
]
461464
)
462465
elif variant == ActionVariant.INFO:
463466
classes.extend(
464467
[
465-
"border-blue-600",
468+
"border-blue-700",
466469
"bg-blue-600",
467470
"text-white",
471+
"dark:border-blue-500",
468472
]
469473
)
470474
elif variant == ActionVariant.WARNING:
471475
classes.extend(
472476
[
473-
"border-orange-600",
477+
"border-orange-700",
474478
"bg-orange-600",
475479
"text-white",
480+
"dark:border-orange-500",
476481
]
477482
)
478483
else:
479484
classes.extend(
480485
[
481486
"border-base-200",
482487
"hover:text-primary-600",
488+
"dark:hover:text-primary-500",
483489
"dark:border-base-700",
484490
]
485491
)

0 commit comments

Comments
 (0)