/* stylelint-disable color-no-hex  */

// Copyright 2018-Present Okta, Inc.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Color Variants

$colors: (
  'success': (
    'lightest': #e5fff6,
    'base': #00d1b3,
    'dark': #00a08e,
  ),
  'action': (
    'lightest': #e5edfb,
    'base': #1662dd,
    'dark': #124a94,
  ),
  'yellow': (
    'lightest': #fcf9e1,
    'base': #ebd551,
    'dark': #bc960f,
  ),
  'warning': (
    'lightest': #feefe2,
    'base': #f47c25,
    'dark': #cb5500,
  ),
  'danger': (
    'lightest': #fee6ea,
    'base': #dd0744,
    'dark': #b80047,
  ),
  'cyan': (
    'lightest': #c6fafa,
    'base': #007f9c,
    'dark': #004d6b,
  ),
  'violet': (
    'lightest': #f3eafe,
    'base': #963fe6,
    'dark': #5a13b4,
  ),
  'magenta': (
    'base': #c72c86,
  ),
  'gray': (
    '000': #fafafa,
    '100': #e4e5e7,
    '200': #cdd1d3,
    '300': #b7bcc0,
    '400': #a0a7ac,
    '500': #899298,
    '600': #737d85,
    '700': #5c6971,
    '800': #46545e,
    '900': #2f3f4a,
  ),
);

$white: #ffffff;

/**
 * Retrieves color variants from variation map.
 * color: cv(action, light); // color: #96bafa;
 */

@function cv($color, $variation: 'base') {
  @if not map-has-key($colors, $color) {
    @error 'Invalid color name: `#{$color}`.';
  }

  $variant: map-deep-get($colors, $color, $variation);

  @if not $variant {
    @error 'Invalid variation: `#{$variation}`.';
  }

  @return $variant;
}

$box-shadow-default: 0 2px 0 rgba(175, 175, 175, 0.12);

// ASA: https://github.com/okta/odyssey/pull/8
$text-body: cv('gray', '900') !default;
$text-heading: cv('gray', '900') !default;
$text-sub: cv('gray', '500') !default;
