プレビュー
HTML
<form>
<fieldset>
<legend>View</legend>
<input id="chic-a" type="radio" name="chic-panel" checked />
<label for="chic-a">Type</label>
<input id="chic-b" type="radio" name="chic-panel" />
<label for="chic-b">Space</label>
<p class="a">Tokens for type.</p>
<p class="b">A single gap.</p>
</fieldset>
</form>
CSS
:root {
--ink: #3f382f;
--paper: #f7f1e6;
--accent: #8d6a3e;
--accent-2: #5a5148;
--on-accent: #fff8ee;
--muted: #8a7f72;
--line: #d8cbb8;
--chip: #efe6d4;
}
fieldset {
display: flex;
flex-wrap: wrap;
gap: 0.4rem;
margin: 0;
padding: 1.35rem 1.45rem;
border: 1px solid var(--line);
border-radius: 0;
background: var(--paper);
color: var(--ink);
font-family: Palatino, Georgia, serif;
}
legend { font-weight: 500; }
input { position: absolute; opacity: 0; }
label {
padding: 0.3rem 0.65rem;
border-radius: 0;
font-size: 0.95rem;
font-weight: 500;
}
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: #3f382f;
--paper: #f7f1e6;
--accent: #8d6a3e;
--accent-2: #5a5148;
--on-accent: #fff8ee;
--muted: #8a7f72;
--line: #d8cbb8;
--chip: #efe6d4;
}
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-[1.35rem_1.45rem] [border:1px_solid_var(--line)] rounded-[0] bg-[var(--paper)] text-[var(--ink)] font-[Palatino,_Georgia,_serif]">
<legend class="font-medium">View</legend>
<input class="absolute opacity-[0]" id="chic-a" type="radio" name="chic-panel" checked />
<label class="p-[0.3rem_0.65rem] rounded-[0] text-[0.95rem] font-medium" for="chic-a">Type</label>
<input class="absolute opacity-[0]" id="chic-b" type="radio" name="chic-panel" />
<label class="p-[0.3rem_0.65rem] rounded-[0] text-[0.95rem] font-medium" for="chic-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>