Closed
Description
dl, dt, and dd get no love. I'm playing around with having them get a "property sheet" treatment.
I have a small example in my project's code:
<dl>
<header>Project</header>
<dt>Files</dt>
<dd><button>Reset</button></dd>
<dt>Numeric Format</dt>
<dd><a href="#">B</a><a href="#">D</a><a href="#">X</a><a href="#">A</a></dd>
</dl>
dl {
display: grid;
grid-template-columns: minmax(max-content, 1fr) minmax(auto, 2fr);
}
dt {
grid-column-start: 1;
}
dd {
grid-column-start: 2;
margin: 0;
}
dl > header {
grid-column: 1 / span 2;
font-weight: bold;
background-color: var(--muted-color);
color: var(--primary-inverse);
padding: var(--form-element-spacing-vertical)
var(--form-element-spacing-horizontal);
}
dd,
dt {
padding: var(--form-element-spacing-vertical)
var(--form-element-spacing-horizontal);
border: 1px solid var(--muted-border-color);
}
dd:nth-of-type(even),
dt:nth-of-type(even) {
background-color: var(--table-row-stripped-background-color);
}
NOTE: The
<header>
is not standards compliant. This first comment is to open the bikeshed asking for thoughts, and is not a proposal on how or what this should finally look like.
This also, IMHO, makes a very nice looking form wrapper:
<form>
<dl>
<dt><label for="firstname">First Name</label></dt>
<dd>
<input type="text" id="firstname" name="firstname" placeholder="First name" />
</dd>
<dt><label for="lastname">Last Name</label></dt>
<dd>
<input type="text" id="lastname" name="lastname" placeholder="Last name" required="" />
</dd>
<dt><label for="email">Email address</label></dt>
<dd>
<input type="email" id="email" name="email" placeholder="email address" />
</dd>
<dt></dt>
<dd><button type="submit">Submit</button></dd>
</dl>
</form>
Examples:
https://www.codeproject.com/Articles/881782/Creating-custom-UI-property-pages-sheets-in-Visual
https://docs.webix.com/desktop__property_sheet.html