You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to use Colorcase but had a couple of features I'll need. I'm happy to implement them but wanted to run them by you before putting in the time.
Translations
Because array keys are used for section and control titles, they can't be safely translated. Currently the structure looks like this:
To ensure backwards compatibilty, I'd look for a label array key and then load the controls appropriately depending on whether or not one exists. There's a small potential for a clash if someone called a section or control "label", but it seems unlikely for it to be lower-case.
I'm open to alternatives, like _label if you want to protect this more. Or we could preserve the array structure and just add a _label control alongside the existing controls, which we pluck out before processing the controls:
This approach may actually be less code to maintain backwards compatibility. Though it may muddy the simplicity of the data structure for new adopters.
Media Queries
I'd like to add support for adding selectors wrapped in a media query, since this is something I need to tackle. I would suggest an implementation like this:
Thinking on this a bit more, there is also a need for one color to match different attributes. For instance, I may have one color that I want to be used for background-color with some selectors and border-color with others.
What about if the selector and attribute arguments could be string or array, like this:
I'd like to use Colorcase but had a couple of features I'll need. I'm happy to implement them but wanted to run them by you before putting in the time.
Translations
Because array keys are used for section and control titles, they can't be safely translated. Currently the structure looks like this:
I'd like to extend it to have a label argument for sections and controls:
To ensure backwards compatibilty, I'd look for a
label
array key and then load the controls appropriately depending on whether or not one exists. There's a small potential for a clash if someone called a section or control "label", but it seems unlikely for it to be lower-case.I'm open to alternatives, like
_label
if you want to protect this more. Or we could preserve the array structure and just add a_label
control alongside the existing controls, which we pluck out before processing the controls:This approach may actually be less code to maintain backwards compatibility. Though it may muddy the simplicity of the data structure for new adopters.
Media Queries
I'd like to add support for adding selectors wrapped in a media query, since this is something I need to tackle. I would suggest an implementation like this:
I can work on this stuff later this week if you think it's something you'd like to merge.
The text was updated successfully, but these errors were encountered: