alterebro / css-tooltip

💬 Only CSS lightweight, minimal and simple tooltips. No dependencies, no javascript, no rubbish, just around ~500 Bytes gzipped
https://alterebro.github.io/css-tooltip/
45 stars 4 forks source link

Hide tooltip after button click #3

Closed KhaVNguyen closed 4 years ago

KhaVNguyen commented 4 years ago

Love this library. Wondering if there's a way to hide the tooltip automatically after a button has been pressed? Seems like the tooltip remains and only hides after I click elsewhere

KhaVNguyen commented 4 years ago

Got it! Just have to add this somewhere in your css:

[data-tooltip]:focus:before,
[data-tooltip]:focus:after,
[data-tooltip]:active:before,
[data-tooltip]:active:after {
  opacity: 0 !important;
}