//
// Copyright 2019 Stijn de Witt. Some rights reserved.
// Licensed under the MIT Open Source license. 
// https://opensource.org/licenses/MIT
// See LICENSE for details.
//
// Based on code copyright 2018 Google Inc. All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// http://www.apache.org/licenses/LICENSE-2.0
// See LICENSE-MDC for details.
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under these licenses is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the licenses for the specific language governing permissions and
// limitations under these licenses.
// 

@import "../animation/variables";
@import "../base/mixins";
@import "../ripple/mixins";
@import "../ripple/variables";
@import "../textfield/functions";
@import "../theme/mixins";
@import "./mixins";
@import "./variables";

// Notched Outline is intended for use by multiple components, but its styles should only be emitted once when bundled
@include mdc-base-emit-once("mdc-notched-outline") {
  .mdc-notched-outline {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 1px);
    height: calc(100% - 2px);
    transition: opacity $mdc-notched-outline-transition-duration $mdc-animation-standard-curve-timing-function;
    opacity: 0;
    overflow: hidden;

    // stylelint-disable selector-max-type
    svg {
      position: absolute;
      width: 100%;
      height: 100%;
    }
    // stylelint-enable selector-max-type
  }

  .mdc-notched-outline__idle {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    transition:
      opacity $mdc-notched-outline-transition-duration $mdc-animation-standard-curve-timing-function,
      border-color $mdc-notched-outline-transition-duration $mdc-animation-standard-curve-timing-function;
    border: 1px solid;
    opacity: 1;
  }

  .mdc-notched-outline__path {
    stroke-width: 1px;
    transition:
      stroke $mdc-notched-outline-transition-duration $mdc-animation-standard-curve-timing-function,
      stroke-width $mdc-notched-outline-transition-duration $mdc-animation-standard-curve-timing-function;
    fill: transparent;
  }

  .mdc-notched-outline--notched {
    opacity: 1;
  }

  .mdc-notched-outline--notched ~ .mdc-notched-outline__idle {
    opacity: 0;
  }
}
