Theme colour switcher

Blog Topic: HTML

I came across a weird issue while doing an accessibility audit recently. NVDA announces the site logo as "clickable", and the cursor changes to a pointer (the little "hand") when hovering over it with the mouse. I assumed it was a link to the homepage, as is typical for header logos, but clicking it did nothing – on the homepage, at least. On interior pages, clicking the logo takes you to…

Continue reading The importance of using correct semantic HTML

Data attributes on HTML elements can be very handy for targeting certain elements with CSS and/or Javascript. Let's say, for example, we have a site with a menu whose links have a different background colour depending on what category they belong to, cats or dogs. The HTML might look like this: <ul class="menu">  <li class="menu-item">    <a…

Continue reading How to add title as data attribute to menu links in Drupal 8 and Twig