_radius.scss 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. @mixin radius($r,$d:null ,$important: false){
  2. $radius-value:map-get($uni-radius, $r) if($important, !important, null);
  3. // Key exists within the $uni-radius variable
  4. @if (map-has-key($uni-radius, $r) and $d){
  5. @if $d == t {
  6. border-top-left-radius:$radius-value;
  7. border-top-right-radius:$radius-value;
  8. }@else if $d == r {
  9. border-top-right-radius:$radius-value;
  10. border-bottom-right-radius:$radius-value;
  11. }@else if $d == b {
  12. border-bottom-left-radius:$radius-value;
  13. border-bottom-right-radius:$radius-value;
  14. }@else if $d == l {
  15. border-top-left-radius:$radius-value;
  16. border-bottom-left-radius:$radius-value;
  17. }@else if $d == tl {
  18. border-top-left-radius:$radius-value;
  19. }@else if $d == tr {
  20. border-top-right-radius:$radius-value;
  21. }@else if $d == br {
  22. border-bottom-right-radius:$radius-value;
  23. }@else if $d == bl {
  24. border-bottom-left-radius:$radius-value;
  25. }
  26. }@else{
  27. border-radius:$radius-value;
  28. }
  29. }
  30. @each $key, $child in $uni-radius {
  31. @if($key){
  32. .uni-radius-#{"" + $key} {
  33. @include radius($key)
  34. }
  35. }@else{
  36. .uni-radius {
  37. @include radius($key)
  38. }
  39. }
  40. }
  41. @each $direction in t, r, b, l,tl, tr, br, bl {
  42. @each $key, $child in $uni-radius {
  43. @if($key){
  44. .uni-radius-#{"" + $direction}-#{"" + $key} {
  45. @include radius($key,$direction,false)
  46. }
  47. }@else{
  48. .uni-radius-#{$direction} {
  49. @include radius($key,$direction,false)
  50. }
  51. }
  52. }
  53. }