segmented-controls.scss 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. //
  2. // Segmented controllers
  3. // --------------------------------------------------
  4. .segmented-control {
  5. position: relative;
  6. display: table;
  7. overflow: hidden;
  8. font-size: 12px;
  9. font-weight: $font-weight-light;
  10. background-color: $chrome-color;
  11. border: 1px solid #ccc;
  12. border-radius: 3px;
  13. // Section within controller
  14. .control-item {
  15. display: table-cell;
  16. width: 1%;
  17. padding-top: 6px;
  18. padding-bottom: 7px;
  19. overflow: hidden;
  20. line-height: 1;
  21. color: #333;
  22. text-align: center;
  23. text-overflow: ellipsis;
  24. white-space: nowrap;
  25. border-left: 1px solid #ccc;
  26. // Remove border-left and shadow from first section
  27. &:first-child {
  28. border-left-width: 0;
  29. }
  30. // Tap state of segmented controller
  31. &:active {
  32. background-color: #eee;
  33. }
  34. // Selected state of segmented controller
  35. &.active {
  36. background-color: #ccc;
  37. }
  38. }
  39. }
  40. // Other segmented controller types
  41. // --------------------------------------------------
  42. // Primary
  43. .segmented-control-primary {
  44. border-color: $primary-color;
  45. .control-item {
  46. color: $primary-color;
  47. border-color: inherit;
  48. &:active {
  49. background-color: lighten($primary-color, 35%);
  50. }
  51. &.active {
  52. color: #fff;
  53. background-color: $primary-color;
  54. }
  55. }
  56. }
  57. // Positive
  58. .segmented-control-positive {
  59. border-color: $positive-color;
  60. .control-item {
  61. color: $positive-color;
  62. border-color: inherit;
  63. &:active {
  64. background-color: lighten($positive-color, 35%);
  65. }
  66. &.active {
  67. color: #fff;
  68. background-color: $positive-color;
  69. }
  70. }
  71. }
  72. // Negative
  73. .segmented-control-negative {
  74. border-color: $negative-color;
  75. .control-item {
  76. color: $negative-color;
  77. border-color: inherit;
  78. &:active {
  79. background-color: lighten($negative-color, 35%);
  80. }
  81. &.active {
  82. color: #fff;
  83. background-color: $negative-color;
  84. }
  85. }
  86. }
  87. // This is used to by the js to show and hide content tide to the segmented control.
  88. .control-content {
  89. display: none;
  90. &.active {
  91. display: block;
  92. }
  93. }