پیشنمایش زنده
کد HTML
<fieldset>
<legend class="sr-only">Checkboxes</legend>
<div
class="flex flex-col items-start divide-y-2 divide-black border-2 border-black shadow-[4px_4px_0_0]"
>
<label
for="Option1"
class="inline-flex items-start gap-3 p-4 focus-within:bg-yellow-300 hover:bg-yellow-100"
>
<input
type="checkbox"
class="size-6 border-2 border-black shadow-[2px_2px_0_0] shadow-black accent-black focus:ring-2 focus:ring-black"
id="Option1"
/>
<div>
<strong class="font-semibold"> Option 1 </strong>
<p class="mt-0.5 text-sm text-pretty">
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Ea,
distinctio.
</p>
</div>
</label>
<label
for="Option2"
class="inline-flex items-start gap-3 p-4 focus-within:bg-yellow-300 hover:bg-yellow-100"
>
<input
type="checkbox"
class="size-6 border-2 border-black shadow-[2px_2px_0_0] shadow-black accent-black focus:ring-2 focus:ring-black"
id="Option2"
/>
<div>
<strong class="font-semibold"> Option 2 </strong>
<p class="mt-0.5 text-sm text-pretty">
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Ea,
distinctio.
</p>
</div>
</label>
<label
for="Option3"
class="inline-flex items-start gap-3 p-4 focus-within:bg-yellow-300 hover:bg-yellow-100"
>
<input
type="checkbox"
class="size-6 border-2 border-black shadow-[2px_2px_0_0] shadow-black accent-black focus:ring-2 focus:ring-black"
id="Option3"
/>
<div>
<strong class="font-semibold"> Option 3 </strong>
<p class="mt-0.5 text-sm text-pretty">
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Ea,
distinctio.
</p>
</div>
</label>
</div>
</fieldset>
کد CSS
/* ! tailwindcss v3.4.17 | MIT License | s://tailwindcss.com */
*,
::after,
::before {
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: #e5e7eb;
}
::after,
::before {
--tw-content: "";
}
:host,
html {
line-height: 1.5;
-webkit-text-size-adjust: 100%;
-moz-tab-size: 4;
tab-size: 4;
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-feature-settings: normal;
font-variation-settings: normal;
-webkit-tap-highlight-color: transparent;
}
body {
margin: 0;
line-height: inherit;
}
hr {
height: 0;
color: inherit;
border-top-width: 1px;
}
abbr:where([title]) {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-size: inherit;
font-weight: inherit;
}
a {
color: inherit;
text-decoration: inherit;
}
b,
strong {
font-weight: bolder;
}
code,
kbd,
pre,
samp {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
"Liberation Mono", "Courier New", monospace;
font-feature-settings: normal;
font-variation-settings: normal;
font-size: 1em;
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
table {
text-indent: 0;
border-color: inherit;
border-collapse: collapse;
}
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
font-feature-settings: inherit;
font-variation-settings: inherit;
font-size: 100%;
font-weight: inherit;
line-height: inherit;
letter-spacing: inherit;
color: inherit;
margin: 0;
padding: 0;
}
button,
select {
text-transform: none;
}
button,
input:where([type="button"]),
input:where([type="reset"]),
input:where([type="submit"]) {
-webkit-appearance: button;
background-color: transparent;
background-image: none;
}
:-moz-focusring {
outline: auto;
}
:-moz-ui-invalid {
box-shadow: none;
}
progress {
vertical-align: baseline;
}
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
height: auto;
}
[type="search"] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-file-upload-button {
-webkit-appearance: button;
font: inherit;
}
summary {
display: list-item;
}
blockquote,
dd,
dl,
figure,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
p,
pre {
margin: 0;
}
fieldset {
margin: 0;
padding: 0;
}
legend {
padding: 0;
}
menu,
ol,
ul {
list-style: none;
margin: 0;
padding: 0;
}
dialog {
padding: 0;
}
textarea {
resize: vertical;
}
input::placeholder,
textarea::placeholder {
opacity: 1;
color: #9ca3af;
}
[role="button"],
button {
cursor: pointer;
}
:disabled {
cursor: default;
}
audio,
canvas,
embed,
iframe,
img,
object,
svg,
video {
display: block;
vertical-align: middle;
}
img,
video {
max-width: 100%;
height: auto;
}
[hidden]:where(:not([hidden="until-found"])) {
display: none;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}
.mt-0\.5 {
margin-top: 0.125rem;
}
.flex {
display: flex;
}
.inline-flex {
display: inline-flex;
}
.size-6 {
width: 1.5rem;
height: 1.5rem;
}
.flex-col {
flex-direction: column;
}
.items-start {
align-items: flex-start;
}
.gap-3 {
gap: 0.75rem;
}
.divide-y-2 > :not([hidden]) ~ :not([hidden]) {
--tw-divide-y-reverse: 0;
border-top-width: calc(2px * calc(1 - var(--tw-divide-y-reverse)));
border-bottom-width: calc(2px * var(--tw-divide-y-reverse));
}
.divide-black > :not([hidden]) ~ :not([hidden]) {
--tw-divide-opacity: 1;
border-color: rgb(0 0 0 / var(--tw-divide-opacity, 1));
}
.text-pretty {
text-wrap: pretty;
}
.border-2 {
border-width: 2px;
}
.border-black {
--tw-border-opacity: 1;
border-color: rgb(0 0 0 / var(--tw-border-opacity, 1));
}
.p-4 {
padding: 1rem;
}
.text-sm {
font-size: 0.875rem;
line-height: 1.25rem;
}
.font-semibold {
font-weight: 600;
}
.accent-black {
accent-color: #000;
}
.shadow-\[2px_2px_0_0\] {
--tw-shadow: 2px 2px 0 0;
--tw-shadow-colored: 2px 2px 0 0 var(--tw-shadow-color);
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000),
var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.shadow-\[4px_4px_0_0\] {
--tw-shadow: 4px 4px 0 0;
--tw-shadow-colored: 4px 4px 0 0 var(--tw-shadow-color);
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000),
var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.shadow-black {
--tw-shadow-color: #000;
--tw-shadow: var(--tw-shadow-colored);
}
.focus-within\:bg-yellow-300:focus-within {
--tw-bg-opacity: 1;
background-color: rgb(253 224 71 / var(--tw-bg-opacity, 1));
}
.hover\:bg-yellow-100:hover {
--tw-bg-opacity: 1;
background-color: rgb(254 249 195 / var(--tw-bg-opacity, 1));
}
.focus\:ring-2:focus {
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0
var(--tw-ring-offset-width) var(--tw-ring-offset-color);
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0
calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow),
var(--tw-shadow, 0 0 #0000);
}
.focus\:ring-black:focus {
--tw-ring-opacity: 1;
--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity, 1));
}