New style for calendar (material design new spec)
parent
20d8834ccb
commit
0e54523fc1
|
@ -5,11 +5,11 @@ $datepicker-primary-color: unquote("rgb(#{$datepicker-primary})") !default;
|
|||
$datepicker-primary-hover-color: unquote("rgba(#{$datepicker-primary}, 0.20)") !default;
|
||||
$datepicker-primary-contrast-color: unquote("rgb(#{$datepicker-primary-contrast})") !default;
|
||||
$datepicker-primary-dark-color: unquote("rgb(#{$datepicker-primary-dark})") !default;
|
||||
$datepicker-dialog-width: 30 * $unit;
|
||||
$datepicker-dialog-width: 33 * $unit;
|
||||
$datepicker-inactive-opacity: .6;
|
||||
$datepicker-weekday-line-height: 2 * $unit;
|
||||
$datepicker-weekday-font-size: $font-size-small;
|
||||
$datepicker-month-font-size: $font-size-big;
|
||||
$datepicker-day-font-size: 5 * $unit;
|
||||
$datepicker-day-line-height: 4 * $unit;
|
||||
$datepicker-year-font-size: 1.8 * $unit;
|
||||
$datepicker-year-font-size: $font-size-small;
|
||||
|
|
|
@ -52,16 +52,12 @@ class CalendarDialog extends React.Component {
|
|||
return (
|
||||
<Dialog active={this.props.active} type="custom" className={style.dialog} actions={this.actions}>
|
||||
<header className={headerClassName}>
|
||||
<span className={style.weekday}>
|
||||
{time.getFullDayOfWeek(this.state.date.getDay())}
|
||||
</span>
|
||||
<div onClick={this.handleSwitchDisplay.bind(this, 'months')}>
|
||||
<span className={style.month}>{time.getShortMonth(this.state.date)}</span>
|
||||
<span className={style.day}>{this.state.date.getDate()}</span>
|
||||
</div>
|
||||
<span className={style.year} onClick={this.handleSwitchDisplay.bind(this, 'years')}>
|
||||
{this.state.date.getFullYear()}
|
||||
</span>
|
||||
<h3 className={style.date} onClick={this.handleSwitchDisplay.bind(this, 'months')}>
|
||||
{time.getShortDayOfWeek(this.state.date.getDay())}, {time.getShortMonth(this.state.date)} {this.state.date.getDate()}
|
||||
</h3>
|
||||
</header>
|
||||
|
||||
<div className={style.wrapper}>
|
||||
|
|
|
@ -6,40 +6,23 @@
|
|||
}
|
||||
|
||||
.header {
|
||||
padding-bottom: $unit;
|
||||
padding: 1.6 * $unit 2 * $unit;
|
||||
color: $datepicker-primary-contrast-color;
|
||||
text-align: center;
|
||||
background-color: $datepicker-primary-color;
|
||||
}
|
||||
|
||||
.weekday {
|
||||
display: block;
|
||||
width: 100%;
|
||||
font-size: $datepicker-weekday-font-size;
|
||||
line-height: $datepicker-weekday-line-height;
|
||||
background-color: $datepicker-primary-dark-color;
|
||||
}
|
||||
|
||||
.month {
|
||||
display: block;
|
||||
padding: $unit;
|
||||
font-size: $datepicker-month-font-size;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.day {
|
||||
display: block;
|
||||
font-size: $datepicker-day-font-size;
|
||||
line-height: $datepicker-day-line-height;
|
||||
cursor: pointer;;
|
||||
}
|
||||
|
||||
.year {
|
||||
display: inline-block;
|
||||
margin-top: $unit;
|
||||
font-size: $datepicker-year-font-size;
|
||||
cursor: pointer;
|
||||
transition: opacity, font-size $animation-duration $animation-curve-default;
|
||||
}
|
||||
|
||||
.date {
|
||||
display: block;
|
||||
font-weight: $font-weight-semi-bold;
|
||||
text-transform: capitalize;
|
||||
transition: opacity $animation-duration $animation-curve-default;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
|
@ -47,9 +30,12 @@
|
|||
}
|
||||
|
||||
.display-years {
|
||||
.day, .month {
|
||||
.date {
|
||||
opacity: $datepicker-inactive-opacity;
|
||||
}
|
||||
.year {
|
||||
font-size: $font-size-normal;
|
||||
}
|
||||
}
|
||||
|
||||
.display-months {
|
||||
|
|
Loading…
Reference in New Issue