Calendar.less 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. .calendarLeftArrow() {
  2. height: 100%;
  3. &::before,
  4. &::after {
  5. position: relative;
  6. top: -1px;
  7. display: inline-block;
  8. width: 8px;
  9. height: 8px;
  10. vertical-align: middle;
  11. border: 0 solid #aaa;
  12. border-width: 1.5px 0 0 1.5px;
  13. border-radius: 1px;
  14. transform: rotate(-45deg) scale(0.8);
  15. transition: all 0.3s;
  16. content: '';
  17. }
  18. &:hover::before,
  19. &:hover::after {
  20. border-color: @text-color;
  21. }
  22. &::after {
  23. display: none;
  24. }
  25. }
  26. .calendarLeftDoubleArrow() {
  27. .calendarLeftArrow;
  28. &::after {
  29. position: relative;
  30. left: -3px;
  31. display: inline-block;
  32. }
  33. }
  34. .calendarRightArrow() {
  35. .calendarLeftArrow;
  36. &::before,
  37. &::after {
  38. transform: rotate(135deg) scale(0.8);
  39. }
  40. }
  41. .calendarRightDoubleArrow() {
  42. .calendarRightArrow;
  43. &::before {
  44. position: relative;
  45. left: 3px;
  46. }
  47. &::after {
  48. display: inline-block;
  49. }
  50. }
  51. .calendarPanelHeader(@calendar-prefix-cls) {
  52. height: 40px;
  53. line-height: 40px;
  54. text-align: center;
  55. border-bottom: @border-width-base @border-style-base @border-color-split;
  56. user-select: none;
  57. a:hover {
  58. color: @link-hover-color;
  59. }
  60. .@{calendar-prefix-cls}-century-select,
  61. .@{calendar-prefix-cls}-decade-select,
  62. .@{calendar-prefix-cls}-year-select,
  63. .@{calendar-prefix-cls}-month-select {
  64. display: inline-block;
  65. padding: 0 2px;
  66. color: @heading-color;
  67. font-weight: 500;
  68. line-height: 40px;
  69. }
  70. .@{calendar-prefix-cls}-century-select-arrow,
  71. .@{calendar-prefix-cls}-decade-select-arrow,
  72. .@{calendar-prefix-cls}-year-select-arrow,
  73. .@{calendar-prefix-cls}-month-select-arrow {
  74. display: none;
  75. }
  76. .@{calendar-prefix-cls}-prev-century-btn,
  77. .@{calendar-prefix-cls}-next-century-btn,
  78. .@{calendar-prefix-cls}-prev-decade-btn,
  79. .@{calendar-prefix-cls}-next-decade-btn,
  80. .@{calendar-prefix-cls}-prev-month-btn,
  81. .@{calendar-prefix-cls}-next-month-btn,
  82. .@{calendar-prefix-cls}-prev-year-btn,
  83. .@{calendar-prefix-cls}-next-year-btn {
  84. position: absolute;
  85. top: 0;
  86. display: inline-block;
  87. padding: 0 5px;
  88. color: @text-color-secondary;
  89. font-size: 16px;
  90. font-family: Arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'Microsoft Sans Serif', sans-serif;
  91. line-height: 40px;
  92. }
  93. .@{calendar-prefix-cls}-prev-century-btn,
  94. .@{calendar-prefix-cls}-prev-decade-btn,
  95. .@{calendar-prefix-cls}-prev-year-btn {
  96. left: 7px;
  97. .calendarLeftDoubleArrow;
  98. }
  99. .@{calendar-prefix-cls}-next-century-btn,
  100. .@{calendar-prefix-cls}-next-decade-btn,
  101. .@{calendar-prefix-cls}-next-year-btn {
  102. right: 7px;
  103. .calendarRightDoubleArrow;
  104. }
  105. .@{calendar-prefix-cls}-prev-month-btn {
  106. left: 29px;
  107. .calendarLeftArrow;
  108. }
  109. .@{calendar-prefix-cls}-next-month-btn {
  110. right: 29px;
  111. .calendarRightArrow;
  112. }
  113. }
  114. .calendar-selected-cell() {
  115. .@{calendar-prefix-cls}-date {
  116. color: @text-color-inverse;
  117. background: @primary-color;
  118. border: @border-width-base @border-style-base transparent;
  119. &:hover {
  120. background: @primary-color;
  121. }
  122. }
  123. }
  124. .@{calendar-prefix-cls} {
  125. position: relative;
  126. width: 280px;
  127. font-size: @font-size-base;
  128. line-height: @line-height-base;
  129. text-align: left;
  130. list-style: none;
  131. background-color: @component-background;
  132. background-clip: padding-box;
  133. border: @border-width-base @border-style-base @border-color-inverse;
  134. border-radius: @border-radius-base;
  135. outline: none;
  136. box-shadow: @box-shadow-base;
  137. &-input-wrap {
  138. height: 34px;
  139. padding: 6px @control-padding-horizontal - 2px;
  140. border-bottom: @border-width-base @border-style-base @border-color-split;
  141. }
  142. &-input {
  143. width: 100%;
  144. height: 22px;
  145. color: @input-color;
  146. background: @input-bg;
  147. border: 0;
  148. outline: 0;
  149. cursor: auto;
  150. .placeholder;
  151. }
  152. &-week-number {
  153. width: 286px;
  154. &-cell {
  155. text-align: center;
  156. }
  157. }
  158. &-header {
  159. .calendarPanelHeader(@calendar-prefix-cls);
  160. }
  161. &-body {
  162. padding: 8px 12px;
  163. }
  164. table {
  165. width: 100%;
  166. max-width: 100%;
  167. background-color: transparent;
  168. border-collapse: collapse;
  169. }
  170. table,
  171. th,
  172. td {
  173. text-align: center;
  174. border: 0;
  175. }
  176. &-calendar-table {
  177. margin-bottom: 0;
  178. border-spacing: 0;
  179. }
  180. &-column-header {
  181. width: 33px;
  182. padding: 6px 0;
  183. line-height: 18px;
  184. text-align: center;
  185. .@{calendar-prefix-cls}-column-header-inner {
  186. display: block;
  187. font-weight: normal;
  188. }
  189. }
  190. &-week-number-header {
  191. .@{calendar-prefix-cls}-column-header-inner {
  192. display: none;
  193. }
  194. }
  195. &-cell {
  196. height: 30px;
  197. padding: 3px 0;
  198. }
  199. &-date {
  200. display: block;
  201. width: 24px;
  202. height: 24px;
  203. margin: 0 auto;
  204. padding: 0;
  205. color: @text-color;
  206. line-height: 22px;
  207. text-align: center;
  208. background: transparent;
  209. border: @border-width-base @border-style-base transparent;
  210. border-radius: @border-radius-sm;
  211. transition: background 0.3s ease;
  212. &-panel {
  213. position: relative;
  214. outline: none;
  215. }
  216. &:hover {
  217. background: @item-hover-bg;
  218. cursor: pointer;
  219. }
  220. &:active {
  221. color: @text-color-inverse;
  222. background: @primary-5;
  223. }
  224. }
  225. &-today &-date {
  226. color: @primary-color;
  227. font-weight: bold;
  228. border-color: @primary-color;
  229. }
  230. &-selected-day &-date {
  231. background: @primary-2;
  232. }
  233. &-last-month-cell &-date,
  234. &-next-month-btn-day &-date {
  235. &,
  236. &:hover {
  237. color: @disabled-color;
  238. background: transparent;
  239. border-color: transparent;
  240. }
  241. }
  242. &-disabled-cell &-date {
  243. position: relative;
  244. width: auto;
  245. color: @disabled-color;
  246. background: @disabled-bg;
  247. border: @border-width-base @border-style-base transparent;
  248. border-radius: 0;
  249. cursor: not-allowed;
  250. &:hover {
  251. background: @disabled-bg;
  252. }
  253. }
  254. &-disabled-cell&-selected-day &-date::before {
  255. position: absolute;
  256. top: -1px;
  257. left: 5px;
  258. width: 24px;
  259. height: 24px;
  260. background: rgba(0, 0, 0, 0.1);
  261. border-radius: @border-radius-sm;
  262. content: '';
  263. }
  264. &-disabled-cell&-today &-date {
  265. position: relative;
  266. padding-right: 5px;
  267. padding-left: 5px;
  268. &::before {
  269. position: absolute;
  270. top: -1px;
  271. left: 5px;
  272. width: 24px;
  273. height: 24px;
  274. border: @border-width-base @border-style-base @disabled-color;
  275. border-radius: @border-radius-sm;
  276. content: ' ';
  277. }
  278. }
  279. &-disabled-cell-first-of-row &-date {
  280. border-top-left-radius: 4px;
  281. border-bottom-left-radius: 4px;
  282. }
  283. &-disabled-cell-last-of-row &-date {
  284. border-top-right-radius: 4px;
  285. border-bottom-right-radius: 4px;
  286. }
  287. &-footer {
  288. padding: 0 12px;
  289. line-height: 38px;
  290. border-top: @border-width-base @border-style-base @border-color-split;
  291. &:empty {
  292. border-top: 0;
  293. }
  294. &-btn {
  295. display: block;
  296. text-align: center;
  297. }
  298. &-extra {
  299. text-align: left;
  300. }
  301. }
  302. .@{calendar-prefix-cls}-today-btn,
  303. .@{calendar-prefix-cls}-clear-btn {
  304. display: inline-block;
  305. margin: 0 0 0 8px;
  306. text-align: center;
  307. &-disabled {
  308. color: @disabled-color;
  309. cursor: not-allowed;
  310. }
  311. &:only-child {
  312. margin: 0;
  313. }
  314. }
  315. .@{calendar-prefix-cls}-clear-btn {
  316. position: absolute;
  317. top: 7px;
  318. right: 5px;
  319. display: none;
  320. width: 20px;
  321. height: 20px;
  322. margin: 0;
  323. overflow: hidden;
  324. line-height: 20px;
  325. text-align: center;
  326. text-indent: -76px;
  327. }
  328. .@{calendar-prefix-cls}-clear-btn::after {
  329. display: inline-block;
  330. width: 20px;
  331. color: @disabled-color;
  332. font-size: @font-size-base;
  333. line-height: 1;
  334. text-indent: 43px;
  335. transition: color 0.3s ease;
  336. }
  337. .@{calendar-prefix-cls}-clear-btn:hover::after {
  338. color: @text-color-secondary;
  339. }
  340. .@{calendar-prefix-cls}-ok-btn {
  341. .btn;
  342. .btn-primary;
  343. .button-size(@btn-height-sm; @btn-padding-sm; @font-size-base; @border-radius-base);
  344. line-height: @btn-height-sm - 2px;
  345. .button-disabled();
  346. }
  347. }