// Import all the theming functionality.
// Core styles that can be used to apply material design treatments to any element.
@mixin cdk-a11y {
  .cdk-visually-hidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;

    // Avoid browsers rendering the focus ring in some cases.
    outline: 0;

    // Avoid some cases where the browser will still render the native controls (see #9049).
    -webkit-appearance: none;
    -moz-appearance: none;
  }
}

/**
 * Applies styles for users in high contrast mode. Note that this only applies
 * to Microsoft browsers. Chrome can be included by checking for the `html[hc]`
 * attribute, however Chrome handles high contrast differently.
 * @param target Which kind of high contrast setting to target. Defaults to `active`, can be
 *    `white-on-black` or `black-on-white`.
 */
@mixin cdk-high-contrast($target: active) {
  @media screen and (-ms-high-contrast: $target) {
    @content;
  }
}

// We want overlays to always appear over user content, so set a baseline
// very high z-index for the overlay container, which is where we create the new
// stacking context for all overlays.
$cdk-z-index-overlay-container: 1000;
$cdk-z-index-overlay: 1000;
$cdk-z-index-overlay-backdrop: 1000;

// Background color for all of the backdrops
$cdk-overlay-dark-backdrop-background: rgba(0, 0, 0, 0.288);

// Default backdrop animation is based on the Material Design swift-ease-out.
$backdrop-animation-duration: 400ms !default;
$backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;


@mixin cdk-overlay() {
  .cdk-overlay-container, .cdk-global-overlay-wrapper {
    // Disable events from being captured on the overlay container.
    pointer-events: none;

    // The container should be the size of the viewport.
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
  }

  // The overlay-container is an invisible element which contains all individual overlays.
  .cdk-overlay-container {
    position: fixed;
    z-index: $cdk-z-index-overlay-container;

    &:empty {
      // Hide the element when it doesn't have any child nodes. This doesn't
      // include overlays that have been detached, rather than disposed.
      display: none;
    }
  }

  // We use an extra wrapper element in order to use make the overlay itself a flex item.
  // This makes centering the overlay easy without running into the subpixel rendering
  // problems tied to using `transform` and without interfering with the other position
  // strategies.
  .cdk-global-overlay-wrapper {
    display: flex;
    position: absolute;
    z-index: $cdk-z-index-overlay;
  }

  // A single overlay pane.
  .cdk-overlay-pane {
    // Note: it's important for this one to start off `absolute`,
    // in order for us to be able to measure it correctly.
    position: absolute;
    pointer-events: auto;
    box-sizing: border-box;
    z-index: $cdk-z-index-overlay;

    // For connected-position overlays, we set `display: flex` in
    // order to force `max-width` and `max-height` to take effect.
    display: flex;
    max-width: 100%;
    max-height: 100%;
  }

  .cdk-overlay-backdrop {
    // TODO(jelbourn): reuse sidenav fullscreen mixin.
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;

    z-index: $cdk-z-index-overlay-backdrop;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    transition: opacity $backdrop-animation-duration $backdrop-animation-timing-function;
    opacity: 0;

    &.cdk-overlay-backdrop-showing {
      opacity: 1;

      // In high contrast mode the rgba background will become solid so we need to fall back
      // to making it opaque using `opacity`. Note that we can't use the `cdk-high-contrast`
      // mixin, because we can't normalize the import path to the _a11y.scss both for the
      // source and when this file is distributed. See #10908.
      @media screen and (-ms-high-contrast: active) {
        opacity: 0.6;
      }
    }
  }

  .cdk-overlay-dark-backdrop {
    background: $cdk-overlay-dark-backdrop-background;
  }

  .cdk-overlay-transparent-backdrop {
    // Note: as of Firefox 57, having the backdrop be `background: none` will prevent it from
    // capturing the user's mouse scroll events. Since we also can't use something like
    // `rgba(0, 0, 0, 0)`, we work around the inconsistency by not setting the background at
    // all and using `opacity` to make the element transparent.
    &, &.cdk-overlay-backdrop-showing {
      opacity: 0;
    }
  }

  // Overlay parent element used with the connected position strategy. Used to constrain the
  // overlay element's size to fit within the viewport.
  .cdk-overlay-connected-position-bounding-box {
    position: absolute;
    z-index: $cdk-z-index-overlay;

    // We use `display: flex` on this element exclusively for centering connected overlays.
    // When *not* centering, a top/left/bottom/right will be set which overrides the normal
    // flex layout.
    display: flex;

    // We use the `column` direction here to avoid some flexbox issues in Edge
    // when using the "grow after open" options.
    flex-direction: column;

    // Add some dimensions so the element has an `innerText` which some people depend on in tests.
    min-width: 1px;
    min-height: 1px;
  }

  // Used when disabling global scrolling.
  .cdk-global-scrollblock {
    position: fixed;

    // Necessary for the content not to lose its width. Note that we're using 100%, instead of
    // 100vw, because 100vw includes the width plus the scrollbar, whereas 100% is the width
    // that the element had before we made it `fixed`.
    width: 100%;

    // Note: this will always add a scrollbar to whatever element it is on, which can
    // potentially result in double scrollbars. It shouldn't be an issue, because we won't
    // block scrolling on a page that doesn't have a scrollbar in the first place.
    overflow-y: scroll;
  }
}

// Implement the rem unit with SCSS so we don't have to actually set a font-size on
// the user's body element.
@function rem($multiplier) {
  $font-size: 10px;
  @return $multiplier * $font-size;
}


// Typography
$vdl-body-font-size-base: rem(1.4) !default;

$vdl-font-light: Roboto-Light, sans-serif !default;
$vdl-font-regular: Roboto-Regular, sans-serif !default;
$vdl-font-medium: Roboto-Medium, sans-serif !default;
$vdl-font-bold: Roboto-Bold, sans-serif !default;

// Media queries
// TODO: Find a way to respect media query ranges.
// TODO: For example the xs-breakpoint should not interfere with the sm-breakpoint.
$vdl-xsmall: 'max-width: 600px';
$vdl-small: 'max-width: 960px';

// TODO: Revisit all z-indices before beta
// z-index master list

$z-index-fab: 20 !default;
$z-index-drawer: 100 !default;

$vdl-z-index-sidenav: 1000;
$vdl-z-index-page: 1000;
$vdl-z-index-title-bar: 1500;
$vdl-z-index-popover: 2000;
$cdk-z-index-overlay-container: 2000;
$cdk-z-index-overlay: 2000;
$cdk-z-index-overlay-backdrop: 2000;
$vdl-z-index-top-bar: 9000;

// Background color for all of the backdrops
$cdk-overlay-dark-backdrop-background: rgba(0, 0, 0, 0.288);

// Global constants
$pi: 3.14159265;

// Padding between input toggles and their labels
$vdl-toggle-padding: 15px !default;

$top-bar-height: 60px;

