//
// Copyright IBM Corp. 2021, 2021
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@import 'carbon-components/scss/components/button/button';
@import '../../global/styles/project-settings';

@include exports('ibm-products--toolbar') {
  $block-class: #{$pkg-prefix}--toolbar;

  $border: carbon--rem(
      $px: 1px,
    )
    solid $ui-03;

  $toolbar-dimensions: carbon--rem(
    $px: 40px,
  );

  .#{$block-class} {
    @include carbon--breakpoint($name: lg) {
      justify-content: flex-end;
    }

    display: flex;
    min-width: $toolbar-dimensions;
    min-height: $toolbar-dimensions;
    background-color: $ui-01;
  }

  .#{$block-class}--vertical,
  .#{$block-class}--vertical > .#{$block-class}__group {
    flex-wrap: wrap;
  }

  .#{$block-class}--vertical {
    max-width: $toolbar-dimensions;
  }

  .#{$block-class}__group {
    display: flex;
    border-right: $border;
    border-bottom: $border;
  }

  .#{$block-class}--vertical > .#{$block-class}__group,
  .#{$block-class}__group:last-of-type {
    border-right-width: 0;
  }

  .#{$block-class}--vertical > .#{$block-class}__group:last-of-type,
  .#{$block-class} .#{$prefix}--dropdown {
    border-bottom-width: 0;
  }

  .#{$block-class}__button--caret {
    position: relative;
  }

  .#{$block-class}__button__caret {
    $caret-dimensions: carbon--rem(
      $px: 6px,
    );

    $position: $carbon--spacing-01;

    position: absolute;
    right: $position;
    bottom: $position;
    width: $caret-dimensions;
    height: $caret-dimensions;
    background: linear-gradient(to right bottom, transparent 50%, $icon-01 50%);
    content: '';
  }
}
