Closed chesio closed 6 months ago
First, let me explain why it was made like that.
The reason why I omitted the $dp-font-color
variable is that the color
property inherits the value from the parent by default and thus, it automatically matches the font color of the block containing the input element (and in most cases, same as body's). The reason we have $dp-background-color
is that the background-color
property is transparent by default and doesn't inherit and thus, something has to be set to prevent the picker element from becoming see-through.
And since the dp-button
mixin is the place intended for writing framework-specific code, I considered it safe to use the framework's variables directly in there.
Next, I see a few things to consider with your code.
$dp-background-color
is for the base background color of the picker element, the name $dp-font-color
implies that it's for changing the base font color of the picker element.
However, the new variable actually changes buttons' color only. Therefore, the name $dp-font-color
is misleading and better to be like $dp-button-font-color
.dp-
prefixed variable is defined, it should be done in the base stylesheet (datepiceker.scss) first, then overridden in the framework variant's.
This means other framework variants' stylesheets also need to be updated so that they use the variable when it's set.And finally, I appreciate your pointing out that there is no way to customize the buttons. Now I realize the problem. However, I make it a policy not to accept requests for patch-like stuff that only treats a single immediate issue without solving its more fundamental problem. For this reason, I'm sorry, but I'd like to turn down this PR, and will add a more general solution in the future version, instead. (Of course, it will be very welcome if you update the code considering the above points, and resubmit a PR.)
Thank you for understanding.
Sorry for replying so late. Thanks for your feedback, I see your points! I'm closing this PR now - if I find some time, I might try to come up with a new PR that considers your points above.
Hi,
I'm using Sass template for Foundation and would like to suggest small improvement.
The
dp-button
mixin directly references value of$body-font-color
variable from Foundation, so there is no way how to change it for datepicker component.My suggestion is to introduce new
$dp-font-color
variable and use it in the mixin:This keeps the template backwards-compatible and handles
$body-font-color
the same way as other Foundation variables like$body-background
are handled.