@function border-radius($pos, $radius, $offset) {
    @return $radius / ($radius min($radius, $pos - $offset) min($radius, 100% - $pos - $offset) $radius);
}

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

@function clip-path($pos, $offset, $height) {
    @return polygon(100% 0, 0 0, 0 100%, 100% 100%, 100% min(100%, $pos + $offset), calc(100% + $height) $pos, 100% max(0%, $pos - $offset));
}

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

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