@plugin "../plugins/unit-conversion";

// NOTE does not set border, @border is only used for calculations

// setting @height and @vertical-padding will use @font-size and overwrite
// any values set to the other variable ie @height overrides
// @vertical-padding and the other way around. @height takes precedence
.input-size(
  @height: 0;
  @padding: 0 0;
  @border: 0px;
  @spacing: 0;
  @font-size: @base-font-size
) {
  @padding-px: px(@padding);
  @height-px: px(@height);
  @font-size-px: px(@font-size);
  @border-px: px(@border);

  & when (@height-px > 0) {
    height: @height-px;

    //padding: 0 (@height-px - @font-size-px - @border-px * 2) / 2 extract(@padding-px, 2);
    padding: 0 extract(@padding-px, 2);
    //padding: 0 extract(@padding-px, 2);
  }

  & when (@height-px = 0) {
    padding: 0 extract(@padding-px, 2);

    height: extract(@padding, 1) * 2 + @border * 2 + @font-size;
  }

  display: block;
  //padding: rem(0 extract(@padding, 2));
  margin: rem(0 0 @spacing 0);

  font-size: rem(@font-size-px);
  //height: rem(@height-px);
  width: 100%;
} 

