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

Remove "bg-light" css class from the datepicker component #3244

Closed
casoetan opened this issue Jun 20, 2019 · 6 comments · Fixed by #3248
Closed

Remove "bg-light" css class from the datepicker component #3244

casoetan opened this issue Jun 20, 2019 · 6 comments · Fixed by #3248

Comments

@casoetan
Copy link

casoetan commented Jun 20, 2019

Versions of Angular, ng-bootstrap and Bootstrap:

Angular: 7.2.2

ng-bootstrap: 4.1.0

Bootstrap: 4.2.1

I think hard coding bg-light into the datepicker makes it difficult to customize it's theme, especially a dark theme.
Most often I've had to override every css class attached to the datepicker, adding !important which doesn't feel right.
Can we remove the bg-light class and let this be handled by the dropdown-menu class, allowing the user to override that.

@benouat
Copy link
Member

benouat commented Jun 21, 2019

Hey @casoetan ! Thanks to report this evolution.

We could for sure, and we will have to, remove the usage of this .bg-light Bootstrap class.
Nonetheless we just can't rely on .dropdown-menu. Our datepicker can also be opened inline, as a simple calendar, and thus won't be wrapped by a dropdown!

I think we just need to move all these values to our .ngb-datepicker classes (and children classes also)

@IAfanasov
Copy link
Contributor

@casoetan I suppose it would be really nice to have a project source code where you try to apply a dark theme. we could use it to test a solution and probably as a starting point to enhance the documentation with styling guidelines

IAfanasov added a commit to IAfanasov/ng-bootstrap that referenced this issue Jun 22, 2019
- sets background color in ngb-dp-* classes instead of using .bg-light

closes ng-bootstrap#3244
@AAiff
Copy link

AAiff commented Jun 24, 2019

For now I created a class to override the bg-light without having to target each instance it's used:

ngb-datepicker .bg-light {
background-color:inherit!important
}

Then gave the ngb-datepicker itself a background-color property.

@IAfanasov
Copy link
Contributor

thank you @AAiff ! Looks like pr created for this issue will fix this problem

@casoetan
Copy link
Author

The PR does fix this problem

@AAiff
Copy link

AAiff commented Jun 25, 2019 via email

benouat pushed a commit that referenced this issue Jul 16, 2019
Sets background color in ngb-dp-* classes instead of using .bg-light

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

Successfully merging a pull request may close this issue.

4 participants