radio.ios.scss 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. @import "../../themes/ionic.globals.ios";
  2. // iOS Radio
  3. // --------------------------------------------------
  4. /// @prop - Color of the checked radio
  5. $radio-ios-color-on: color($colors-ios, primary) !default;
  6. /// @prop - Width of the radio icon
  7. $radio-ios-icon-width: 16px !default;
  8. /// @prop - Height of the radio icon
  9. $radio-ios-icon-height: 21px !default;
  10. /// @prop - Border width of the radio icon
  11. $radio-ios-icon-border-width: 2px !default;
  12. /// @prop - Border style of the radio icon
  13. $radio-ios-icon-border-style: solid !default;
  14. /// @prop - Opacity of the disabled radio
  15. $radio-ios-disabled-opacity: .3 !default;
  16. // deprecated
  17. $radio-ios-item-left-margin: null !default;
  18. /// @prop - Margin top of the item-start in a radio
  19. $radio-ios-item-start-margin-top: 8px !default;
  20. /// @prop - Margin end of the item-start in a radio
  21. $radio-ios-item-start-margin-end: 21px !default;
  22. /// @prop - Margin bottom of the item-start in a radio
  23. $radio-ios-item-start-margin-bottom: 8px !default;
  24. /// @prop - Margin start of the item-start in a radio
  25. $radio-ios-item-start-margin-start: 3px !default;
  26. // deprecated
  27. $radio-ios-item-right-margin: null !default;
  28. /// @prop - Margin top of the item-end in a radio
  29. $radio-ios-item-end-margin-top: $item-ios-padding-media-top !default;
  30. /// @prop - Margin end of the item-end in a radio
  31. $radio-ios-item-end-margin-end: 11px !default;
  32. /// @prop - Margin bottom of the item-end in a radio
  33. $radio-ios-item-end-margin-bottom: $item-ios-padding-media-bottom !default;
  34. /// @prop - Margin start of the item-end in a radio
  35. $radio-ios-item-end-margin-start: ($item-ios-padding-start / 2) !default;
  36. .radio-ios {
  37. position: relative;
  38. display: inline-block;
  39. }
  40. // iOS Radio Circle: Unchecked
  41. // -----------------------------------------
  42. .radio-ios .radio-icon {
  43. position: relative;
  44. display: block;
  45. width: $radio-ios-icon-width;
  46. height: $radio-ios-icon-height;
  47. }
  48. // iOS Radio Checkmark: Checked
  49. // -----------------------------------------
  50. .radio-ios .radio-checked .radio-inner {
  51. @include position(4px, null, null, 7px);
  52. position: absolute;
  53. width: 5px;
  54. height: 12px;
  55. border-width: $radio-ios-icon-border-width;
  56. border-top-width: 0;
  57. border-left-width: 0;
  58. border-style: $radio-ios-icon-border-style;
  59. border-color: $radio-ios-color-on;
  60. transform: rotate(45deg);
  61. }
  62. // iOS Radio: Disabled
  63. // -----------------------------------------
  64. .radio-ios.radio-disabled,
  65. .item-ios.item-radio-disabled ion-label {
  66. opacity: $radio-ios-disabled-opacity;
  67. pointer-events: none;
  68. }
  69. // iOS Radio Within An Item
  70. // -----------------------------------------
  71. .item-ios .radio-ios {
  72. position: static;
  73. display: block;
  74. @include deprecated-variable(margin, $radio-ios-item-right-margin) {
  75. @include margin($radio-ios-item-end-margin-top, $radio-ios-item-end-margin-end, $radio-ios-item-end-margin-bottom, $radio-ios-item-end-margin-start);
  76. }
  77. &[item-left], // deprecated
  78. &[item-start] {
  79. @include deprecated-variable(margin, $radio-ios-item-left-margin) {
  80. @include margin($radio-ios-item-start-margin-top, $radio-ios-item-start-margin-end, $radio-ios-item-start-margin-bottom, $radio-ios-item-start-margin-start);
  81. }
  82. }
  83. }
  84. .item-radio.item-ios ion-label {
  85. @include margin-horizontal(0, null);
  86. }
  87. // iOS Radio Item Label: Checked
  88. // -----------------------------------------
  89. .item-radio-checked.item-ios ion-label {
  90. color: $radio-ios-color-on;
  91. }
  92. // iOS Radio Color Mixin
  93. // --------------------------------------------------
  94. @mixin radio-theme-ios($color-name, $color-base) {
  95. .item-radio-ios-#{$color-name}.item-radio-checked ion-label {
  96. color: $color-base;
  97. }
  98. .radio-ios-#{$color-name} .radio-checked {
  99. color: $color-base;
  100. }
  101. .radio-ios-#{$color-name} .radio-checked .radio-inner {
  102. border-color: $color-base;
  103. }
  104. }
  105. // Generate iOS Radio Colors
  106. // --------------------------------------------------
  107. @each $color-name, $color-base, $color-contrast in get-colors($colors-ios) {
  108. @include radio-theme-ios($color-name, $color-base);
  109. }