.colorpicker {
  $self: &;
  padding: 0;
  margin: 0;
  list-style: none;
  background: #fff;
  li {
    position: relative;
    display: inline-block;
    padding: 0;
    &:first-child {
      margin-top: 0;
    }

    &:not(:last-child) {
      padding-right: 7px;
      margin-right: 0;
    }

    &.active {
      .colorpicker__outline {
        border: 3px solid #109fd7;
        width: $colorpicker-size;
        height: $colorpicker-size;
      }
    }
  }

  &__outline {
    cursor: pointer;
    display: inline-block;
    width: $colorpicker-size - 1;
    height: $colorpicker-size - 1;
    border-radius: 100%;
    position: relative;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
  }

  &__inline {
    display: inline-block;
    width: 100%;
    height: 100%;
    border: 1px solid #000;
    border-radius: 100%;
    position: absolute;
    top: 0;
    left: 0;
  }

  // modifier

  &--vertical {
    li {
      display: block;
      width: 100%;
      + li {
        margin-top: 5px;
      }
    }
  }

  &--border {
    border: 1px solid $border-color;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    width: 53px;
    padding: 10px 0 10px 20px;
    flex-flow: column wrap;
    #{$self}__outline {
      width: $colorpicker-vertical-size - 1;
      height: $colorpicker-vertical-size - 1;
    }
    li {
      line-height: 1em;
      &.active {
        .colorpicker__outline {
          border: 2px solid #109fd7;
          width: $colorpicker-vertical-size;
          height: $colorpicker-vertical-size;
        }
      }
    }
  }
}

.colorpicker-mobile {
  $self: &;
  position: relative;
  display: inline-block;

  &__dropdown {
    background-color: #fff;
    position: absolute;
    top: 30px;
    left: -8px;
    padding: 10px;
    border: 1px solid #f1f1f1;
    box-shadow: 3px 5px 3px rgba(0, 0, 0, 0.1);
    display: none;
    width: 135px;

    &:before {
      content: "";
      width: 100%;
      position: absolute;
      height: 10px;
      top: -11px;
      left: 0;
      background-color: #fff;
    }

    &:after {
      content: "";
      border-top: 1px solid #f1f1f1;
      border-left: 1px solid #f1f1f1;
      border-right: 1px solid transparent;
      border-bottom: 1px solid transparent;
      width: 10px;
      height: 10px;
      position: absolute;
      top: -5px;
      left: 10px;
      -webkit-transform: rotate(45deg);
      transform: rotate(45deg);
      background-color: #fff;
    }

    .title {
      font-size: 10px;
      line-height: 1;
      margin-bottom: 6px;
    }

    &.active {
      display: block;
    }

    hr {
      margin: 10px 0;
    }
  }

  &:hover {
    #{$self}__dropdown {
      display: block;
    }
  }

  img {
    width: 18px;
  }

  .colorpicker {
    &__outline {
      width: 20px;
      height: 20px;
    }

    .active {
      .colorpicker__outline {
        width: 20px;
        height: 20px;
      }
    }
  }
}