// global values for vdl-hint & vdl-error
$vdl-hint-error-font-size: 0.625rem;
$vdl-hint-error-line-height: 0.8125rem;

// Easing Curves
// TODO(jelbourn): all of these need to be revisited

// The default animation curves used by material design.
$vdl-linear-out-slow-in-timing-function: cubic-bezier(0, 0, 0.2, 0.1) !default;
$vdl-fast-out-slow-in-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !default;
$vdl-fast-out-linear-in-timing-function: cubic-bezier(0.4, 0, 1, 1) !default;

$ease-in-out-curve-function: cubic-bezier(0.35, 0, 0.25, 1) !default;

$swift-ease-out-duration: 400ms !default;
$swift-ease-out-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
$swift-ease-out: all $swift-ease-out-duration $swift-ease-out-timing-function !default;

$swift-ease-in-duration: 300ms !default;
$swift-ease-in-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2) !default;
$swift-ease-in: all $swift-ease-in-duration $swift-ease-in-timing-function !default;

$swift-ease-in-out-duration: 500ms !default;
$swift-ease-in-out-timing-function: $ease-in-out-curve-function !default;
$swift-ease-in-out: all $swift-ease-in-out-duration
  $swift-ease-in-out-timing-function !default;

$swift-linear-duration: 80ms !default;
$swift-linear-timing-function: linear !default;
$swift-linear: all $swift-linear-duration $swift-linear-timing-function !default;


// The default duration value for elevation transitions.
$vdl-elevation-transition-duration: 280ms !default;

// The default easing value for elevation transitions.
$vdl-elevation-transition-timing-function: $vdl-fast-out-slow-in-timing-function;

@mixin vdl-bottom-shadow() {
  box-shadow: 0 4px 3px -2px rgba(0, 0, 0, 0.25);
}
$elevations: (
    0 1px 3px 0 rgba(0, 0, 0, 0.12),
    0 1px 1px 0 rgba(0, 0, 0, 0.14),
    0 2px 1px -1px rgba(0, 0, 0, 0.2)
  ),
  (
    0 1px 5px 0 rgba(0, 0, 0, 0.12),
    0 2px 2px 0 rgba(0, 0, 0, 0.14),
    0 3px 1px -2px rgba(0, 0, 0, 0.2)
  ),
  (
    0 1px 8px 0 rgba(0, 0, 0, 0.12),
    0 3px 4px 0 rgba(0, 0, 0, 0.14),
    0 3px 3px -2px rgba(0, 0, 0, 0.2)
  ),
  (
    0 1px 10px 0 rgba(0, 0, 0, 0.12),
    0 4px 5px 0 rgba(0, 0, 0, 0.14),
    0 2px 4px -1px rgba(0, 0, 0, 0.2)
  ),
  (
    0 1px 14px 0 rgba(0, 0, 0, 0.12),
    0 5px 8px 0 rgba(0, 0, 0, 0.14),
    0 3px 5px -1px rgba(0, 0, 0, 0.2)
  ),
  (
    0 1px 18px 0 rgba(0, 0, 0, 0.12),
    0 6px 10px 0 rgba(0, 0, 0, 0.14),
    0 3px 5px -1px rgba(0, 0, 0, 0.2)
  ),
  (
    0 2px 16px 1px rgba(0, 0, 0, 0.12),
    0 7px 10px 1px rgba(0, 0, 0, 0.14),
    0 4px 5px -2px rgba(0, 0, 0, 0.2)
  ),
  (
    0 3px 14px 2px rgba(0, 0, 0, 0.12),
    0 8px 10px 1px rgba(0, 0, 0, 0.14),
    0 5px 5px -3px rgba(0, 0, 0, 0.2)
  ),
  (
    0 4px 16px 2px rgba(0, 0, 0, 0.12),
    0 9px 12px 1px rgba(0, 0, 0, 0.14),
    0 5px 6px -3px rgba(0, 0, 0, 0.2)
  ),
  (
    0 4px 18px 3px rgba(0, 0, 0, 0.12),
    0 10px 14px 1px rgba(0, 0, 0, 0.14),
    0 6px 6px -3px rgba(0, 0, 0, 0.2)
  ),
  (
    0 4px 20px 3px rgba(0, 0, 0, 0.12),
    0 11px 15px 1px rgba(0, 0, 0, 0.14),
    0 6px 7px -4px rgba(0, 0, 0, 0.2)
  ),
  (
    0 5px 22px 4px rgba(0, 0, 0, 0.12),
    0 12px 17px 2px rgba(0, 0, 0, 0.14),
    0 7px 8px -4px rgba(0, 0, 0, 0.2)
  ),
  (
    0 5px 24px 4px rgba(0, 0, 0, 0.12),
    0 13px 19px 2px rgba(0, 0, 0, 0.14),
    0 7px 8px -4px rgba(0, 0, 0, 0.2)
  ),
  (
    0 5px 26px 4px rgba(0, 0, 0, 0.12),
    0 14px 21px 2px rgba(0, 0, 0, 0.14),
    0 7px 9px -4px rgba(0, 0, 0, 0.2)
  ),
  (
    0 6px 28px 5px rgba(0, 0, 0, 0.12),
    0 15px 22px 2px rgba(0, 0, 0, 0.14),
    0 8px 9px -5px rgba(0, 0, 0, 0.2)
  ),
  (
    0 6px 30px 5px rgba(0, 0, 0, 0.12),
    0 16px 24px 2px rgba(0, 0, 0, 0.14),
    0 8px 10px -5px rgba(0, 0, 0, 0.2)
  ),
  (
    0 6px 32px 5px rgba(0, 0, 0, 0.12),
    0 17px 26px 2px rgba(0, 0, 0, 0.14),
    0 8px 11px -5px rgba(0, 0, 0, 0.2)
  ),
  (
    0 7px 34px 6px rgba(0, 0, 0, 0.12),
    0 18px 28px 2px rgba(0, 0, 0, 0.14),
    0 9px 11px -5px rgba(0, 0, 0, 0.2)
  ),
  (
    0 7px 36px 6px rgba(0, 0, 0, 0.12),
    0 19px 29px 2px rgba(0, 0, 0, 0.14),
    0 9px 12px -6px rgba(0, 0, 0, 0.2)
  ),
  (
    0 8px 38px 7px rgba(0, 0, 0, 0.12),
    0 20px 31px 3px rgba(0, 0, 0, 0.14),
    0 10px 13px -6px rgba(0, 0, 0, 0.2)
  ),
  (
    0 8px 40px 7px rgba(0, 0, 0, 0.12),
    0 21px 33px 3px rgba(0, 0, 0, 0.14),
    0 10px 13px -6px rgba(0, 0, 0, 0.2)
  ),
  (
    0 8px 42px 7px rgba(0, 0, 0, 0.12),
    0 22px 35px 3px rgba(0, 0, 0, 0.14),
    0 10px 14px -6px rgba(0, 0, 0, 0.2)
  ),
  (
    0 9px 44px 8px rgba(0, 0, 0, 0.12),
    0 23px 36px 3px rgba(0, 0, 0, 0.14),
    0 11px 14px -7px rgba(0, 0, 0, 0.2)
  ),
  (
    0 9px 46px 8px rgba(0, 0, 0, 0.12),
    0 24px 38px 3px rgba(0, 0, 0, 0.14),
    0 11px 15px -7px rgba(0, 0, 0, 0.2)
  );

