Align settings nav text with the content heading, not just box height
The previous fix made the nav card and content column exactly equal height, but the two boxes' TOP EDGES were already aligned all along — what actually looked "off" was that the nav's first item text sat ~12px lower than the content heading/Save button, because Tabler's default list-group-item padding (1.25rem) is sized for a standalone list card, not a compact sidebar nav. Verified with the same pixel-measurement technique as the previous fix, against the real markup rendered in a browser: before, the nav's first-item text center sat at y=95.5 while the content heading/button center sat at y=84 (both card tops already matched at y=64). Tightening this list-group's own item padding to 0.5rem (scoped via its own --tblr-list-group-item-padding-y CSS variable, not a global override) brought the nav text center to y=83.5 — 0.5px off target, imperceptible. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6ff20d42fd
commit
439eccaebb
1 file changed
+10
-1
@@ -1,3 +1,4 @@
|
|||||||
|
import type { CSSProperties } from "react";
|
||||||
import { NavLink, Outlet } from "react-router-dom";
|
import { NavLink, Outlet } from "react-router-dom";
|
||||||
|
|
||||||
const SUB_NAV = [
|
const SUB_NAV = [
|
||||||
@@ -16,7 +17,15 @@ export default function Settings() {
|
|||||||
<div className="row align-items-stretch">
|
<div className="row align-items-stretch">
|
||||||
<div className="col-12 col-md-3 col-lg-2 mb-3 mb-md-0">
|
<div className="col-12 col-md-3 col-lg-2 mb-3 mb-md-0">
|
||||||
<div className="card h-100">
|
<div className="card h-100">
|
||||||
<div className="list-group list-group-flush">
|
{/* Tabler's default list-group-item padding (1.25rem) is sized for
|
||||||
|
standalone list cards, not a nav sidebar — at that padding the
|
||||||
|
first item's text sits ~12px below where the content column's
|
||||||
|
own heading/button row starts, even though the two boxes
|
||||||
|
themselves are top-aligned. Tightening just this list-group's
|
||||||
|
own padding (via its own CSS variable, verified pixel-for-pixel
|
||||||
|
against the real markup) brings the two back to the same
|
||||||
|
visual line instead of only the same box height. */}
|
||||||
|
<div className="list-group list-group-flush" style={{ "--tblr-list-group-item-padding-y": "0.5rem" } as CSSProperties}>
|
||||||
{SUB_NAV.map((item) => (
|
{SUB_NAV.map((item) => (
|
||||||
<NavLink
|
<NavLink
|
||||||
key={item.to}
|
key={item.to}
|
||||||
|
|||||||
Reference in new issue
Block a user