全屏
<fieldset color-scheme="light">
  <label>
    Default
    <input type="radio" name="default-demo-light" checked>
    <input type="radio" name="default-demo-light">
    <input type="radio" name="default-demo-light">
  </label>

  <label class="accented">
    Tinted
    <input type="radio" name="accented-demo-light" checked>
    <input type="radio" name="accented-demo-light">
    <input type="radio" name="accented-demo-light">
  </label>
</fieldset>

<fieldset color-scheme="dark">
  <label>
    Default
    <input type="radio" name="default-demo-dark" checked>
    <input type="radio" name="default-demo-dark">
    <input type="radio" name="default-demo-dark">
  </label>

  <label class="accented">
    Tinted
    <input type="radio" name="accented-demo-dark" checked>
    <input type="radio" name="accented-demo-dark">
    <input type="radio" name="accented-demo-dark">
  </label>
</fieldset>
.accented {
  accent-color: deeppink;
}

[color-scheme="dark"] .accented {
  accent-color: hsl(328 100% 80%);
}

input {
  --size: 2rem;
  block-size: var(--size);
  inline-size: var(--size);
}

label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

[color-scheme="light"] {
  color-scheme: light;
}

[color-scheme="dark"] {
  color-scheme: dark;
}

fieldset {
  border: 1px solid hsl(0 0% 50%);
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

fieldset[color-scheme="dark"] {
  background: Canvas;
  color: white;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html {
  block-size: 100%;
}

body {
  min-block-size: 100%;
  font-family: system-ui, sans-serif;
  
  display: grid;
  place-content: center;
  gap: 2rem;
}

@media (min-width: 540px) {
  body {
    grid-auto-flow: column;
  }
}
返回