$container-width: 45rem;
$container-min-padding: 1rem;
$container-width-threshold: $container-width + 2 * $container-min-padding;

$primary-color: #36e281;
$border-color: #bfbfbf;
$background-color: white;
$background-color-dark: #1b1d1f;
$standard-border-width: .075rem;
$standard-border: $standard-border-width solid $border-color;

$font-heading: "Lora", "Lora Fallback", serif;
$font-body: "Raleway", "Raleway Fallback", sans-serif;
$font-code: "Inconsolata", monospace, "STIXGeneral";

$warning-background-color: #ffee99;
$warning-border-color: #f5c827;
$warning-background-color-dark: #75640a;
$warning-border-color-dark: $warning-background-color;

$target-background-color: lighten(yellow, 30%);
$target-background-color-dark: #55511c;

$code-color: #f0f0f0;
$code-color-dark: lighten($background-color-dark, 10%);
$code-token-color: darken($primary-color, 25%);
$code-token-color-dark: $primary-color;
$code-highlight-color: #fffd99;
$code-highlight-color-dark: #555538;
$code-border-color: darken($code-color, 10%);
$code-lineno-color: black;
$code-lineno-spacing: 1rem;
$code-comment-color: grey;
$code-comment-color-dark: #68dcff;
$code-border: $standard-border-width solid $code-border-color;

$input-padding: 0.5rem;

$sidenote-padding: 1rem;
$sidenote-highlight-border-width: .2rem;

$margin-width: 30rem;
$margin-inner-offset: 0.5rem;
$margin-outer-offset: 1rem;

$toc-border-color: $code-border-color;

// Default values for CSS variables for fallback.
$css-vars: (
    background-color: $background-color,
    text-color: black,

    warning-background-color: $warning-background-color,
    warning-border-color: $warning-border-color,

    target-background-color: $target-background-color,

    code-color: $code-color,
    code-lineno-color: $code-lineno-color,
    code-keyword-color: $code-token-color,
    code-comment-color: $code-comment-color,
    code-type-color: $code-token-color,
    code-highlight-color: $code-highlight-color,
);

@mixin var($property, $varName) {
    #{$property}: map-get($css-vars, $varName);
    #{$property}: var(--#{$varName});
}
