Skip to content

Commit

Permalink
Merge pull request #17447 from ant-design/fix-time-picker-style
Browse files Browse the repository at this point in the history
style: 馃拕 optimize TimePicker focus style
  • Loading branch information
afc163 committed Jul 3, 2019
2 parents 1dff6bf + efadb09 commit 859bba5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
31 changes: 17 additions & 14 deletions components/date-picker/style/TimePicker.less
Expand Up @@ -48,7 +48,6 @@
&-select {
position: relative; // Fix chrome weird render bug
float: left;
box-sizing: border-box;
height: 226px;
overflow: hidden;
font-size: @font-size-base;
Expand All @@ -68,7 +67,6 @@
}

ul {
box-sizing: border-box;
width: 100%;
max-height: 206px;
margin: 0;
Expand All @@ -77,30 +75,35 @@
}

li {
box-sizing: content-box;
width: 100%;
height: 24px;
margin: 0;
padding-left: 32px;
line-height: 24px;
text-align: center;
list-style: none;
cursor: pointer;
transition: background 0.3s ease;
transition: all .3s;
user-select: none;
}

li:last-child::after {
display: block;
height: 202px;
content: '';
}
&:last-child::after {
display: block;
height: 202px;
content: '';
}

li:hover {
background: @item-hover-bg;
&:hover {
background: @item-hover-bg;
}

&:focus {
color: @primary-color;
font-weight: 600;
outline: none;
}
}

li&-option-selected {
font-weight: bold;
font-weight: 600;
background: @time-picker-selected-bg;
}

Expand Down
14 changes: 8 additions & 6 deletions components/time-picker/style/index.less
Expand Up @@ -39,7 +39,6 @@

&-wrap {
position: relative;
box-sizing: border-box;
padding: 7px 2px 7px @control-padding-horizontal;
border-bottom: @border-width-base @border-style-base @border-color-split;
}
Expand All @@ -56,7 +55,6 @@
&-select {
position: relative; // Fix chrome weird render bug
float: left;
box-sizing: border-box;
width: @time-picker-panel-column-width;
max-height: @timepicker-item-height * 6;
overflow: hidden;
Expand All @@ -81,15 +79,13 @@
}

ul {
box-sizing: border-box;
width: 100%;
margin: 0;
padding: 0 0 @timepicker-item-height * 5;
list-style: none;
}

li {
box-sizing: content-box;
width: 100%;
height: @timepicker-item-height;
margin: 0;
Expand All @@ -98,16 +94,22 @@
text-align: left;
list-style: none;
cursor: pointer;
transition: background 0.3s;
transition: all 0.3s;
user-select: none;

&:focus {
color: @primary-color;
font-weight: 600;
outline: none;
}
}

li:hover {
background: @item-hover-bg;
}

li&-option-selected {
font-weight: bold;
font-weight: 600;
background: @time-picker-selected-bg;
&:hover {
background: @time-picker-selected-bg;
Expand Down

0 comments on commit 859bba5

Please sign in to comment.