Skip to content

Node.js based forum software built for the modern web

Add utilities to hide first/last child elements

Barış Soner Uşaklıfd50b266c680
diff --git a/public/scss/generics.scss b/public/scss/generics.scss
index 4f099c720e..41dd299e6d 100644
--- a/public/scss/generics.scss
+++ b/public/scss/generics.scss
@@ -160,9 +160,18 @@ blockquote {
.hidden-blockquote { blockquote { display: none; } }
.hidden-pre { pre { display: none; } }
-.hidden-leading-br {
- > br:first-child {
- display: none;
+$hidden-elements-for-first-last-child: br, hr;
+
+@each $element in $hidden-elements-for-first-last-child {
+ .hidden-first-child-#{$element} {
+ > #{$element}:first-child {
+ display: none;
+ }
+ }
+ .hidden-last-child-#{$element} {
+ > #{$element}:last-child {
+ display: none;
+ }
}
}