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