@value inputBg, textDark, textLight, readOnlyBorder from '../colors.css';
@value activeEdgeWidth, inputHeight, inputMargin from '../dimensions.css';

.common {
  position: relative;
}

.common > input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.common > input + span {
  display: inline-block;
  outline-offset: -1px;
  border: 1px solid;
  background-repeat: no-repeat;
}

.embedded > input + span {
  width: 17px;
  height: 17px;
  margin: 1px;
}

:not(.embedded) > input + span {
  width: calc(inputHeight - 2px);
  height: calc(inputHeight - 2px);
  margin: 0 0 10px 0;
}

.common > input:checked + span {
  background-image: url(../../images/check.svg);
}

.common > input:focus + span {
  outline: solid textDark;
  outline-width: activeEdgeWidth;
}

.normal {
  composes: common;
}

.normal > input + span {
  border-color: textLight;
  background-color: inputBg;
}

.readOnly {
  composes: common;
}

.readOnly > input + span {
  border-color: readOnlyBorder;
}

.indeterminate > input + span {
  background-image: url(../../images/square.svg);
}
