Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to theme? #102

Open
gaharrington opened this issue Mar 26, 2017 · 4 comments
Open

How to theme? #102

gaharrington opened this issue Mar 26, 2017 · 4 comments

Comments

@gaharrington
Copy link

Is there any documentation for how to color/theme the datetimepickers?

@hexadecy
Copy link

Redefine some background and color and include them in a .css after material-datetimepicker.css

.dtp table.dtp-picker-days tr > td > a.selected {
	background: blue;
}

.dtp table.dtp-picker-days tr > td > a.selected.hilite {
	background: blue;
	color: red;
}

.dtp table.dtp-picker-days tr > td > a.hilite:not(.selected) {
	color: red;
}

.dtp div.dtp-year-btn {
	color: red;
}

.dtp div.dtp-date, .dtp div.dtp-time {
	background: blue;
}

.dtp > .dtp-content > .dtp-date-view > header.dtp-header {
	background: blue;
}

.dtp .dtp-picker-time > a.dtp-select-hour.selected {
	background: blue;
}

.dtp .dtp-actual-meridien a.selected {
	background: red;
}

.dtp .dtp-hand.on {
	background: red;
}

.dtp div.dtp-actual-year {
	color: red;
}

@gaharrington
Copy link
Author

gaharrington commented Mar 26, 2017

I used your approach successfully. Thank you @hexadecy!

I restructured it slightly, for simpler maintenance in my custom .css:

.dtp table.dtp-picker-days tr > td > a.selected,
.dtp table.dtp-picker-days tr > td > a.selected.hilite,
.dtp div.dtp-date, .dtp div.dtp-time,
.dtp > .dtp-content > .dtp-date-view > header.dtp-header,
.dtp .dtp-picker-time > a.dtp-select-hour.selected {
    background: #5A2B83;
}

.dtp table.dtp-picker-days tr > td > a.selected.hilite,
.dtp table.dtp-picker-days tr > td > a.hilite:not(.selected),
.dtp div.dtp-year-btn,
.dtp div.dtp-actual-year {
    color: #8D5EB6;
}

.dtp .dtp-actual-meridien a.selected,
.dtp .dtp-hand.on {
    background: #8D5EB6;
}

I would like to contribute a solution that is easier to override and documented. Would you accept a pull request for that contribution?

My first thought is to restructure the css usage to include classes:

.dtp-color-primary
.dtp-color-secondary

Would do you think of that approach?

@hexadecy
Copy link

Yes you can submit a PR here
.dtp-primary-color .dtp-accent-color

@hexadecy
Copy link

Since 1.8.1, change color when selecting hours, minutes or seconds.

.dtp table.dtp-picker-days tr > td > a.selected,
.dtp table.dtp-picker-days tr > td > a.selected.hilite,
.dtp div.dtp-date, .dtp div.dtp-time, .dtp .dtp-hand.on,
.dtp .dtp-actual-meridien a.selected,
.dtp .dtp-picker-time > a.dtp-select-hour.selected {
	background: #2abab9;
}

.dtp table.dtp-picker-days tr > td > a.hilite:not(.selected),
.dtp div.dtp-actual-time.p60 span.selected {
	color: #2abab9;
}

.dtp div.dtp-year-btn, .dtp div.dtp-actual-year, .dtp div.dtp-actual-maxtime {
	color: #d0f0f0;
}

.dtp > .dtp-content > .dtp-date-view > header.dtp-header {
	background: #009796;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants