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

Enhancement: Support for adding jquery type style operation #35

Open
toshsan opened this issue Nov 24, 2022 · 3 comments
Open

Enhancement: Support for adding jquery type style operation #35

toshsan opened this issue Nov 24, 2022 · 3 comments

Comments

@toshsan
Copy link

toshsan commented Nov 24, 2022

$("table").class("table", false) or style?

@argyleink
Copy link
Owner

is your example looking to toggle the .table class?

i imagine this feature request based on the title to be closer to like $('table').css({background: red, color: white})?

@toshsan
Copy link
Author

toshsan commented Nov 28, 2022

Both will be nice, $(selector).class(name, toggle=true) and $(selector).css({object})

@argyleink
Copy link
Owner

personally i use classList for toggling classes, but it does mean you need to have a node reference and not a list reference:

$('table')[0].classList.toggle('table', condition)

But agree it would be easier if it could be done on the whole collection without a loop 👍🏻

Same for styles, would be nice to be able to specify an object and have it apply nice and easy. At this point tho, maybe jQuery is better than this micro lib? Good call on putting these features on the radar tho!

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