@mixin vdl-elevation($index) {
  box-shadow: nth($elevations, $index);
}

@mixin vdl-elevation-transition(
  $duration: $vdl-elevation-transition-duration,
  $easing: $vdl-elevation-transition-timing-function
) {
  transition: vdl-elevation-transition-property-value($duration, $easing);
}

/// Color palettes from the Material Design spec.
// See https://www.google.com/design/spec/style/color.html
//
// Contrast colors are hard-coded because it is too difficult (probably impossible) to
// calculate them. These contrast colors are pulled from the public Material Design spec swatches.
// While the contrast colors in the spec are not prescriptive, we use them for convenience.

$black-87-opacity: rgba(black, 0.87);
$white-87-opacity: rgba(white, 0.87);
$black-12-opacity: rgba(black, 0.12);
$white-12-opacity: rgba(white, 0.12);
$black-6-opacity: rgba(black, 0.06);
$white-6-opacity: rgba(white, 0.06);

$vdl-red: (
  50: #ffebee,
  100: #ffcdd2,
  200: #ef9a9a,
  300: #e57373,
  400: #ef5350,
  500: #f44336,
  600: #e53935,
  700: #d32f2f,
  800: #c62828,
  900: #b71c1c,
  A100: #ff8a80,
  A200: #ff5252,
  A400: #ff1744,
  A700: #d50000,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: $black-87-opacity,
    400: $black-87-opacity,
    500: white,
    600: white,
    700: white,
    800: $white-87-opacity,
    900: $white-87-opacity,
    A100: $black-87-opacity,
    A200: white,
    A400: white,
    A700: white
  )
);

$vdl-pink: (
  50: #fce4ec,
  100: #f8bbd0,
  200: #f48fb1,
  300: #f06292,
  400: #ec407a,
  500: #e91e63,
  600: #d81b60,
  700: #c2185b,
  800: #ad1457,
  900: #880e4f,
  A100: #ff80ab,
  A200: #ff4081,
  A400: #f50057,
  A700: #c51162,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: $black-87-opacity,
    400: $black-87-opacity,
    500: white,
    600: white,
    700: $white-87-opacity,
    800: $white-87-opacity,
    900: $white-87-opacity,
    A100: $black-87-opacity,
    A200: white,
    A400: white,
    A700: white
  )
);

$vdl-purple: (
  50: #f3e5f5,
  100: #e1bee7,
  200: #ce93d8,
  300: #ba68c8,
  400: #ab47bc,
  500: #9c27b0,
  600: #8e24aa,
  700: #7b1fa2,
  800: #6a1b9a,
  900: #4a148c,
  A100: #ea80fc,
  A200: #e040fb,
  A400: #d500f9,
  A700: #aa00ff,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: white,
    400: white,
    500: $white-87-opacity,
    600: $white-87-opacity,
    700: $white-87-opacity,
    800: $white-87-opacity,
    900: $white-87-opacity,
    A100: $black-87-opacity,
    A200: white,
    A400: white,
    A700: white
  )
);

$vdl-deep-purple: (
  50: #ede7f6,
  100: #d1c4e9,
  200: #b39ddb,
  300: #9575cd,
  400: #7e57c2,
  500: #673ab7,
  600: #5e35b1,
  700: #512da8,
  800: #4527a0,
  900: #311b92,
  A100: #b388ff,
  A200: #7c4dff,
  A400: #651fff,
  A700: #6200ea,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: white,
    400: white,
    500: $white-87-opacity,
    600: $white-87-opacity,
    700: $white-87-opacity,
    800: $white-87-opacity,
    900: $white-87-opacity,
    A100: $black-87-opacity,
    A200: white,
    A400: $white-87-opacity,
    A700: $white-87-opacity
  )
);

$vdl-indigo: (
  50: #e8eaf6,
  100: #c5cae9,
  200: #9fa8da,
  300: #7986cb,
  400: #5c6bc0,
  500: #3f51b5,
  600: #3949ab,
  700: #303f9f,
  800: #283593,
  900: #1a237e,
  A100: #8c9eff,
  A200: #536dfe,
  A400: #3d5afe,
  A700: #304ffe,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: white,
    400: white,
    500: $white-87-opacity,
    600: $white-87-opacity,
    700: $white-87-opacity,
    800: $white-87-opacity,
    900: $white-87-opacity,
    A100: $black-87-opacity,
    A200: white,
    A400: white,
    A700: $white-87-opacity
  )
);

$vdl-blue: (
  50: #e3f2fd,
  100: #bbdefb,
  200: #90caf9,
  300: #64b5f6,
  400: #42a5f5,
  500: #2196f3,
  600: #1e88e5,
  700: #1976d2,
  800: #1565c0,
  900: #0d47a1,
  A100: #82b1ff,
  A200: #448aff,
  A400: #2979ff,
  A700: #2962ff,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: $black-87-opacity,
    400: $black-87-opacity,
    500: white,
    600: white,
    700: white,
    800: $white-87-opacity,
    900: $white-87-opacity,
    A100: $black-87-opacity,
    A200: white,
    A400: white,
    A700: white
  )
);

$vdl-light-blue: (
  50: #e1f5fe,
  100: #b3e5fc,
  200: #81d4fa,
  300: #4fc3f7,
  400: #29b6f6,
  500: #03a9f4,
  600: #039be5,
  700: #0288d1,
  800: #0277bd,
  900: #01579b,
  A100: #80d8ff,
  A200: #40c4ff,
  A400: #00b0ff,
  A700: #0091ea,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: $black-87-opacity,
    400: $black-87-opacity,
    500: white,
    600: white,
    700: white,
    800: white,
    900: $white-87-opacity,
    A100: $black-87-opacity,
    A200: $black-87-opacity,
    A400: $black-87-opacity,
    A700: white
  )
);

$vdl-cyan: (
  50: #e0f7fa,
  100: #b2ebf2,
  200: #80deea,
  300: #4dd0e1,
  400: #26c6da,
  500: #00bcd4,
  600: #00acc1,
  700: #0097a7,
  800: #00838f,
  900: #006064,
  A100: #84ffff,
  A200: #18ffff,
  A400: #00e5ff,
  A700: #00b8d4,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: $black-87-opacity,
    400: $black-87-opacity,
    500: white,
    600: white,
    700: white,
    800: white,
    900: $white-87-opacity,
    A100: $black-87-opacity,
    A200: $black-87-opacity,
    A400: $black-87-opacity,
    A700: $black-87-opacity
  )
);

