@use 'variables' as *;

// Every colour below is a $pptx-* variable declared (with !default) in the theme's
// _<theme>-definition.scss, so a sample can override any of them before the theme is
// compiled, or at runtime through the matching --ej2-pptx-* CSS variable.

// Theme mode is resolved at compile time from $skin-name / $theme-name, the same way the
// other controls branch. $skin-name does not carry the dark suffix for several themes
// (for example bootstrap5-dark has $skin-name 'bootstrap5'), so dark is read from $theme-name.
$pptx-theme-mode: 'light';
@if $skin-name == 'highcontrast' or $skin-name == 'highcontrast-light' or $theme-name == 'fluent2-highcontrast' {
  $pptx-theme-mode: 'highcontrast';
}
@else if $theme-name == 'material-dark' or $theme-name == 'fabric-dark' or $theme-name == 'bootstrap-dark' or $theme-name == 'bootstrap5-dark' or $theme-name == 'bootstrap5.3-dark' or $theme-name == 'tailwind-dark' or $theme-name == 'tailwind3-dark' or $theme-name == 'fluent2-dark' or $theme-name == 'fluentui-dark' or $theme-name == 'Material3-dark' or $theme-name == 'material3-dark' or $theme-name == 'fluent-dark' {
  $pptx-theme-mode: 'dark';
}

@include export-module('pptxeditor-theme') {

  // Native form controls and scrollbars follow the theme mode.
  @if $pptx-theme-mode == 'light' {
    .ej2-pptx-editor,
    .ej2-pptx-slideshow {
      color-scheme: light;
    }
  }
  @else {
    .ej2-pptx-editor,
    .ej2-pptx-slideshow {
      color-scheme: dark;
    }
  }

  // High contrast: selected state text uses the on-accent colour and the shell hairlines
  // use the text colour so every region stays distinguishable.
  @if $pptx-theme-mode == 'highcontrast' {
    .ej2-pptx-editor .ej2-pptx-ribbon.e-ribbon .e-content .e-ribbon-item .e-btn.e-active,
    .ej2-pptx-editor .ej2-pptx-ribbon.e-ribbon .e-content .e-ribbon-item .e-btn.ej2-pptx-ribbon-format--on,
    .ej2-pptx-editor .ej2-pptx-ribbon.e-ribbon .e-ribbon-item .e-btn.pptx-ribbon-btn-active,
    .ej2-pptx-status-bar__notes--active {
      color: $pptx-on-primary-color;

      .e-btn-icon,
      .e-icons {
        color: $pptx-on-primary-color;
      }
    }

    .ej2-pptx-status-bar,
    .ej2-pptx-thumbnail-panel,
    .ej2-pptx-notes-pane {
      border-color: $pptx-text-color;
    }
  }
}
