////
/// Feature flags.
/// @group feature-flags
/// @copyright IBM Security 2019 - 2021
////

@import 'carbon-components/scss/globals/scss/feature-flags';
@import 'carbon-components/scss/globals/scss/functions';

// TODO: `2.x` - Deprecate after teams have migrated to `@carbon/grid`.

/// Grid feature flag.
/// @type String
$grid__name: css-gridish;

/// Platform feature flag.
/// @type String
$platform__name: platform;

/// Theme feature flag.
/// @type String
$theme__name: enable-css-custom-properties;

/// Security theme feature flag.
/// @type String
$theme__name--security: security--css-custom-property-theming;

// TODO: `2.x` - Deprecate after teams have migrated to `@carbon/type`.

/// Type feature flag.
/// @type String
$type__name: ibm-type;

/// Default feature flag values.
/// @type Map<String, String>
$security--default-feature-flags: (
  #{$grid__name}: true,
  #{$platform__name}: true,
  #{$theme__name--security}: true,
  #{$type__name}: true
);

$security--feature-flags: () !default;

$security--feature-flags: map-merge(
  $map1: $security--default-feature-flags,
  $map2: $security--feature-flags,
);

$security--feature-flags: map-merge(
  $map1: $security--feature-flags,
  $map2: (
    #{$theme__name}: map-get(
        $map: $security--feature-flags,
        $key: $theme__name--security,
      ) or map-get(
        $map: $feature-flags,
        $key: $theme__name,
      ),
  ),
);

$feature-flags: map-merge(
  $map1: $feature-flags,
  $map2: $security--feature-flags,
);