$vdl-teal: (
  50: #e0f2f1,
  100: #b2dfdb,
  200: #80cbc4,
  300: #4db6ac,
  400: #26a69a,
  500: #009688,
  600: #00897b,
  700: #00796b,
  800: #00695c,
  900: #004d40,
  A100: #a7ffeb,
  A200: #64ffda,
  A400: #1de9b6,
  A700: #00bfa5,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: $black-87-opacity,
    400: $black-87-opacity,
    500: white,
    600: white,
    700: white,
    800: $white-87-opacity,
    900: $white-87-opacity,
    A100: $black-87-opacity,
    A200: $black-87-opacity,
    A400: $black-87-opacity,
    A700: $black-87-opacity
  )
);

$vdl-green: (
  50: #e8f5e9,
  100: #c8e6c9,
  200: #a5d6a7,
  300: #81c784,
  400: #66bb6a,
  500: #4caf50,
  600: #43a047,
  700: #388e3c,
  800: #2e7d32,
  900: #1b5e20,
  A100: #b9f6ca,
  A200: #69f0ae,
  A400: #00e676,
  A700: #00c853,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: $black-87-opacity,
    400: $black-87-opacity,
    500: white,
    600: white,
    700: white,
    800: $white-87-opacity,
    900: $white-87-opacity,
    A100: $black-87-opacity,
    A200: $black-87-opacity,
    A400: $black-87-opacity,
    A700: $black-87-opacity
  )
);

$vdl-light-green: (
  50: #f1f8e9,
  100: #dcedc8,
  200: #c5e1a5,
  300: #aed581,
  400: #9ccc65,
  500: #8bc34a,
  600: #7cb342,
  700: #689f38,
  800: #558b2f,
  900: #33691e,
  A100: #ccff90,
  A200: #b2ff59,
  A400: #76ff03,
  A700: #64dd17,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: $black-87-opacity,
    400: $black-87-opacity,
    500: $black-87-opacity,
    600: $black-87-opacity,
    700: $black-87-opacity,
    800: white,
    900: white,
    A100: $black-87-opacity,
    A200: $black-87-opacity,
    A400: $black-87-opacity,
    A700: $black-87-opacity
  )
);

$vdl-lime: (
  50: #f9fbe7,
  100: #f0f4c3,
  200: #e6ee9c,
  300: #dce775,
  400: #d4e157,
  500: #cddc39,
  600: #c0ca33,
  700: #afb42b,
  800: #9e9d24,
  900: #827717,
  A100: #f4ff81,
  A200: #eeff41,
  A400: #c6ff00,
  A700: #aeea00,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: $black-87-opacity,
    400: $black-87-opacity,
    500: $black-87-opacity,
    600: $black-87-opacity,
    700: $black-87-opacity,
    800: $black-87-opacity,
    900: white,
    A100: $black-87-opacity,
    A200: $black-87-opacity,
    A400: $black-87-opacity,
    A700: $black-87-opacity
  )
);

$vdl-yellow: (
  50: #fffde7,
  100: #fff9c4,
  200: #fff59d,
  300: #fff176,
  400: #ffee58,
  500: #ffeb3b,
  600: #fdd835,
  700: #fbc02d,
  800: #f9a825,
  900: #f57f17,
  A100: #ffff8d,
  A200: #ffff00,
  A400: #ffea00,
  A700: #ffd600,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: $black-87-opacity,
    400: $black-87-opacity,
    500: $black-87-opacity,
    600: $black-87-opacity,
    700: $black-87-opacity,
    800: $black-87-opacity,
    900: $black-87-opacity,
    A100: $black-87-opacity,
    A200: $black-87-opacity,
    A400: $black-87-opacity,
    A700: $black-87-opacity
  )
);

$vdl-amber: (
  50: #fff8e1,
  100: #ffecb3,
  200: #ffe082,
  300: #ffd54f,
  400: #ffca28,
  500: #ffc107,
  600: #ffb300,
  700: #ffa000,
  800: #ff8f00,
  900: #ff6f00,
  A100: #ffe57f,
  A200: #ffd740,
  A400: #ffc400,
  A700: #ffab00,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: $black-87-opacity,
    400: $black-87-opacity,
    500: $black-87-opacity,
    600: $black-87-opacity,
    700: $black-87-opacity,
    800: $black-87-opacity,
    900: $black-87-opacity,
    A100: $black-87-opacity,
    A200: $black-87-opacity,
    A400: $black-87-opacity,
    A700: $black-87-opacity
  )
);

$vdl-orange: (
  50: #fff3e0,
  100: #ffe0b2,
  200: #ffcc80,
  300: #ffb74d,
  400: #ffa726,
  500: #ff9800,
  600: #fb8c00,
  700: #f57c00,
  800: #ef6c00,
  900: #e65100,
  A100: #ffd180,
  A200: #ffab40,
  A400: #ff9100,
  A700: #ff6d00,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: $black-87-opacity,
    400: $black-87-opacity,
    500: $black-87-opacity,
    600: $black-87-opacity,
    700: $black-87-opacity,
    800: white,
    900: white,
    A100: $black-87-opacity,
    A200: $black-87-opacity,
    A400: $black-87-opacity,
    A700: black
  )
);

$vdl-deep-orange: (
  50: #fbe9e7,
  100: #ffccbc,
  200: #ffab91,
  300: #ff8a65,
  400: #ff7043,
  500: #ff5722,
  600: #f4511e,
  700: #e64a19,
  800: #d84315,
  900: #bf360c,
  A100: #ff9e80,
  A200: #ff6e40,
  A400: #ff3d00,
  A700: #dd2c00,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: $black-87-opacity,
    400: $black-87-opacity,
    500: white,
    600: white,
    700: white,
    800: white,
    900: white,
    A100: $black-87-opacity,
    A200: $black-87-opacity,
    A400: white,
    A700: white
  )
);

$vdl-brown: (
  50: #efebe9,
  100: #d7ccc8,
  200: #bcaaa4,
  300: #a1887f,
  400: #8d6e63,
  500: #795548,
  600: #6d4c41,
  700: #5d4037,
  800: #4e342e,
  900: #3e2723,
  A100: #d7ccc8,
  A200: #bcaaa4,
  A400: #8d6e63,
  A700: #5d4037,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: white,
    400: white,
    500: $white-87-opacity,
    600: $white-87-opacity,
    700: $white-87-opacity,
    800: $white-87-opacity,
    900: $white-87-opacity,
    A100: $black-87-opacity,
    A200: $black-87-opacity,
    A400: white,
    A700: $white-87-opacity
  )
);

