date-picker-np
Version:
Nepali Date Picker for React
141 lines (130 loc) • 3.1 kB
CSS
/* calendar styles */
.date-picker-calendar {
position: absolute;
top: 20%;
border: 1px solid rgb(226, 226, 226);
box-shadow: 0 0 20px rgb(0, 0, 0, 0.1);
border-radius: 4px;
min-width: 220px;
width: 220px;
min-height: 284px;
height: 284px;
background: white;
padding: 4px 8px;
}
.date-picker-calendar-header {
display: flex;
justify-content: space-between;
align-items: center;
margin: 2px 0;
height: 30px;
line-height: 16px;
}
.date-picker-calendar-header-arrow {
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
width: 30px;
height: 30px;
}
.date-picker-calendar-header-arrow.date-picker-calendar-header-arrow-disabled {
opacity: 0.4;
cursor: default;
}
.date-picker-calendar-header-dropdown-text {
border: 1px solid gray;
padding: 4px 10px;
cursor: pointer;
}
.date-picker-selector-container {
position: absolute;
bottom: 0;
left: 0;
z-index: 1;
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
background: white;
padding: 4px 8px 10px;
}
.date-picker-selector-header {
display: flex;
align-items: center;
justify-content: center;
height: 34px;
flex-shrink: 0;
}
/* selector container for month */
.date-picker-selector-block-container {
display: grid;
grid-template-columns: repeat(3, 1fr);
overflow: hidden;
flex: 1;
}
.date-picker-selector-block-container > div {
display: grid;
place-items: center;
cursor: pointer;
}
.date-picker-selector-block-container > div > div {
padding: 10px 10px;
}
.date-picker-selector-block-container
> div
> div.date-picker-selector-block-selected {
color: white;
background: rgb(2, 118, 156);
}
.date-picker-selector-block-container
> div.date-picker-selector-block-disabled {
opacity: 0.4;
cursor: default;
}
.date-picker-selector-block-container
> div:hover:not(.date-picker-selector-block-disabled)
> div:not(.date-picker-selector-block-selected) {
background: rgb(226, 226, 226);
}
/* selector container for year */
.date-picker-year-selector-block-container {
display: grid;
grid-template-columns: repeat(3, 1fr);
overflow: auto;
margin: 4px 0 2px;
}
.date-picker-year-selector-block-container > div {
height: 38px;
line-height: 38px;
text-align: center;
cursor: pointer;
}
.date-picker-year-selector-block-container
> div:not(
.date-picker-selector-block-disabled,
.date-picker-year-selector-block-selected
):hover {
background: rgb(226, 226, 226);
}
.date-picker-year-selector-block-container
> div.date-picker-year-selector-block-selected {
background: rgb(2, 118, 156);
color: white;
}
.date-picker-year-selector-block-container
> div.date-picker-selector-block-disabled {
opacity: 0.4;
cursor: default;
}
/* scrollbar for the year menu */
.date-picker-year-selector-block-container::-webkit-scrollbar {
width: 4px;
}
.date-picker-year-selector-block-container::-webkit-scrollbar-thumb {
background: #888;
border-radius: 4px;
}
.date-picker-year-selector-block-container::-webkit-scrollbar-thumb:hover {
background: #555;
}