UNPKG

noa-jalali-datepicker

Version:

A modern, Persian (Jalali) date picker for React applications. This date picker supports both light and dark themes, providing a sleek and user-friendly interface for selecting dates.

156 lines (134 loc) 2.87 kB
/* width */ ::-webkit-scrollbar { width: 6px; } /* Track */ ::-webkit-scrollbar-track { box-shadow: inset 0 0 5px rgba(234, 70, 70, 0); border-radius: 20px; } /* Handle */ ::-webkit-scrollbar-thumb { background: #989898; border-radius: 20px; } .datepicker-input { border: 1px solid; margin-bottom: 10px; color: inherit; /* Inherit from props */ font-family: inherit; /* Inherit font-family from parent */ transition: background-color 0.3s ease; min-height: 36px; } .datepicker-popup { border: 1px solid; background-color: inherit; /* Inherit from props */ position: absolute; width: 370px; margin-top: 5px; z-index: 9999999 !important; padding: 15px; } .datepicker-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; } .datepicker-header-month, .datepicker-header-year, .datepicker-arrow { padding: 5px 10px; font-weight: bold; cursor: pointer; transition: background-color 0.2s; } .datepicker-arrow { width: 30px; height: 30px; display: flex; justify-content: center; align-items: center; border-radius: 50%; transition: color 0.3s ease, border 0.3s ease; } .datepicker-days, .datepicker-weeks { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; } .datepicker-day, .datepicker-week, .datepicker-month, .datepicker-year { padding: 10px; text-align: center; cursor: pointer; transition: background-color 0.3s, color 0.3s; } .datepicker-week { font-weight: bold; opacity: 70%; font-size: 80%; } .datepicker-day:hover { background-color: #f0f0f0; color: #333; } .datepicker-day.empty { visibility: hidden; } .datepicker-months, .datepicker-years { display: flex; flex-wrap: wrap; gap: 5px; max-height: 20vh; overflow-y: auto; } .datepicker-month.current, .datepicker-year.current { background-color: transparent; } .datepicker-dropdown { position: absolute; background-color: white; border: 1px solid #ddd; border-radius: 6px; z-index: 100; width: 370px; padding: 10px; } .datepicker-months-grid, .datepicker-years-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-height: 290px; overflow-y: scroll; } .datepicker-months-grid { overflow-y: unset !important; } .datepicker-month, .datepicker-year { text-align: center; padding: 10px; border: 1px solid; border-radius: 5px; cursor: pointer; transition: background-color 0.2s; } .datepicker-month:hover, .datepicker-year:hover { background-color: rgba(0, 0, 0, 0.1); } .datepicker-month-button, .datepicker-year-button { cursor: pointer; } .datepicker-month-button:hover, .datepicker-year-button:hover { opacity: 70%; }