$vdl-grey: (
  0: #ffffff,
  50: #fafafa,
  100: #f5f5f5,
  200: #eeeeee,
  300: #e0e0e0,
  400: #bdbdbd,
  500: #9e9e9e,
  600: #757575,
  700: #616161,
  800: #424242,
  900: #212121,
  1000: #000000,
  A100: #ffffff,
  A200: #eeeeee,
  A400: #bdbdbd,
  A700: #616161,
  contrast: (
    0: $black-87-opacity,
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: $black-87-opacity,
    400: $black-87-opacity,
    500: $black-87-opacity,
    600: $white-87-opacity,
    700: $white-87-opacity,
    800: $white-87-opacity,
    900: $white-87-opacity,
    1000: $white-87-opacity,
    A100: $black-87-opacity,
    A200: $black-87-opacity,
    A400: $black-87-opacity,
    A700: $white-87-opacity
  )
);

$vdl-blue-grey: (
  50: #eceff1,
  100: #cfd8dc,
  200: #b0bec5,
  300: #90a4ae,
  400: #78909c,
  500: #607d8b,
  600: #546e7a,
  700: #455a64,
  800: #37474f,
  900: #263238,
  A100: #cfd8dc,
  A200: #b0bec5,
  A400: #78909c,
  A700: #455a64,
  contrast: (
    50: $black-87-opacity,
    100: $black-87-opacity,
    200: $black-87-opacity,
    300: $black-87-opacity,
    400: white,
    500: white,
    600: $white-87-opacity,
    700: $white-87-opacity,
    800: $white-87-opacity,
    900: $white-87-opacity,
    A100: $black-87-opacity,
    A200: $black-87-opacity,
    A400: white,
    A700: $white-87-opacity
  )
);

// Background palette for light themes.
$vdl-light-theme-background: (
  status-bar: map_get($vdl-grey, 300),
  app-bar: map_get($vdl-grey, 100),
  background: map_get($vdl-grey, 50),
  hover: rgba(black, 0.04),
  card: white,
  dialog: white,
  disabled-button: $black-12-opacity,
  raised-button: white,
  focused-button: $black-6-opacity,
  selected-button: map_get($vdl-grey, 300),
  selected-disabled-button: map_get($vdl-grey, 400),
  disabled-button-toggle: map_get($vdl-grey, 200)
);

// Background palette for dark themes.
$vdl-dark-theme-background: (
  status-bar: black,
  app-bar: map_get($vdl-grey, 900),
  background: #303030,
  hover: rgba(white, 0.04),
  card: map_get($vdl-grey, 800),
  dialog: map_get($vdl-grey, 800),
  disabled-button: $white-12-opacity,
  raised-button: map-get($vdl-grey, 800),
  focused-button: $white-6-opacity,
  selected-button: map_get($vdl-grey, 900),
  selected-disabled-button: map_get($vdl-grey, 800),
  disabled-button-toggle: map_get($vdl-grey, 1000)
);

// Foreground palette for light themes.
$vdl-light-theme-foreground: (
  base: black,
  divider: $black-12-opacity,
  dividers: $black-12-opacity,
  disabled: rgba(black, 0.38),
  disabled-button: rgba(black, 0.38),
  disabled-text: rgba(black, 0.38),
  hint-text: rgba(black, 0.38),
  secondary-text: rgba(black, 0.54),
  icon: rgba(black, 0.54),
  icons: rgba(black, 0.54),
  text: rgba(black, 0.87)
);

// Foreground palette for dark themes.
$vdl-dark-theme-foreground: (
  base: white,
  divider: $white-12-opacity,
  dividers: $white-12-opacity,
  disabled: rgba(white, 0.3),
  disabled-button: rgba(white, 0.3),
  disabled-text: rgba(white, 0.3),
  hint-text: rgba(white, 0.3),
  secondary-text: rgba(white, 0.7),
  icon: white,
  icons: white,
  text: white
);



// For a given hue in a palette, return the contrast color from the map of contrast palettes.
// @param $color-map
// @param $hue
@function vdl-contrast($palette, $hue) {
  @return map-get(map-get($palette, contrast), $hue);
}

// Creates a map of hues to colors for a theme. This is used to define a theme palette in terms
// of the Material Design hues.
// @param $color-map
// @param $primary
// @param $lighter
@function vdl-palette(
  $base-palette,
  $default: 500,
  $lighter: 100,
  $darker: 700
) {
  $result: map_merge(
    $base-palette,
    (
      default: map-get($base-palette, $default),
      lighter: map-get($base-palette, $lighter),
      darker: map-get($base-palette, $darker),
      default-contrast: vdl-contrast($base-palette, $default),
      lighter-contrast: vdl-contrast($base-palette, $lighter),
      darker-contrast: vdl-contrast($base-palette, $darker)
    )
  );

  // For each hue in the palette, add a "-contrast" color to the map.
  @each $hue, $color in $base-palette {
    $result: map_merge(
      $result,
      (
        '#{$hue}-contrast': vdl-contrast($base-palette, $hue)
      )
    );
  }

  @return $result;
}

// Gets a color from a theme palette (the output of vdl-palette).
// The hue can be one of the standard values (500, A400, etc.), one of the three preconfigured
// hues (default, lighter, darker), or any of the aforementioned prefixed with "-contrast".
//
// @param $color-map The theme palette (output of vdl-palette).
// @param $hue The hue from the palette to use. If this is a value between 0 and 1, it will
//     be treated as opacity.
// @param $opacity The alpha channel value for the color.
@function vdl-color($palette, $hue: default, $opacity: 1) {
  // If hueKey is a number between zero and one, then it actually contains an
  // opacity value, so recall this function with the default hue and that given opacity.
  @if type-of($hue) == number and $hue >= 0 and $hue <= 1 {
    @return vdl-color($palette, default, $hue);
  }

  $color: map-get($palette, $hue);
  $opacity: if(opacity($color) < 1, opacity($color), $opacity);

  @return rgba($color, $opacity);
}

// Creates a container object for a light theme to be given to individual component theme mixins.
@function vdl-light-theme($primary, $accent, $warn: vdl-palette($vdl-red)) {
  @return (
    primary: $primary,
    accent: $accent,
    warn: $warn,
    is-dark: false,
    foreground: $vdl-light-theme-foreground,
    background: $vdl-light-theme-background
  );
}

// Creates a container object for a dark theme to be given to individual component theme mixins.
@function vdl-dark-theme($primary, $accent, $warn: vdl-palette($vdl-red)) {
  @return (
    primary: $primary,
    accent: $accent,
    warn: $warn,
    is-dark: true,
    foreground: $vdl-dark-theme-foreground,
    background: $vdl-dark-theme-background
  );
}

// Utility for fetching a nested value from a typography config.
@function _vdl-get-type-value($config, $level, $name) {
  @return map-get(map-get($config, $level), $name);
}

// Gets the font size for a level inside a typography config.
@function vdl-font-size($config, $level) {
  @return _vdl-get-type-value($config, $level, font-size);
}

// Gets the line height for a level inside a typography config.
@function vdl-line-height($config, $level) {
  @return _vdl-get-type-value($config, $level, line-height);
}

// Gets the font weight for a level inside a typography config.
@function vdl-font-weight($config, $level) {
  @return _vdl-get-type-value($config, $level, font-weight);
}

