luci-theme-material: update cascade.css to use first-of-type instead of last/first...
authorFlorian Eckert <[email protected]>
Thu, 6 Mar 2025 09:31:37 +0000 (10:31 +0100)
committerPaul Donald <[email protected]>
Thu, 6 Mar 2025 17:21:32 +0000 (11:21 -0600)
first-child:
Selects an element that is the first child of its parent. The element must
be the very first child of its parent, regardless of its type.

first-of-type:
Selects the first element of its type among its siblings. The element must
be the first of its type (e.g., <p>, <div>, etc.) within its parent, but it
does *not* have to be the first child.

Makes the CSS usage more robust if the layout changes and new html elements
are added.

Signed-off-by: Florian Eckert <[email protected]>
themes/luci-theme-material/htdocs/luci-static/material/cascade.css

index ad29f36911cafbefe642a1c9e095d7fa45ed3dce..f6ddb74c4d813d9612ff5adf1c82997489d6134d 100644 (file)
@@ -1786,11 +1786,11 @@ body:not(.Interfaces) .cbi-rowstyle-2:first-child {
        justify-content: space-between;
 }
 
-.modal .button-row > :not(:last-child) {
+.modal .button-row > button:not(:first-of-type) {
        margin-right: .5em;
 }
 
-.modal .button-row > :first-child {
+.modal .button-row > button:first-of-type {
        margin-right: auto;
 }