3 ms·
For those wondering, the main trick is here: https://github.com/chinchang/hint.css/blob/master/hint.css#L65 https://github.com/chinchang/hint.css/blob/master/hi
by sylvinus 11y ago
For those wondering, the main trick is here:
https://github.com/chinchang/hint.css/blob/master/hint.css#L65 https://github.com/chinchang/hint.css/blob/master/hint.css#L...
This creates a pseudo ":after" element with content set to the value of the data-hint attribute. Smart!
https://developer.mozilla.org/en-US/docs/Web/CSS/attr https://developer.mozilla.org/en-US/docs/Web/CSS/attr
- aidos 11y agoThat's amazingly useful. I'd never seen that before. It says that support other than with 'content' is experimental. Where else does it work? Does anyone have any other useful / novel use cases they could share?
- addedlovely 11y agoI believe it's pretty solid: http://caniuse.com/#search=CSS%20Generated%20content%20for%20pseudo-elements http://caniuse.com/#search=CSS%20Generated%20content%20for%2... Also checkout the pseudo counter: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Lists_and_Counters/Using_CSS_counters https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Lists_a...
- ahoy 11y agoVery clever. I didn't know you could reference attributes in css.