@function border-image($pos, $offset, $height, $radius, $border-width, $bg-color) {
    @return conic-gradient($bg-color 0 0) fill 0 / ($radius max($border-width, 100% - $pos - $offset) 0 max($border-width, $pos - $offset)) / 0 0 $height 0;
}

@function clip-path($pos, $offset, $height, $border-width, $angle) {
    @return polygon(
        0 100%,
        0 0,
        100% 0,
        100% 100%,
        min(100% - $border-width, $pos + $offset - $border-width * tan(45deg - $angle / 4)) calc(100% - $border-width),
        $pos calc(100% + $height - $border-width / sin($angle / 2)),
        max($border-width, $pos - $offset + $border-width * tan(45deg - $angle / 4)) calc(100% - $border-width)
    );
}

@mixin mixin($pos, $radius, $height, $angle, $border-width, $bg-color) {
    $offset: $height * tan($angle / 2);

    clip-path: clip-path($pos, $offset, $height, $border-width, $angle);
    border-image: border-image($pos, $offset, $height, $radius, $border-width, $bg-color);
}
