2018-12-23 02:11:11 -05:00
|
|
|
// stylelint-disable property-blacklist
|
2014-12-02 17:02:35 -05:00
|
|
|
// Single side border-radius
|
|
|
|
|
2020-02-14 01:40:07 -05:00
|
|
|
// Helper function to replace negative values with 0
|
|
|
|
@function valid-radius($radius) {
|
|
|
|
$return: ();
|
|
|
|
@each $value in $radius {
|
|
|
|
@if type-of($value) == number {
|
|
|
|
$return: append($return, max($value, 0));
|
|
|
|
} @else {
|
|
|
|
$return: append($return, $value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@return $return;
|
|
|
|
}
|
|
|
|
|
2018-12-23 02:11:11 -05:00
|
|
|
@mixin border-radius($radius: $border-radius, $fallback-border-radius: false) {
|
2015-10-07 03:05:38 -04:00
|
|
|
@if $enable-rounded {
|
2020-02-14 01:40:07 -05:00
|
|
|
border-radius: valid-radius($radius);
|
2015-10-07 03:05:38 -04:00
|
|
|
}
|
2018-12-23 02:11:11 -05:00
|
|
|
@else if $fallback-border-radius != false {
|
|
|
|
border-radius: $fallback-border-radius;
|
|
|
|
}
|
2015-10-07 03:05:38 -04:00
|
|
|
}
|
|
|
|
|
2020-09-01 17:17:17 -04:00
|
|
|
@mixin border-top-radius($radius: $border-radius) {
|
2015-09-03 12:04:51 -04:00
|
|
|
@if $enable-rounded {
|
2020-02-14 01:40:07 -05:00
|
|
|
border-top-left-radius: valid-radius($radius);
|
|
|
|
border-top-right-radius: valid-radius($radius);
|
2015-09-03 12:04:51 -04:00
|
|
|
}
|
2014-12-02 17:02:35 -05:00
|
|
|
}
|
|
|
|
|
2020-09-01 17:17:17 -04:00
|
|
|
@mixin border-right-radius($radius: $border-radius) {
|
2015-09-03 12:04:51 -04:00
|
|
|
@if $enable-rounded {
|
2020-02-14 01:40:07 -05:00
|
|
|
border-top-right-radius: valid-radius($radius);
|
|
|
|
border-bottom-right-radius: valid-radius($radius);
|
2015-09-03 12:04:51 -04:00
|
|
|
}
|
2014-12-02 17:02:35 -05:00
|
|
|
}
|
|
|
|
|
2020-09-01 17:17:17 -04:00
|
|
|
@mixin border-bottom-radius($radius: $border-radius) {
|
2015-09-03 12:04:51 -04:00
|
|
|
@if $enable-rounded {
|
2020-02-14 01:40:07 -05:00
|
|
|
border-bottom-right-radius: valid-radius($radius);
|
|
|
|
border-bottom-left-radius: valid-radius($radius);
|
2015-09-03 12:04:51 -04:00
|
|
|
}
|
2014-12-02 17:02:35 -05:00
|
|
|
}
|
|
|
|
|
2020-09-01 17:17:17 -04:00
|
|
|
@mixin border-left-radius($radius: $border-radius) {
|
2015-09-03 12:04:51 -04:00
|
|
|
@if $enable-rounded {
|
2020-02-14 01:40:07 -05:00
|
|
|
border-top-left-radius: valid-radius($radius);
|
|
|
|
border-bottom-left-radius: valid-radius($radius);
|
2015-09-03 12:04:51 -04:00
|
|
|
}
|
2014-12-02 17:02:35 -05:00
|
|
|
}
|
2019-01-06 20:01:36 -05:00
|
|
|
|
2020-09-01 17:17:17 -04:00
|
|
|
@mixin border-top-left-radius($radius: $border-radius) {
|
2019-02-07 03:02:05 -05:00
|
|
|
@if $enable-rounded {
|
2020-02-14 01:40:07 -05:00
|
|
|
border-top-left-radius: valid-radius($radius);
|
2019-02-07 03:02:05 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-01 17:17:17 -04:00
|
|
|
@mixin border-top-right-radius($radius: $border-radius) {
|
2019-01-06 20:01:36 -05:00
|
|
|
@if $enable-rounded {
|
2020-02-14 01:40:07 -05:00
|
|
|
border-top-right-radius: valid-radius($radius);
|
2019-01-06 20:01:36 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-01 17:17:17 -04:00
|
|
|
@mixin border-bottom-right-radius($radius: $border-radius) {
|
2019-02-07 03:02:05 -05:00
|
|
|
@if $enable-rounded {
|
2020-02-14 01:40:07 -05:00
|
|
|
border-bottom-right-radius: valid-radius($radius);
|
2019-02-07 03:02:05 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-01 17:17:17 -04:00
|
|
|
@mixin border-bottom-left-radius($radius: $border-radius) {
|
2019-01-06 20:01:36 -05:00
|
|
|
@if $enable-rounded {
|
2020-02-14 01:40:07 -05:00
|
|
|
border-bottom-left-radius: valid-radius($radius);
|
2019-01-06 20:01:36 -05:00
|
|
|
}
|
|
|
|
}
|