fix(notice): compact layout -- hide message/actions with display:none to prevent flex width pollution

The hidden __message (max-height:0, opacity:0) still had white-space:
pre-wrap which contributed to flex intrinsic width calculation in compact
layout, causing the __content flex container to miscalculate width and
truncate the title to 'ST...'.

Also add flex:0 1 auto + min-width:0 to compact __title so it properly
shrinks with ellipsis instead of overflow when space is limited.
This commit is contained in:
Youzini-afk
2026-04-29 17:34:09 +08:00
parent 49c984f788
commit cc527f63d7

View File

@@ -88,6 +88,7 @@ function ensureStyle(doc) {
.st-bme-notice[data-layout="compact"] .st-bme-notice__content {
display: flex;
align-items: center;
min-width: 0;
overflow: hidden;
}
@@ -107,6 +108,8 @@ function ensureStyle(doc) {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex: 0 1 auto;
min-width: 0;
}
.st-bme-notice__message {
@@ -131,6 +134,7 @@ function ensureStyle(doc) {
max-height: 0;
opacity: 0;
margin-top: 0;
display: none;
}
.st-bme-notice::after {
@@ -271,6 +275,7 @@ function ensureStyle(doc) {
opacity: 0;
margin-top: 0;
overflow: hidden;
display: none;
}
.st-bme-notice[data-layout="normal"] .st-bme-notice__actions {