// Gets the font-family from a typography config and removes the quotes around it.
@function vdl-font-family($config, $level: null) {
  $font-family: map-get($config, font-family);

  @if $level != null {
    $font-family: _vdl-get-type-value($config, $level, font-family);
  }

  @return unquote($font-family);
}

// Converts a typography level into CSS styles.
@mixin vdl-typography-level-to-styles($config, $level) {
  $font-size: vdl-font-size($config, $level);
  $font-weight: vdl-font-weight($config, $level);
  $line-height: vdl-line-height($config, $level);
  $font-family: vdl-font-family($config, $level);

  // Use the shorthand `font` to represent a typography level, because it's the shortest. Notes that
  // we need to use interpolation for `font-size/line-height` in order to prevent SASS from dividing
  // the two values.
  font: $font-weight #{$font-size}/#{$line-height} $font-family;
}

// Color swatches
$brand-red: #b1181e;
$brand-black: #231f20;
$brand-gray: #c9cad4;

$ui-white: #ffffff;
$ui-black: #000000;

$ui-gray-10: #f9f9f9;
$ui-gray-20: #f3f3f3;
$ui-gray-30: #e7e7e7;
$ui-gray-40: #d5d5d5;
$ui-gray-50: #c2c2c2;
$ui-gray-60: #939393;
$ui-gray-70: #707070;
$ui-gray-80: #4a4a4a;
$ui-gray-90: #333333;

$ui-blue-10: #d8eeff;
$ui-blue-20: #bddaf1;
$ui-blue-30: #3a7da9;
$ui-blue-40: #0070bd;
$ui-blue-50: #005a99;
$ui-blue-60: #004677;
$ui-blue-70: #32424d;
$ui-blue-80: #2a3842;
$ui-blue-90: #202c34;

$s-dark-red-10: #b0130c;
$s-red-10: #e91a18;
$s-dark-orange-10: #e86600;
$s-orange-10: #ffa801;
$s-yellow-10: #fff048;
$s-green-10: #007900;
$s-blue-10: #3b73b4;
$s-purple-10: #643da6;

$red-05: #ffebee;
$red-10: #ffcdd1;
$red-20: #f19a99;
$red-30: #e77271;
$red-40: #f1524b;
$red-50: #f7412d;
$red-60: #e7372d;
$red-70: #d52d28;
$red-80: #c82621;
$red-90: #b91913;

$dark-orange-05: #fbe9e7;
$dark-orange-10: #ffccba;
$dark-orange-20: #ffab8e;
$dark-orange-30: #ff8a60;
$dark-orange-40: #ff703a;
$dark-orange-50: #ff5607;
$dark-orange-60: #f75002;
$dark-orange-70: #e84900;
$dark-orange-80: #da4200;
$dark-orange-90: #c13500;

$orange-05: #fff3df;
$orange-10: #ffe1af;
$orange-20: #ffcd7a;
$orange-30: #ffb840;
$orange-40: #ffa800;
$orange-50: #ff9900;
$orange-60: #fd8d00;
$orange-70: #f77c00;
$orange-80: #f16c00;
$orange-90: #e85000;

$amber-05: #fff8e0;
$amber-10: #ffedb0;
$amber-20: #ffe17b;
$amber-30: #ffd63f;
$amber-40: #ffcb00;
$amber-50: #ffc200;
$amber-60: #ffb400;
$amber-70: #ffa100;
$amber-80: #ff8f00;
$amber-90: #ff6f00;

$yellow-05: #fffde6;
$yellow-10: #fffac1;
$yellow-20: #fff698;
$yellow-30: #fff36c;
$yellow-40: #fff049;
$yellow-50: #ffed18;
$yellow-60: #feda10;
$yellow-70: #fcc101;
$yellow-80: #fba900;
$yellow-90: #f77f00;

$lime-05: #f9fbe6;
$lime-10: #f0f5c1;
$lime-20: #e6ef98;
$lime-30: #dce96d;
$lime-40: #d4e34a;
$lime-50: #cdde20;
$lime-60: #c0cc1b;
$lime-70: #afb513;
$lime-80: #9e9e0e;
$lime-90: #827802;

$lite-green-05: #f1f8e8;
$lite-green-10: #dceec6;
$lite-green-20: #c4e2a2;
$lite-green-30: #add67d;
$lite-green-40: #9bce5f;
$lite-green-50: #89c540;
$lite-green-60: #7ab439;
$lite-green-70: #66a030;
$lite-green-80: #538c27;
$lite-green-90: #316a18;

$green-05: #e8f5e9;
$green-10: #c7e7c8;
$green-20: #a4d7a5;
$green-30: #7fc881;
$green-40: #63bc66;
$green-50: #47b04b;
$green-60: #3fa142;
$green-70: #348f37;
$green-80: #2a7e2e;
$green-90: #175f1c;

$teal-05: #dff2f1;
$teal-10: #b1dfdb;
$teal-20: #7dcbc4;
$teal-30: #48b6ac;
$teal-40: #19a79a;
$teal-50: #009788;
$teal-60: #008a7b;
$teal-70: #00796b;
$teal-80: #00695c;
$teal-90: #004d40;

$cyan-05: #dff7fa;
$cyan-10: #b0ebf3;
$cyan-20: #7cdeeb;
$cyan-30: #45d0e2;
$cyan-40: #0ec6dc;
$cyan-50: #00bcd6;
$cyan-60: #00acc3;
$cyan-70: #0097a8;
$cyan-80: #008390;
$cyan-90: #006065;

$lite-blue-05: #e0f5ff;
$lite-blue-10: #b1e5fd;
$lite-blue-20: #7ed3fc;
$lite-blue-30: #48c2f9;
$lite-blue-40: #18b5f9;
$lite-blue-50: #00a7f7;
$lite-blue-60: #0099e8;
$lite-blue-70: #0086d4;
$lite-blue-80: #0075bf;
$lite-blue-90: #00559d;

$blue-05: #e2f2fe;
$blue-10: #badefc;
$blue-20: #8ec9fb;
$blue-30: #60b4f9;
$blue-40: #3ba3f8;
$blue-50: #1194f6;
$blue-60: #1086e8;
$blue-70: #0c74d5;
$blue-80: #0a62c3;
$blue-90: #0544a4;

$indigo-05: #e8eaf6;
$indigo-10: #c5c9ea;
$indigo-20: #9fa7dc;
$indigo-30: #7884cd;
$indigo-40: #5b69c3;
$indigo-50: #3e4eb8;
$indigo-60: #3845ae;
$indigo-70: #2f3ba2;
$indigo-80: #273195;
$indigo-90: #191e80;

$dark-purple-05: #ede7f6;
$dark-purple-10: #d1c3ea;
$dark-purple-20: #b39bdd;
$dark-purple-30: #9572cf;
$dark-purple-40: #7e53c5;
$dark-purple-50: #6734ba;
$dark-purple-60: #5e2eb4;
$dark-purple-70: #5126ab;
$dark-purple-80: #451fa3;
$dark-purple-90: #311294;

