Skip to content

Commit 466a50d

Browse files
authored
Fix icon vertical alignment in alert component (#4823)
* Fix icon vertical alignment in alert component Use `block` on the icon span to remove inline line-box descender space, and derive flex alignment from whether a header is present: `items-center` for single-line alerts, `items-start` for multi-line alerts with a header. * update changelog * Adds issue to changelog * updates changelog
1 parent c1bc757 commit 466a50d

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ and this project adheres to
2727

2828
### Fixed
2929

30+
- Fix icon vertical alignment in sandbox alert banners
31+
[#4730](https://github.com/OpenFn/lightning/issues/4730)
3032
- Fix issue where back button must be pressed 3 times to go back once from the
3133
Workflow canvas [#4812](https://github.com/OpenFn/lightning/issues/4812)
3234
- Reduce `run:log` channel timeouts under heavy log volume by moving `log_lines`

lib/lightning_web/live/components/common.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ defmodule LightningWeb.Components.Common do
123123

124124
~H"""
125125
<div id={@id} class={"rounded-md bg-#{@color}-50 p-4 text-wrap #{@class}"}>
126-
<div class="flex">
127-
<div class="flex-shrink-0">
128-
<.icon name={@icon} class={"align-top h-5 w-5 text-#{@color}-400"} />
126+
<div class={["flex", if(@header, do: "items-start", else: "items-center")]}>
127+
<div class="shrink-0">
128+
<.icon name={@icon} class={"block h-5 w-5 text-#{@color}-400"} />
129129
</div>
130130
<div class={[
131131
"ml-3 min-w-0 flex-1",

0 commit comments

Comments
 (0)