@use '../config' as *;
@use '../function' as *;

@mixin generate-default {
  ::selection {
    background-color: color('background', 'selection');
    color: color('foreground', 'selection');
    text-shadow: none;
  }

  html {
    box-sizing: border-box;

    @if setting('html-smooth-scrolling') {
      @media (prefers-reduced-motion: no-preference) {
        scroll-behavior: smooth;
      }
    }
  }

  *,
  ::before,
  ::after {
    box-sizing: inherit;
  }

  body {
    background: color('background');
    color: color('text');
  }

  a {
    color: color('link');
    text-decoration: underline;
    transition-duration: config('duration', $transition);
    transition-property: color;
    transition-timing-function: config('timing-function', $transition);

    &:hover {
      color: color('link-hover');
    }
  }

  button {
    color: inherit;
  }

  // Turn off double-tap on mobile to zoom
  a,
  button {
    touch-action: manipulation;
  }
}
