2020-09-28 13:57:48 +02:00
|
|
|
// stylelint-disable property-disallowed-list
|
2014-12-02 23:02:35 +01:00
|
|
|
// Single side border-radius
|
|
|
|
|
2020-02-14 07:40:07 +01: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 08:11:11 +01:00
|
|
|
@mixin border-radius($radius: $border-radius, $fallback-border-radius: false) {
|
2015-10-07 09:05:38 +02:00
|
|
|
@if $enable-rounded {
|
2020-02-14 07:40:07 +01:00
|
|
|
border-radius: valid-radius($radius);
|
2015-10-07 09:05:38 +02:00
|
|
|
}
|
2018-12-23 08:11:11 +01:00
|
|
|
@else if $fallback-border-radius != false {
|
|
|
|
border-radius: $fallback-border-radius;
|
|
|
|
}
|
2015-10-07 09:05:38 +02:00
|
|
|
}
|
|
|
|
|
2020-09-01 23:17:17 +02:00
|
|
|
@mixin border-top-radius($radius: $border-radius) {
|
2015-09-03 18:04:51 +02:00
|
|
|
@if $enable-rounded {
|
2020-02-14 07:40:07 +01:00
|
|
|
border-top-left-radius: valid-radius($radius);
|
|
|
|
border-top-right-radius: valid-radius($radius);
|
2015-09-03 18:04:51 +02:00
|
|
|
}
|
2014-12-02 23:02:35 +01:00
|
|
|
}
|
|
|
|
|
2020-09-01 23:17:17 +02:00
|
|
|
@mixin border-right-radius($radius: $border-radius) {
|
2015-09-03 18:04:51 +02:00
|
|
|
@if $enable-rounded {
|
2020-02-14 07:40:07 +01:00
|
|
|
border-top-right-radius: valid-radius($radius);
|
|
|
|
border-bottom-right-radius: valid-radius($radius);
|
2015-09-03 18:04:51 +02:00
|
|
|
}
|
2014-12-02 23:02:35 +01:00
|
|
|
}
|
|
|
|
|
2020-09-01 23:17:17 +02:00
|
|
|
@mixin border-bottom-radius($radius: $border-radius) {
|
2015-09-03 18:04:51 +02:00
|
|
|
@if $enable-rounded {
|
2020-02-14 07:40:07 +01:00
|
|
|
border-bottom-right-radius: valid-radius($radius);
|
|
|
|
border-bottom-left-radius: valid-radius($radius);
|
2015-09-03 18:04:51 +02:00
|
|
|
}
|
2014-12-02 23:02:35 +01:00
|
|
|
}
|
|
|
|
|
2020-09-01 23:17:17 +02:00
|
|
|
@mixin border-left-radius($radius: $border-radius) {
|
2015-09-03 18:04:51 +02:00
|
|
|
@if $enable-rounded {
|
2020-02-14 07:40:07 +01:00
|
|
|
border-top-left-radius: valid-radius($radius);
|
|
|
|
border-bottom-left-radius: valid-radius($radius);
|
2015-09-03 18:04:51 +02:00
|
|
|
}
|
2014-12-02 23:02:35 +01:00
|
|
|
}
|
2019-01-07 02:01:36 +01:00
|
|
|
|
2020-09-01 23:17:17 +02:00
|
|
|
@mixin border-top-left-radius($radius: $border-radius) {
|
2019-02-07 09:02:05 +01:00
|
|
|
@if $enable-rounded {
|
2020-02-14 07:40:07 +01:00
|
|
|
border-top-left-radius: valid-radius($radius);
|
2019-02-07 09:02:05 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-01 23:17:17 +02:00
|
|
|
@mixin border-top-right-radius($radius: $border-radius) {
|
2019-01-07 02:01:36 +01:00
|
|
|
@if $enable-rounded {
|
2020-02-14 07:40:07 +01:00
|
|
|
border-top-right-radius: valid-radius($radius);
|
2019-01-07 02:01:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-01 23:17:17 +02:00
|
|
|
@mixin border-bottom-right-radius($radius: $border-radius) {
|
2019-02-07 09:02:05 +01:00
|
|
|
@if $enable-rounded {
|
2020-02-14 07:40:07 +01:00
|
|
|
border-bottom-right-radius: valid-radius($radius);
|
2019-02-07 09:02:05 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-01 23:17:17 +02:00
|
|
|
@mixin border-bottom-left-radius($radius: $border-radius) {
|
2019-01-07 02:01:36 +01:00
|
|
|
@if $enable-rounded {
|
2020-02-14 07:40:07 +01:00
|
|
|
border-bottom-left-radius: valid-radius($radius);
|
2019-01-07 02:01:36 +01:00
|
|
|
}
|
|
|
|
}
|