daterangepicker.scss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. //
  2. // A stylesheet for use with Bootstrap 3.x
  3. // @author: Dan Grossman http://www.dangrossman.info/
  4. // @copyright: Copyright (c) 2012-2015 Dan Grossman. All rights reserved.
  5. // @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
  6. // @website: https://www.improvely.com/
  7. //
  8. //
  9. // VARIABLES
  10. //
  11. //
  12. // Settings
  13. // The class name to contain everything within.
  14. $prefix-class: daterangepicker;
  15. $arrow-size: 7px !default;
  16. //
  17. // Colors
  18. $daterangepicker-color: inherit !default;
  19. $daterangepicker-bg-color: #fff !default;
  20. $daterangepicker-cell-color: $daterangepicker-color !default;
  21. $daterangepicker-cell-border-color: transparent !default;
  22. $daterangepicker-cell-bg-color: $daterangepicker-bg-color !default;
  23. $daterangepicker-cell-hover-color: $daterangepicker-color !default;
  24. $daterangepicker-cell-hover-border-color: $daterangepicker-cell-border-color !default;
  25. $daterangepicker-cell-hover-bg-color: #eee !default;
  26. $daterangepicker-in-range-color: #000 !default;
  27. $daterangepicker-in-range-border-color: transparent !default;
  28. $daterangepicker-in-range-bg-color: #ebf4f8 !default;
  29. $daterangepicker-active-color: #fff !default;
  30. $daterangepicker-active-bg-color: #357ebd !default;
  31. $daterangepicker-active-border-color: transparent !default;
  32. $daterangepicker-unselected-color: #999 !default;
  33. $daterangepicker-unselected-border-color: transparent !default;
  34. $daterangepicker-unselected-bg-color: #fff !default;
  35. //
  36. // daterangepicker
  37. $daterangepicker-width: 278px !default;
  38. $daterangepicker-padding: 4px !default;
  39. $daterangepicker-z-index: 3000 !default;
  40. $daterangepicker-border-size: 1px !default;
  41. $daterangepicker-border-color: #ccc !default;
  42. $daterangepicker-border-radius: 4px !default;
  43. //
  44. // Calendar
  45. $daterangepicker-calendar-margin: $daterangepicker-padding !default;
  46. $daterangepicker-calendar-bg-color: $daterangepicker-bg-color !default;
  47. $daterangepicker-calendar-border-size: 1px !default;
  48. $daterangepicker-calendar-border-color: $daterangepicker-bg-color !default;
  49. $daterangepicker-calendar-border-radius: $daterangepicker-border-radius !default;
  50. //
  51. // Calendar Cells
  52. $daterangepicker-cell-size: 20px !default;
  53. $daterangepicker-cell-width: $daterangepicker-cell-size !default;
  54. $daterangepicker-cell-height: $daterangepicker-cell-size !default;
  55. $daterangepicker-cell-border-radius: $daterangepicker-calendar-border-radius !default;
  56. $daterangepicker-cell-border-size: 1px !default;
  57. //
  58. // Dropdowns
  59. $daterangepicker-dropdown-z-index: $daterangepicker-z-index + 1 !default;
  60. //
  61. // Controls
  62. $daterangepicker-control-height: 30px !default;
  63. $daterangepicker-control-line-height: $daterangepicker-control-height !default;
  64. $daterangepicker-control-color: #555 !default;
  65. $daterangepicker-control-border-size: 1px !default;
  66. $daterangepicker-control-border-color: #ccc !default;
  67. $daterangepicker-control-border-radius: 4px !default;
  68. $daterangepicker-control-active-border-size: 1px !default;
  69. $daterangepicker-control-active-border-color: #08c !default;
  70. $daterangepicker-control-active-border-radius: $daterangepicker-control-border-radius !default;
  71. $daterangepicker-control-disabled-color: #ccc !default;
  72. //
  73. // Ranges
  74. $daterangepicker-ranges-color: #08c !default;
  75. $daterangepicker-ranges-bg-color: #f5f5f5 !default;
  76. $daterangepicker-ranges-border-size: 1px !default;
  77. $daterangepicker-ranges-border-color: $daterangepicker-ranges-bg-color !default;
  78. $daterangepicker-ranges-border-radius: $daterangepicker-border-radius !default;
  79. $daterangepicker-ranges-hover-color: #fff !default;
  80. $daterangepicker-ranges-hover-bg-color: $daterangepicker-ranges-color !default;
  81. $daterangepicker-ranges-hover-border-size: $daterangepicker-ranges-border-size !default;
  82. $daterangepicker-ranges-hover-border-color: $daterangepicker-ranges-hover-bg-color !default;
  83. $daterangepicker-ranges-hover-border-radius: $daterangepicker-border-radius !default;
  84. $daterangepicker-ranges-active-border-size: $daterangepicker-ranges-border-size !default;
  85. $daterangepicker-ranges-active-border-color: $daterangepicker-ranges-bg-color !default;
  86. $daterangepicker-ranges-active-border-radius: $daterangepicker-border-radius !default;
  87. //
  88. // STYLESHEETS
  89. //
  90. .#{$prefix-class} {
  91. position: absolute;
  92. color: $daterangepicker-color;
  93. background: $daterangepicker-bg-color;
  94. border-radius: $daterangepicker-border-radius;
  95. width: $daterangepicker-width;
  96. padding: $daterangepicker-padding;
  97. margin-top: $daterangepicker-border-size;
  98. // TODO: Should these be parameterized??
  99. top: 100px;
  100. left: 20px;
  101. $arrow-prefix-size: $arrow-size;
  102. $arrow-suffix-size: ($arrow-size - $daterangepicker-border-size);
  103. &:before, &:after {
  104. position: absolute;
  105. display: inline-block;
  106. border-bottom-color: rgba(0, 0, 0, 0.2);
  107. content: '';
  108. }
  109. &:before {
  110. top: -$arrow-prefix-size;
  111. border-right: $arrow-prefix-size solid transparent;
  112. border-left: $arrow-prefix-size solid transparent;
  113. border-bottom: $arrow-prefix-size solid $daterangepicker-border-color;
  114. }
  115. &:after {
  116. top: -$arrow-suffix-size;
  117. border-right: $arrow-suffix-size solid transparent;
  118. border-bottom: $arrow-suffix-size solid $daterangepicker-bg-color;
  119. border-left: $arrow-suffix-size solid transparent;
  120. }
  121. &.opensleft {
  122. &:before {
  123. // TODO: Make this relative to prefix size.
  124. right: $arrow-prefix-size + 2px;
  125. }
  126. &:after {
  127. // TODO: Make this relative to suffix size.
  128. right: $arrow-suffix-size + 4px;
  129. }
  130. }
  131. &.openscenter {
  132. &:before {
  133. left: 0;
  134. right: 0;
  135. width: 0;
  136. margin-left: auto;
  137. margin-right: auto;
  138. }
  139. &:after {
  140. left: 0;
  141. right: 0;
  142. width: 0;
  143. margin-left: auto;
  144. margin-right: auto;
  145. }
  146. }
  147. &.opensright {
  148. &:before {
  149. // TODO: Make this relative to prefix size.
  150. left: $arrow-prefix-size + 2px;
  151. }
  152. &:after {
  153. // TODO: Make this relative to suffix size.
  154. left: $arrow-suffix-size + 4px;
  155. }
  156. }
  157. &.dropup {
  158. margin-top: -5px;
  159. // NOTE: Note sure why these are special-cased.
  160. &:before {
  161. top: initial;
  162. bottom: -$arrow-prefix-size;
  163. border-bottom: initial;
  164. border-top: $arrow-prefix-size solid $daterangepicker-border-color;
  165. }
  166. &:after {
  167. top: initial;
  168. bottom:-$arrow-suffix-size;
  169. border-bottom: initial;
  170. border-top: $arrow-suffix-size solid $daterangepicker-bg-color;
  171. }
  172. }
  173. &.dropdown-menu {
  174. max-width: none;
  175. z-index: $daterangepicker-dropdown-z-index;
  176. }
  177. &.single {
  178. .ranges, .calendar {
  179. float: none;
  180. }
  181. }
  182. /* Calendars */
  183. &.show-calendar {
  184. .calendar {
  185. display: block;
  186. }
  187. }
  188. .calendar {
  189. display: none;
  190. max-width: $daterangepicker-width - ($daterangepicker-calendar-margin * 2);
  191. margin: $daterangepicker-calendar-margin;
  192. &.single {
  193. .calendar-table {
  194. border: none;
  195. }
  196. }
  197. th, td {
  198. white-space: nowrap;
  199. text-align: center;
  200. // TODO: Should this actually be hard-coded?
  201. min-width: 32px;
  202. }
  203. }
  204. .calendar-table {
  205. border: $daterangepicker-calendar-border-size solid $daterangepicker-calendar-border-color;
  206. padding: $daterangepicker-calendar-margin;
  207. border-radius: $daterangepicker-calendar-border-radius;
  208. background: $daterangepicker-calendar-bg-color;
  209. }
  210. table {
  211. width: 100%;
  212. margin: 0;
  213. }
  214. td, th {
  215. text-align: center;
  216. width: $daterangepicker-cell-width;
  217. height: $daterangepicker-cell-height;
  218. border-radius: $daterangepicker-cell-border-radius;
  219. border: $daterangepicker-cell-border-size solid $daterangepicker-cell-border-color;
  220. white-space: nowrap;
  221. cursor: pointer;
  222. &.available {
  223. &:hover {
  224. background-color: $daterangepicker-cell-hover-bg-color;
  225. border-color: $daterangepicker-cell-hover-border-color;
  226. color: $daterangepicker-cell-hover-color;
  227. }
  228. }
  229. &.week {
  230. font-size: 80%;
  231. color: #ccc;
  232. }
  233. }
  234. td {
  235. &.off {
  236. &, &.in-range, &.start-date, &.end-date {
  237. background-color: $daterangepicker-unselected-bg-color;
  238. border-color: $daterangepicker-unselected-border-color;
  239. color: $daterangepicker-unselected-color;
  240. }
  241. }
  242. //
  243. // Date Range
  244. &.in-range {
  245. background-color: $daterangepicker-in-range-bg-color;
  246. border-color: $daterangepicker-in-range-border-color;
  247. color: $daterangepicker-in-range-color;
  248. // TODO: Should this be static or should it be parameterized?
  249. border-radius: 0;
  250. }
  251. &.start-date {
  252. border-radius: $daterangepicker-cell-border-radius 0 0 $daterangepicker-cell-border-radius;
  253. }
  254. &.end-date {
  255. border-radius: 0 $daterangepicker-cell-border-radius $daterangepicker-cell-border-radius 0;
  256. }
  257. &.start-date.end-date {
  258. border-radius: $daterangepicker-cell-border-radius;
  259. }
  260. &.active {
  261. &, &:hover {
  262. background-color: $daterangepicker-active-bg-color;
  263. border-color: $daterangepicker-active-border-color;
  264. color: $daterangepicker-active-color;
  265. }
  266. }
  267. }
  268. th {
  269. &.month {
  270. width: auto;
  271. }
  272. }
  273. //
  274. // Disabled Controls
  275. //
  276. td, option {
  277. &.disabled {
  278. color: #999;
  279. cursor: not-allowed;
  280. text-decoration: line-through;
  281. }
  282. }
  283. select {
  284. &.monthselect, &.yearselect {
  285. font-size: 12px;
  286. padding: 1px;
  287. height: auto;
  288. margin: 0;
  289. cursor: default;
  290. }
  291. &.monthselect {
  292. margin-right: 2%;
  293. width: 56%;
  294. }
  295. &.yearselect {
  296. width: 40%;
  297. }
  298. &.hourselect, &.minuteselect, &.secondselect, &.ampmselect {
  299. width: 50px;
  300. margin-bottom: 0;
  301. }
  302. }
  303. //
  304. // Text Input Controls (above calendar)
  305. //
  306. .input-mini {
  307. border: $daterangepicker-control-border-size solid $daterangepicker-control-border-color;
  308. border-radius: $daterangepicker-control-border-radius;
  309. color: $daterangepicker-control-color;
  310. height: $daterangepicker-control-line-height;
  311. line-height: $daterangepicker-control-height;
  312. display: block;
  313. vertical-align: middle;
  314. // TODO: Should these all be static, too??
  315. margin: 0 0 5px 0;
  316. padding: 0 6px 0 28px;
  317. width: 100%;
  318. &.active {
  319. border: $daterangepicker-control-active-border-size solid $daterangepicker-control-active-border-color;
  320. border-radius: $daterangepicker-control-active-border-radius;
  321. }
  322. }
  323. .daterangepicker_input {
  324. position: relative;
  325. i {
  326. position: absolute;
  327. // NOTE: These appear to be eyeballed to me...
  328. left: 8px;
  329. top: 8px;
  330. }
  331. }
  332. &.rtl {
  333. .input-mini {
  334. padding-right: 28px;
  335. padding-left: 6px;
  336. }
  337. .daterangepicker_input i {
  338. left: auto;
  339. right: 8px;
  340. }
  341. }
  342. //
  343. // Time Picker
  344. //
  345. .calendar-time {
  346. text-align: center;
  347. margin: 5px auto;
  348. line-height: $daterangepicker-control-line-height;
  349. position: relative;
  350. padding-left: 28px;
  351. select {
  352. &.disabled {
  353. color: $daterangepicker-control-disabled-color;
  354. cursor: not-allowed;
  355. }
  356. }
  357. }
  358. }
  359. //
  360. // Predefined Ranges
  361. //
  362. .ranges {
  363. font-size: 11px;
  364. float: none;
  365. margin: 4px;
  366. text-align: left;
  367. ul {
  368. list-style: none;
  369. margin: 0 auto;
  370. padding: 0;
  371. width: 100%;
  372. }
  373. li {
  374. font-size: 13px;
  375. background: $daterangepicker-ranges-bg-color;
  376. border: $daterangepicker-ranges-border-size solid $daterangepicker-ranges-border-color;
  377. border-radius: $daterangepicker-ranges-border-radius;
  378. color: $daterangepicker-ranges-color;
  379. padding: 3px 12px;
  380. margin-bottom: 8px;
  381. cursor: pointer;
  382. &:hover {
  383. background: $daterangepicker-ranges-hover-bg-color;
  384. border: $daterangepicker-ranges-hover-border-size solid $daterangepicker-ranges-hover-border-color;
  385. color: $daterangepicker-ranges-hover-color;
  386. }
  387. &.active {
  388. background: $daterangepicker-ranges-hover-bg-color;
  389. border: $daterangepicker-ranges-hover-border-size solid $daterangepicker-ranges-hover-border-color;
  390. color: $daterangepicker-ranges-hover-color;
  391. }
  392. }
  393. }
  394. /* Larger Screen Styling */
  395. @media (min-width: 564px) {
  396. .#{$prefix-class} {
  397. width: auto;
  398. .ranges {
  399. ul {
  400. width: 160px;
  401. }
  402. }
  403. &.single {
  404. .ranges {
  405. ul {
  406. width: 100%;
  407. }
  408. }
  409. .calendar.left {
  410. clear: none;
  411. }
  412. &.ltr {
  413. .ranges, .calendar {
  414. float:left;
  415. }
  416. }
  417. &.rtl {
  418. .ranges, .calendar {
  419. float:right;
  420. }
  421. }
  422. }
  423. &.ltr {
  424. direction: ltr;
  425. text-align: left;
  426. .calendar{
  427. &.left {
  428. clear: left;
  429. margin-right: 0;
  430. .calendar-table {
  431. border-right: none;
  432. border-top-right-radius: 0;
  433. border-bottom-right-radius: 0;
  434. }
  435. }
  436. &.right {
  437. margin-left: 0;
  438. .calendar-table {
  439. border-left: none;
  440. border-top-left-radius: 0;
  441. border-bottom-left-radius: 0;
  442. }
  443. }
  444. }
  445. .left .daterangepicker_input {
  446. padding-right: 12px;
  447. }
  448. .calendar.left .calendar-table {
  449. padding-right: 12px;
  450. }
  451. .ranges, .calendar {
  452. float: left;
  453. }
  454. }
  455. &.rtl {
  456. direction: rtl;
  457. text-align: right;
  458. .calendar{
  459. &.left {
  460. clear: right;
  461. margin-left: 0;
  462. .calendar-table {
  463. border-left: none;
  464. border-top-left-radius: 0;
  465. border-bottom-left-radius: 0;
  466. }
  467. }
  468. &.right {
  469. margin-right: 0;
  470. .calendar-table {
  471. border-right: none;
  472. border-top-right-radius: 0;
  473. border-bottom-right-radius: 0;
  474. }
  475. }
  476. }
  477. .left .daterangepicker_input {
  478. padding-left: 12px;
  479. }
  480. .calendar.left .calendar-table {
  481. padding-left: 12px;
  482. }
  483. .ranges, .calendar {
  484. text-align: right;
  485. float: right;
  486. }
  487. }
  488. }
  489. }
  490. @media (min-width: 730px) {
  491. .#{$prefix-class} {
  492. .ranges {
  493. width: auto;
  494. }
  495. &.ltr {
  496. .ranges {
  497. float: left;
  498. }
  499. }
  500. &.rtl {
  501. .ranges {
  502. float: right;
  503. }
  504. }
  505. .calendar.left {
  506. clear: none !important;
  507. }
  508. }
  509. }