Preview
HTML
<form>
<fieldset>
<legend>View</legend>
<input id="editorial-a" type="radio" name="editorial-panel" checked />
<label for="editorial-a">Type</label>
<input id="editorial-b" type="radio" name="editorial-panel" />
<label for="editorial-b">Space</label>
<p class="a">Tokens for type.</p>
<p class="b">A single gap.</p>
</fieldset>
</form>
CSS
:root {
--ink: #1c1915;
--paper: #fbf7ee;
--accent: #6b3f2a;
--accent-2: #2c3a4a;
--on-accent: #fbf7ee;
--muted: #6f675c;
--line: #cfc4b0;
--chip: #f0e9db;
}
fieldset {
display: flex;
flex-wrap: wrap;
gap: 0.4rem;
margin: 0;
padding: 0;
border: 1px solid var(--line);
border-radius: 0;
background: var(--paper);
color: var(--ink);
font-family: Palatino, Georgia, serif;
}
legend { font-weight: 600; }
input { position: absolute; opacity: 0; }
label {
padding: 0.3rem 0.65rem;
border-radius: 0;
font-size: 1rem;
font-weight: 600;
}
input:checked + label {
background: var(--accent);
color: var(--on-accent);
}
p {
flex: 1 0 100%;
display: none;
margin: 0.4rem 0 0;
}
input:nth-of-type(1):checked ~ .a,
input:nth-of-type(2):checked ~ .b {
display: block;
}
Tailwind
<style>
:root {
--ink: #1c1915;
--paper: #fbf7ee;
--accent: #6b3f2a;
--accent-2: #2c3a4a;
--on-accent: #fbf7ee;
--muted: #6f675c;
--line: #cfc4b0;
--chip: #f0e9db;
}
input:checked + label {
background: var(--accent);
color: var(--on-accent);
}
input:nth-of-type(1):checked ~ .a,
input:nth-of-type(2):checked ~ .b {
display: block;
}
</style>
<form>
<fieldset class="flex flex-wrap gap-[0.4rem] m-0 p-0 [border:1px_solid_var(--line)] rounded-[0] bg-[var(--paper)] text-[var(--ink)] font-[Palatino,_Georgia,_serif]">
<legend class="font-semibold">View</legend>
<input class="absolute opacity-[0]" id="editorial-a" type="radio" name="editorial-panel" checked />
<label class="p-[0.3rem_0.65rem] rounded-[0] text-[1rem] font-semibold" for="editorial-a">Type</label>
<input class="absolute opacity-[0]" id="editorial-b" type="radio" name="editorial-panel" />
<label class="p-[0.3rem_0.65rem] rounded-[0] text-[1rem] font-semibold" for="editorial-b">Space</label>
<p class="a [flex:1_0_100%] hidden m-[0.4rem_0_0]">Tokens for type.</p>
<p class="b [flex:1_0_100%] hidden m-[0.4rem_0_0]">A single gap.</p>
</fieldset>
</form>