diff --git a/site/public/www.michalspacek.cz/i/css/screen.css b/site/public/www.michalspacek.cz/i/css/screen.css index 11bb11dcb..440ce7055 100644 --- a/site/public/www.michalspacek.cz/i/css/screen.css +++ b/site/public/www.michalspacek.cz/i/css/screen.css @@ -72,7 +72,25 @@ blockquote { q::before { content: "«"; } q::after { content: "»"; } img { border: none; } -abbr.dtstart, abbr.dtend { text-decoration: none; } +abbr.dtstart, abbr.dtend { text-decoration: none !important; } +abbr[data-title] { + position: relative; + text-decoration: underline dotted; +} +abbr[data-title]:hover::after, abbr[data-title]:focus::after { + content: attr(data-title); + position: absolute; + left: 0; + bottom: -2.1em; + width: auto; + white-space: nowrap; + background-color: #DEDEDE; + color: #1E1E1E; + border-radius: 2px; + box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.4); + font-size: small; + padding: 3px 5px; +} code, .highlight pre code { padding: 0.2em 0.1em; margin: 0; diff --git a/site/public/www.michalspacek.cz/i/js/scripts.js b/site/public/www.michalspacek.cz/i/js/scripts.js index 2f34e26fc..128ae624f 100644 --- a/site/public/www.michalspacek.cz/i/js/scripts.js +++ b/site/public/www.michalspacek.cz/i/js/scripts.js @@ -109,4 +109,16 @@ App.ready(document, function () { 'behavior': 'smooth', }); } + + App.on('mouseover', 'abbr', function (event) { + event.target.dataset.title = event.target.title; + event.target.removeAttribute('title'); + }); + App.on('mouseout', 'abbr', function (event) { + event.target.title = event.target.dataset.title; + event.target.blur(); + }); + for (const item of document.querySelectorAll('abbr')) { + item.tabIndex = 0; + } });