/**
 * @license
 * Copyright Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
@use './core' as *;
@use '../../state-layer';
@use '../../focus-indicator';

//
// Host
//

$_host-tokens: [display];

:host {
  @include tokens($includes: $_host-tokens);
}

:host {
  @include host;
}

:host([hidden]) {
  display: none;
}

//
// Base
//

.forge-button-toggle {
  @include tokens($excludes: $_host-tokens);
}

.forge-button-toggle {
  @include base;

  forge-state-layer {
    @include state-layer.provide-theme((
      color: #{token(color)}
    ));
  }

  forge-focus-indicator {
    @include focus-indicator.provide-theme((
      outward-offset: #{token(focus-indicator-offset)},
      color: #{token(focus-indicator-color)},
      shape: #{token(shape)},
      shape-start-start: #{token(shape-start-start)},
      shape-start-end: #{token(shape-start-end)},
      shape-end-start: #{token(shape-end-start)},
      shape-end-end: #{token(shape-end-end)},
    ));
  }
}

::slotted(:is([slot=start],[slot=end])) {
  font-size: #{token(icon-size)};
}

//
// Selected
//

:host([selected]) {
  .forge-button-toggle {
    @include selected;
  }
}

//
// Disabled
//

:host([disabled]) {
  @include host-disabled;
  cursor: not-allowed;
  
  .forge-button-toggle {
    @include disabled;
  }
}

:host([disabled][selected]) {
  .forge-button-toggle {
    @include selected-disabled;
  }
}