$purple-05: #f3e5f5;
$purple-10: #e2bde8;
$purple-20: #cf91da;
$purple-30: #bb65ca;
$purple-40: #ac41be;
$purple-50: #9d1bb2;
$purple-60: #8f19ac;
$purple-70: #7c13a4;
$purple-80: #6b0f9c;
$purple-90: #4a078e;

$pink-05: #fde4ec;
$pink-10: #fde4ec;
$pink-20: #f68eb1;
$pink-30: #f26091;
$pink-40: #ef3c79;
$pink-50: #ec1561;
$pink-60: #da135f;
$pink-70: #c4105a;
$pink-80: #af0d56;
$pink-90: #8a064f;

$brown-05: #efebe9;
$brown-10: #d7ccc8;
$brown-20: #bcaaa4;
$brown-30: #a2887e;
$brown-40: #8e6e62;
$brown-50: #7a5547;
$brown-60: #6e4c40;
$brown-70: #5e4036;
$brown-80: #4f342d;
$brown-90: #3e2722;

$blue-gray-05: #eceff1;
$blue-gray-10: #cfd8dc;
$blue-gray-20: #b0bec5;
$blue-gray-30: #8fa4af;
$blue-gray-40: #77909d;
$blue-gray-50: #5f7d8c;
$blue-gray-60: #536e7b;
$blue-gray-70: #445a65;
$blue-gray-80: #36474f;
$blue-gray-90: #253238;

@mixin background-opacity($color, $opacity: 0.35) {
  background: rgba($color, $opacity);
}


@mixin vdl-option-theme($theme) {
  $foreground: map-get($theme, foreground);
  $background: map-get($theme, background);
  $primary: map-get($theme, primary);
  $accent: map-get($theme, accent);
  $warn: map-get($theme, warn);

  .vdl-option {
    color: vdl-color($foreground, text);

    &:hover:not(.vdl-option-disabled),
    &:focus:not(.vdl-option-disabled) {
      background: $ui-gray-80;
    }

    .vdl-primary &.vdl-selected:not(.vdl-option-disabled) {
      color: vdl-color($primary);
    }

    .vdl-accent &.vdl-selected:not(.vdl-option-disabled) {
      color: vdl-color($accent);
    }

    .vdl-warn &.vdl-selected:not(.vdl-option-disabled) {
      color: vdl-color($warn);
    }

    // In multiple mode there is a checkbox to show that the option is selected.
    &.vdl-selected:not(.vdl-option-multiple):not(.vdl-option-disabled) {
      background: vdl-color($background, hover);
    }

    &.vdl-active {
      background: vdl-color($background, hover);
      color: vdl-color($foreground, text);
    }

    &.vdl-option-disabled {
      color: vdl-color($foreground, hint-text);
    }
  }
}

@mixin vdl-option-typography($config) {
  .vdl-option {
    font: {
      family: vdl-font-family($config, subheading-2);
      size: vdl-font-size($config, subheading-2);
    }
  }
}





@mixin vdl-optgroup-theme($theme) {
  $foreground: map-get($theme, foreground);

  .vdl-optgroup-label {
    color: vdl-color($foreground, secondary-text);
  }

  .vdl-optgroup-disabled .vdl-optgroup-label {
    color: vdl-color($foreground, hint-text);
  }
}

@mixin vdl-optgroup-typography($config) {
  .vdl-optgroup-label {
    @include vdl-typography-level-to-styles($config, body-2);
  }
}




@mixin _vdl-pseudo-checkbox-inner-content-theme($theme, $pallete-name) {
  $pallete: map-get($theme, $pallete-name);
  $color: vdl-color($pallete);

  .vdl-pseudo-checkbox-checked.vdl-#{$pallete-name},
  .vdl-pseudo-checkbox-indeterminate.vdl-#{$pallete-name},
  .vdl-#{$pallete-name} .vdl-pseudo-checkbox-checked,
  .vdl-#{$pallete-name} .vdl-pseudo-checkbox-indeterminate {
    background: $ui-blue-20;
  }
}

@mixin vdl-pseudo-checkbox-theme($theme) {
  $is-dark-theme: map-get($theme, is-dark);
  $primary: map-get($theme, primary);
  $accent: map-get($theme, accent);
  $warn: map-get($theme, warn);
  $background: map-get($theme, background);

  // The color of the checkbox's checkmark / mixedmark.
  $checkbox-mark-color: vdl-color($background, background);

  // NOTE(traviskaufman): While the spec calls for translucent blacks/whites for disabled colors,
  // this does not work well with elements layered on top of one another. To get around this we
  // blend the colors together based on the base color and the theme background.
  $white-30pct-opacity-on-dark: #686868;
  $black-26pct-opacity-on-light: #b0b0b0;
  $disabled-color: if(
    $is-dark-theme,
    $white-30pct-opacity-on-dark,
    $black-26pct-opacity-on-light
  );

  .vdl-pseudo-checkbox::after {
    color: $checkbox-mark-color;
  }

  .vdl-pseudo-checkbox-checked,
  .vdl-pseudo-checkbox-indeterminate {
    border: none;

    &.vdl-primary {
      background: vdl-color($primary, 500);
    }

    &.vdl-accent {
      background: vdl-color($accent, 500);
    }

    &.vdl-warn {
      background: vdl-color($warn, 500);
    }

    &.vdl-pseudo-checkbox-disabled {
      background: $disabled-color;
    }
  }
}


// Mixin that renders all of the core styles that are not theme-dependent.
@mixin vdl-core() {
  @include cdk-a11y();
  @include cdk-overlay();
}

// Mixin that renders all of the core styles that depend on the theme.
@mixin vdl-core-theme($theme) {
  @include vdl-option-theme($theme);
  @include vdl-optgroup-theme($theme);
  @include vdl-pseudo-checkbox-theme($theme);

  // Wrapper element that provides the theme background when the
  // user's content isn't inside of a `vdl-sidenav-container`.
  .vdl-app-background {
    $background: map-get($theme, background);
    background-color: vdl-color($background, background);
  }

  // Marker that is used to determine whether the user has added a theme to their page.
  .vdl-theme-loaded-marker {
    display: none;
  }
}




// Include this empty mixin for consistency with the other components.
@mixin vdl-grid-list-theme($theme) {
}



// Gradient for showing the dashed line when the input is disabled.
// Unlike using a border, a gradient allows us to adjust the spacing of the dotted line
// to match the Material Design spec.
$vdl-underline-disabled-background-image: linear-gradient(
  to right,
  rgba(0, 0, 0, 0.26) 0%,
  rgba(0, 0, 0, 0.26) 33%,
  transparent 0%
);

@mixin vdl-control-disabled-underline {
  background-image: $vdl-underline-disabled-background-image;
  background-size: 4px 1px;
  background-repeat: repeat-x;
}




