Browse Source

update datepicker style

pull/20/head
afc163 10 years ago
parent
commit
7a9e066946
  1. 137
      style/components/datepicker/Calendar.less
  2. 45
      style/components/datepicker/DecadePanel.less
  3. 62
      style/components/datepicker/MonthPanel.less
  4. 47
      style/components/datepicker/Picker.less
  5. 2
      style/components/datepicker/TimePanel.less
  6. 66
      style/components/datepicker/YearPanel.less
  7. 10
      style/components/tab.less

137
style/components/datepicker/Calendar.less

@ -1,3 +1,73 @@
.calendarPanelHeader(@prefixCalendarClass) {
padding: 0 10px;
height: 34px;
line-height: 34px;
text-align: center;
user-select: none;
-webkit-user-select: none;
border-bottom: 1px solid #e9e9e9;
a:hover {
color: @link-hover-color;
}
.@{prefixCalendarClass}-century-select,
.@{prefixCalendarClass}-decade-select,
.@{prefixCalendarClass}-year-select,
.@{prefixCalendarClass}-month-select {
padding: 0px 2px;
font-weight: bold;
display: inline-block;
color: #666;
line-height: 34px;
}
.@{prefixCalendarClass}-century-select-arrow,
.@{prefixCalendarClass}-decade-select-arrow,
.@{prefixCalendarClass}-year-select-arrow,
.@{prefixCalendarClass}-month-select-arrow {
display: none;
}
.@{prefixCalendarClass}-prev-century-btn,
.@{prefixCalendarClass}-next-century-btn,
.@{prefixCalendarClass}-prev-decade-btn,
.@{prefixCalendarClass}-next-decade-btn,
.@{prefixCalendarClass}-prev-month-btn,
.@{prefixCalendarClass}-next-month-btn,
.@{prefixCalendarClass}-prev-year-btn,
.@{prefixCalendarClass}-next-year-btn {
position: absolute;
top: 0;
color: #999;
font-family: Arial,"Hiragino Sans GB","Microsoft Yahei","Microsoft Sans Serif",sans-serif;
padding: 0 5px;
font-size: 16px;
display: inline-block;
line-height: 34px;
}
.@{prefixCalendarClass}-prev-century-btn,
.@{prefixCalendarClass}-prev-decade-btn,
.@{prefixCalendarClass}-prev-year-btn {
left: 7px;
}
.@{prefixCalendarClass}-next-century-btn,
.@{prefixCalendarClass}-next-decade-btn,
.@{prefixCalendarClass}-next-year-btn {
right: 7px;
}
.@{prefixCalendarClass}-prev-month-btn {
left: 29px;
}
.@{prefixCalendarClass}-next-month-btn {
right: 29px;
}
}
.@{prefixCalendarClass} {
position: relative;
outline: none;
@ -11,7 +81,6 @@
box-shadow: 0 0 4px #d9d9d9;
background-clip: padding-box;
line-height: @line-height-base;
display: block !important;
&-week-number {
width: 286px;
@ -22,61 +91,7 @@
}
&-header {
padding: 0 10px;
height: 34px;
text-align: center;
user-select: none;
-webkit-user-select: none;
border-bottom: 1px solid #e9e9e9;
.@{prefixCalendarClass}-year-select,
.@{prefixCalendarClass}-month-select {
padding: 0px 2px;
font-weight: bold;
display: inline-block;
color: #666;
line-height: 34px;
&:hover {
color: #23c0fa;
}
}
> a {
color: #999;
font-family: Arial,"Hiragino Sans GB","Microsoft Yahei","Microsoft Sans Serif","WenQuanYi Micro Hei",sans-serif;
padding: 0 5px;
font-size: 16px;
display: inline-block;
line-height: 34px;
}
.@{prefixCalendarClass}-month-select-arrow {
display: none;
}
}
&-prev-month-btn,
&-next-month-btn,
&-prev-year-btn,
&-next-year-btn {
position: absolute;
top: 0;
}
&-prev-year-btn {
left: 7px;
}
&-next-year-btn {
right: 7px;
}
&-prev-month-btn {
left: 29px;
}
&-next-month-btn {
right: 29px;
.calendarPanelHeader(@prefixCalendarClass);
}
&-calendar-body {
@ -117,7 +132,7 @@
}
&-cell {
padding: 1px 0;
padding: 3px 0;
}
&-date {
@ -125,11 +140,11 @@
margin: 0 auto;
color: #666;
border-radius: 4px 4px;
width: 26px;
height: 26px;
width: 20px;
height: 20px;
line-height: 20px;
padding: 0;
background: transparent;
line-height: 26px;
text-align: center;
&:hover {
@ -193,7 +208,7 @@
.@{prefixCalendarClass}-clear-btn {
display: inline-block;
text-align: center;
margin-left: 8px;
margin-left: 10px;
&:hover {
cursor: pointer;

45
style/components/datepicker/DecadePanel.less

@ -14,46 +14,7 @@
}
.@{prefixCalendarClass}-decade-panel-header {
padding: 0 10px;
height: 34px;
line-height: 34px;
position: relative;
text-align: center;
user-select: none;
-webkit-user-select: none;
border-bottom: 1px solid #e9e9e9;
> a {
font-weight: bold;
display: inline-block;
padding: 1px 5px;
text-align: center;
width: 30px;
&:hover {
cursor: pointer;
color: #23c0fa;
}
}
}
.@{prefixCalendarClass}-decade-panel-prev-century-btn, .@{prefixCalendarClass}-decade-panel-next-century-btn {
position: absolute;
top: 0;
}
.@{prefixCalendarClass}-decade-panel-prev-century-btn {
user-select: none;
left: 0;
}
.@{prefixCalendarClass}-decade-panel-next-century-btn {
user-select: none;
right: 0;
}
.@{prefixCalendarClass}-decade-panel-body {
padding: 9px 10px 10px;
.calendarPanelHeader(~"@{prefixCalendarClass}-decade-panel");
}
.@{prefixCalendarClass}-decade-panel-table {
@ -100,8 +61,8 @@
-webkit-user-select: none;
}
.@{prefixCalendarClass}-decade-panel-decade:before {
content: "\e651";
font-family: "iconfont" !important;
content: "\e611";
font-family: "anticon" !important;
}
}

62
style/components/datepicker/MonthPanel.less

@ -14,60 +14,13 @@
}
.@{prefixCalendarClass}-month-panel-header {
padding: 0 10px;
height: 34px;
line-height: 30px;
position: relative;
text-align: center;
user-select: none;
-webkit-user-select: none;
border-bottom: 1px solid #e9e9e9;
> a {
font-weight: bold;
display: inline-block;
padding: 0 5px;
text-align: center;
width: 30px;
&:hover {
cursor: pointer;
color: #23c0fa;
}
}
}
.@{prefixCalendarClass}-month-panel-prev-year-btn, .@{prefixCalendarClass}-month-panel-next-year-btn {
position: absolute;
top: 0;
}
.@{prefixCalendarClass}-month-panel-prev-year-btn {
user-select: none;
left: 0;
}
.@{prefixCalendarClass}-month-panel .@{prefixCalendarClass}-month-panel-year-select {
width: 180px;
}
.@{prefixCalendarClass}-month-panel-year-select-arrow {
display: none;
}
.@{prefixCalendarClass}-month-panel-next-year-btn {
user-select: none;
right: 0;
}
.@{prefixCalendarClass}-month-panel-body {
padding: 9px 10px 10px;
.calendarPanelHeader(~"@{prefixCalendarClass}-month-panel");
}
.@{prefixCalendarClass}-month-panel-table {
table-layout: fixed;
width: 100%;
height:255px;
height: 248px;
border-collapse: separate;
}
@ -76,16 +29,15 @@
}
.@{prefixCalendarClass}-month-panel-month {
display: block;
width: 46px;
display: inline-block;
margin: 0 auto;
color: #666;
border-radius: 4px 4px;
height: 36px;
padding: 0;
background: transparent;
line-height: 36px;
text-align: center;
height: 24px;
line-height: 24px;
padding: 0px 6px;
border-radius: 4px;
&:hover {
background: #ebfaff;

47
style/components/datepicker/Picker.less

@ -1,4 +1,5 @@
.@{prefixCalendarClass}-picker .@{prefixCalendarClass}, .@{prefixCalendarClass}-picker-container .@{prefixCalendarClass} {
.@{prefixCalendarClass}-picker .@{prefixCalendarClass},
.@{prefixCalendarClass}-picker-container .@{prefixCalendarClass} {
position: absolute;
display: none;
left: -9999px;
@ -9,47 +10,13 @@
.@{prefixCalendarClass}-picker {
position: relative;
display: inline-block;
&-open .@{prefixCalendarClass}, &-container-open .@{prefixCalendarClass} {
display: block;
}
}
.@{prefixCalendarClass}-picker {
&-input {
box-sizing: border-box;
cursor: pointer;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
height: 32px;
width: 100%;
position: relative;
display: inline-block;
margin: 0 0;
padding: 7px 10px;
border-radius: 6px 6px;
border: 1px solid #d9d9d9;
background-color: #ffffff;
color: #666;
line-height: 1.5;
transform: border 0.3s cubic-bezier(0.35, 0, 0.25, 1), background 0.3s cubic-bezier(0.35, 0, 0.25, 1), box-shadow 0.3s cubic-bezier(0.35, 0, 0.25, 1);
font-family: inherit;
vertical-align: baseline;
&:focus {
border-color: #23c0fa;
box-shadow: 0 0 3px #23c0fa;
}
&:hover {
border-color: #23c0fa;
}
.ant-input;
}
&-icon {
position: absolute;
-webkit-user-select: none;
user-select: none;
&:after {
position: relative;
left: -22px;
@ -61,4 +28,12 @@
margin-right: -20px;
}
}
&-open .@{prefixCalendarClass},
&-container-open .@{prefixCalendarClass} {
display: block;
}
&-open &-input {
border-color: #23c0fa;
box-shadow: 0 0 3px #23c0fa;
}
}

2
style/components/datepicker/TimePanel.less

@ -21,7 +21,7 @@
}
.@{prefixCalendarClass}-time-panel-body {
padding: 9px 10px 10px;
padding: 2px 10px;
}
.@{prefixCalendarClass}-time-panel-title {

66
style/components/datepicker/YearPanel.less

@ -14,60 +14,13 @@
}
.@{prefixCalendarClass}-year-panel-header {
padding: 0 10px;
height: 34px;
line-height: 30px;
position: relative;