discourse/app/assets/stylesheets/common/components/banner.scss
Kris 5c37e27844
UX: only remove paragaph margin in banner if it's the last child (#34695)
Using `last-of-type` means the margin is removed from the last
paragraph, even if there are other elements that fall at the end of the
banner... so we lose some needed space here:

<img width="977" height="258" alt="image"
src="https://github.com/user-attachments/assets/48195d9f-37b7-4a36-8ea6-96849d248b1e"
/>

if we use `last-child` it will ensure the `p` is actually the last node,
so space is retained

<img width="973" height="269" alt="image"
src="https://github.com/user-attachments/assets/763975d3-d184-4c22-ad8b-393aac9b5ee4"
/>
2025-09-03 13:02:19 -04:00

57 lines
909 B
SCSS
Vendored

// --------------------------------------------------
// Banner
// --------------------------------------------------
#banner {
padding: 1em;
background: var(--tertiary-low);
color: var(--primary);
z-index: z("base") + 1;
margin-bottom: 1em;
max-height: 20vh;
overflow: auto;
.floated-buttons {
float: right;
display: flex;
> .btn {
padding-top: 0;
padding-bottom: 0;
color: var(--primary-high);
.d-icon {
color: var(--primary-medium);
}
&:hover {
color: var(--primary);
.d-icon {
color: var(--primary-high);
}
}
}
.desktop-view & .btn.close {
margin-left: 0.25em;
}
}
}
#banner-content {
hr {
border-color: var(--primary-medium);
}
> p:first-child {
margin-top: 0;
}
> p:last-child {
margin-bottom: 0;
}
a.anchor {
display: none;
}
}