-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add class attribute as a supported attribute. #23
Comments
Hi @LuisAverhoff thanks for your suggestion 👍 Do you have a specific use-case in mind where you can't work around it by using, for example, the index of the buttons? |
@jcsmorais Like for example if I was using a css framework like bootstrap, how would I pass in their css button class since I dont have direct access to the html button element? You mentioned the index of the button. I'm assuming you are talking about fetching all buttons with the I think adding the class attribute as a supported attribute is a much better solution seeing that everyone using this plugin will more than likely want to customize the shortcut buttons and having a quick way to pass the class in versus doing a |
Yes, I was suggesting something like the following: .shortcut-buttons-flatpickr-button[data-index="0"] {
background-color: blue;
} But I see what you're saying and it does make sense 🙂 |
Closing as this request has been fulfilled by #31 |
@jcsmorais I tried: Would be great if multiple classes are allowed, probably typed as array which almost works, for example this change works for me, but I don't know how to submit PR.
|
Why not add your class array by using something like this:
I don't think this plugin should handle the format in which your classes are provided. Or am I missing something? |
It does not work.. Problem is there is probably no way to provide more than one class with current code. |
Ah, okay. Quirky classList-add method there. I can add your functionality later today through a PR. But if you can run this plugin code (including the test suite) on your local machine, you could try to make your own PR. It's not that difficult and you already got there most of the way :) It's actually a very good first issue PR and on Google are many resources to teach you how to do it. |
I checked how to make a PR, I would be able to do that, but have no idea how to run tests. Would be glad if you can do it, and possibly make a version after it is merged so it can be used with npm|yarn. |
Hi @hracik you can run the tests by running the following commands:
Your suggestion above looks good 👍 |
Thanks, I tried, but failed. I am not familiar with TypeScript, this line in index.ts is a problem:
It does not work.. Type 'string | string[]' is not an array type or a string type. Also it would allow other attributes, different from |
I managed to create simpler pull request, which does not work with array but with string only.. maybe it is this way even better. |
@jcsmorais |
Currently only the
aria-label
andaccess-key
attribute are supported. You should probably addclass
as a supported attribute so that users of this plugin can add a custom class to the shortcut buttons.The text was updated successfully, but these errors were encountered: