chinchang / hint.css

A CSS only tooltip library for your lovely websites.
https://kushagra.dev/lab/hint/
MIT License
8.42k stars 701 forks source link

Use title attribute if data-hint attribute doesn't exist #86

Closed adam-lynch closed 8 years ago

chinchang commented 9 years ago

+1 @adam-lynch Seems like to good idea. We just need some way to switch this feature on/off. Thinking loud...SASS variable (custom build) or may be just a line commented in the CSS to turn it on?

adam-lynch commented 9 years ago

I don't see why you'd ever want it turned off.

If you're using it as you are now, then it'll take the data-hint value. If you decide to not give a data-hint (I assume it does nothing right now), it'll now look for a title and use it. If a title also doesn't exist, it'll do what it does now when data-hint is missing; nothing (same assumption again).

So, disabling it would only make sense for people using this currently without data-hint which isn't a use case / doesn't make any sense. Right?

dbkaplun commented 8 years ago

+1

sasindumendis commented 8 years ago

+1

Came here to ask for this. Glad someone already filed the issue. :smile:

My main concern was, having the support for title attribute will let us just add the CSS file to existing projects without updating the markup.

chinchang commented 8 years ago

Was looking into this issue. Some thoughts:

davidspiess commented 8 years ago

Wouldn't a title attribute be better for accessibility too?

chinchang commented 8 years ago

In support of accessibility, Hint.css now works with aria-label attribute too. As for supporting the title attribute, conflict with the native tooltip is an issue which cannot be prevented. Closing this issue.