datepicker3.less 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. .datepicker {
  2. border-radius: @border-radius-base;
  3. &-inline {
  4. width: 220px;
  5. }
  6. direction: ltr;
  7. &-rtl {
  8. direction: rtl;
  9. &.dropdown-menu { left: auto; }
  10. table tr td span {
  11. float: right;
  12. }
  13. }
  14. &-dropdown {
  15. top: 0;
  16. left: 0;
  17. padding: 4px;
  18. &:before {
  19. content: '';
  20. display: inline-block;
  21. border-left: 7px solid transparent;
  22. border-right: 7px solid transparent;
  23. border-bottom: 7px solid @dropdown-border;
  24. border-top: 0;
  25. border-bottom-color: rgba(0,0,0,.2);
  26. position: absolute;
  27. }
  28. &:after {
  29. content: '';
  30. display: inline-block;
  31. border-left: 6px solid transparent;
  32. border-right: 6px solid transparent;
  33. border-bottom: 6px solid @dropdown-bg;
  34. border-top: 0;
  35. position: absolute;
  36. }
  37. &.datepicker-orient-left:before { left: 6px; }
  38. &.datepicker-orient-left:after { left: 7px; }
  39. &.datepicker-orient-right:before { right: 6px; }
  40. &.datepicker-orient-right:after { right: 7px; }
  41. &.datepicker-orient-bottom:before { top: -7px; }
  42. &.datepicker-orient-bottom:after { top: -6px; }
  43. &.datepicker-orient-top:before {
  44. bottom: -7px;
  45. border-bottom: 0;
  46. border-top: 7px solid @dropdown-border;
  47. }
  48. &.datepicker-orient-top:after {
  49. bottom: -6px;
  50. border-bottom: 0;
  51. border-top: 6px solid @dropdown-bg;
  52. }
  53. }
  54. table {
  55. margin: 0;
  56. -webkit-touch-callout: none;
  57. -webkit-user-select: none;
  58. -khtml-user-select: none;
  59. -moz-user-select: none;
  60. -ms-user-select: none;
  61. user-select: none;
  62. tr {
  63. td, th {
  64. text-align: center;
  65. width: 30px;
  66. height: 30px;
  67. border-radius: 4px;
  68. border: none;
  69. }
  70. }
  71. }
  72. // Inline display inside a table presents some problems with
  73. // border and background colors.
  74. .table-striped & table tr {
  75. td, th {
  76. background-color: transparent;
  77. }
  78. }
  79. table tr td {
  80. &.old,
  81. &.new {
  82. color: @btn-link-disabled-color;
  83. }
  84. &.day:hover,
  85. &.focused {
  86. background: @gray-lighter;
  87. cursor: pointer;
  88. }
  89. &.disabled,
  90. &.disabled:hover {
  91. background: none;
  92. color: @btn-link-disabled-color;
  93. cursor: default;
  94. }
  95. &.highlighted {
  96. @highlighted-bg: @state-info-bg;
  97. .button-variant(#000, @highlighted-bg, darken(@highlighted-bg, 20%));
  98. border-radius: 0;
  99. &.focused {
  100. background: darken(@highlighted-bg, 10%);
  101. }
  102. &.disabled,
  103. &.disabled:active {
  104. background: @highlighted-bg;
  105. color: @btn-link-disabled-color;
  106. }
  107. }
  108. &.today {
  109. @today-bg: lighten(orange, 30%);
  110. .button-variant(#000, @today-bg, darken(@today-bg, 20%));
  111. &.focused {
  112. background: darken(@today-bg, 10%);
  113. }
  114. &.disabled,
  115. &.disabled:active {
  116. background: @today-bg;
  117. color: @btn-link-disabled-color;
  118. }
  119. }
  120. &.range {
  121. @range-bg: @gray-lighter;
  122. .button-variant(#000, @range-bg, darken(@range-bg, 20%));
  123. border-radius: 0;
  124. &.focused {
  125. background: darken(@range-bg, 10%);
  126. }
  127. &.disabled,
  128. &.disabled:active {
  129. background: @range-bg;
  130. color: @btn-link-disabled-color;
  131. }
  132. }
  133. &.range.highlighted {
  134. @range-highlighted-bg: mix(@state-info-bg, @gray-lighter, 50%);
  135. .button-variant(#000, @range-highlighted-bg, darken(@range-highlighted-bg, 20%));
  136. &.focused {
  137. background: darken(@range-highlighted-bg, 10%);
  138. }
  139. &.disabled,
  140. &.disabled:active {
  141. background: @range-highlighted-bg;
  142. color: @btn-link-disabled-color;
  143. }
  144. }
  145. &.range.today {
  146. @range-today-bg: mix(orange, @gray-lighter, 50%);
  147. .button-variant(#000, @range-today-bg, darken(@range-today-bg, 20%));
  148. &.disabled,
  149. &.disabled:active {
  150. background: @range-today-bg;
  151. color: @btn-link-disabled-color;
  152. }
  153. }
  154. &.selected,
  155. &.selected.highlighted {
  156. .button-variant(#fff, @gray-light, @gray);
  157. text-shadow: 0 -1px 0 rgba(0,0,0,.25);
  158. }
  159. &.active,
  160. &.active.highlighted {
  161. .button-variant(@btn-primary-color, @btn-primary-bg, @btn-primary-border);
  162. text-shadow: 0 -1px 0 rgba(0,0,0,.25);
  163. }
  164. span {
  165. display: block;
  166. width: 23%;
  167. height: 54px;
  168. line-height: 54px;
  169. float: left;
  170. margin: 1%;
  171. cursor: pointer;
  172. border-radius: 4px;
  173. &:hover,
  174. &.focused {
  175. background: @gray-lighter;
  176. }
  177. &.disabled,
  178. &.disabled:hover {
  179. background: none;
  180. color: @btn-link-disabled-color;
  181. cursor: default;
  182. }
  183. &.active,
  184. &.active:hover,
  185. &.active.disabled,
  186. &.active.disabled:hover {
  187. .button-variant(@btn-primary-color, @btn-primary-bg, @btn-primary-border);
  188. text-shadow: 0 -1px 0 rgba(0,0,0,.25);
  189. }
  190. &.old,
  191. &.new {
  192. color: @btn-link-disabled-color;
  193. }
  194. }
  195. }
  196. .datepicker-switch {
  197. width: 145px;
  198. }
  199. .datepicker-switch,
  200. .prev,
  201. .next,
  202. tfoot tr th {
  203. cursor: pointer;
  204. &:hover {
  205. background: @gray-lighter;
  206. }
  207. }
  208. .prev, .next {
  209. &.disabled {
  210. visibility: hidden;
  211. }
  212. }
  213. // Basic styling for calendar-week cells
  214. .cw {
  215. font-size: 10px;
  216. width: 12px;
  217. padding: 0 2px 0 5px;
  218. vertical-align: middle;
  219. }
  220. }
  221. .input-group.date .input-group-addon {
  222. cursor: pointer;
  223. }
  224. .input-daterange {
  225. width: 100%;
  226. input {
  227. text-align: center;
  228. }
  229. input:first-child {
  230. border-radius: 3px 0 0 3px;
  231. }
  232. input:last-child {
  233. border-radius: 0 3px 3px 0;
  234. }
  235. .input-group-addon {
  236. width: auto;
  237. min-width: 16px;
  238. padding: 4px 5px;
  239. line-height: @line-height-base;
  240. border-width: 1px 0;
  241. margin-left: -5px;
  242. margin-right: -5px;
  243. }
  244. }