FrontEnd.ro logo
CSS "Parent" Selector

<style>
  body {
    --body: #ededed;
    --text: #000;
    --primary: #2980b9;
  }

  /* Other rules... */

  body:has(#themeControl:checked) {
    --body: #282a36;
    --text: #f8f8f2;
    --primary: #f39c12;
  }
</style>
<label>
  Use dark theme
  <input id="themeControl" type="checkbox" />
</label>