@mixin vdl-select-theme($theme) {
  .vdl-select-content,
  .vdl-select-panel-done-animating {
    background: $ui-gray-10;
  }

  .vdl-select-value {
    color: $ui-gray-90;
  }

  .vdl-select-placeholder {
    color: $ui-gray-70;
  }

  .vdl-select-disabled .vdl-select-value {
    color: $ui-gray-70;
    opacity: 0.5;
  }

  .vdl-select-arrow {
    color: $ui-gray-80;
  }

  .vdl-select-panel {
    .vdl-option.vdl-selected:not(.vdl-option-multiple) {
      background: $ui-blue-20;
    }
  }
}



@mixin _vdl-slide-colors($thumb-color, $bar-color) {
  .vdl-slide-toggle-thumb {
    background-color: $thumb-color;
  }

  .vdl-slide-toggle-bar {
    background-color: $bar-color;
  }
}

// Ignoring theme variable passed in. Not needed
@mixin vdl-slide-toggle-theme($ignoredTheme) {
  $thumb-default: $ui-gray-20;
  $bar-default: $ui-gray-50;

  $thumb-checked: $ui-blue-40;
  $bar-checked: $ui-blue-20;

  $thumb-error: $s-red-10;
  $bar_error: $ui-gray-50;

  .vdl-slide-toggle {
    @include _vdl-slide-colors($ui-gray-20, $ui-gray-50);

    &.vdl-checked {
      @include _vdl-slide-colors($ui-blue-40, $ui-blue-20);
    }

    &.vdl-error {
      @include _vdl-slide-colors($s-red-10, $red-10);
    }
  }
}

// This contains all of the styles for the badge
// rather than just the color/theme because of
// no style sheet support for directives.



@mixin cdk-a11y {
  .cdk-visually-hidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;

    // Avoid browsers rendering the focus ring in some cases.
    outline: 0;

    // Avoid some cases where the browser will still render the native controls (see #9049).
    -webkit-appearance: none;
    -moz-appearance: none;
  }
}

/**
 * Applies styles for users in high contrast mode. Note that this only applies
 * to Microsoft browsers. Chrome can be included by checking for the `html[hc]`
 * attribute, however Chrome handles high contrast differently.
 * @param target Which kind of high contrast setting to target. Defaults to `active`, can be
 *    `white-on-black` or `black-on-white`.
 */
@mixin cdk-high-contrast($target: active) {
  @media screen and (-ms-high-contrast: $target) {
    @content;
  }
}



$vdl-badge-font-size: 12px;
$vdl-badge-font-weight: 600;
$vdl-badge-default-size: 22px !default;
$vdl-badge-small-size: $vdl-badge-default-size - 6;
$vdl-badge-large-size: $vdl-badge-default-size + 6;

$badge-color-normal: $ui-blue-20;
$badge-color-primary: $ui-blue-60;
$badge-color-positive: $s-green-10;
$badge-color-negative: $s-red-10;

// Mixin for building offset given different sizes
@mixin _vdl-badge-size($size) {
  .vdl-badge-content {
    width: $size;
    height: $size;
    line-height: $size;

    @include cdk-high-contrast {
      outline: solid 1px;
      border-radius: 0;
    }
  }

  &.vdl-badge-above {
    .vdl-badge-content {
      top: -$size / 2;
    }
  }

  &.vdl-badge-below {
    .vdl-badge-content {
      bottom: -$size / 2;
    }
  }

  &.vdl-badge-before {
    margin-left: $size;

    .vdl-badge-content {
      left: -$size;
    }
  }

  [dir='rtl'] &.vdl-badge-before {
    margin-left: 0;
    margin-right: $size;

    .vdl-badge-content {
      left: auto;
      right: -$size;
    }
  }

  &.vdl-badge-after {
    margin-right: $size;

    .vdl-badge-content {
      right: -$size;
    }
  }

  [dir='rtl'] &.vdl-badge-after {
    margin-right: 0;
    margin-left: $size;

    .vdl-badge-content {
      right: auto;
      left: -$size;
    }
  }

  &.vdl-badge-overlap {
    &.vdl-badge-before {
      margin-left: $size / 2;

      .vdl-badge-content {
        left: -$size / 2;
      }
    }

    [dir='rtl'] &.vdl-badge-before {
      margin-left: 0;
      margin-right: $size / 2;

      .vdl-badge-content {
        left: auto;
        right: -$size / 2;
      }
    }

    &.vdl-badge-after {
      margin-right: $size / 2;

      .vdl-badge-content {
        right: -$size / 2;
      }
    }

    [dir='rtl'] &.vdl-badge-after {
      margin-right: 0;
      margin-left: $size;

      .vdl-badge-content {
        right: auto;
        left: -$size / 2;
      }
    }
  }
}

@mixin vdl-badge-theme($theme) {
  $accent: $badge-color-negative;
  $warn: $badge-color-negative;
  $primary: $badge-color-primary;

  .vdl-badge-content {
    color: white;
    background: $primary;
  }

  .vdl-badge-accent {
    .vdl-badge-content {
      background: $accent;
      // color: $accent;
    }
  }

  .vdl-badge-warn {
    .vdl-badge-content {
      // color: $warn;
      background: $warn;
    }
  }

  .vdl-badge {
    position: relative;
  }

  .vdl-badge-hidden {
    .vdl-badge-content {
      display: none;
    }
  }

  .vdl-badge-content {
    position: absolute;
    text-align: center;
    display: inline-block;
    border-radius: 50%;
    transition: transform 200ms ease-in-out;
    transform: scale(0.6);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    pointer-events: none;
  }

  // The active class is added after the element is added
  // so it can animate scale to default
  .vdl-badge-content.vdl-badge-active {
    // Scale to `none` instead of `1` to avoid blurry text in some browsers.
    transform: none;
    color: white;
  }

  .vdl-badge-small {
    @include _vdl-badge-size($vdl-badge-small-size);
  }
  .vdl-badge-medium {
    @include _vdl-badge-size($vdl-badge-default-size);
  }
  .vdl-badge-large {
    @include _vdl-badge-size($vdl-badge-large-size);
  }
}

@mixin vdl-badge-typography($config) {
  .vdl-badge-content {
    font-weight: $vdl-badge-font-weight;
    font-size: $vdl-badge-font-size;
    font-family: vdl-font-family($config);
  }

  .vdl-badge-small .vdl-badge-content {
    font-size: $vdl-badge-font-size / 2;
  }

  .vdl-badge-large .vdl-badge-content {
    font-size: $vdl-badge-font-size * 2;
  }
}


// Create a theme.
@mixin angular-material-theme($theme) {
  @include vdl-core-theme($theme);
  @include vdl-grid-list-theme($theme);
  @include vdl-select-theme($theme);
  @include vdl-slide-toggle-theme($theme);
  @include vdl-badge-theme($theme);
}
