Hidde's blog Posts about HTML, CSS, JavaScript, accessibility and browsers from the perspective of a curious front-end developer. 2024-12-29T00:00:00Z https://hidde.blog Hidde de Vries [email protected] Styleguides for better front-ends 2013-11-18T00:00:00Z https://hidde.blog/styleguides-for-better-front-ends/ <p>I just read Anna Debenham’s <a href="http://www.fivesimplesteps.com/products/front-end-style-guides">pocket guide to front-end styleguides</a>. With only 69 pages, it is a concise guide to what (front-end) style guides are and how to use them.</p> <p>It explains what style guides are (used) for, goes into different kinds of style guides used specifically on the web, describes what elements a web style guide can consist of, considers some of the main benefits of style guides on the web, gives some examples of good web style guides and finally looks into what the future for style guides might be.</p> <p>Anna describes many different types of style guides for the web, such as style tiles, pattern portfolio’s and <a href="http://adactio.com/journal/5028/">pattern primers</a>. The main idea with all of those is that they come into being <em>before</em> page lay-out. They describe visual styles of page components, from which full pages can be construed later on in the design process.</p> <p><img src="https://hidde.blog/_images/screen-shot-2013-11-18-at-21.35.04-.png" alt="Book cover" /> <em>The cover of Anna’s Pocket Guide</em> </p> <h2>Style guides for better front-ends</h2> <p>Style guides can be very helpful for those pursuing to build better front-ends (and who isn’t?).</p> <ul> <li>You don’t know which HTML the CMS or future versions of the CMS will spit out, and even if you do, the designer might not have styled them. If you include all generally used HTML in your style guide, you can make sure all of those are properly styled and tested across different platforms and devices.</li> <li>Creating a front-end style guide will help find inconsistencies between components’ designs, and therefore help avoid inconsistencies in the underlying CSS.</li> <li>Making a front-end style guide helps thinking even more component-like, which according <a href="http://bradfrostweb.com/blog/post/scope-components-not-pages/">to</a> <a href="http://vimeopro.com/fronteers/13/video/77905683">some</a> is good. Components are not tied to a specific space in a page layout. That is helpful as much of today’s web design is for multiple screens.</li> <li>The style guide can be used to show all involved in the project what kinds of content (can) exist in their website.</li> </ul> <p>I have used simple style guide and pattern primers in projects before, and plan to do even more so after reading Anna’s short book.</p> <p>,</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/styleguides-for-better-front-ends/">Styleguides for better front-ends</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Styleguides for better front-ends">Reply via email</a></p> World Usability Day in Bristol 2013-11-19T00:00:00Z https://hidde.blog/world-usability-day-in-bristol/ <p class="intro">Last week, the World Usability Day Bristol was hosted in MShed, a building that is home to Bristol’s city museum with the same name. </p> <p><img alt="The view from MShed" height="2448" src="https://hidde.blog/_images/img2415-.jpg" title="The view from MShed" width="3264" /> <em>The view from MShed</em></p> <p>World Usability Day 2013 happened in lots of cities all over the world. This local edition was organised by Nomensa, a digital agency based in Bristol. The conference featured speakers discussing a variety of subjects, including interaction design, accessibility, dark patterns and the possible future of the web. It was well organised: the venue had a great view of Bristol, lunch, scones and tea were all taken care of and all of tickets were very affordable.</p> <p>My focus here will be on three talks that I particularly liked, about practical abstraction, the <span class="caps">BBC</span>’s super accessible olympics website, creating cross channel user experiences.</p> <h2>Dan Klyn: practical abstraction</h2> <p>In his talk, Dan Klyn focused on architecture, rather than design or usability. He tried to connect ancient Roman architecture principles to modern information architecture principles. </p> <p>In Roman architecture the triad of <em>firmitatis</em>, <em>utilitatis</em> and <em>venustatis</em> were considered the main principles of architecture. Roughly translated, they correspond to strength (or firmness), commodity (or utility) and beauty, respectively. </p> <blockquote> <p>In Roman architecture the triad of <em>firmitatis</em>, <em>utilitatis</em> and <em>venustatis</em> were considered the main principles of architecture.</p> </blockquote> <p>Different architects in history can be said to adhere to different equations of those three principles. Buildings that were designed by the American architect Frank Lloyd Wright often had leaking roofs, they lacked <em>firmitatis</em>, but they were both useful and beautiful. A software example: Apple’s first release of Apple Maps for iOS tended to show people plainly wrong directions, but its use could easily be seen and it looked beautiful.</p> <p>There are also examples of two properties giving rise to a third. The architect Johnson was famous for designing buildings that were strong and beautiful buildings, and therefore functional. One could say their utility <em>derived</em> from those former two properties. The German architect Gropius, the founder of Bauhaus, designed buildings that were strong as well as useful, and therefore beautiful. One could say its beauty <em>derived</em> from those former two properties. An example of this from software design is Craiglist: its beauty is in the combination of its strength and utility. Rather than having one property derive from the combination of the others, one could also ‘add’ one of the properties to a combination of the others. Gumtree is an example of this: it is strong and useful, and a visual design layer has been added to that, as a third property.</p> <p>Other principles from architecture that we might want to apply to web design: order, arrangement, proportion, symmetry, appropriateness and budget-friendliness.</p> <h2>Alistair Duggin: the <span class="caps">BBC</span>’s accessible olympics website</h2> <p>Accessibility was a high priority in building <span class="caps">BBC</span>’s <a href="http://www.bbc.co.uk/sport/0/olympics/2012/">website for the London 2012 olympics</a>. Front-end developer Alistair Duggin shared some of his experiences working on this huge website.</p> <p>The <span class="caps">BBC</span> aimed to deliver content about the Olympics to as many channels as possible, such as tv, radio and internet. On the internet, the <span class="caps">BBC</span> aims for a high degree of accessibility. “The <span class="caps">BBC</span> is paid for by everyone and therefore must be accessible to everyone, otherwise the <span class="caps">BBC</span> is not the <span class="caps">BBC</span>.”, said Michael Grade, Director General <span class="caps">BBC</span> 2004-6.</p> <blockquote> <p>The <span class="caps">BBC</span> is paid for by everyone and therefore must be accessible to everyone, otherwise the <span class="caps">BBC</span> is not the <span class="caps">BBC</span>.</p> </blockquote> <p>The website was built around a sports ontology: athletes connected to countries and events, events connected to a ventue and sport. All of these ontology items had their own pages, so there were pages for all of the 10000 athletes, 205 countries, 36 sports, 304 medal winning events and 30 venues, and they were all interconnected.</p> <p>Making something accessible is not as easy as it sounds. An extra complication was that all the templates had to be right when the site was put in use, which was when the Olympics started. During the Olympics itself, there was a code freeze (except for very urgent bug fixes). </p> <p>The website was a great succes: it was viewed by 37 million UK browsers (57 globally). Many have viewed it on mobile (9.2 million mobile browsers, 12 million requests for video from mobile devices, 34% of all daily browsing by mobile).</p> <p>These things helped making the <span class="caps">BBC</span>’s London 2012 site more accessible:</p> <ul> <li>usage of a front-end style guide, to keep code consistent (more consistency is better for users)</li> <li>front-end was built component-based; a component could generally drop in most parts of most pages</li> <li>progressive enhancement was used: pages were built in ‘layers’, so that the basic content was accessible to anyone</li> <li>content was added in logical order, alt text added to images that needed it, tables had captions, abbreviations had their full text in the code</li> <li>in the HTML the team used: the HTML5 doctype, lang-attribute, skip-links, a unique <code>&lt;title&gt;</code> and <code>&lt;h1&gt;</code> and <span class="caps">WAI</span>-<span class="caps">ARIA</span> landmark roles, hierarchical heading structure, no duplicate links, alt text if they would not duplicate, links that were sensible outside their context, correctly coded forms and tables</li> <li>in <span class="caps">CSS</span>, the team was careful not to implement barriers with <span class="caps">CSS</span>; display:none was only used when strictly needed, focus-styles were defined, outline:0 and !important were avoided, colour contrast was checked and the lay-outs were checked without JS and images</li> <li>*in JavaScript, the team used feature detection, generated only valid <span class="caps">HTML</span>, updated state labels such as ‘open’ and ‘close’ appropriately, made all content accessible via keyboard and took care not to add keyboard traps</li> <li><span class="caps">WAI</span>-<span class="caps">ARIA</span> was used as an enhancement for those users with devices that support it, for example to keep users informed, manage focus, implement keyboard controls and provide hidden instructions</li> </ul> <h2>Andrea Resmini: cross channel experiences</h2> <p>Andrea Resmini talked about how websites have gotten more deeply integrated in our world, and <em>cross channel services</em>.</p> <p>The difference between multi channel services and cross channel services is that the former serves A, serves B and serves C, whilst the latter includes A, B and C.</p> <p>Computing used to be bound to a very specific time and place, e.g. a computer would not follow you. Today, cyberspace is very deeply integrated into the world around us. It has become much like a layer.</p> <p>In a city we are said to ‘know’, we have a mental map of that city. In the first few days in a new city, we are able to create such a mental map. Now with digital products, this is not much different. A digital product like Facebook is much like a city that we have a mental map of. Their app on our phone is part of this, and so are the friends we know to be online in its chat service.</p> <blockquote> <p>The architecture of information spaces comes down to the information architecture of places.</p> </blockquote> <p>We ‘know’ a place, because we know specific characteristics of it. Those characteristics make up our memory of the place. If we want to create a cross channel experience that is easy to navigate, we should concentrate on creating characteristics. The architecture of information spaces comes down to the information architecture of places.</p> <p>Recommended reading: <a href="http://manovich.net/LNM/index.html">Manovich, The language of new media</a></p> <hr/> <p>Originally posted as <a href="https://hidde.blog/world-usability-day-in-bristol/">World Usability Day in Bristol</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20World Usability Day in Bristol">Reply via email</a></p> Mark Boulton's grid system design workshop 2013-11-27T00:00:00Z https://hidde.blog/mark-boultons-grid-system-design-workshop/ <p class="intro">On November 27th, I attended Mark Boulton’s workshop about designing grid systems. It took place in Cardiff, UK, on the day before Handheld conference.</p> <p>In the first half of the workshop, Mark taught us the basics of grid design theory. In the second half, we were put to work and made our own grid-based design.</p> <p>Mark emphasised that the design of (the grid of) a website should be a system. He said humans are pattern-recognisable machines, that humans recognise order. Grid systems can help create such order. Hence the workshop name: it was about grid <em>systems</em>.</p> <p>First of, Mark went through some history of grid design and type design in general. Grids have existed long before the web. Very long ago, the decorative type in books had already some kind of system, but things really started with the Swiss graphic design in the 1960s.</p> <blockquote> <p>Odd columns can create tension and balance.</p> </blockquote> <p>Grid systems, Mark said, are most obvious in long form editorials, such as newspapers or magazines. In those places they make the content easier to read. In a lot of print work, odd columns prevail. Print designers do this to create tension and balance. It can ‘unsettle the eye’. In web design, even columns are often used.</p> <p>One grid does not fit all, in contrary. If a grid doesn’t work for your content then you need to change the grid, that’s ok. Creating a good grid takes a lot playing around with the content you have available. This is why Mark feels grid frameworks that you have just downloaded from the web (like Bootstrap or the older 960 grid solutins) often don’t work.</p> <h2>Types of grids</h2> <p>Mark explained different types of grids: columnar, hierarchical, modular, baseline and compound grids.</p> <ul> <li><strong>columnar</strong> grids can be subdivided into regular and irregular grids. UX designers use the term ‘swim lanes’ for groups of grid columns that form one big column. There can be different ratios in between the columns</li> <li><strong>modular</strong> grids are hard to do on the web as height in browsers and devices is difficult to work with (and perhaps not desirable)</li> <li><strong>baseline</strong> grids are most often used to prevent ghosting (the effect that happens in books if the text on the page behind the page you’re reading does not have the same baseline). On the web, there is no ghosting, and using a baseline grid can start to dictate undesirable line-heights. See Mark’s <a href="http://www.markboulton.co.uk/journal/incremental-leading">“Incremental Leading“</a> about this.</li> </ul> <blockquote> <p>Avoid too many columns, it makes the grid less powerful.</p> </blockquote> <p>The main point of grids is that it can make different pages that use it feel like ‘one system’. The more columns a grid has, the less power it has to come across as one system. Mark recommended to avoid too many columns.</p> <h2>Terminology</h2> <p>Mark also explained some of the basic terminoloy in grid design. A grid designer needs to know what margins, gutters, modules (or ‘units’), columns, hanging lines, offsetting and fields are.</p> <h3>On hanging lines</h3> <p>Good typesetting, Mark mentioned, is like good conversations, or if you like, a good talk. A good talk makes use of pauses, inflections, etc. Something like a pause in a talk is very fragile, it is hard to say when it is ‘just right’. Hanging lines can make typography better like pauses can make talks better, Mark argued.</p> <h3>On gutters</h3> <p>If your gutter is small, you can add a line to it. Newspapers sometimes do this. On the web, if you put a 1px line in your gutter, it can be useful to have a gutter with an odd width (so that the line plus surrounding whitespace are an even number). Sometimes gutters are defined by the padding within the module. Mark mentioned that this approach can require more mark-up, I have not yet done the comparison myself.</p> <h3>On <span class="caps">DNA</span> of grids</h3> <p>For years, web designers and web developers have come up with solutions to create grids on the web, a famous one being <a href="http://960.gs/">960</a>. According to Mark, grid systems like 960 are too limiting. Also, they have their own “DNA”. If many sites use the grid system, all of those sites end up having the same <span class="caps">DNA</span>. That threatens original web design.</p> <h2>Designing a grid system</h2> <p>In a lot of graphic design, the design is tied to the page size, Mark called this ‘knowable space’. On the web, there are no book-like pages and thus no page size, no dimensions that you can be sure of. Yes, grid systems for the web are hard.</p> <blockquote> <p>We should design content out, not canvas in.</p> </blockquote> <p>For that reason, Mark argues we should design content out, not canvas in. See also his <a href="http://www.markboulton.co.uk/journal/a-richer-canvas">“A Richer Canvas”</a> article from 2011. This means you use your content to derive a canvas from, rather than start with a canvas and lay-out your content on it. </p> <p>During the workshop, Mark explained three steps to designing content out:</p> <ol> <li>Find the knowable, fixed content sizes</li> <li>If there aren’t any, make some up</li> <li>Use them to design your grid</li> </ol> <p>Grids are a system, as Mark said in the beginning. He mentioned three ways to ensure this basic principle:</p> <ul> <li>Relate <strong>everything</strong> back to the module</li> <li>Use repeated ratios</li> <li>Bind the content to the grid</li> </ul> <h2>Putting it into practice</h2> <p>The second part of the workshop day, we were put to work. We were given the choice between four projects, or could work on our own side project. The goal was to create a grid system. Mark gave us individual feedback and reviewed some of the projects in front of the class. This was of great help to those who had worked on them, but not much less for the rest of the group.</p> <p>Mark Boulton’s workshop was very useful, and had a perfect mix of theory and practice.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/mark-boultons-grid-system-design-workshop/">Mark Boulton's grid system design workshop</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Mark Boulton's grid system design workshop">Reply via email</a></p> Handheld 2013: the web's structure, expectations and data poetry 2013-11-28T00:00:00Z https://hidde.blog/handheld-2013-the-webs-structure-expectations-and-data-poetry/ <p class="intro">In this post I’m going to go through some highlights of Handheld 2013, which started of with the Welsh anthem being played on an electric guitar. </p> <p><img alt="Handheld logo" src="https://hidde.blog/_images/handheld-.png" title="Handheld logo" /> </p> <h2>The conference</h2> <p>Generally, I much enjoyed Handheld. If I’m right, it was meant for people who make things for handheld devices. This year, it seemed, the speakers were mostly talking about the web. Which is good, and important. I can imagine some people missed talks about app development, but I didn’t.</p> <p>A common theme of this year’s Handheld was communication with clients. These days, to make sure our sites work on a big range of devices, most web designers have started using responsive web design (<span class="caps">RWD</span>) in some way or another. With <span class="caps">RWD</span>, the uncertainty of what a web design is going to look like has become more apparent than ever. It was always the case that websites could not look the same in every browser, but now that we attempt to optimise for more than just a few desktop browsers, we have to come up with ways to explain this to our clients. This is a lot about building trust, confidence and that sort of thing, in addition to crafting great designs.</p> <p>Having just recovered from co-organising <a href="http://fronteers.nl/13">my own conference</a> , I may have had a biased view here, but there were some things I did not like about the practical side of things, including the waiting at registration and the somewhat too visible sponsor involvement.</p> <h2>Some talks I loved</h2> <h3>The long web</h3> <p><strong>Jeremy Keith</strong> talked about the web, a medium which he clearly loves (and who doesn’t?) He loves it for reasons such as its backwards compatible design, allowing for websites to be built in layers of structure, style and functionality. He also loves it for its <span class="caps">URL</span> system, providing a great and multi-purpose way for developers to make content available. </p> <p>The biggest change in working on the web recently must have been the ‘mobile first’ paradigm, or ’content first’. According to Jeremy, you could work <span class="caps">URL</span> first, so that you start thinking about how to address the content before you even think about navigation. A clever way he mentioned to create a website from content is to break it into bits of content, components. Creating a library of components can help a lot. Jeremy created <a href="https://github.com/adactio/Pattern-Primer">Pattern Primer</a> as a handy way to show patterns and their <span class="caps">HTML</span>. And there is of course <a href="http://hiddedevries.nl/en/blog/2013-11-18-styleguides-for-better-front-ends">Anna Debenham’s book on style guides</a>. </p> <p>Content first also works through in code. You could put the content as (one of) the first thing(s) in your code, and the navigation at the very end.</p> <p>Jeremy pleaded for progressive enhancement and rightly so. It almost ‘follows’ from working starting with (structured) content first. Progressive enhancement is often thought of being there for users that ‘have their JavaScript turned of‘. Although it does probably help those people, progressive enhancement has more to it. It helps anticipating those things that you did not expect, like a bug in one of your JavaScript files. It is about dealing with technology failing, rather than it not being supported.</p> <blockquote> <p>Do not outsource your [website’s] performance to a third party.</p> </blockquote> <p>A great example Jeremy mentioned is that of the social sharing button thingies that many sites use these days. The social media sites often offer those as a <code>&lt;script&gt;</code>-element that they ask you to drop in the middle of a page. Now if you imagine a Twitter widget in the middle of a page: if a user in China opens that page, it may stop loading when it gets to the Twitter widget, because Twitter is blocked in China so its script is never found. Your website’s speed is its most important UX feature, Jeremy warned, “do not outsource your performance to a third party.”</p> <h3>How to call your client an idiot without being fired</h3> <p><strong>Andy Clarke</strong>’s talk was about how to communicate about design with clients.</p> <blockquote> <p>We should avoid setting the wrong expectations</p> </blockquote> <p>Old-fashioned ways of wireframing and design comps is that they might cause us to set the wrong expectations. When a client is shown a wireframe that already has some basic lay-out, as wireframes often do, they might expect the visual design to look like that lay-out. If the client is shown static design comps, they may assume that the final website will look exactly like them on any browser or device ever used.</p> <p>What we design, Andy says, is not how we design, but how we communicate our designs. It does not matter which tool you like to create designs, as long as you make sure you set the right expectations.</p> <p>According to Andy, the waterfall method is one of the main causes to problems related to expectations. To be able to set expectations right, we should start working in agile teams. That way, designers, developers and clients work together. In the process, everyone involved will know what is being worked on, and big surprises at the end are avoided. Working together, team members will feel more accountable.</p> <p>To improve the way we design websites, we could improve the way we ask for our client’s feedback. If they work alongside designers and developers, we already avoided ‘the big reveal’. There are some other ways to improve the feedback process. At Andy’s company, they try to make it easier to control the feedback conversation, by insisting on face-to-face feedback, not allowing feedback by phone or email. They also try to control the environment in which the design is presented, by making sure everyone who can decide about it is in the meeting. They also find it important to leave their personality at the door: it is about the integrity of the design, not about that of the person who made it or gives feedback about it.</p> <h3>Data poetry</h3> <p><strong>Brendan Dawes</strong> had a great talk about data. Now data can have two appearances, Brendan showed. There is the ‘raw’ format of just plain csv of <span class="caps">JSON</span> files in a text editor. They look boring and do not invite people to interact with them. They don’t look sexy. But when using data as an input for graphic design, it can come to life. Data represented in a graphical way can show give us new insights. It can help us see connections that we would not have noticed in the csv, although technically they were in there. </p> <blockquote> <p>Data needs poetry</p> </blockquote> <p>In his talk, Brendan showed heaps of examples of cool things he had done with data, including many new ways of representing data that was already there. These examples really nderlined his point that data ultimately comes to life when it is put in a graphical form. “Data needs poetry,” Brendan concluded.</p> <h2>And more…</h2> <p>And there were other talks I did not mention. </p> <p>Syd Lawrence opened up with an entertaining live show, which involved people texting details to a phone number that were later used for playing ‘Guess who?’.</p> <p>Ling Valentine argued that for information-rich web sites like <a href="http://lingscars.com/">her own</a> it makes sense to stay away from responsive web design and use a simple, yet annoying mobile page to get people to your desktop site asap. </p> <p>The prophet of web standards Jeffrey Zeldman gave his ‘ten commandments of web design’, often using his own A List Apart as an example. He loves the web as much as Jeremy does.</p> <p>Mark Boulton explained how as a designer of <span class="caps">RWD</span> projects, you have to worry about content as it is such an integral part of what the design is made of. He illustrated this with stories about some projects he did, like Al Jazeera, <span class="caps">CERN</span>, <span class="caps">UCL</span> and World Skills London.</p> <p>Jon Hicks talked about the pros and cons of icon fonts and showed how to make one. He also briefly discussed some alternatives to using icon fonts, like <span class="caps">SVG</span> sprites.</p> <p>Eddie Machado made the Handheld site and explained how. I found he brought a lot of tools in that, imho, he could have done without (eg Sass for icon fonts), and ‘dirty’ tricks like <code>&lt;/code&gt;</code>-elements inside a <code>&lt;div&gt;</code> instead of a <code>&lt;video&gt;</code> so that he could conditionally load them in a video.</p> <p>There were not only talks at Handheld. There was also <a href="http://brucelawson.co.uk/">Bruce</a> singing web standard classics such as ‘Like a rounded corner’ and a new (?) song callde ‘Living standard’, and <a href="http://aralbalkan.com/">Aral</a> who announced the next phase of his Project Prometheus, now known as <a href="http://indiephone.eu/">Indie</a>. </p> <p>Handheld conference was a great and varied day. There will be no Handheld next year, but the organisers have plans for another event. I’m going to keep an eye on this.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/handheld-2013-the-webs-structure-expectations-and-data-poetry/">Handheld 2013: the web's structure, expectations and data poetry</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Handheld 2013: the web's structure, expectations and data poetry">Reply via email</a></p> Unobtrusive icons 2014-01-07T00:00:00Z https://hidde.blog/unobtrusive-icons/ <p class="intro">In this article, I describe a way to add icons to descriptive links, and one that makes icons by themselves more accessible. </p> <p>Icons are often employed to provide a visual description of an action. In some recent projects, I have treated such descriptive icons as merely enhancements of descriptive text. Because surely, text that describes some action is a basic yet functional substitute for an icon that describes that same action. </p> <h2>Icons preceding descriptive links</h2> <p>For example: an <span class="caps">RSS</span> link. In its most basic form, it would be:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>http://site.com/feed<span class="token punctuation">"</span></span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>icon icon-rss<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>RSS<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span></code></pre> <p>The link with just the word ‘RSS’ is sufficient, it does the job of pointing the user to the <span class="caps">RSS</span> feed. Or the finely tuned searchbot, a browser plug-in that looks for <span class="caps">RSS</span> feeds or even a screenreader. </p> <p>In its enhanced form, it would have a super sharp, retina proof vector icon in front of it. </p> <p>Now, as we already made sure everyone is pointed to the <span class="caps">RSS</span> feed in a basic way, we have already <i>included</i> almost everyone, we can apply the enhancement to only the browsers that understand it. </p> <p>The icon would be a character from an icon font. Let’s add the character with a pseudo element in <span class="caps">CSS</span>: </p> <pre class="language-css"><code class="language-css"><span class="token selector">.icon-rss:before</span> <span class="token punctuation">{</span> <span class="token property">content</span><span class="token punctuation">:</span> <span class="token string">'foo'</span><span class="token punctuation">;</span> <span class="token comment">/* character in your icon font, preferably one from Unicode's private use areas */</span> <span class="token punctuation">}</span></code></pre> <h2>Icons with descriptive fallbacks</h2> <p>Sometimes, a web interface uses an icon by itself, without a label. In this case, it does not come with a useful descriptive text out-of-the-box. Adding it with generated content would exclude users whose browsers don’t understand <code>:before</code> or <code>:after</code>. </p> <p>Support for generated content can be detected by Modernizr. Taking advantage of the class Modernizr adds, we could show or hide descriptive alternatives for generated content. </p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>generatedcontent-alt<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Enlarge text<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">></span></span></code></pre> <pre class="language-css"><code class="language-css"><span class="token selector">.generatedcontent .generatedcontent-alt</span> <span class="token punctuation">{</span> <span class="token property">position</span><span class="token punctuation">:</span> absolute<span class="token punctuation">;</span> <span class="token property">overflow</span><span class="token punctuation">:</span> hidden<span class="token punctuation">;</span> <span class="token property">clip</span><span class="token punctuation">:</span> <span class="token function">rect</span><span class="token punctuation">(</span>0 0 0 0<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token property">height</span><span class="token punctuation">:</span> 1px<span class="token punctuation">;</span> <span class="token property">width</span><span class="token punctuation">:</span> 1px<span class="token punctuation">;</span> <span class="token property">margin</span><span class="token punctuation">:</span> -1px<span class="token punctuation">;</span> <span class="token property">padding</span><span class="token punctuation">:</span> 0<span class="token punctuation">;</span> <span class="token property">border</span><span class="token punctuation">:</span> 0<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>This will <a href="http://snook.ca/archives/html_and_css/hiding-content-for-accessibility">“visually” hide</a> the alternative in the case it is no longer needed, when generated content support has been detected by Modernizr. </p> <p>Another example:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>printversion.html<span class="token punctuation">"</span></span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>icon icon-print<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>generatedcontent-alt<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Print<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span></code></pre> <p>The text ‘Print’ is no longer needed if the print icon is there. If generated content is not supported, the text provides an acceptable alternative.</p> <h2>Text as the most basic alternative</h2> <p>Icons have great advantages, and can help users finding their way around a website. But there will be cases in which the icons don’t work, for example if your web font fails, generated content is not supported or your user only processes text (e.g. Googlebot or a blind user). </p> <p>With text, you can be sure you reach almost all web users. This makes it the ideal alternative, that is always good to have it in place, even if you (visually) hide it from most users.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/unobtrusive-icons/">Unobtrusive icons</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Unobtrusive icons">Reply via email</a></p> Meeting the TAG 2014-01-08T00:00:00Z https://hidde.blog/meeting-the-tag/ <p class="intro">When <a href="http://brucelawson.co.uk/">Bruce Lawson</a> <a href="https://twitter.com/brucel/status/420166987491188736">tweeted</a> about an opportunity to meet the <span class="caps">TAG</span>, I managed, at the last minute, to get a ticket and joined a room full of very smart people discussing some technical aspects of the web medium.</p> <p>Although Bruce and <a href="http://adactio.com/journal/6629/">Jeremy</a> have already written a much better summary of this fascinating evening, I will share my thoughts nonetheless.</p> <h2>The <span class="caps">TAG</span>?</h2> <p>‘TAG’ is an abbreviation of ‘Technical Architecture Group’. They are a special working group within the W3C, overseeing which web standards are developed and thinking about the general direction of the web.</p> <h2>The meeting</h2> <p>The meeting took place in the form of a Q&A session at the Google Campus in London, followed by beers. The atmophere was good, the <span class="caps">TAG</span> members interesting and the audience interested.</p> <h3>Archeology</h3> <p>When I entered the room, sorry I was late, there was a discussion about which design principles the <span class="caps">TAG</span> has. The web and its possibilities have extended tremendously over the past years, and the main concern of the <span class="caps">TAG</span> is making sure that the capabilities of the web ‘platform’ are well documented. Many things a web browser needs to do are not formally described by a spec, but nonetheless, they need doing. Those who put web standards together have to do some sort of ‘archeology’ into what browsers do to find consensus. </p> <h3><span class="caps">DRM</span></h3> <p>Then, someone asked a question about a drm. An <a href="http://www.w3.org/TR/encrypted-media/">extension</a> of <span class="caps">HTML</span>, agreed upon by the W3C, provides <span class="caps">API</span>s ‘to control playback of protected content’. It has been called <a href="http://lists.w3.org/Archives/Public/public-html/2012Feb/0274.html">unethical</a> and bad for the web. In response to the question, the <span class="caps">TAG</span> pointed out that they are merely responsible for technical architecture, not for policy. However, individual <span class="caps">TAG</span> members did respond. Anne van Kesteren said he personally thinks <span class="caps">DRM</span> does not work and is bad for the web. Tim Berners-Lee, after explaining <span class="caps">DRM</span> is already in a lot of things that almost all of us use, pointed out the <span class="caps">DRM</span> issue is not simple and goes much beyond just technical problems. Many little procedures that make the web work and resulted in its popularity have a social aspect as well as a technical aspect. Someone in the audience noted that the technical <span class="caps">DRM</span> discussion ought to be preceded by another, about how, as a society, we want to value content creators. Because surely, we all want to read great books and watch interesting films, and no one would deny the makers of these things to do it for free. I agreed, this discussion has implications beyond tech.</p> <h3>Web Components</h3> <p>In the HTML5 spec, a number of new elements were introduced. Commonly used classnames, like header, footer and section had gotten there own element. When those new HTML5 elements were introduced, they appeared to have been carefully chosen, to make sure the standard remained simple yet effective. With Web Components, it will be possible for developers to use any element they like. Then, asked Jeremy Keith, with some irony, ‘what do we need standards bodies for?’ Now of course it is still good to standardise commonly used elements. Web Components are not meant to create your own <code>&lt;div&gt;</code>-like elements, although you can. They are meant to create the kind of elements that have extra features, like <code>&lt;input type=&quot;range&quot;&gt;</code>. For standard elements, the browser has <span class="caps">API</span>s to ‘do’ those features. If you make them with a web component, you provide the <span class="caps">API</span> yourself, with JavaScript. Then, if some web components become very common, the W3C may decide standardise them, so that they can be used declaratively. In the future, commonly used Components and their JS <span class="caps">API</span>s could be standardised and become part of browsers, just like commonly used classnames were standardised as elements. Now the web is being used more and more as a platform, some developers serve empty <code>&lt;body&gt;</code> elements with a lot of JS. With Web Components, they can serve <code>&lt;body&gt;</code> elements containing meaningful custom elements.</p> <h3><span class="caps">URL</span>s</h3> <p>As the very last question, Andrew Betts brought up an issue that he had with the web product he works on. He felt it was not always possible to represent what was on the page with its <span class="caps">URL</span>. One concern he mentioned is that context is not always taken into account. In his organisation, some teams wanted to have different content in different contexts, and there is nothing in <span class="caps">URL</span>s that can help specify which context is currently used. The assumption of different web contexts have been argued to be <a href="http://www.the-haystack.com/2011/01/07/there-is-no-mobile-web/">wrong</a> , but Andrew’s case was interesting and lead to the <span class="caps">TAG</span>’s final conclusion: ‘we all love <span class="caps">URL</span>s!’</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/meeting-the-tag/">Meeting the TAG</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Meeting the TAG">Reply via email</a></p> Embedded video in responsive lay-outs 2014-02-05T00:00:00Z https://hidde.blog/embedded-video-in-responsive-lay-outs/ <p>Many videos on the web are hosted at third parties and included through an <code>&lt;iframe&gt;</code>. This can be a problem for flexible width sites, as an <code>&lt;iframe&gt;</code> with 100% width will not automatically have a height that respects the aspect ratio of the embedded content.</p> <h2>Forcing an aspect ratio-respecting height</h2> <p>The embedded content will, it its simplest form, be like:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>iframe</span><span class="token punctuation">/></span></span></code></pre> <p>The width of the video can be adjusted to the width of its container or viewport by setting a <code>width: 100%</code> to the <code>&lt;iframe&gt;</code>, Because the width is not set on the video element itself, as it can be with inline <code>&lt;img&gt;</code> or <code>&lt;video&gt;</code> elements, the browser doesn’t know what the height should be, as there can be any number of elements in your <code>&lt;iframe&gt;</code>.</p> <p>Let’s wrap the <code>&lt;iframe&gt;</code> in its own container.</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>embed-holder<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>iframe</span><span class="token punctuation">/></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span></code></pre> <p>The <code>embed-holder</code> will be positioned relatively, so that it flows with the page. Its <code>max-width</code> will be <code>100%</code> and its <code>overflow</code> will be set to <code>hidden</code>. We add a <code>padding-top</code> to the container to reserve some space for the YouTube player.</p> <p>Now comes the trick<sup class="footnote" id="fnrev947036112553666b6ee6be-1"><a href="https://hidde.blog/embedded-video-in-responsive-lay-outs/#fn947036112553666b6ee6be-1">1</a></sup>: the <code>embed-holder</code> will get a <code>padding-bottom</code> of <code>56.25%</code>. Using a percentage for the padding forces a height that is relative to the width of the element. If we want the embed to stick to the aspect ratio of <code>16:9</code>, we need to express that ratio as <code>100:x</code>. We can calculate that by dividing 100 by 16, then multiplying the answer with 9. </p> <p>Let’s for now assume videos in the ratio of 16:9. Using the following <span class="caps">CSS</span>, <code>.embed-holder</code> will have the correct aspect ratio in any container or viewport.</p> <pre class="language-css"><code class="language-css"><span class="token selector">.embed-holder</span> <span class="token punctuation">{</span> <span class="token property">max-width</span><span class="token punctuation">:</span> 100%<span class="token punctuation">;</span> <span class="token property">overflow</span><span class="token punctuation">:</span> hidden<span class="token punctuation">;</span> <span class="token property">padding-top</span><span class="token punctuation">:</span> 30px<span class="token punctuation">;</span> <span class="token property">padding-bottom</span><span class="token punctuation">:</span> 56.25%<span class="token punctuation">;</span> <span class="token comment">/* ensuring 16:9 aspect ratio; use 75% for a 4:3 ratio */</span> <span class="token punctuation">}</span> <span class="token selector">&lt;p>The last step is to fit the video into the container.&lt;/p> ```css .embed-holder iframe</span> <span class="token punctuation">{</span> <span class="token property">position</span><span class="token punctuation">:</span> absolute<span class="token punctuation">;</span> <span class="token property">left</span><span class="token punctuation">:</span> 0<span class="token punctuation">;</span> <span class="token property">top</span><span class="token punctuation">:</span> 0<span class="token punctuation">;</span> <span class="token property">width</span><span class="token punctuation">:</span> 100%<span class="token punctuation">;</span> <span class="token property">height</span><span class="token punctuation">:</span> 100%<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>The <code>.embed-holder</code> acts as the positioning context for the <code>&lt;iframe&gt;</code>. The <code>width</code> and <code>height</code> will be that of <code>.embed-holder</code>, so it will have the correct ratio.</p> <h2>Extra step for WordPress users</h2> <p>If you want to do this in WordPress, one extra step is required. </p> <p>By default, WordPress creates embeds from any <span class="caps">URL</span>s to video services like YouTube and Vimeo. Rightfully, it does not add an extra wrapping element to your code, which is what we need in this particular situation. </p> <p>To do this, simply add a filter<sup class="footnote" id="fnrev947036112553666b6ee6be-2"><a href="https://hidde.blog/embedded-video-in-responsive-lay-outs/#fn947036112553666b6ee6be-2">2</a></sup> to the embedding function in your <code>functions.php</code> :</p> <pre class="language-php"><code class="language-php"><span class="token function">add_filter</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'embed_oembed_html'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'wrap_embedded_els'</span><span class="token punctuation">,</span> <span class="token number">99</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token keyword">function</span> <span class="token function-definition function">wrap_embedded_els</span><span class="token punctuation">(</span><span class="token variable">$html</span><span class="token punctuation">,</span> <span class="token variable">$url</span><span class="token punctuation">,</span> <span class="token variable">$attr</span><span class="token punctuation">,</span> <span class="token variable">$post_id</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token keyword">return</span> <span class="token string single-quoted-string">'&lt;div class="embed-holder">'</span> <span class="token operator">.</span> <span class="token variable">$html</span> <span class="token operator">.</span> <span class="token string single-quoted-string">'&lt;/div>'</span><span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>This wraps the WordPress-generated embeds into a container, to which the above <span class="caps">CSS</span> can be applied.</p> <p>Please note: this wraps all embeds, including some you may not want to apply a different aspect ratio to, such as SoundCloud.</p> <h3 class="notes-title">Notes</h3> <p class="footnote" id="fn947036112553666b6ee6be-1"><sup>1</sup> This is not my own idea, it has been explained by others. <a href="http://alistapart.com/article/creating-intrinsic-ratios-for-video">Original idea</a> by Thierry Koblentz on A List Apart (May 2009)</p> <p class="footnote" id="fn947036112553666b6ee6be-2"><sup>2</sup> Function via <a href="http://cubecolour.co.uk/ductile-responsive-video/">cubecolour</a> , who also made a <a href="http://cubecolour.co.uk/ductile-responsive-video/">WordPress plugin</a> to add both the <span class="caps">CSS</span> and the filter)</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/embedded-video-in-responsive-lay-outs/">Embedded video in responsive lay-outs</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Embedded video in responsive lay-outs">Reply via email</a></p> State of the Browser 2014 2014-04-27T00:00:00Z https://hidde.blog/state-of-the-browser-2014/ <p class="intro">At State of the Browser in London, a one day event in Conway Hall, organised by the London Web Standards team, eight speakers talked about recent developments in the web and web browsers. Topics included Service Workers, performance, responsive images, web ‘apps’ and new <span class="caps">CSS</span> features for responsive web design. </p> <p>These are my notes of the day.</p> <h2>Fernando Campo & Borja Salguero – Firefox OS: not only promises</h2> <p>In their talk, Fernando and Borja of Telefónica’s Firefox OS team discussed what they have been working on and what their priorities are in terms of new features. </p> <p>They said the phone is slow, as they focused first on getting it launched and focus now on making it better. It also has few apps, missing features and is hard to debug, but the team is working hard on making it better, faster and stronger. </p> <h3>Recent improvements</h3> <p>What they’ve been doing in the last half year to improve Firefox OS:</p> <ul> <li>There is an app manager which can be used from Firefox nightly. It helps to check the manifest file amongst other things. There is also a simulator, debugger (which works with either the simulator or a real device if you have one) and profiler (with which you can profile actions).</li> <li>In addition to that, two new measuring tools were launched that can help Firefox OS devs to improve performance: Datazilla and Eideticker (with which you can analyse ‘real’ fps)</li> <li>They have also introduced more <span class="caps">API</span>s.</li> </ul> <h3>Ideas behind Firefox OS</h3> <blockquote> <p>Firefox OS is a project to push the web forward</p> </blockquote> <p>Firefox OS, Borja explained, is really a project to push the web forward. To do this, Mozilla/Telefónica work together with a lot of partners. One improvement they want to achieve is the exchange of information between apps. Their solution for this is “Inter App Communication”, which helps apps ‘talk to each other’. </p> <p>In the newest version, your phone will not be a thing you install apps on, it will be more like a browser. Because that is what Mozilla is good at, making browsers. The OS that doesn’t require you to install apps, completely changes the way we work with devices. </p> <p>More is coming from the makers of Firefox OS, including FirefoxAccounts, your settings in the cloud, and project ‘Loop’ that employs WebRTC to let users call for free. There is also Project ‘Mulet’, which allows developers to do all things related to Firefox OS from the browser. </p> <p>If we want to know more, Borja explained, there is a lot of documentation available on the Mozilla Developer Network, including screencasts. </p> <p>At the end of the year new 25 <span class="caps">USD</span> devices will be introduced, with all the power of the web, aiming to open the web to people that could previously not afford devices with the same acces to the web. </p> <h2>Andreas Bovens – Intro to @viewport & other new Responsive Web Design <span class="caps">CSS</span> features</h2> <p>Andreas discussed some of the lesser known features for responsive web design that are in browsers already, but not used so much yet. </p> <p>First, Andreas showed the various different browsers that Opera currently offers. There are Chromium-based browsers for Android, Opera Mini based on Presto and the experimental UX of Coast for iOS. </p> <p>He then discussed four <span class="caps">CSS</span> features that are ideal in responsive design. </p> <h3>1. @viewports</h3> <p>The web started off fluid, there was hardly any way to do fixed layouts. Then table layouts came in and fixed <span class="caps">CSS</span> widths. Some years later, liquid layout made a comeback, using percentages, max-widths and min-widths. Then, along the lines of the fluid trend, came responsive web design, employing use of media queries and encouring thinking more about different devices. It is now an established way of working. </p> <p>Karl Gernstner introduced the notion of ‘design programme‘, a set of rules for constructing a range of visual solutions. See also: Lupton, <em>Thinking with type</em>; Kerstner, <em>Programme entwerfen</em>. </p> <p>Two technologies make <span class="caps">RWD</span> possible: media queries and the meta viewport tag. Media queries allow developers to apply <span class="caps">CSS</span> rules conditionally, the meta viewport tag allows setting the zoom level (most browsers ‘zoom out’ to display legacy, non-mobile-optimised ). With the meta viewport tag in a page, media queries work as intended. </p> <p>The whole zooming out to the page width thing started in mobile Safari, and they added the meta viewport tag to allow developers to circumvent the zooming. Soon after, it got implemented in most other modern browsers. </p> <h4>Not a standard</h4> <p>A bad thing about the meta viewport tag: it was not a standard, so people started confusing syntax, e.g. adding semicolons instead of commas (eventually both ended up being supported). As there was no standard, edge cases are now handled different by each browser. Some features are not supported everywhere, e.g. <code>user-scalable=no</code>, so you’re never sure whether things will work or not. Android added <code>target-densitydpi</code>, which Opera also added. Internet Explorer implemented <code>device-width</code> as 320px as that was the original iPhone width. Safari zooms in 1.333% in landscape mode, which could be avoid by (their propriety) <code>initial-scale:1</code> rule. Then Apple came up with minimal-ui properties. Anyway, end of rant, Opera decided to write a spec for viewport. </p> <p>To standardise the things the viewport meta element did, Opera wrote <code>@viewport</code> as a <span class="caps">CSS</span> spec. Settings that you can set with the meta element can now be set in <span class="caps">CSS</span>. [Sidenote Yoav Weiss added to his talk: if you use <code>@viewport</code> in <span class="caps">CSS</span>, set it an inline <code>&lt;style&gt;</code> -element, as otherwise it will mess with things, including responsive images].</p> <p>Example:</p> <pre class="language-css"><code class="language-css"><span class="token atrule"><span class="token rule">@viewport</span></span> <span class="token punctuation">{</span> <span class="token property">width</span><span class="token punctuation">:</span> auto<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>In some senses <code>@viewport</code> is better than the original meta tag, and for sure it is better documented as it is a standard. </p> <p>If you want to try it out now, you turn it on in Opera or Chrome flags and you can play with it. Currently, it would be advisable to use both as support for <code>@viewport</code> has hardly landed in browsers. </p> <h3>2. Resolution media queries</h3> <p>When devices with higher pixel densities came about, they started interpreting 1px in <span class="caps">CSS</span> as 2px on the device, for example iPhone 4 interpreted 1 <span class="caps">CSS</span>-pixel as 4 device-pixels. This makes fonts and vector graphics look very pretty, but can make bitmap graphics look blurry. </p> <p>Resolution media queries can use ‘dots per px’ units (dppx). </p> <p>Example:</p> <pre class="language-css"><code class="language-css"><span class="token atrule"><span class="token rule">@media</span> <span class="token punctuation">(</span>screen <span class="token keyword">and</span> <span class="token property">min-resolution</span><span class="token punctuation">:</span> 2dppx<span class="token punctuation">)</span></span> <span class="token punctuation">{</span> <span class="token selector">.thing</span> <span class="token punctuation">{</span> <span class="token property">background-size</span><span class="token punctuation">:</span> 50%<span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span></code></pre> <pre class="language-css"><code class="language-css"><span class="token atrule"><span class="token rule">@media</span> <span class="token punctuation">(</span>screen <span class="token keyword">and</span> <span class="token property">min-resolution</span><span class="token punctuation">:</span> 3dppx<span class="token punctuation">)</span></span> <span class="token punctuation">{</span> <span class="token selector">.thing</span> <span class="token punctuation">{</span> <span class="token property">background-size</span><span class="token punctuation">:</span> 33.33%<span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> &lt;p>This technique is similar to &lt;code>device-pixel-ratio&lt;/code> that works in some browsers<span class="token punctuation">,</span> except this one is standardised. It is in some browsers<span class="token punctuation">,</span> and not behind flags so can be used today <span class="token punctuation">(</span>but it is not available everywhere yet<span class="token punctuation">)</span>. &lt;/p> &lt;h3>3. object-fit&lt;/h3> &lt;p>New &lt;span class=<span class="token string">"caps"</span>>CSS&lt;/span> <span class="token property">rules</span><span class="token punctuation">:</span> &lt;/p> ```css <span class="token property">object-fit</span><span class="token punctuation">:</span> fill<span class="token punctuation">;</span></code></pre> <pre class="language-css"><code class="language-css"><span class="token property">object-fit</span><span class="token punctuation">:</span> contain<span class="token punctuation">;</span></code></pre> <pre class="language-css"><code class="language-css"><span class="token property">object-fit</span><span class="token punctuation">:</span> cover<span class="token punctuation">;</span> <span class="token property">overflow</span><span class="token punctuation">:</span> hidden<span class="token punctuation">;</span></code></pre> <p>These features are very useful to make small adjustments to images. They were already possible on background images, but not on inline images.</p> <h3>4. Viewport percentage widths/heights</h3> <p>Units: <code>vw</code>, <code>vh</code>, <code>vmin</code>, <code>vmax</code></p> <p>Think of your canvas as a 100 by 100 units, then <code>vw</code> and <code>vh</code> are those units, e.g. <code>50vw</code> would be half of the width of your canvas. </p> <p>Opera was heavily involved in all four, both at spec level and implementation level. </p> <h2>Ruth John – Browsers at play</h2> <p>Ruth builds interactive prototypes at 02. At State of the Browser, she showed some great things she built. </p> <h3> VJ’ing with <span class="caps">CSS</span> Animations and WebAudio <span class="caps">API</span></h3> <p>When she was at uni, Ruth used to be a VJ. Recently, she thought, with all the cool things now possible in the web (<span class="caps">CSS</span> animations, WebAudio <span class="caps">API</span>), can I recreate the visuals of those days in the browser?</p> <p>Ruth showed various demoes, including one that heavily used the Web Audio <span class="caps">API</span> (recommended reading: O’Reilly’s book on this subject). It allows you to control volume, create sound and analyse sound. The latter, Ruth used to create graphics that responded to changes in a music file. </p> <p>With <code>getUserMedia</code>, microphone input can be analysed in JavaScript, using the Web Audio <span class="caps">API</span>. Ruth showed a cool demo in which graphics responded to her voice. </p> <p>Demoes online: dancing.rumyra.com/shake-n-track dancing.rumyra.com/vibrate</p> <h2>Jake Archibald – Network connectivity: optional</h2> <p>The web is in a state where developers do dirty tricks to get you to go to download their native apps. “Why is that, why are mobile apps still preferred to the web versions?”, Jake asked. </p> <p>Some reasons: </p> <ul> <li>availability offline</li> <li>server push</li> <li>background synchronisation</li> <li>geo fencing</li> <li>payments</li> <li>performance</li> <li>‘app presence’</li> </ul> <p>The web is really exciting, said Jake, as people are currently working on implementation of all of the above.</p> <p>To improve performance, the 300ms double tap delay was removed from Chrome and Opera (soon to be removed in Firefox), for whenever a screen is small and the <code>device-width</code> meta tag is used.</p> <p>To improve presence, so that the app can be in start menus, home screens, status bars, etc, the app manifest spec is being written at the moment, describing a way to have a json file with properties of apps, to make all the different <code>&lt;meta&gt;</code> elements that are currently used to do the same, obsolete.</p> <h3>Service workers</h3> <p>To improve offline availability, service workers are coming! There was, of course, AppCache. It tried to create shortcuts for a destination it didn’t know, it was hard to know what to expect from it and its <span class="caps">API</span> was too complicated. </p> <p>We should treat online as a progressive enhancement to offline, and work ‘offline first’. That way, cached content is shown first, whilst making a request to the network for fresh content. When that network request fails, the cached content will still be there; if it succeeds, there will be fresh content. </p> <p>Service Workers are reactive, not predictive, as AppCache was. It will try stuff and see what happens. The advantage of that is: if the thing it tried does not work, fallbacks can be added, making it very suitable for progressive enhancement.</p> <h3>What the web can do vs what apps can do</h3> <p>Native app developers can do everything, the web can sometimes feel like a massive can’t. Packaged apps are not the solution, they are interim, until the web has improved and become better. Native will always be better <strong>on their platform</strong>, the web will not win on that front. But it will win in being more accessible and much more widely available. </p> <h2>Martin Beeby – High-performance web platform</h2> <p>Martin Beeby, developer evangelist for Microsoft’s Internet Explorer, explained how to improve performance of websites, and what to keep in mind when building for Internet Explorer 11. </p> <p>Things limiting speed on the web are bandwidth, latency and data plans. </p> <p>Perceived performance is the most important to optimise. An important part of this is the use of memory. Inefficient use of memory can be a problem for performance, but also for the user’s hard drive life expectancy. Most of the memory websites take up is taken up by images. </p> <p>Power consumption is something to think about as well, as it is about the user’s battery. </p> <p>New website: status.modern.ie to give community more insight in what features the IE team considers supporting, as well as what’s already built in. </p> <p>Microsoft built two tools to measure performance: the F12 dev tools, in IE10 and more even in IE11 this has improved a lot. There is also the Windows Performance Toolkit, which can be used to measure any app on Windows. </p> <p>Performance improvements that can be made: </p> <ul> <li>One of the most important performance optimisations are in images: often images for mobile do not have the right size and this can take a long time (not only downloading the images, but also image decoding).</li> <li>Defer script execution: put scripts in the footer, or, if you put them in the top, add the async/defer attributes.</li> <li>Reduce number of frameworks: not only because they would have to be downloaded, but also because they have to be garbage collected</li> <li>To fix items don’t add timers or events, they fire at the wrong timing or too often (e.g. scroll), use <code>requestAnimationFrame</code> (fires whenever the browser is ready to paint the screen, and can therefore be a lot smoother than something that fires each time the user scrolls)</li> <li>use <span class="caps">CSS</span> animations, not JS animations where possible</li> <li>use <span class="caps">JPG</span> instead of <span class="caps">PNG</span> where possible, <span class="caps">JPG</span>s have a huge performance benefit</li> <li>keep in mind: download size vs memory size. Memory size needed to store an image is often bigger than the image download size: width * height * 4, roughly. Copying an image from memory to gpu can relatively take quite a lot of time. In IE11, <span class="caps">JPG</span>s are hardware accelerated.</li> <li>when you develop on mobile, use a ‘low end first’ approach.</li> </ul> <h2>Yoav Weiss – Brace yourselves – responsive images are coming</h2> <p>Responsive images is to ‘efficiently load propertly dimensionsed images that fit the pages design’. My main concern is with performance here, we cannot be developing websites for 550$ smartphones only. </p> <h3><code><picture></picture></code> vs srcset</h3> <p><code>&lt;picture&gt;</code> was thought up by the responsive images working group, Hixie of <span class="caps">WHATWG</span> did not like it and added, without much public discussion, the <code>srcset</code> idea. Two years later, both will be implemented.</p> <p>Tab Atkins came up with <code>src-n</code>, apparently over a bottle of wine. It was great for discussion, this time amongst browser vendors, which was good. Then, the original picture syntax was redefined, with a new proposal that can make everyone happy. Now the Responsive Images Community Group and <span class="caps">WHATWG</span> are working on it together. </p> <p>Yoav is implementing it in Blink, Mozilla are also working on implementing it it. Should be there in a couple of months. </p> <h3>picture 2.0</h3> <p>Usecase 1: bigger images for high resolution devices / the ‘retina’ use case</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>picture</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>source</span> <span class="token attr-name">media</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>”mq”</span> <span class="token attr-name">srcset</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>”/path”</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>img</span><span class="token punctuation">/></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>picture</span><span class="token punctuation">></span></span></code></pre> <p>There can be multiple <code>&lt;source&gt;</code> elements, the <code>srcset</code> attribute can have more than one image.</p> <p>In Chrome, the <code>srcset</code> attribute works on <code>&lt;img&gt;</code> elements today.</p> <p>Use case 2: art direction, in case you need multiple images to be properly cropped for different layout)<br /> Use case 3: mime type fallbacks (jpgr, webp, jpeg2000 are formats that only work in some browsers, they would need a fallback)</p> <p>An image element is always required, otherwise the picture will not display. </p> <h3>The <code>sizes</code> attribute, variable widths </h3> <p>Use case 4: variable width images</p> <p>‘Picture is a magical span, nothing more’ said Tab Atkins. You should not try to style it using <span class="caps">CSS</span>.</p> <p>When looking up what ‘w’ means, look at the picture spec, as the ‘old’ syntax is quite different. </p> <p>If you want to play with <code>&lt;picture&gt;</code> and <code>srcset</code> today, there is a polyfill available: Picturefill 2.0 was released by the Filament Group, it is officially spec compliant.</p> <h2>Dan Donald – What it means to be flexible</h2> <p>Dan Donald explored what it means to build websites in a flexible manner. </p> <p>Responsive web design is a recipe for managing and constraining the fluidity of the web. It is a recipe in the sense that it leads to a lot of improvements to the web, like responsive images. </p> <p>An example of flexibility: the nature of breakpoints. They are a tool to describe change. Are we designing for content or devices? One can use device-oriented breakpoints, but they make the assumption that we can rely on devices having the same widths. Another option is content oriented breakpoints. </p> <p>When using device breakpoints, we get a conflict with the universality principle of the web. There’s little to no correlation between viewport width alone and devices. </p> <p>We have a breakpoint purpose mash-up. We work in a world of assumption, but what do we really know? E.g., the user agent string we get on the service side, is full of lie. </p> <p>An important concept within building flexible pages, is the ‘element media query’. It does not currently exist in a standardised form or in browser implementation, but that did not stop various developers from building their own JavaScript solutions. Dan showed us his.</p> <h2>Chris Heilmann – Open web apps</h2> <p>Chris talked about the open web, and about what Firefox OS can mean within the context of the open web.</p> <p>Open Web Apps: manifest file that says what your app is/does. Apps are a better form factor for devices (then <span class="caps">URL</span>s). </p> <p>What makes a good app? Why do people download a calculator app, rather than typing their calculation into an online tool like Google? </p> <ul> <li>focused (it is full screen)</li> <li>mobile (it works offline)</li> <li>contained (you can delete the icon to delete the app, you can send it as one thing)</li> <li>integrated (it works together with the OS and has hardware access)</li> <li>it is responsive and fast</li> </ul> <p>Can all of the things that make apps great be done in <span class="caps">HTML</span>? </p> <p>A great app does one thing and do that one thing well. Simplicity is what makes app so popular. </p> <p>Service workers is the most important thing at the moment, offline viewing is a very important thing that needs to be solved. </p> <p>Go low in your testing, do not test on too fast connections, as the web is universal and it would be bad preventing people with low bandwidth connections from accessing your website.</p> <p>Everyone with an <span class="caps">FTP</span> connection and text editor can work on Open Web Apps, not just rich kids in Sillicon Valley that can pay 99 dollars and buy the newest devices to test on. That’s not the web! </p> <h2>Q&A</h2> <p>Throughout the day, attendees could ask questions via Twitter and to the organisers. After the last talk, Daniel Appelquist confronted the speakers with some of the questions that were asked.</p> <p>(Answers are based on my notes, and should not be considered to be literally what the panelists said).</p> <h3>Q: How will HTTP2 change any of the thinking about responsive web design thinking? </h3> <blockquote> <p>With HTTP2, combining all your JS into one file will become an anti pattern […] the same goes for sprited images</p> </blockquote> <p><strong>Jake</strong>: HTTP2 will turn a lot of good practices into bad practices, for example, starting a new request would be less of a deal. Combining all your JS into one file will become an anti pattern, lots of small files will work much better. The same goes for sprited images. </p> <p><strong>Yoav</strong>: Today, the browser has to download everything to get started, which today is good because it saves <span class="caps">HTTP</span> requests, but if that is no longer needed, it will be better to have many small files. </p> <p><strong>Andreas</strong>: I agree, best practices like sprites will have to be rethought. This will mostly be an education problem, we will have to ‘unevangelise’.</p> <p><strong>Chris</strong>: Most people use build processes nowadays, and an advantage of that problems like this can be solved by adjusting those tools. These things are already abstractions, so we only need to adjust the abstractions. </p> <h3>Q: How can we be a web industry that women don’t feel alieniated in?</h3> <p><strong>Martin</strong>: All I can do is not be a dick, that is the only thing I can have control over. </p> <p><strong>Ruth</strong>: It is an issue. I have been lucky, as in most places where I worked, people weren’t dicks. I think it is mostly a social problem. I’ve had sexism and it isn’t nice, but there are worse problems in this world. </p> <p><strong>Chris</strong>: Sites like Codebabes are blatant trolling, they’re not much more than a clickbait. We are not going to solve social problems on the internet by clickbaits. We should not give them a lot of attention in tweets.</p> <p><strong>Ruth</strong>: listen to ‘the science of the sexes’ podcast, it is a great resource. </p> <h3>Q: Everyone keeps talking about “the web platform“, what is a platform and should we want the web to be a “platform”?</h3> <p><strong>Chris</strong>: The web is an opportunity for people to publish on, it is a way to spread information in a world wide manner. It is a set of technologies.</p> <p><strong>Andreas</strong>: It is just a matter of naming. We have called it ‘web standards’, and later internally at Opera we called it ‘the web stack’. Some use the word ‘HTML5’, maybe ‘platform’ is a better term for it all. Whether it means something deeper than that, I’m not sure. </p> <h3>Q: How can we make the web platform a better platform for games?</h3> <p><strong>Ruth</strong>: That’s a really good question, but very difficult to answer. We already have things that are amazing at games, like Xbox and Playstation. I think we need to build a lot more to show what is possible. The Audio <span class="caps">API</span> and Vibration <span class="caps">API</span> i talked about seem great for games. </p> <p><strong>Martin</strong>: we [at Microsoft] go to lots of game developers, at big companies, but also indie game developers. I don’t know much about game development, it is a very different world. Interesting is what is happening with WebGL, not just for games but for parallel computing in general, it it has implications for lots of things outside gaming as well. It is very complicated though, hard to learn. </p> <p><strong>Chris</strong>: It is a different world, like native vs web. Gaming is a speed test, if we can get games running on web technology, we can learn from it for other applications of the web. </p> <h3>Q: How will Web Components change the way we work on the web?</h3> <p><strong>Chris</strong>: Web Components are an amazing opportunity, they allow us to write proper widgets on the web. Whatever <span class="caps">HTML</span> you were missing, you can now actually write and publish yourself. It allows for widgets that are running with the browser and not against it. They becomes part of the browser. Jake had a talk about a tabs component some years ago, that is one to watch again. [I think Chris meant Jake’s talk ‘Reusable code: for good and for awesome’ at Fronteers 2010. <a href="http://vimeo.com/15984466">Video</a> / <a href="https://fronteers.nl/congres/2010/sessions/reusable-code-for-good-or-for-awesome-jake-archibald">transcript and slides</a></p> <p><strong>Jake</strong>: Web Components are an important part of the extensible web. For someone new to <span class="caps">HTML</span>, it was weird that <code><h1></h1></code> and <code><h2></h2></code> looked different — <span class="caps">CSS</span> helped to explain why this is. Developer tools in modern browsers to this with things like performance waterfalls. Service Workers does a similar things to help understand the network. Web Components will help to show why things render the way they do. Libraries like jQuery UI that change a <code>&lt;div&gt;</code> into a widget will no longer be needed, you could just have a new element doing a widget.</p> <p><strong>Yoav</strong>: I’m slightly worried about performance of Web Components, for example in terms of blocking rendering. The browser has to download the import and files within that file and files within that file. We have to make sure it will not become the next @import of <span class="caps">CSS</span>. </p> <h3>Q: What is the future state of deep linking from web apps? And into web apps?</h3> <p><strong>Barjo</strong>: Haida does that for Firefox OS, it will make the flow more natural for the user, linking will feel more natural like it is in the native OS already. </p> <p><strong>Jake</strong>: We can’t lose the <span class="caps">URL</span>.</p> <p><strong>Andreas</strong>: I agree. <span class="caps">URL</span>s are the power of the web and an advantage of the web over native apps. The web can link to apps, but <span class="caps">URL</span>s can also be used to link from an app to the web.</p> <h2>Conclusion</h2> <p>I’ve had a great day in London, and enjoyed this very affordable conference a lot. There was plenty to learn and it is exciting to know that a lot of the stuff presented today, will be in browsers in the not too distant future.</p> <p><small>Thanks <a href="http://krijnhoetmer.nl/">Krijn</a> and <a href="http://mathiasbynens.be/">Mathias</a> for pointing me at spelling errors in previous drafts of this post.</small></p> <hr/> <p>Originally posted as <a href="https://hidde.blog/state-of-the-browser-2014/">State of the Browser 2014</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20State of the Browser 2014">Reply via email</a></p> Keeping it simple 2014-05-08T00:00:00Z https://hidde.blog/keeping-it-simple/ <p class="intro">When trying to improve front-end skills, we should improve our knowledge of <span class="caps">HTML</span>, <span class="caps">CSS</span> and JavaScript first and our knowledge of specific tools later.</p> <p>Most of the web is written in three simple yet powerful languages: <span class="caps">HTML</span>, <span class="caps">CSS</span> and JavaScript. Terminology in job ads and portfolios comprises a lot more: <span class="caps">LESS</span>, Sass, grunt, Foundation, Bootstrap, jQuery and the like. They are mentioned alongside the big three, but they really are quite different. The former are the foundation of the web, the latter are ‘just’ tools to do stuff with them. Tools that have their merits, surely. But the only thing that constrains how effective one can use front-end tooling, is how effective one can use <span class="caps">HTML</span>, <span class="caps">CSS</span> and JavaScript. </p> <p>An example: <em><span class="caps">CSS</span> preprocessors</em>, like Sass en <span class="caps">LESS</span>. They can be incredibly useful and powerful tools for writing <span class="caps">CSS</span>, but they require knowledge of how box models, positioning, inheritance and specificity work. Limited understanding of these things can makes things worse if applied through a preprocessor (for instance, unintended nesting). Preprocessors provide power, but it is a kind of power that should be used wisely.</p> <p><em>Bower</em> is another example: it can help manage dependencies, and makes it very easy to add new dependencies. This may sound like an advantage, but it makes it too easy to bloat a codebase and complicate a project too soon. Whilst it was easy to add a <span class="caps">CSS</span> library through Bower, it is now hard to manage <code>&lt;button&gt;</code> styles as the <span class="caps">CSS</span> library does overly specific styling that is hard to override.</p> <p>Tools like preprocessors and package managers have their merits, but to become a better front-end developer, one should focus on <span class="caps">HTML</span>, <span class="caps">CSS</span> and JavaScript.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/keeping-it-simple/">Keeping it simple</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Keeping it simple">Reply via email</a></p> Museums Get Mobile! 2014-05-17T00:00:00Z https://hidde.blog/museums-get-mobile/ <p class="intro">“Museums Get Mobile!” was a one day event on designing mobile experiences, aimed at managers, curators and consultants in the cultural sector. It was organised by the UK Museums Computer Group in MShed, Bristol.</p> <p>The day kicked off with a welcome from the organisers and a short talk from the sponsor, about the advantages of apps. This was followed by the first keynote: Clearleft’s Andy Budd. </p> <h2>Andy Budd – Responsive design is easy </h2> <p>Andy Budd started off by claiming that responsive design is actually quite easy, quickly adding ‘as long as you have been paying attention’. </p> <p>He took us through the various stages of the history of web design, going for flexible to fixed to flexible and responsive. He showed <a href="http://info.cern.ch/hypertext/WWW/TheProject.html">the very first web page</a>, that was just text, had no <span class="caps">CSS</span> and was therefore already responsive. It could be accessed from any kind if device. This is no accident, as the web was envisioned with universality as its underlying principle. Paraphrasing Tim Berners-Lee, it should be accessible from any kind of hardware that can connect to the internet. Along came designers, and they messed it up. Designers have been breaking responsiveness by placing content in fixed width containers.</p> <blockquote> <p>Embrace the flexibility of the web</p> </blockquote> <p>There have always been voices that we should embrace the flexibility of the web, most notably John Allsopp in his [classic] article <a href="http://alistapart.com/article/dao/">A Dao of Web Design</a>: “we should embrace the fact that the web doesnt have the same constraints [as print], and design for its flexibility”. </p> <p>Just like people thought tableless <span class="caps">CSS</span> sites would never become the norm, some people still think responsive design never will. Andy emphasised responsive design definitely is the future, as it is <em>the most sensible thing to do</em>. </p> <p>Andy briefly discussed apps versus websites, and was in favour of the web, arguing from statistics. The chance someone will visit your website is much higher than that someone will go through the whole process of finding, downloading and installing your app, especially if they rarely ever visit. Secondly, a problem with apps is that there are a lot of different ecosystems: iOS, Android, Windows Phone, Blackberry, and so on. </p> <p>Responsive web design can be regarded as a logical next step in the history of web design. There were fluid sites, then fixed sites designed for fixed widths, then half fluid sites and now fully fluid and adaptive sites that are meant to work everywhere. </p> <p>It started to be used in personal projects first, and quickly made its way into commercial sites, <a href="http://thebostonglobe.com/">The Boston Globe</a> being one of the first. A great example of a responsive museum website is that of the <a href="http://rijksmuseum.nl/">Rijksmuseum</a> [see also <a href="http://vimeo.com/78929841">the case study of the new Rijksmuseum website at Fronteers 2013</a>.</p> <p>Being such a logical next step, for front-end developers, responsive design is not so hard, especially if you have been paying attention to things like fluid design. If you haven’t, it may snuck on you. Learning responsive design from scratch is probably hard and scary, as there is a lot involved. </p> <p>Organisations have to make their sites responsive. “Wait and see” is not a great strategy, your competitors will get ahead of you. “It’s hard” is not a valid argument. Yes, it will take extra time (and budget), in our [Clearleft’s] experience about 10% more. But if 50% of your visitors visit from mobile, which is likely to be the statistic in 2014, is spending 10% more to reach 50% more people really so bad? Why spend 100% of the money on 50% of the people that access your site? As a museum, you would not discriminate against sex or race, why discriminate mobile users?</p> <p>Responsive design is <strong>not</strong> designing three versions for mobile, tablet and desktop respectively. It is a way to pour your content in as many as possible ‘glasses’ (Andy visualised content as water, and devices as glasses). Responsive design demands you understand your content. </p> <blockquote> <p> Our job is not to dictate design, it is to hint design </p> </blockquote> <p>In responsive design, never think of devices, think of breakpoints instead: optimise where the layout breaks, not where a specific device is used. You have no control over what devices a visitor uses to access your website, what browser they have, what font size they set. Our job is not to dictate design, it is to hint design. </p> <p>In a responsive design process, developers and designers should work closely together and talk to each other. </p> <p>Responsive retro-fitting, the process of making an existing website responsive, does not work well, as it fails to address content problems and does not have the benefits of starting with mobile first. Companies like the Guardian started with a responsive mobile site from scratch, built next to the existing site. It was initially only shown on mobile devices, whilst it was being optimised for bigger screens. It is planned to replace the existing site sometime this year.</p> <p>Mobile first is a very useful conception to think of, as it can helps focusing attention. There is less space available, so it forces content, marketing and design people to prioritise.</p> <p>Jeremy Keith would hate me for saying this, but I prefer tablet first, it is a nice midground. You start from a tablet version, them scale up a bit for larger screens and scale down a bit for smaller screens. We are currently taking this approach working with a client. </p> <p>There are still a lot of issues to resolve with responsive design, an important one being how to deal with images. <a href="http://picture.responsiveimages.org/">yay for <code>&lt;picture&gt;</code> </a></p> <p>The question shouldn’t be, “when should I make my site responsive?”, it should be “when can I make my site responsive?”</p> <p><strong>Q</strong>: How do you deal with people within the organisation that are convinced they need an app?<br /> <strong>A</strong>: Mobile apps are part of a healthy ecosystem, but responsive web design is a sensible and logical approach to take. Irregular visitors of your museum will not take the hassle of searching for and installing your app, fans of the museum may like app. You don’t need to talk your boss out of apps, but you should be doing responsive web design as a default. </p> <blockquote> <p>Ask for forgiveness, not permission</p> </blockquote> <p><strong>Q</strong>: How to ask for budget to do responsive design?<br /> <strong>A</strong>: Use statistics. Personally, I prefer to ask for forgiveness, not permission. In the project description, don’t make a big deal about it being responsive, maybe call it “has to work on a variety of devices”. That is just very sensible, no one can argue against that. And then when it launches and happens to work across lots of devices, everyone is happy. </p> <h2>Designing for changing museum audiences in-gallery and online</h2> <h3>Ivan Teage</h3> <p>Ivan Teage of the Natural History Museum (<span class="caps">NHM</span>) explained how the <span class="caps">NHM</span>’s approach to mobile caters for the basic needs of visitors. </p> <p><span class="caps">NHM</span> offers WiFi, which is activated through a splash page that comes up when users try to connect. On this page, <span class="caps">NHM</span> can get the visitor’s attention. Analytics are used to see what people are doing and test different content. </p> <p><span class="caps">NHM</span> research shows 77% of visitors have a smart phone. Many have a tablet, but they don’t bring it to the museum. Before visiting, 1 in 3 visitors research their visit on their phone. </p> <p>Nearly 10% of the visitors, uses the WiFi, making it a big hit, especially since no efforts were made to promote it. Most use it not to find information related to the museum, but for Facebook. </p> <blockquote> <p>In 2014, on average, websites will have more mobile visits than desktop visits</p> </blockquote> <p>As Andy said before, in 2014, on average websites will have more mobile visits than desktop visits. The website of the <span class="caps">NHM</span> currently hovers around 44%. There is also a notable difference between pages, some pages are much more popular on mobile, others on desktop. </p> <p>One of the great challenges <span class="caps">NHM</span> faces is that there are a lot of different priorities within the organisation, some “nondigital”.</p> <h3>Frankly green + webb</h3> <p>The biggest aspect in mobile is the organisation. There is a lot of making things for mobile just for the sake of making things for mobile, those are the most challenging projects to work on. </p> <p>Some regard mobile as a tool. Working on mobile, people tend to focus on choosing tools first, rather than on the actual project. Maybe because it is not very physical, mobile is often called “an experience”. </p> <p>Let’s look at defining what we have to design before we choose the tool to design it with. </p> <blockquote> <p>For a specialist (…) it can be heart-breaking to be asked to summarise something in three sentences</p> </blockquote> <p>For a specialist, for example, a curator who studied 15 years on a subject, it can be heart-breaking to be asked to summarise something in three sentences, they would probably prefer more detail.</p> <p>Digital services often exist of more than just a website. As they often involve with physical services as well, [like a physical box office in the case of a museum], there are lots and lots of people involved in any given project. It will be hard to get them on the same line, or in the same meeting room. </p> <p>Two tools to deal with this complexity:</p> <ul> <li>a digital services manifesto, a set of shared objective like <a href="https://www.gov.uk/design-principles">the one <span class="caps">GDS</span> released</a>, can be a great tool to push a project in an organisation</li> <li>a visitor journey, an outline of every step a visitor can be involved in, to try to understand what the whole experience is like. There are a lot of examples of visitor maps on the internet, from companies like Lego and Starbucks.</li> </ul> <h2>Léonie Watson </h2> <p>Léonie Watson talked about accessibility (on the web). </p> <p>Accessibility is not boring, we can creative visually exciting and creative experiences that are accessible. It is not difficult, it is no rocket science, but there may be unfamiliarity. </p> <p>Accessibility is usability for all of us. </p> <blockquote> <p>Everybody benefits from accessibility</p> </blockquote> <p>Who benefits:</p> <ul> <li>You do. You can make your content available to more people, you open it up to a larger audience, which makes a great feal of sense.</li> <li>We do (us being people with disabilities, like sight, hearing, learning, cognitive).</li> <li>Everybody does. The real minority in the world, are just regular people. People surfing the internet wearing glasses or with a hangover, or people who are tired, because their young kids kept them up all night.</li> </ul> <p>There are accessibility guidelines that make sure we can find out what to do, and help to make things testible. <span class="caps">BBC</span> recently launched their <a href="http://www.bbc.co.uk/guidelines/futuremedia/accessibility/mobile">Mobile Accessbiblity Guidelines</a>. </p> <p>There is accessibility testing. Some things can be automated, but putting your content in front of people with disabilities will likely be more effective. </p> <p>There is also legislation. In some countries more than others. In the UK, there is the Equality Act. It does not have any requirements for accessibility, it only says “digital services have to be accessible”, it doesn’t specify to which standard.</p> <p>Accessibility does generally cost a little bit more. If your people are good and used to accessible best practices, they can do optimisations at no extra cost. But if you want to do testing, which you probably should, it can cost more than other usability testing, for example transport costs. </p> <blockquote> <p>Retrofitting accessibility is probably just as hard as retrofitting responsive design</p> </blockquote> <p>It is best to ‘do’ accessibility throughout all stages of the projects. Keep an eye on it as the project goes. It works with waterfall and agile. Test as often as possible, fix as quickly as possible. It is easier and perhaps cheaper to fix things in early versions than it is in live sites. Retrofitting accessibility is probably just as hard as retrofitting responsive design, which Andy discussed. It will cost much more and probably achieves less. </p> <p>Accessibility is forever, not just for launch. Keep an eye on accessibility after the project goes live, maybe monthly or yearly. </p> <p><strong>Andy Budd</strong>: Five to six years ago, developers were very involved with accessibility, do you think that is decreasing now?<br /> <strong>Léonie</strong>: Yes, it does get lost in the buzz sometimes, but there are still a lot of efforts and generally the situation is quite good. </p> <h2>Making responsive design a reality: accessibility and content strategies and commissioning content strategies</h2> <h3>Andrew Lewis – thinking holistically about mobile-responsive services</h3> <p>Andrew Lewis of the Victoria & Albert museum discussed how they think about responsive web design. A responsive web service is one that adjusts content to your audience. </p> <p>V&A did a responsive retrofit in 2012. </p> <p>Responsive design is not about technology, it really is about social behaviour. </p> <p>Situations in which people use their phone:</p> <ul> <li>preplanning a visit</li> <li>visual diary</li> <li>comfy sofa time</li> </ul> <p>Mobile users and tablet users are often the same people. The V&A website optimises for different contexts, orientations and screen sizes. </p> <h3>Dan Goodwin – Collaborative discovery: commissioning a big web project when you’re not sure what you want</h3> <p>Dan Goodwin, UX Director at Bristol-and Cornwall based agency <a href="http://fffunction.co/">fffunction</a>, talked about kicking off a big web project. </p> <p>It is difficult to choose the right agency for the job. A traditional commissioning approach could include asking within your network, send out request for proposals, asking agencies to come up with quotes. </p> <p>But an important thing to note is: in the process of building a website, requirements are going to change. That is a given. The problem with the traditional commissioning approach is that nobody really knows 100% what’s needed. </p> <p>Working on the <a href="http://www.bristolmuseums.org.uk/">Bristol Museums</a> websites, fffunction did a <em>collaborative discovery phase</em>, to make sure all the different requirements were analysed and looked into. </p> <p>They did a stakeholder workshop, a get together with a selected number of shareholders, getting them to put post it notes on the wall, with things like target audience, principles, content ideas and potential features. It gave a great insight into the scope of the project and what needed addressing. They also did user interviews, which helped testing their assumptions. </p> <p>During the Q&A, some pros and cons of working agile were discussed. Working with flexible requirements is one thing, agreeing to or getting permission for flexible pricing another. </p> <h2>Shelley Mannion – Learning from mobile experiences in museums</h2> <p>Shelley Mannion from the British Museum showed how (people) interacted with various kinds of devices and experiences within the British Museum. </p> <p>Contrary to other speakers before, Shelley did have some good experience with apps. Some webbased, some native.</p> <p>In statistics of the British Museum website, mobile has also grown a lot. It increases reasonably quickly, but not as fast as the first graph showed. </p> <p>In her talk, Shelley challenged some common assumptions, like “It has to be the latest device”, this really depends on the device you are using. Another assumption she challenged: “the bigger the screen, the more people can stand around it” . They found the maximum seems to be about 3-4 people around a screen, regardless of how big the screen is.</p> <p>Shelley showed a couple of very interesting examples of projects in which visitors interact with exhibitions. Imagery, videos and <span class="caps">URL</span>s will be in the slides, but they were unavailable at the time of writing.</p> <h2>Conclusion</h2> <p>Some important takeaways of the day were that mobile is here to stay, that it will be bigger than desktop in 2014, and it would be ideal to make things universally accessible, embrace the flexibility of the web and have a flexible workflow. It became clear that those things can be difficult and scary, but they will be beneficial in the long run. Some solutions were discussed: more research —into visitors/users as well as into the project scope—, better teams in which designers, developers and content people work well together and always keep challenging your assumptions.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/museums-get-mobile/">Museums Get Mobile!</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Museums Get Mobile!">Reply via email</a></p> Responsive Day Out 2 - the squishening 2014-06-29T00:00:00Z https://hidde.blog/responsive-day-out-2-the-squishening/ <p>Last year I experienced Responsive Day Out through its <a href="http://adactio.com/journal/6091/">audio podcast</a> (<a href="http://huffduffer.com/adactio/tags/responsiveconf/rss"><span class="caps">RSS</span></a>), this year I decided to buy a ticket and travel from Bristol to Brighton for the real thing. It was a varied day, with room for aspects like design, business, information architecture and even <span class="caps">CSS</span> specs. </p> <p>The day was structured in three blocks of three speakers talking for 20 minutes, plus one block of Ethan Marcotte, who <a href="http://alistapart.com/article/responsive-web-design">came up</a> with the term ‘responsive web design’. The event’s social media hash tag, #beepcheeks, was named after him.</p> <p><img alt="Photo of the stage" src="https://hidde.blog/_images/photo-2-.jpg" title="Photo of the stage" /> </p> <h2>Part 1: Stephen Hay, Sally Jenkinson and Ida Aalen</h2> <p class="intro">In the first session, Stephen Hay introduced us to the method of ’sculpting text’, Sally Jenkinson discussed aspects of responsive web design beyond just designing for different screen widths and Ida Aalen shared her experience working on a large responsive project for the Norwegian cancer association. </p> <h3>Sculpting text</h3> <p><a href="https://front-end.social/@stephenhay">Stephen Hay</a> explained that text is what underlies the web. Structured text, to be more precise. Structured text is portable, it can stay the same regardless of which device you use to access a web page. It exposes inappropriate and irrelevant content more easily than a full fledged web design comp would. Web designers have been designing containers to fill with text for ages, so that text would be the last step in their project work flows. But if text is the most portable, shouldn’t we really start with text first? Stephen argued we should. </p> <blockquote> <p>Increase screen size, until you feel the layout breaks, at which point you add a breakpoint</p> </blockquote> <p>The method of sculpting text, Stephen explained, consists in adding layers of <span class="caps">CSS</span> rules to structured text. It can start with styling text on a small width, a ‘single column grid’ if you will. Start simple. To structured text on a narrow screen you can do things like colour, typography, spacing, et cetera first. Then you increase screen size, until you feel the layout <em>breaks</em>, at which <em>point</em> you can add a breakpoint. You can then introduce things like columns. Sketching is helpful when trying to come up with solutions for larger screen widths. </p> <p>Sculpting text first and coming up with a canvas later in the process, rather than designing a canvas to put content in afterwards, will help designers understand what they are designing. As a methodology, it helps us cope with the multi device world they design for, Stephen argued. </p> <p>A more in-depth discussion of responsive design workflow, can be found in <a href="http://responsivedesignworkflow.com/">Stephen’s book with the same name</a>, which I recommend reading, or have a look at his <a href="https://speakerdeck.com/stephenhay/sculpting-text">slides</a>.</p> <h3>Responsive planning</h3> <p>Sally Jenkinson emphasised that responsive design is not only about designing for multiple screen widths, it is also about being very good at planning, not being afraid to experiment and making the right choices. </p> <blockquote> <p>Our choices have great impact</p> </blockquote> <p>The choices web designers and developers face, Sally argued, can have large philosophical and ethical impact. A developer often makes choices that impact what a user experiences. This can include ‘invisible requirements’, like progressive enhancement. The decision to make a website ask for a user’s location, may feel awkward or unnecessarily invade their privacy, especially if the app does not evidently require location.</p> <p>Sometimes we should make choices or do things that aren’t part of our job descriptions. Planners can try out new technologies, rather than solving problems with solutions that we happen to be used to. Choices should not be about what is beneficial to us as designers, developers or businesses, they should be made with the bigger picture in mind. It is about end users ultimately, we should avoid ‘narcissistic web design’, Sally advocated. And we should avoid making choices that invade our users’ privacy. </p> <h3>The core model </h3> <p><a href="https://www.linkedin.com/in/idaaalen/">Ida Aalen</a> described the ‘core model’ for information architecture, and spelled out how it benefited her team when working on the website for <a href="https://kreftforeningen.no/">the Norwegian Cancer Society</a> (<code>lang=no</code>). (<a href="http://iallenkelhet.no/2014/06/27/responsive-day-out-2-slides-and-resources-from-my-talk-on-the-norwegian-cancer-society/">Slides</a>)</p> <p>In information architecture, which is a lot about users navigating, it is important to note users will often not (want to) navigate your site. They often just look at one page, coming in following a Google search or a link on Facebook. </p> <blockquote> <p>Core pages serve both business and user needs</p> </blockquote> <p>Ida talked about the overlap between business needs and user needs. Some pages only serve one of the two, some serve both. Those are <em>core content pages</em>. An example she discussed is a page about lung cancer: it serves business goals (informing people, sharing knowledge) as well as user needs (getting to know more about symptoms, prevention and treatments). From core content pages, one can think about pages that precede it, and those that can lead a user to elsewhere. The core content is the same on all pages, regardless of device used. </p> <p>For the Cancer Society, a lot of time was spent on mobile. Ida shared some data on usage. Users visiting with small screens spent roughly the same amount of time on the site as those with large screens. Conversion rates did not differ much between screen sizes used, so it was worthwhile to spend time on designing for all screens.</p> <h2>Part 2: Rachel Andrew, Dan Donald and Inayaili de León Persson</h2> <p class="intro">In the second session, Rachel Andrew talked about the <span class="caps">CSS</span> Grid Layout Spec, Dan Donald considered the flexible web and Inayaili de León Persson shared her experience of making ubuntu.com responsive.</p> <h3><span class="caps">CSS</span> Grid Layout</h3> <p><a href="https://front-end.social/@rachelandrew">Rachel Andrew</a> discussed the new <span class="caps">CSS</span> Grid Layout spec. Since it was originally proposed by Microsoft and used in IE10, it evolved a lot. </p> <p>Rachel discussed different ways of defining grids in <span class="caps">CSS</span>, using Grid Layout. There is <em>line based positioning</em>, and the use of <em>grid area names</em>, also known as ‘defining grids in ascii art’. For components you specify in which areas they should be displayed. Then, on the wrapper they are in, you define where those areas are. To see how it works, have a look at her <a href="http://rachelandrew.co.uk/presentations/css-grid">code examples</a> or her <a href="http://rachelandrew.co.uk/archives/2014/06/27/css-grid-layout-getting-to-grips-with-the-chrome-implementation/">blogpost about the subject</a>.</p> <p>She also explained how grid layout differs from flexbox: whereas the former is most suitable for full page layout, the latter works best for smaller UI components. </p> <h3>The flexible web and element queries</h3> <p>Dan Donald talked about building for a flexible web. In particular, he talked about flexible components using element queries. </p> <blockquote> <p>Element queries are media queries that respond not on a document level, but on a component or element level.</p> </blockquote> <p>Element queries are media queries that respond not on a document level, but on a component or element level. Currently, they exist mostly as a concept, i.e. there is no standard with browser support. Nevertheless, it is possible to use the concept in web pages today. Dan explained how he did so in a project for <span class="caps">BBC</span>, using data attributes to specify queries, a bit of JavaScript to make them more flexible and, of course, <span class="caps">CSS</span> to define what to do at breakpoints.</p> <h3>Realistic responsive design</h3> <p><a href="https://yaili.com/">Inayaili de Léon Persson</a> showed us what she learned when working on the responsive version of Ubuntu.com. At the time, the team did not have the luxuries of starting from scratch, or working on it full time. The mark-up and content had to stay the same, and the team had to squeeze the project in between their other duties. </p> <p>Inayaili explained that when making a site responsive, it is often not only about just that, there are many priorities, goals and needs. The team behind Ubuntu.com benefited from buying some of the most used devices, using Basecamp to document as much as they could and making clever use of stuff others had done, inside and outside the organisation. </p> <p>An interesting step in the process that Inayaili described was the writing of ‘responsive rules’, like ‘Content that is divided in half or thirds should convert into single column when it becomes too narrow’. See also <a href="http://design.canonical.com/2014/03/making-ubuntu-com-responsive-setting-the-rules/">Setting the rules</a> in the series <a href="http://design.canonical.com/2014/03/making-ubuntu-com-responsive/">Making Ubuntu responsive</a> on the Ubuntu site.</p> <h2>Part 3: Oliver Reichenstein, Kirsty Burgoine and Stephanie Rieger</h2> <p class="intro">In the third session, Oliver Reichenstein proposed a better way of structuring websites, which his company recently employed for The Guardian, Kirsty Burgoine shared how her responsive web design process developed and Stephanie Rieger dived into new media queries.</p> <h3>The container model</h3> <p><a href="httpss://mastodon.social/@reichenstein">Oliver Reichenstein</a> explained that making information easy to find for users is hard. Most information architecture starts from the homepage down, with lots of diverging branches. These kind of trees can be very sturdy. Home pages and sidebars are often full of stuff, because of politics. </p> <blockquote> <p>The alternative [to sturdy information architecture] is the container model</p> </blockquote> <p><img alt="Oliver Reichenstein" src="https://hidde.blog/_images/143390459397ec8183821z-.jpg" title="Oliver Reichenstein" /> <em>Oliver Reichenstein explains the container model (photo by <a href="https://www.flickr.com/photos/marcthiele/14339045939/in/photostream/">Marc Thiele</a>)</em></p> <p>The alternative is the container model: have containers with specific content and decide where to put them. Containers are full width and horizontal, pages can have a series of containers stacked up.<sup class="footnote" id="fnrev212853781453b1512fb6ecc"><a href="https://hidde.blog/responsive-day-out-2-the-squishening/#fn212853781453b1512fb6ecc">1</a></sup> Containers are self sufficient and can appear anywhere. On a news site, a container can be a world cup section, or a top news section. The article is a container, the comment section is a container. Container based design is without columns, but you can put content next to each other, <em>if the content is comparable</em>, for example a top sport section next to top politics.</p> <p>The container model is to avoid pages where lots of unrelated bits of information are placed next to each other, just because there is a sidebar that can be filled with content. Responsive design or mobile first forces us to have priorities. We should stick to those priorities when working up to larger screens. If you work up from mobile to larger screen, you should still not put lots of random content to fill up space.</p> <p>Oliver’s company <a href="http://ia.net/">Information Architects</a> helped newspaper The Guardian implementing the container system on their new site, which is currently in beta. But the model is not only useful on news sites, it works for e-commerce and corporate sites, too, Oliver stressed.</p> <p class="footnote" id="fn212853781453b1512fb6ecc"><sup>1</sup> <a href="http://next.theguardian.com/blog/container-model-blended-content/">Blogpost about the container model at The Guardian</a></p> <h3>Responsive deliverables</h3> <p><a href="https://kirstyburgoine.wordpress.com/">Kirsty Burgoine</a> shared various approaches her business tried when making responsive websites. She also discussed the importance of trust.</p> <p>All approaches shared that the website was going to be responsive. The first approach was not telling the client, and surprising them with the fact that the website worked on mobile. It resulted in happy clients, but it had a steep learning curve and caused unbilled time. The second approach was to tell them about responsive design, but not to promise anything. The good thing was that her workflow could stay roughly the same. The downside, that it required a lot of trust from clients. The third approach was to dive straight into code, and do <span class="caps">HTML</span> early. It made Kirsty happy as a developer, but clients would have hardly any deliverables. The client would have to have trust, without seeing what was being done.</p> <p>The fourth and final approach was a very practical one. It embraced the chaos that making responsive websites can be. There were lots of different deliverables, or in lieu of them, sharing of ideas. Regular meetings were held to make sure the client was still on board.</p> <h3>The future of <span class="caps">CSS</span> media queries</h3> <p><a href="https://stephanierieger.com/">Stephanie Rieger</a> went into some of the new media queries that are being discussed. </p> <p>There are proposals and drafts for media queries based on user’s JavaScript support, light level, the kind or lack of pointer, ability to hover, screen’s update frequency and overflowing capabilities.</p> <p>Stephanie also discussed additional media queries that she thought could be useful, including one to see what language a device can use (Chinese interfaces need less space for words then Western ones, as less characters are needed).</p> <p>Another interesting thought Stephanie shared was that of a browser built-in navigation system, that would just expose the page’s <code>nav</code> items via a control that is best for the device. For example, a phone could have a built-in hamburger icon to open it, a Google Glass could have a speech command to request it.</p> <h2>Part 4: @beep</h2> <p>The last talk of the day was delivered by Ethan Marcotte, who <a href="http://alistapart.com/article/responsive-web-design">gave the idea of designing flexible web pages its thoughtful name</a>. His talk, which I was lucky enough to see him do at <a href="http://cssday.nl/2014"><span class="caps">CSS</span> Day</a> earlier this month, was about being lazy. Or, as I would rephrase it: keeping things simple. According to Ethan, being lazy is the only response to the increasingly complex web we work on, with its multitude of devices, connection speeds and interaction models. </p> <p>He showed some ideas for being lazy about lay-out: the <a href="http://hiddedevries.nl/en/blog/2014-02-05-embedded-video-in-responsive-lay-outs">padding trick</a> and <code>nth-child</code> for infinite grids with relatively simple <span class="caps">CSS</span>. He also discussed frameworks. On the web they are often too descriptive, too ‘heavy’. In a broader sense, there are examples of great ‘frameworks’: Disney’s <a href="http://www.youtube.com/watch?v=bHfDEsNLg34">12 principles of animation</a> (video), the Whitney museum with its <a href="http://whitney.org/NewIdentity">logo</a> that can have infinite variants, all based on one simple rule, and Karl Gernsters idea of set of solutions rather than just solutions.</p> <p>Ethans talk made a lot of sense to me. The multitude of devices, connection speeds and interaction models is a fact. There are roughly two ways of dealing with this fact: designing a solution for <em>each of them</em>, or designing a few simple rules that automatically deal with <em>all of them</em>. The latter works for Disney or the Whitney museum, and it is sensible to say it will work best for us, working on responsive web design.</p> <h2>Round-up</h2> <p>Throughout the talks it became clear that responsive web design is now just web design. The great variety in devices people view the web with has influenced web design a lot. In a good way. It has lead many of us to do away with assumptions, and begin to build more solid websites. The idea of separating structure, style and behaviour is definitely not new, but seems to have become inevitable at last. It is key to a great responsive workflow. This starts with structured text, as Stephen explained. Responsive web design also lead us to radically change workflow and planning, as Kirsty, Sally and Inayaili discussed. The surge of small devices with browsers forced web makers to think about priorities in content and navigation, as Ida and Oliver discussed. New standards and ideas, like those discussed by Rachel, Dan and Stephanie, will help us cater even better for a multitude of devices, but we should not just use new technologies for the sake of it, like Sally emphasised.</p> <p>Responsive Day Out 2 was one of my favourite events this year. It was simple: no lunch, no WiFi, no coffee, no after parties, but also: a low price. And admittedly, good coffee or food is never really far away in Brighton anyway. The format, 20-minute talks, worked well. It resulted in a great variety of subjects. There was a good balance of theoretical/conceptual talks and practical case-study like talks.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/responsive-day-out-2-the-squishening/">Responsive Day Out 2 - the squishening</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Responsive Day Out 2 - the squishening">Reply via email</a></p> Breakpoints based on language 2014-08-05T00:00:00Z https://hidde.blog/breakpoints-based-on-language/ <p class="intro">In responsive web design, many of us think of breakpoints as related to the width of lay-outs. But there are other points that can break a website, like language.</p> <h2>Breakpoints: more than just widths and heights</h2> <p>In <a href="http://responsivedesignworkflow.com/"><em>Responsive Design Workflow</em></a>, <a href="http://the-haystack.com/">Stephen Hay</a> encourages readers to think about breakpoints regardless of specifics like widths or lay-out. Stephen says breakpoints are ‘the points when certain aspects of a website or web application change depending on specified conditions’ (<span class="caps">RDW</span>, page 92). This definition includes lay-out, but it also leaves room for many other aspects to be breakpoints.</p> <p>Thinking of breakpoints in this more abstract way, they can be added for <em>any change of condition</em>. Width-based breakpoints optimise for width conditions. If a lay-out breaks on wide screens, a breakpoint is added. There can be breakpoints for conditions like ‘JavaScript is available’ and ‘JavaScript is not available’; some websites break without JavaScript. Certain aspects can be implemented differently to accommodate this: a form that gives validation feedback as you tab through it, versus a form that is able to show such information , but only after submission to the server. </p> <p>Between the conditions ‘screen is greyscale’ and ‘screen is full colour’ is another breakpoint. Maybe they require different logos. </p> <h2>Breakpoints based on language</h2> <p>Recently, I worked on a project for <a href="http://transition.tk/">Transition前進樂團</a>, a Bristol-based band that performs in Taiwan and China. They recently launched their first all Chinese album. Naturally, they needed their website to support both languages. We explored the option of building separate sites in Chinese and English. But the cool thing about the band is that they are English, but sing in Chinese. Bilinguality is an essential part of their identity. Showing the two languages side by side would probably work ok, especially since the two languages look quite different. We decided to give it a go.</p> <p><img alt="" height="587" src="https://hidde.blog/_images/transition-en-zh-.gif" width="861" /> <em>The Transition前進樂團 website has two languages side by side</em></p> <p><span class="caps">HTML</span> allows for language attributes, so that authors can define in which language content is written. Most people add one to the <code>&lt;html&gt;</code> element. The attribute can be useful for browsers, search engines and screen readers. For example, it can help a browsers suggest “This page is in Chinese. Can we translate this page to English for you?”, or help a screen reader decide to use a Chinese voice.</p> <p>This website uses:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>html</span> <span class="token attr-name">lang</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>en<span class="token punctuation">"</span></span><span class="token punctuation">></span></span></code></pre> <p>In the Transition site, pages contain both English and Chinese. I added <code>lang="en"</code> to the <span class="caps">HTML</span> element, and <code>lang="zh-TW"</code> to all bits of Chinese content. Content that is not in the page’s main language can be a breakpoint, especially if it’s in a non-Western language. Chinese text is much easier to read if it is aligned justified. Likewise, right-to-left reading language may require optimisations too.</p> <h2>Language breakpoints in <span class="caps">CSS</span></h2> <p>If the Chinese content is in elements with the correct language attribute, they can be styled with simple <span class="caps">CSS</span>. There are no language media queries, but there is something that works just as well: attribute selectors.</p> <p>Let’s say content in the default language is marked up like this:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>content-part<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span></code></pre> <p>And styled like this:</p> <pre class="language-css"><code class="language-css"><span class="token selector">.content-part</span> <span class="token punctuation">{</span> <span class="token property">text-align</span><span class="token punctuation">:</span> left<span class="token punctuation">;</span> <span class="token property">color</span><span class="token punctuation">:</span> black<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>The Chinese text is marked up the same, but with a <code>lang</code> attribute:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>content-part<span class="token punctuation">"</span></span> <span class="token attr-name">lang</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zh-TW<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span></code></pre> <p>For the Chinese bits, we would like the text to appear justified. And in purple, because we can. Chinese characters are all the same width, so justified alignment can make them more readable. We can do this by adding <code>[lang|=zh]</code> to the style rule. This applies to all content parts with a language attribute that starts with <code>zh</code>, i.e. all different kinds of Chinese.</p> <pre class="language-css"><code class="language-css"><span class="token selector">.content-part[lang|=zh]</span> <span class="token punctuation">{</span> <span class="token property">text-align</span><span class="token punctuation">:</span> justify<span class="token punctuation">;</span> <span class="token property">color</span><span class="token punctuation">:</span> purple<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <h3>Other options</h3> <p>There is also the <code>:lang()</code> selector, which can be used to apply style rules to content in a specific language. Differences:</p> <ul> <li>It does not only (?) look at the language attribute, it can also <a href="http://www.w3.org/TR/selectors/#lang-pseudo">uses browser technology</a> to decide what language content is in. Depending on the situation, this may be useful.</li> <li>It does not accept regular expressions, so in the case of Chinese, it does not let you write the rule for all different kinds of Chinese (zh-TW, zh-CN)</li> </ul> <p>Alternatively, one could also add classnames to content in a different language, and use those to style. See also: <a href="http://www.w3.org/International/questions/qa-css-lang">Styling using language attributes</a> by the W3C.</p> <h2>Conclusion</h2> <p>Like screen width conditions, language conditions can be adapted to with simple <span class="caps">CSS</span> rules. This is what makes the web such a great medium: if your document is well structured, there are a lot things you can do depending on specific conditions. Really, this is just <a href="https://www.gov.uk/service-manual/making-software/progressive-enhancement.html">progressive enhancement</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/breakpoints-based-on-language/">Breakpoints based on language</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Breakpoints based on language">Reply via email</a></p> Review: the Mobile Web Handbook 2014-09-18T00:00:00Z https://hidde.blog/review-the-mobile-web-handbook/ <p>Peter-Paul Koch, famous for <a href="http://www.quirksmode.org/book">PPK on JavaScript</a>, <a href="http://quirksmode.org/">Quirksmode.org</a> and more recently as a co-organiser of various Amsterdam-based web conferences just released his new book: the Mobile Web Handbook, published by <a href="https://shop.smashingmagazine.com/mobile-web-handbook.html">Smashing Magazine</a>.</p> <p><img src="https://hidde.blog/_images/mobweb-.jpg" alt="The Mobile Web Handbook" />! <em>I have read the book on a recent train trip from Bristol to Brighton. It is 227 pages and beautifully illustrated.</em></p> <p>Websites have been developed for more than one screen for a few years now. This inevitably followed from the rise of lots of different screen sizes. New phones, phablets, tablets, laptops and desktops with excellent and not so excellent browsers have come out and users simply started using those to visit our websites. As a response to the explosion of screen widths in our browser statistics, website owners could do nothing but adapt. Websites had to work on mobile.</p> <h2>Why we (still) need a handbook for mobile</h2> <p>By now, most of us have worked on websites made for lots of different screens. There are heaps of talks and articles out there to help. But development for mobile is complex, and untangling this complexity is important. The pixels, viewports and touch events that are discussed in the Mobile Web Handbook may be things we already use every day, but it is incredibly useful to see the concepts explained and annotated by someone with a lot of experience in testing browsers and mobile devices. </p> <h2>The book</h2> <p>The book starts with an introduction of the mobile world, which goes into things like market shares, OSes, stats (and how to interpret them) and strategies of device vendors, operators and browser makers. It gives a lot of useful background information, essential stuff to understanding the mobile world. More context of the mobile world is given throughout the book, for example in the chapter about (the politics of) Android. </p> <p>After this first chapter the book goes into the more technical aspects of mobile development: from browsers and viewports to pseudo class selectors in CSS and touch/pointer events in JavaScript.</p> <p>Towards the end of the book, a chapter is devoted to acquiring devices, with some useful hints as to which devices (not) to buy. This chapter, I found, is easier to read than to bring in practice. The argument for having real devices to test on is clear to me, but spending a hundred pounds every month on new devices would not work for me. As a freelancer, I prefer to use a combination of my own real devices, an Open Device Lab (like the <a href="http://odlbristol.co.uk/">Bristol ODL</a>) and even emulators. </p> <p>Last but not least, the last chapter is about the future of mobile web development, and contains various predictions on what to expect next.</p> <h2>Buy this book</h2> <p>If you’re not sure what the differences are between the visual viewport and the layout viewport, or between device pixels and CSS pixels, you have to read this book! The same goes if you would like to have better insight in the mobile landscape and the politics of (mobile-related) web standards. The ebook is <a href="https://shop.smashingmagazine.com/mobile-web-handbook.html">available</a> for direct download, and it seems that hard copies are going to be shipped sometime this month.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/review-the-mobile-web-handbook/">Review: the Mobile Web Handbook</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Review: the Mobile Web Handbook">Reply via email</a></p> Collaborate 2014: designing with empathy for all 2014-11-14T00:00:00Z https://hidde.blog/collaborate-2014-designing-with-empathy-for-all/ <p class="intro">At the lovely St George’s, Bristol-based UX agency <a href="http://nomensa.com/">Nomensa</a> organised Collaborate, a one day conference about user experience and (interaction) design.</p> <h2>Nick Finck – The nuances of UX</h2> <p><a href="http://nickfinck.com/">Nick Finck</a> started off with his talk “The Nuances of UX”. He focused on what he regards as the four things that make up a good user experience: details, simplification, process and research and showed various examples of each. </p> <h3>Details</h3> <p>Details like the background colour of a placeholder for an image that is going to be loaded or a descriptive diagram component staying in position when changing the thing it describes, can be great details that improve the UX in a way users would only notice when it is taken out. </p> <h3>Simplification </h3> <p>It is important to keep asking ourselves whether we really need whichever things we want to add to a web page. But we should not over-simplify, as that can lead us to miss important details, the work still needs to be done.</p> <h3>Process </h3> <p>Most of our processes are feature-driven, our world is driven by version numbers. Features and version numbers, though great for marketing, rarely they are a means to improve the user experience.</p> <h3>Research</h3> <p>It is important to look at how people use products. Making things merely understandable and usable is great, but we also need to focus on making them “bring joy and excitement, pleasure and fun, and, yes, beauty” as Don Norman said.</p> <p>Technology is moving so fast that what we thought was a solution for our business no longer is a couple of years later. The most important variable is, as Charles Darwin found, adaptability. </p> <h2>David Peter Simon – Representing information across channels</h2> <p>One of my favourite talks of the day was the one by <a href="http://davidpetersimon.com/">David Peter Simon</a> about the future of information architecture and portable content. He emphasised the importance of <strong>structured content first</strong>, a concept well introduced in Mark Boulton’s article <a href="http://markboulton.co.uk/journal/structure-first-content-always">Structure First. Content Always</a>.</p> <p>David Peter Simon showed the significance of structured content with examples from the ecosystem Amazon Kindle, the create-once-publish-everywhere approach of <span class="caps">NPR</span> and the structured content of Facebook stories.</p> <p>As I talked to a content editor during one of the breaks, I found “structured content” is quite a technical term. The difference between plain text content and structured content is that it is not just text, it has things like headings, emphasised words, links, images and lists. A job ad is usually not just plain text: it can be structured into bits like a job title, a location, a salary indication, a ‘apply before’ date, et cetera. A recipe will have things like a list of ingredients, a photo of the end result and a list of steps to follow. These are all things you could in principle display in a different colour of size, they signify different bits of content.</p> <p>Structured content is the most portable thing of a website. A job ad will always have a job title, a location, etc, whether it is displayed on a phone, a desktop computer or even a smart watch.</p> <p>An interesting example David Peter Simon showed was that of Facebook. Facebook, he said, “is the first service that can be used by anyone from very young to very old, because it has succeeded in structuring information in such a way that a mental model of the information is created so that it can be familiarised with, regardless of where it is displayed. It no longer requires cognitive load to recognise the content.”</p> <p>Thinking about responsive web design can be misleading as it often means thinking about (code) techniques. Thinking about mobile can be misleading as it often means thinking about a specific set of devices we want to support. Thinking about structured content does not have such problems, and therefore it is a perfect first step to create truly device agnostic experiences.</p> <p>Some links about (structured) content: </p> <ul> <li><a href="http://alistapart.com/article/future-ready-content">Future-ready content</a> by Sara Wachter-Boettcher on A List Apart</li> <li><a href="https://speakerdeck.com/stephenhay/sculpting-text">Sculpting text</a> (slides of <a href="http://the-haystack.com/">Stephen Hay</a>’s talk at Responsive Day Out)</li> </ul> <h2>Joshua Marshall – Empathy as a core feature</h2> <p>Joshua talked about what is one of the biggest miracles of the past few years: <span class="caps">GOV</span>.UK! Until earlier this year he was Head of Accessibility at the Government Digital Service, the UK government department tasked with ‘<a href="https://gds.blog.gov.uk/">leading the digital transformation of government</a> ’. </p> <p>After describing how the <span class="caps">GDS</span> and the new <a href="http://gov.uk/"><span class="caps">GOV</span>.UK</a> came about, Joshua discussed the place of accessibility in the project and on the web in general. Accessibility, he said, is about <strong>making it work for everyone</strong>. <span class="caps">GOV</span>.UK had 1.2 billion page views in the first year, that are a lot of people to annoying if it is not working right.</p> <p><img alt="" height="799" src="https://hidde.blog/_images/1415965144-screen-shot-2014-11-14-at-11.35.48-.png" width="1190" /> <em>Accessibility guidelines in the <span class="caps">GDS</span> Service Manual</em> </p> <p>An important part of enforcing things work for everyone is established by the <a href="https://www.gov.uk/design-principles">Design Principles</a>, which emphasises user needs. It explicitly lists things like making it simple to use and inclusive. There is also the <a href="https://www.gov.uk/service-manual">Service Manual</a>, which has a brilliant <a href="https://www.gov.uk/service-manual/user-centred-design/accessibility.html">part about accessibility</a>, very useful for those working on any website, not just government. </p> <p>The earlier you introduce accessibility in the project, the easier it becomes. In multidisciplinary teams, accessibility can be made the responsibility of each person in the team. With lots of semantics in the <span class="caps">HTML</span> standard and beyond (<span class="caps">WAI</span>-<span class="caps">ARIA</span>), accessibility is part of a modern web stack; old-fashioned looking websites do not follow from it, on the contrary.</p> <p>Design like you give a damn. A more accessible website is better at enabling users to do what they need to do. It is not about you, it is about what you empower your users to achieve. Focusing on simplicity, usability and accessible UX makes everything better for every one of your users.</p> <p>UX and accessibility both have empathy as their core value, so they should work together more. </p> <h2>Simon Norris – Digital first: a philosophy</h2> <p>The last speaker before lunch was Simon Norris, who doubled as the MC of the event. He discussed his concept of “Digital First” in three acts: past, present and future.</p> <p>Simon started off by giving us an overview of major events in the history of the world wide web. Most of these events only took place in the past few decades, great to realise. He then went on to the now and discussed the importance of the ‘in between’. Some UX practitioners tend to think of UX as if it were as series of screens or wireframes, which makes us forget to think about the in between, which, arguably, is more important. He then discussed the future of UX, in which he discussed interesting concepts around ecology, arguing they cannot be designed, only shaped.</p> <h2>Maya Middlemiss – The users’ experience of user experience</h2> <p>Maya Middlemiss, managing director of a company that specialises in recruiting respondents for usability research, shared some insights of this interesting and often less discussed part of usability. </p> <p>To recruit people to come into a user testing session can be anything from quite easy to very tricky, Maya said. It gets easier if it is for a well known brand and they agree to have their name disclosed to potential candidates, and it gets quite hard if it is for specialised products, especially if it is with regards to finance, as people are often more suspicious answering questions. On the test day, giving respondents simple refreshments, a glass of water or a sandwich, can help a great deal in making them feel welcome and comfortable.</p> <p>Maya shared various videos of respondents that had experienced a user testing session, and were happy to share what their experience was like. </p> <h2>Dan Healy – Making things totes emosh and dead amaze: engaging millennials online</h2> <p>Next up was Dan Healy, who works as a user researcher at Nationwide building society. In his job he does a lot of research into marketing for millennials, or young adults. In his very energetic talk, he shared some insights. </p> <p>There are lots of young people in the UK, and so far banks hardly pay attention to them in terms of marketing, usually focusing on their parents instead. Of Nationwide’s 16 million customers, 1.95 million are younger than 18, this is a group twice the size of Bristol’s population, too large to ignore.</p> <p>An important lesson, said Dan, is not to try and speak young people’s language, that can only go miserably wrong. Instead, <strong>be scientific about it</strong> and use tools to measure readability of text. On some occasions, a couple of difficult word can make a whole page difficult to understand for (young) readers. Improving such text can improve the site for everyone, not just young people. Don’t underestimate the impact small (copy) changes can make on cognitive load of a text.</p> <h2>Ben Bywater – user research: from full fat to lean</h2> <p>Ben Bywater works at MixRadio, formerly Nokia Music and talked about user research. He had interviewed tens of user researchers to find out where they worked (client-side or agency-side) and how much experience they had in the field.</p> <p>Ben encouraged us to be more pragmatic, calling pragmatism ‘the sweet spot between insight and resource’. It seems throughout the years the amount of time available for user research has declined, but user researchers have more influence on the end result. The best method to be more pragmatic is to do user testing. It can also be better do adapt more: agencies coaching in-house UX at clients. Increasing input can be good too, by establishing long term communities of users. Lastly Ben discussed measuring UX more, by using data analytics to measure the effectiveness of UX changes.</p> <h2>Thomas Wendt – the broken worldview of experience design</h2> <p>Building on the philosophical foundations of the German philosopher/phenomenologist Martin Heidegger, Thomas Wendt spoke about what he calls “Design for Da-sein”. </p> <p>Phenomenology can be regarded as the study of human experience. “Dasein” is a Heideggerian term that means something along the lines of an individual’s mode of being in the world.</p> <p>UX designers often assume users think rationally about their actions, but there can be a non-direction-ness in their behaviour. Websites like Instagram and Buzzfeed gain from this.</p> <p>Another assumption is that users think, then act, but often that is not the case, said Thomas. Actually, I think we can see that in e-commerce websites: sometimes it can be easy to trick customers into buying something by using emotionally appealing arguments like ‘most other people also bought this’.</p> <p>Thomas also talked about the importance of a designer’s intention. It is often portrayed as more important than everything else, but, he said, we should not prioritise it above adaptability, we could do without designer gods!</p> <p>More reading: </p> <ul> <li><a href="http://www.designfordasein.com/">Website of the forthcoming book Design for Dasein</a></li> <li><a href="http://plato.stanford.edu/entries/heidegger">Stanford Encyclopedia of Philosophy on Heidegger</a></li> </ul> <h2>Main theme: have empathy with users and design like you give damn</h2> <p>One of the recurring themes at Collaborate 2014 was that user experience is very much about having empathy for users and for <strong>all users</strong>. As a front-end developer this is a large part of my daily job. But as Joshua Marshall said, accessibility is a responsibility that should be shared across everyone in a team, as it should be part of <strong>every aspect of a web project</strong>. Not just in code, but also in user experience, visual design and, most importantly, well written content.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/collaborate-2014-designing-with-empathy-for-all/">Collaborate 2014: designing with empathy for all</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Collaborate 2014: designing with empathy for all">Reply via email</a></p> Review: Responsible Responsive Design 2014-11-21T00:00:00Z https://hidde.blog/review-responsible-responsive-design/ <p>It’s been 4 years since Ethan Marcotte’s seminal A List Apart article, and by now, responsive web design <a href="http://thomasbyttebier.be/blog/responsive-web-design-is-a-pleonasm">has become a pleonasm</a>. All proper web design is now responsive, and the question is no longer <em>if</em> we do responsive, it is <em>how</em> we do it and <em>why</em> we should do it better or more responsible.</p> <p>In the past few years, responsive web design has matured from the conceptual idea it once was. It influenced thinking about plenty related, general web design issues. Many have written about the role of structured content, web design software and progressive enhancement. As a front-end developer, I know this was also true for the code side of things. We started putting more thought into how content is delivered (<a href="https://developers.google.com/speed/docs/insights/PrioritizeVisibleContent">first</a>!), have been finding out which kind of client side detection mechanisms work (and which <a href="http://css-tricks.com/browser-detection-is-bad/">don’t</a>) and tried to come up with solutions for browser testing.</p> <p><img src="https://hidde.blog/_images/screen-shot-2014-11-22-at-14.17.47-.png" alt="Book cover" />! <em>The turquoise cover of ‘Responsible Responsive Design’, published by A Book Apart</em></p> <h2>Sound reasoning and well-explained code examples</h2> <p>So what about the book? I was excited for it to be released, being a fan of all the awesome articles and scripts Scott and the Filament Group have been releasing recently. When the book came out, it was an instant buy, I started reading the same evening.</p> <p>The most important facets of better responsive websites, according to Scott, are <em>usability</em>, <em>accessibility</em>, <em>sustainability</em> and <em>performance</em>. All four are described in detail in his book, with solid reasoning and handy code suggestions.</p> <p>‘Responsible Responsive Design’ is a very practical overview of discussions that happened in the past few years, and hands the reader sensible argumentation as per why some responsive strategies are preferable to others. “Finding” breakpoints vs defining them, progressive enhancement vs graceful degradation, ‘web-safe’ gestures vs false assumptions, feature detection vs browser sniffing, FOUT vs FOIT and much more. If technical arguments don’t convince, he also shows examples of big websites that use solutions like <a href="http://scottjehl.github.io/picturefill/">Picturefill</a> (Microsoft), <a href="https://github.com/filamentgroup/AppendAround">responsive source order scripts</a> (The Boston Globe) and <a href="https://github.com/filamentgroup/shoestring">Shoestring</a> (Lego).</p> <p>Secondly, other than explaining why some things are sensible solutions, Scott also explains how to do things with code examples, and walks the reader through the workings of some of the techniques he discusses, like the <a href="https://html.spec.whatwg.org/multipage/embedded-content.html#the-picture-element">sizes</a> attribute, <a href="http://responsivenews.co.uk/post/18948466399/cutting-the-mustard">cutting the mustard</a> and <a href="https://github.com/filamentgroup/loadCSS">loadCSS()</a>.</p> <h2>Responsible decision making</h2> <p>I found it very useful to read what Scott had to say about why we should do responsive design responsibly. Some benefits of the ‘responsible’ techniques are quite technical in nature, making them difficult to argue for. But they impact people everywhere. Arguing for those people is an important part of being a responsible responsive designer. Things like prioritising loading content over loading the fancy fonts, can be difficult to explain, and Scotts book makes this easier. It is easier to convince management to go for a cutting the mustard type of approach, if you can say that big organisations like the BBC and the Boston Globe do it, too.</p> <p>Anyway, I can highly recommend ‘Responsible Responsive Design’. If you ever design or build websites, and are unsure whether your responsive strategies are indeed responsible, read this book! </p> <h2>How to get the book</h2> <p>‘Responsible Responsive Design’ is <a href="http://www.abookapart.com/products/responsible-responsive-design">available from A Book Apart</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/review-responsible-responsive-design/">Review: Responsible Responsive Design</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Review: Responsible Responsive Design">Reply via email</a></p> Progressive enhancement with handlers and enhancers 2015-04-03T00:00:00Z https://hidde.blog/progressive-enhancement-with-handlers-and-enhancers/ <p class="intro">Recently I adopted a different way to manage bits of JavaScript in websites I was building. It exercises progressive enhancement (PE) by declaring handler and enhancer functions on <span class="caps">HTML</span> elements.</p> <p><strong>TL;DR</strong>: When JavaScript is used to handle user interactions like clicks, or enhance the page by manipulating the <span class="caps">DOM</span>, traditionally you’d have JavaScript find that <span class="caps">HTML</span> element in your page, and hook some code into it. But what if you’d switch that around, and have the <span class="caps">HTML</span> element “tell” JavaScript what function to execute?</p> <p>How? I declare JavaScript functions on <span class="caps">HTML</span> elements. Separating them to functions that happen on click and those that happen on page load, I use two attributes (<code>data-handler</code> and <code>data-enhancer</code>) that both get space-separated function names as their values. Then, with a little bit of JavaScript, I make sure the functions execute when they need to.</p> <p>Note that this works best for websites for which the mark-up is rendered on the server, to which JavaScript is added as an extra layer. Websites that rely on JavaScript for rendering content will probably have options to do the same within the framework they are built with.</p> <h2>Separating to handlers and enhancers</h2> <p>On many small to medium sized websites, the required JavaScript can be drilled down to two types of usage: </p> <ol> <li>things that need to happen on a click</li> <li>enhancements after the inital page load</li> </ol> <p>Surely, there are often other events we want to use for triggering JavaScript (scroll, anyone?), but let’s focus on these two types first.</p> <p>Many simple websites will have both types of script in a single <code>scripts.js</code> file, which is also used to query the nodes interactions need to happen on, and to add click handlers to those nodes.</p> <p>This year, <a href="http://krijnhoetmer.nl/">Krijn</a> and <a href="http://brinkhu.is/">Matijs</a> introduced me to a new way to go about this. It has proven to be a very powerful pattern in some of my recent projects, which is why I’d like to share it here. Credits for the pattern, and for the initialisation functions I will discuss later, go to them.</p> <h2>Including JavaScript functions to the declarative model</h2> <p>The pattern starts from the idea that web pages have three layers to them: structure (<span class="caps">HTML</span>), lay-out (<span class="caps">CSS</span>) and enhancement (JavaScript). <span class="caps">HTML</span> is a declarative language: as an author, you declare what you’d like something to be, and that is what it will be. </p> <blockquote class="in-content"> <p class="in-content">Let this be a header, let this be a list item, let this be a block quote.</p> </blockquote> <p>This is great, browsers can now know that ‘this’ is a list item, and treat it as such. Screenreaders may announce it as a list, your <span class="caps">RSS</span> reader or mobile Safari “reader view” can view it as a list, et cetera.</p> <p>With <span class="caps">CSS</span> we declare what things look like:</p> <blockquote class="in-content"> <p class="in-content">Let headers be dark blue, let list items have blue bullets and let block quotes render in slightly smaller type.</p> </blockquote> <p>This works rather well for us, because now we don’t need to think about what will happen if we add another list item. It being a list item, it will have the <span class="caps">CSS</span> applied to it, so it will have blue bullets. </p> <p>The idea I’d like to share here, is that of making JavaScript functions part of this declarative model. If we can declare what something looks like in <span class="caps">HTML</span>, why not declare what its behaviour is, too?</p> <h2 id="handlers">Handlers: things that happen on a click</h2> <p>The idea is simple: we introduce a <code>data-handler</code> attribute to all elements that need to trigger function execution. As their value, we add one or more functions name(s) that need(s) to execute on click. </p> <p>For example, here’s a link:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>#punk-ipa<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>More about Punk IPA<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span></code></pre> <p>This is an in-page link to a section that explains more about Punk <span class="caps">IPA</span>. It will work regardless of JavaScript, but can be improved with it.</p> <p>Cooler than linking to a section about Punk <span class="caps">IPA</span>, is to have some sort of overlay open, with or without a fancy animation. We add a <code>data-handler</code> attribute:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>#punk-ipa<span class="token punctuation">"</span></span> <span class="token attr-name">data-handler</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>overlay<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>More about Punk IPA<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span> </code></pre> <p>In the data-handler, the value holds a function name, in this case ‘overlay’. The idea is that the overlay function executes when the link is clicked. Naturally, you would be able to add more than one function name, and separate function names by spaces. This works just like <code>class="foo bar"</code>.</p> <p>Within the function declaration, we will know which element was clicked, so we can access attributes. We can access the <code>href</code> or any data attribute. With that, it can grab the content that’s being linked to, append it into some sort of overlay, and smoothly transition the overlay into the page.</p> <p>Note that this is similar to doing <code>&lt;a onclick=&quot;overlayfunction(); anotherfunction();&quot;&gt;</code> , but with the added benefit that a <code>data-handler</code> only gets meaning once JavaScript is active and running, and that it contains strings like <span class="caps">CSS</span> classes, instead of actual JavaScript code. This way, the scripting is separated in the same way as the style rules are.</p> <p>Also note that is best practice to only add handlers to <span class="caps">HTML</span> elements that are made for click behaviour, like <code>&lt;button&gt;</code>s and <code>&lt;a&gt;</code>.</p> <h3>Adding function definitions</h3> <p>In our JavaScript (e.g. an included <code>scripts.js</code> file), we add all functions for click behaviour to one object: </p> <pre class="language-javascript"><code class="language-javascript"><span class="token keyword">var</span> handlers <span class="token operator">=</span> <span class="token punctuation">{</span> <span class="token string-property property">'function-name'</span> <span class="token operator">:</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token parameter">e</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token comment">// This function is executed on click of any element with </span> <span class="token comment">// 'function-name' in its data-handler attribute.</span> <span class="token comment">// The click event is in 'e', $(this).attr('data-foo') holds the</span> <span class="token comment">// value of data-foo of the element the user clicked on </span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token string-property property">'another-function-name'</span> <span class="token operator">:</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token parameter">e</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">;</span></code></pre> <p>Those working in teams could consider making the handler object global. That way functions can have their own files, making collaboration through version control easier.</p> <h3>Adding click handling: one handler to rule them all</h3> <p>If we set all our click-requiring functionality up within <code>data-handler</code> attributes, we only need to attach one click handler to our document. <a href="http://davidwalsh.name/event-delegate">Event delegation</a> can then be used to do stuff to the actual element that is clicked on, even when that actual element did not exist on page load (i.e. was loaded in with <span class="caps">AJAX</span>).</p> <p>This function (jQuery) can be used to handle clicks, then search through the handler functions and apply the ones specified in the data-handler function:</p> <pre class="language-javascript"><code class="language-javascript"><span class="token function">$</span><span class="token punctuation">(</span><span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token string">'use strict'</span><span class="token punctuation">;</span> <span class="token comment">// generic click handler</span> <span class="token function">$</span><span class="token punctuation">(</span>document<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">on</span><span class="token punctuation">(</span><span class="token string">'click'</span><span class="token punctuation">,</span> <span class="token string">'[data-handler]'</span><span class="token punctuation">,</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token parameter">event</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token keyword">var</span> handler <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">getAttribute</span><span class="token punctuation">(</span><span class="token string">'data-handler'</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// honour default behaviour when using modifier keys when clicking</span> <span class="token comment">// for example:</span> <span class="token comment">// cmd + click / ctrl + click opens a link in a new tab</span> <span class="token comment">// shift + click opens a link in a new window</span> <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>tagName <span class="token operator">===</span> <span class="token string">'A'</span> <span class="token operator">&amp;&amp;</span> <span class="token punctuation">(</span>event<span class="token punctuation">.</span>metaKey <span class="token operator">||</span> event<span class="token punctuation">.</span>ctrlKey <span class="token operator">||</span> event<span class="token punctuation">.</span>shiftKey<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token keyword">return</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>handlers <span class="token operator">&amp;&amp;</span> <span class="token keyword">typeof</span> handlers<span class="token punctuation">[</span>handler<span class="token punctuation">]</span> <span class="token operator">===</span> <span class="token string">'function'</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> handlers<span class="token punctuation">[</span>handler<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">call</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">,</span> event<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>window<span class="token punctuation">.</span>console <span class="token operator">&amp;&amp;</span> <span class="token keyword">typeof</span> console<span class="token punctuation">.</span>log <span class="token operator">===</span> <span class="token string">'function'</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">'Non-existing handler: "%s" on %o'</span><span class="token punctuation">,</span> handler<span class="token punctuation">,</span> <span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> <p>(<a href="https://gist.github.com/matijs/5b2d6675265ec440bcba">Source</a>; see also <a href="https://gist.github.com/matijs/9bb314a9a184b53952e2">its vanilla JavaScript version</a>)</p> <h2 id="enhancers">Enhancers: things that happen after page load</h2> <p>We can run functions to enhance elements in a similar way, by adding their function names to a <code>data-enhancer</code> attribute. The corresponding functions go into a <code>enhancers</code> object, just like the <code>handlers</code> object above.</p> <p>For example, a page element that needs to display tweets. Again, here’s a link:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://twitter.com/bbc<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Tweets of the BBC<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span></code></pre> <p>To enhance this link to the <span class="caps">BBC</span>’s tweets, we may want to load a widget that displays actual tweets. The function to do that may add some container <code>&lt;div&gt;</code> s, and run some calls to the Twitter <span class="caps">API</span> to grab tweets. To trigger this function:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://twitter.com/bbc<span class="token punctuation">"</span></span> <span class="token attr-name">data-enhancer</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>twitter-widget<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> Tweets of the BBC<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span></code></pre> <p>To find out whose Twitter widget to display, our function could analyse the <span class="caps">URL</span> in the <code>href</code> attribute, or we can add an extra attribute:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://twitter.com/bbc<span class="token punctuation">"</span></span> <span class="token attr-name">data-enhancer</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>twitter-widget<span class="token punctuation">"</span></span> <span class="token attr-name">data-twitter-user</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>bbc<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Tweets of the BBC<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span></code></pre> <p>Another example: of a large amount of text, we want to hide all but the first paragraph, then add a “Show all” button to show the remainder. The <span class="caps">HTML</span> will contain all of the content, and we will hide the remainder with JavaScript.</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>section</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">></span></span>Some text<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">></span></span>Some more text<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">></span></span>Some more text<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>section</span><span class="token punctuation">></span></span></code></pre> <p>To the block of text we add a data-enhancer function that makes sure everything but the first paragraph is hidden, and a “Show all” button is added.</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>section</span> <span class="token attr-name">data-enhancer</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>only-show-first-paragraph<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">></span></span>Some text<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">></span></span>Some more text<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">></span></span>Some more text<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>section</span><span class="token punctuation">></span></span></code></pre> <p>A function named ‘only-show-first-paragraph’ could then take care of removing the content, and adding a button that reveals it (this button could have a <code>data-handler</code> for that behaviour).</p> <h3>Running all enhancements</h3> <p>Assuming all our <code>enhancer</code> functions are in one <code>enhancer</code> object, we can run all <code>enhancers</code> on a page with one function. The function looks for all elements with a <code>data-enhancer</code> attribute, and calls the appropriate functions.</p> <pre class="language-javascript"><code class="language-javascript"><span class="token function">$</span><span class="token punctuation">(</span><span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token string">'use strict'</span><span class="token punctuation">;</span> <span class="token comment">// kick off js enhancements</span> <span class="token function">$</span><span class="token punctuation">(</span><span class="token string">'[data-enhancer]'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">each</span><span class="token punctuation">(</span><span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token keyword">var</span> enhancer <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">getAttribute</span><span class="token punctuation">(</span><span class="token string">'data-enhancer'</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>enhancers <span class="token operator">&amp;&amp;</span> <span class="token keyword">typeof</span> enhancers<span class="token punctuation">[</span>enhancer<span class="token punctuation">]</span> <span class="token operator">===</span> <span class="token string">'function'</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> enhancers<span class="token punctuation">[</span>enhancer<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">call</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>window<span class="token punctuation">.</span>console <span class="token operator">&amp;&amp;</span> <span class="token keyword">typeof</span> console<span class="token punctuation">.</span>log <span class="token operator">===</span> <span class="token string">'function'</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">'Non-existing enhancer: "%s" on %o'</span><span class="token punctuation">,</span> enhancer<span class="token punctuation">,</span> <span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> <h2>Wrap-up</h2> <p>So the basic idea is: functions for click behaviour are handlers, and those that happen on page load are enhancers. They are stored in a <code>handlers</code> and <code>enhancers</code> object respectively, and triggered from <span class="caps">HTML</span> elements that have <code>data-handler</code> and <code>data-enhancer</code> attributes on them, to declare which functions they need.</p> <p>In summary: </p> <ol> <li>All functions that need to execute on click (or touch or pointer events), are declared on the <span class="caps">HTML</span> element that should trigger the click, in a <code>data-handler</code> attribute</li> <li>All functions that need to change/enhance stuff on the <span class="caps">DOM</span>, are declared on the <span class="caps">HTML</span> element they need to change, in a <code>data-enhancer</code> attribute</li> <li>Two JavaScript functions run through <code>data-handler</code> and <code>data-enhancer</code> attributes respectively, and execute all functions when they are required</li> </ol> <h2>Thoughts?</h2> <p>This pattern is not new, similar things have been done by others. Rik Schennink wrote about <a href="http://rikschennink.nl/thoughts/controlling-behaviour/">controlling behaviour</a> before, and his <a href="http://conditionerjs.com/">conditioner.js</a> deserves special mention. It is a library that not only manages modules of JavaScript, it also activates them based on responsive breakpoints, something the pattern described here does not do out of the box (it could).</p> <p>For me and teams I worked in, the above has proven to be a useful way to declare actions and enhancements within pages. It adds maintainability, because it helps keeping functions organised. It also promotes reusability: although new functions can be added for each use, multiple elements can make use of the same function. </p> <p>The method is not perfect for every project, and it can definitely be improved upon. For example, we could add the function that triggers all <code>data-handler</code> functions to an enhancer ( <code>&lt;html data-enhancer=&quot;add-handlers&quot;&gt;</code> ), as it is an enhancement (of the page) by itself. In big projects with many people working on the same codebase, it may be useful to have all functions in separate files and have a globally available handlers object.</p> <p><em>Update 07/04/2015</em>: I have opened comments, would love to hear any feedback</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/progressive-enhancement-with-handlers-and-enhancers/">Progressive enhancement with handlers and enhancers</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Progressive enhancement with handlers and enhancers">Reply via email</a></p> On cognitive accessibility 2015-04-04T00:00:00Z https://hidde.blog/on-cognitive-accessibility/ <p class="intro">This week I attended my first <a href="http://www.meetup.com/Accessible-Bristol/">Accessible Bristol</a>, which was an interesting talk by <a href="https://twitter.com/acuity_design">Alastair Somerville</a> about cognitive accessibility. <a href="http://www.slideshare.net/Someral/sensing-happiness-talk-for-accessible-bristol-31-march-2015">Slides</a> are available.</p> <p>Although I had worked on accessible websites before, and seen my bit of cognitive science at university, the combination of accessibility and cognition in one term was new to me. Cognitive accessibility, Alastair described, is the state you reach when something is perceivable, intelligible <em>and</em> actionable by as many people as possible. All three will have to be the case for it to work. </p> <p>Alastair showed some example projects where he worked on improving cognitive accessibility, including the application of an urban design paradigm called “<a href="http://en.wikipedia.org/wiki/Shared_space%E2%80%9D">shared space</a> at Exhibition Road in London.</p> <h3>Making things accessible cognitively, is about personalisation</h3> <p>The impairments we are looking at are things like dyslexia and autism, but also dementia and ageing. Cognitive impairments apply to all users: not only do we all age, situations of cognitive impairment happen to us all. This can be as simple as being in a foreign country, unable to read the menu. For it applies to all of us, cognitive accessibility is about inclusion, Alastair argued.</p> <p>This is what we should design for, too. Alastair shared these words by Dieter Rams (citation needed):</p> <blockquote class="in-content"> <p class="in-content">Indifference towards people and the reality in which they live is actually the one and only cardinal sin in design.</p> </blockquote> <p>So, in other words, for designers to impose a reality onto your users is a bad thing. All people are different, cognitive impairment differs from person to person. Instead, designers should try to understand the reality the user is in and start from there. Cognitive accessibility, then, Alastair said, is about personalisation. It is about making something work for someone, or for someone’s personal reality, so to say.</p> <h3>Interesting projects in cognitive accessibility</h3> <p>There are many (research) projects in cognitive accessibility going on, Alastair shared some of those: </p> <ol> <li>Eiman Kanjo’s research on emotion in place / redesigning physical space</li> <li>The <a href="http://www.w3.org/WAI/PF/cognitive-a11y-tf/">W3C Cognitive and Learning Disabilities Accessibility Task Force</a>, and Jamie Knight’s blog posts: <a href="http://jkg3.com/Journal/cognitive-accessibility-101-part-1-what-is-cognitive-accessibility">part 1</a> and <a href="http://jkg3.com/Journal/cognitive-accessibility-101-part-2-how-it-effects-me-the-tools-i-use">part 2</a></li> <li>Steve Maslin (Schumacher institute, Bristol), works in physical design. His <a href="https://stevemaslin.wordpress.com/2015/02/06/design-for-the-mind/">blog post about design for the mind</a></li> <li>The US Army is doing really interesting research on a thing called ”responsive data load through emotionally aware devices”</li> </ol> <h3>Designing for happiness </h3> <p>Concluding, Alastair described happiness as “well directed attention”, so being happy is when your attention is well directed. Attention is a feature of one’s cognition, hence it is very personal, and personalisation is the strategy to make things more accessible cognitively. This brings us to the equation Alastair ended with: cognitive accessibility = personalisation = design for happiness. </p> <p>This isn’t an easy thing to do, because if happiness is so personal, the problem, I think, would be that one thing is used by a lot of different persons. How can we keep all happy, personalise for those who need it, yet don’t disturb those who don’t? </p> <p>Building a website, for example, one can define focus styles. That way keyboard users can keep track of the element currently in focus. Often though, I have worked with designers that would ask me to remove the focus styles, because they also showed up for non-keyboard users, which did not fit in the look and feel they had in mind. The Dieter Rams quote applies to those designers, obviously, but surely I can understand what they want is make a pretty website. </p> <p>Another website-related example is skip links: they can be very useful for specific people that use them, for others they might feel unnecessary. Many websites only show them when a tab key is pressed, which is a way to make them available to those who need them, yet invisible for those who don’t. An <a href="http://www.ixda.org/local/event/33625">interesting talk</a> I saw about this was by Johan Huijkman of <a href="http://q42.com/">Q42</a>, who has added lots of a11y improvements to Dutch public transport website <a href="http://9292.nl/">9292.nl</a> that were invisible to most, yet available to those in need. <a href="http://www.slideshare.net/huijkman/ux-candydxf181212">Slides</a> available (in Dutch). He too related accessibility to the user’s experience, and called the accessibility layer “invisible” UX.</p> <p>Making accessibility invisible is not always the best solution: traffic lights that indicate their state with warning sounds, for example, are just out there, offering a useful level of cognition to users that need it. Or subtitles/dubbing added to speech in foreign languages on television: it is made visible/audible to all, including those who do understand the foreign language.</p> <p>How can we decide which levels of accessibility to add, what to improve, and how to do this? Alastair mentioned various ways, including testing with (cognitively impaired) users. He also mentioned it can help to read personal blogs of those who are cognitively impaired and describe how they interact, whether physically or digitally. In the end, it is all about caring more about the reality your users live in, and less about your own.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/on-cognitive-accessibility/">On cognitive accessibility</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20On cognitive accessibility">Reply via email</a></p> Switching to HTTPS 2015-04-12T00:00:00Z https://hidde.blog/switching-to-https/ <p class="intro">From yesterday, this website is only available via <span class="caps">HTTPS</span>. In this post I will explain my reasons for making the switch, and how I did it at Webfaction.</p> <h2><span class="caps">HTTP</span> with <span class="caps">SSL</span></h2> <p><span class="caps">HTTPS</span> stands for HyperText Transfer Protocol with Secure Sockets Layer, or <strong><span class="caps">HTTP</span> with <span class="caps">SSL</span></strong> for short. Data over <span class="caps">HTTP</span> is sent as plain text. Data over <span class="caps">HTTPS</span> is encrypted before it is sent off, and not decrypted until it arrives at the user.</p> <p><span class="caps">HTTPS</span> is great and a must-use for websites that deal with sensitive data, e.g. credit card details, because sending such data in plain text would make it trivial to intercept. With <span class="caps">HTTPS</span>, the data is encrypted, and thus safe from hackers, at least in theory.</p> <p>The certificates that are required to serve your website over <span class="caps">HTTPS</span> are not expensive (starting at £10 per year), and there are various initiatives that aim at make it easier or free. <a href="https://letsencrypt.org/howitworks/">Let’s encrypt</a>, sponsored by Mozilla and <span class="caps">EFF</span>, amongst others, looks promising. What’s more, you used to need a dedicated IP address, but if your server supports <a href="https://en.wikipedia.org/wiki/Server_Name_Indication"><span class="caps">SNI</span></a>, this is no longer required. Note that not all browsers support the latter (notably IE6 and older versions of Android).</p> <h2 id="why">Why use it on this website?</h2> <p>“Your website contains just some blog posts”, I hear you say, “so why would you encrypt it?” Even for sites that do not take sensitive data like payment details, there are additional benefits of <span class="caps">HTTPS</span> over <span class="caps">HTTP</span>. The most important one is content integrity. </p> <h3>Content integrity </h3> <p>The user can be more certain that the content is genuine. On a news website, we want to be sure the news stories were not meddled with. There is quite a number of countries where the state censors the news by default. If in such countries, news websites send their content over plain text, it is much easier for their government to change what is being served, e.g. replace all instances of “war” with “peace”.</p> <p>I am the last to pretend anyone would want to alter information on my website, but for the sake of argument: even on this website content integrity could be an issue. Serving over <span class="caps">HTTPS</span> makes sure that the phone number on my contact page is not replaced by that of someone with malicious intentions. </p> <h3>Preventing ad insertion</h3> <p>Imagine you are on a WiFi hotspot. If the owner of the hotspot wants to earn some extra money, they could insert advertising into websites served via their internet connection (<a href="http://arstechnica.com/tech-policy/2014/09/why-comcasts-javascript-ad-injections-threaten-security-net-neutrality/">happens</a>). This would not work on websites that are served over <span class="caps">HTTPS</span>, hence this website stays the way it was intended to.</p> <h3>Protecting form data</h3> <p>If you want to comment below, I will require your name and email address. Imagine you leave a comment whilst on airport WiFi and someone in the lounge is bored and listens in for e-mail addresses going over the line. They could, if you submit the data over non-secure <span class="caps">HTTP</span>. With <span class="caps">HTTPS</span> on, we can be more sure that this data goes from you to me, and nowhere else.</p> <h3>Securing my back-end logins</h3> <p>The content on this website is managed by <a href="http://grabaperch.com/">Perch</a>. If I log in to add new content whilst on public WiFi, my (login) data will be encrypted. The same applies when I access my website’s analytics package, <a href="http://piwik.org/">Piwik</a>.</p> <h3>Other potential benefits</h3> <p>A personal benefit of serving my site over <span class="caps">HTTPS</span> is that I will now be able to experiment with new standards like <a href="http://www.w3.org/TR/service-workers/">Service Workers</a>, which is only available for websites served over <span class="caps">HTTPS</span>.</p> <p>Another benefit in the long term, could be if search engines start to prefer sites that are served over <span class="caps">HTTPS</span>. Google has said <a href="http://googlewebmastercentral.blogspot.co.uk/2014/08/https-as-ranking-signal.html">they will</a>. This makes serving over <span class="caps">HTTPS</span> more attractive to those interested in a higher search engine ranking. Yes, that’s right, serving your website over <span class="caps">HTTPS</span> optimises your <span class="caps">SEO</span> in search engines.</p> <h2 id="how">How I did it</h2> <p>To get a signed certificate for your domain and serve your content over <span class="caps">HTTPS</span>, these are the steps:</p> <ol> <li><em>Applying for a certificate</em> <br /> Create a key on your web server, use it to generate a Certificate Signing Request (<span class="caps">CSR</span>) and give the <span class="caps">CSR</span> to a Certification Authority</li> <li><em>Uploading the certificate</em> <br /> When the Certification Authority has been able to sign your certificate and has returned it to you, upload the certificate to your server</li> <li><em>Installing the certificate</em> <br /> Install the certificate by enabling <span class="caps">HTTPS</span> on the server and reloading the server configuration</li> </ol> <p>My host, Webfaction, was able to do the last step for me, so I only had to do the first two steps myself: applying for the certificate and uploading the signed certificate.</p> <h3>Applying for a certificate</h3> <p>Certificates are sold by many different providers, I bought mine at <a href="https://sslcertificaten.nl/">sslcertificaten.nl</a>. </p> <p>There are various types of certificates, they differ in how much is actually verified. The ones that are only domain name verified seem to be the simplest, I went for one of those. They can be as cheap as ten pounds per year. There are more complex ones that involve more thorough checks and will cost around a hundred pounds. Certificates are for one domain only, unless you buy one with a wildcard. They are more expensive than single domain certificates, but will work for <code>anything.yourdomain.com</code>. </p> <p>In the purchase process,you will be asked to input a Certificate Signing Request (<span class="caps">CSR</span>). The easiest way to generate one, it by opening an <span class="caps">SSH</span> session to your webserver in your terminal:</p> <pre class="language-bash"><code class="language-bash"><span class="token function">ssh</span> yourserver </code></pre> <p>Then, create a key (replace ‘domainname’ with any name):</p> <pre class="language-bash"><code class="language-bash">openssl genrsa <span class="token parameter variable">-out</span> domainname.key <span class="token number">2048</span></code></pre> <p>A key file <em>domainname.key</em> is created. Then create the signing request:</p> <pre class="language-bash"><code class="language-bash">openssl req <span class="token parameter variable">-new</span> <span class="token parameter variable">-key</span> domainname.key <span class="token parameter variable">-out</span> domainname.csr</code></pre> <p>The command prompt will ask you for some information. When asked for a “common name”, enter the domain name that you need the certificate to work on (in my case: hiddedevries.nl).</p> <p>Then, to copy the <span class="caps">CSR</span>, type this:</p> <pre class="language-bash"><code class="language-bash"><span class="token function">more</span> domainname.csr</code></pre> <p>The code will appear in your Terminal window, ready to copy and paste.</p> <p>Depending on where you buy your certificate, you will have to fill in your information to complete the purchasing process.</p> <p>In the type of certificate I chose, the only verification step was done with an email from the Certification Authority to admin@mydomain. The e-mail contained a link that I, i.e. the person with access to the domain name’s admin email address, could click to approve the certificate request. </p> <p>About 15 minutes after approving the certificate request, I was sent my certificate. For the certificate to function, they sent me two other certificates: a root certificate and an intermediate certificate. </p> <h3>Uploading the certificate</h3> <p>Using <span class="caps">SFTP</span>, I uploaded my certificate, the root certificate and the intermediate certificate, to the root of my web server.</p> <h3>Installing the certificate</h3> <p>To get the certificate installed, I opened a support ticket at Webfaction, as per <a href="http://docs.webfaction.com/user-guide/websites.html#secure-sites-https">their instructions</a>. Fifteen minutes later I received an email stating that the certificate had been installed.</p> <h2>That’s about it</h2> <p>I have little experience of how it works at other hosting providers, but was quite pleased to see how quick it went at mine. Basically, I uploaded the files and got in touch with support, who then did the rest. Whether “the rest” is incredibly painful, or just a few simple steps, I am not sure (<a href="https://www.digicert.com/ssl-certificate-installation-apache.htm">instructions for Apache</a>).</p> <p>Note that once it is setup, you should also make sure your assets (<span class="caps">CSS</span>, JavaScript, images) are served over <span class="caps">HTTPS</span>. If you use <span class="caps">CDN</span>s, use one that supports <span class="caps">HTTPS</span>. Likewise, if you use plug-ins that do stuff with <span class="caps">URL</span>s, make sure they know about the change (or use relative <span class="caps">URL</span>s). </p> <p>Some further reading/tips about <span class="caps">HTTPS</span>:</p> <ul> <li><a href="https://en.wikipedia.org/wiki/HTTPS"><span class="caps">HTTPS</span></a> on Wikipedia</li> <li><a href="http://www.wired.com/2014/04/https/">It’s time to encrypt the entire internet</a> by Klint Finley</li> <li><a href="https://letsencrypt.org/howitworks/">Let’s encrypt</a></li> <li><a href="https://www.eff.org/https-everywhere"><span class="caps">HTTPS</span> Everywhere</a></li> </ul> <p>But also: </p> <ul> <li><a href="http://www.sott.net/article/275524-Why-HTTPS-and-SSL-are-not-as-secure-as-you-think">Why <span class="caps">HTTPS</span> and <span class="caps">SSL</span> are not as secure as you think</a> by Scott Ogrin</li> <li><a href="http://blog.codinghorror.com/should-all-web-traffic-be-encrypted/">Should all web traffic be encrypted?</a> by Jeff Atwood</li> </ul> <hr/> <p>Originally posted as <a href="https://hidde.blog/switching-to-https/">Switching to HTTPS</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Switching to HTTPS">Reply via email</a></p> Making our websites even more mobile friendly 2015-04-16T00:00:00Z https://hidde.blog/making-our-websites-even-more-mobile-friendly/ <p class="intro">From 21 April, Google <a href="http://googlewebmastercentral.blogspot.co.uk/2015/02/finding-more-mobile-friendly-search.html">will start</a> preferring sites it considers “mobile friendly”. The criteria are listed in a <a href="http://googlewebmastercentral.blogspot.co.uk/2015/02/finding-more-mobile-friendly-search.html">blog post</a> and Google provide a <a href="http://www.google.com/webmasters/tools/mobile-friendly/">tool for web masters</a> to check whether they deem websites eligible for the label.</p> <p>First, we should define what we are trying to be friendly for here. What’s the ‘mobile’ in ‘mobile friendly’? Is it people on small screen widths, people on the move, people with a slow connection? The latter is interesting, as there are people using their fast home WiFi on a mobile device on the couch or loo. There are also people who access painfully slow hotel WiFi on their laptops.</p> <p>Assumptions are pretty much useless for making decisions about what someone is <em>doing</em> on your site. Mobile, <a href="http://www.lukew.com/ff/entry.asp?1333">as</a> <a href="https://adactio.com/journal/4443/">argued</a> <a href="http://globalmoxie.com/blog/mobile-context-stats.shtml">before</a> <a href="http://www.the-haystack.com/2012/07/09/great-works-of-fiction-presents-the-mobile-context/">by</a> <a href="http://mark-kirby.co.uk/2011/the-mobile-context/">many</a>, is <em>not</em> a context that helps us make design decisions. We’ll accept that for the purpose of this article, and think of mobile as a worst-case scenario that we can implement technical improvements for: people on-the-go, using small devices on non-stable connection speeds.</p> <h2>Great principles to start with</h2> <p>So what are Google’s criteria for mobile friendliness? According to their blog post, they consider a website mobile friendly if it:</p> <blockquote class="in-content"> <p class="in-content"></p><ul> <li>Avoids software that is not common on mobile devices, like Flash</li> <li>Uses text that is readable without zooming</li> <li>Sizes content to the screen so users don’t have to scroll horizontally or zoom</li> <li>Places links far enough apart so that the correct one can be easily tapped<br /> (<a href="http://googlewebmastercentral.blogspot.co.uk/2015/02/finding-more-mobile-friendly-search.html">Source</a>)</li><br /> </ul><p></p> </blockquote> <p>Websites that stick to these criteria will be much friendlier to mobile users than websites that don’t. Still, do they cover all it gets to be mobile friendly? </p> <h3>It passes heavy websites, too</h3> <p>At Fronteers, we celebrated April Fool’s by announcing, tongue-in-cheek, that we went all Single Page App. We included as many JavaScript libraries into the website as we could, without ever actually making use of them. It made the page much heavier in size. We also wrapped all of our markup in <code><noscript></noscript></code> elements, with no actual JavaScript code to fetch and render content. The site became non-functional for users with JavaScript on. External scripts were included in the <code>&lt;head&gt;</code> of the page, so that their requests would block the page from rendering. With JavaScript turned off, the site was usable as usual, with JavaScript on, all the user saw was an animated spinner gif.</p> <p><img alt="Screenshot of Fronteers website" height="345" src="https://hidde.blog/_images/screenshot-.jpg" title="Screenshot of Fronteers website" width="500" /> <em>All the user saw was an animated spinner gif</em></p> <p>Probably not particularly funny, but it showed a problem that many modern websites have: loading content is made dependent on loading JavaScript, and lots of it. This is not user friendly, and certainly not friendly to users on wobbly mobile connections. In our extreme case, the content was made inaccessible. Still, as Krijn Hoetmer pointed out on Twitter this morning, the joke —still live on <a href="https://fronteers.nl/blog/2015/04/fronteers-spaof">the page announcing it</a> (view the source) — passed Google’s test for mobile friendliness:</p> <blockquote class="tweet in-content"> <p class="tweet in-content">Nope, Google, a media query doesn’t make a site “Mobile-friendly”. Your algo needs some love: <a href="https://www.google.nl/search?q=site:fronteers.nl/blog/2015/04/fronteers-spaof&gws_rd=cr&ei=zawwVaaBEdPaarqlgNgF">google.com/search?q=site:…</a> <a href="https://pbs.twimg.com/media/CCnsNWdVEAA8UNm.jpg%3Alarge">pic.twitter.com/GPgEfkpKLV</a></p> </blockquote> <p>I think he is right, the algorithm could be improved. This is not trivial, because the algorithm has no way to find out if we intended to do anything more than display a spinner. Maybe we really required all the frameworks.</p> <p>The tweet inspired me to formulate some other criteria that are not currently part of Google’s algorithm, but are essential for mobile friendliness.</p> <h2>Even more friendly mobile sites</h2> <p>There are various additional things we can do:</p> <h3>Minimise resources to reach goals</h3> <p>Slow loading pages are particularly unfriendly to mobile users. Therefore, we should probably:</p> <ul> <li><em>Be careful with web fonts</em><br /> Using web fonts instead of native fonts often cause blank text due to font requests (<a href="https://www.igvita.com/2015/04/10/fixing-the-blank-text-problem/">29% of page loads on Chrome for Android displayed blank text</a>). This is even worse for requests on mobile networks as they often travel longer. Possible warning: “Your website’s text was blank for x seconds due to web fonts”</li> <li><em>Initially, only load code we absolutely need</em><br /> On bad mobile connections, every byte counts. Minimising render-blocking code is a great way to be friendlier to mobile users. Tools like Filament’s <a href="https://github.com/filamentgroup/loadCSS">loadCSS</a> / <a href="https://github.com/filamentgroup/loadJS">loadJS</a> and Addy Osmani’s <a href="https://github.com/addyosmani/critical">Critical</a> are useful for this. Possible warning: “You have loaded more than 300 lines of JavaScript, is it absolutely needed before content display?”</li> <li><em>Don’t load large images on small screens</em> <br /> Possible warning: “Your website shows large images to small screens”</li> </ul> <p>Google has fantastic resources for measuring page speed. Its tool <a href="https://developers.google.com/speed/pagespeed/insights/">Pagespeed Insights</a> is particularly helpful to determine if you are optimising enough. A reason not to include it in the “mobile friendly” algorithm, is that speed is arguably not a mobile specific issue. </p> <h3>Use enough contrast</h3> <p>If someone wants to read your content in their garden, on the window seat of a moving train or anywhere with plenty of light, they require contrast in the colours used. The same applies to users with low brightness screens, and those with ultramodern, bright screens who turned down their brightness to deal with battery incapacity. </p> <p>Using grey text on a white background can make content much harder to read on small screens. Added benefit for using plenty of contrast: it is also <a href="http://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast">a good accessibility practice</a>.</p> <p>Again, this is probably not mobile specific; more contrast helps many others. </p> <h3>Attach our JavaScript handlers to ‘mobile’ events</h3> <p>Peter-Paul Koch dedicated a chapter of his <a href="http://www.smashingmagazine.com/2014/04/29/meet-mobile-web-handbook-new-smashing-book-peter-paul-koch/">Mobile Web Handbook</a> to touch and pointer events. Most mobile browsers have mouse events for backwards compatibility reasons (<span class="caps">MWH</span>, 148), he describes. That is to say, many websites check for mouse clicks in their scripts. Mobile browser makers decided not to wait for all the developers to also check for touch behaviour. So, mobile browser makers implemented a touch version of the mouse click behaviour, so that click events also fired on touch.</p> <p>Most mobile browsers listen to touch events, like <code>touchstart</code> or <code>gesturechange</code> (iOS). So maybe we could measure mobile friendliness by checking if such events are listened to? This is a tricky one, because a script that only listens to click events can be mobile friendly, because of backwards compatibility.</p> <p>Depending on the functionality, JavaScript interactions can be improved by making use of mobile specific events. Carousels (if you really need to) are a good example of this: adding some swipe events to your script can make it much more mobile friendly. Or actually, like the two above, it would make it friendlier for all users, including those with non-mobile touch screens.</p> <h2>Even more friendly sites</h2> <p>Page speed, colour contrast and touch events may not be mobile specific, but I would say that goes for all four of Google’s criteria too. Legible text helps all users. Tappable text also helps users of non-mobile touch screens. </p> <p>If we are talking about improving just for mobile, Google’s criteria are a great start. But we need to work harder to achieve more mobile friendliness. Above, I’ve suggested some other things we should do. Some can be measured, like improving load times and providing enough contrast. These things are friendly to all users, including mobile ones. Other things will have to be decided case by case, like including ‘mobile’ events in JavaScript, but probably also how much of our <span class="caps">CSS</span> or JavaScript is critical. As always, it depends.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/making-our-websites-even-more-mobile-friendly/">Making our websites even more mobile friendly</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Making our websites even more mobile friendly">Reply via email</a></p> Solving problems with CSS 2015-04-20T00:00:00Z https://hidde.blog/solving-problems-with-css/ <p>Writing CSS is, much like the rest of web development, about solving problems. There’s an idea for laying out content, the front-end developer comes up with a way to get the content marked up, and she writes some CSS rules to turn the marked up content into the lay-out as it was intended. Simple enough, until we decide to outsource our abstraction needs.</p> <p>TL;DR: I think there is a tendency to add solutions to code bases before carefully considering the problems they solve. Abstraction and the tooling that make them possible are awesome, but they do not come without some problems.</p> <p>When going from paper, Photoshop, Illustrator or whatever into the browser, we use HTML, CSS and JavaScript to turn ideas about content, design and behaviour into some sort of system. We solve our problems by making abstractions. We don’t style specific page elements, we style classes of page elements. Some abstract more from there on, and generate HTML with Haml templates, write CSS through Sass or LESS or use CoffeeScript to write JavaScript.</p> <p>I work at agencies a lot, so in my daily work I see problems solved in lots of different ways. Some choose to enhance their workflow with preprocessors and build tools, some don’t. All fine, many roads lead to Rome. Often, specifics like grids or media query management (apparently that is a thing) are outsourced to a mixin or Sass function. With so many well-documented libraries, plug-ins and frameworks available, there’s a lot of choice. </p> <h2>What tools can do</h2> <p>Libraries like Bourbon for Sass have lots of utilities that are solutions to solve specific problems. Their <code>mixin</code>s can do things like:</p> <pre class="language-php"><code class="language-php">@linear<span class="token operator">-</span><span class="token function">gradient</span><span class="token punctuation">(</span><span class="token variable">$colour</span><span class="token punctuation">,</span><span class="token variable">$colour</span><span class="token punctuation">,</span><span class="token variable">$fallback</span><span class="token punctuation">,</span><span class="token variable">$fallback_colour</span><span class="token punctuation">)</span> </code></pre> <p>which is <a href="https://github.com/thoughtbot/bourbon/blob/master/app/assets/stylesheets/css3/_linear-gradient.scss">transformed</a> into a <code>linear-gradient</code> preceded by a <code>-webkit</code> prefixed version and a fallback background colour. Someone found it would be good to outsource typing the fallback background colour, the prefixed one and then the actual one. So they came up with a solution that involves typing the gradient colours and the fallback colour as arguments of a <code>mixin</code>.</p> <p>This kind of abstraction is great, because it can ensure all <code>linear-gradient</code> values in the project are composed in the same, consistent way. Magically, it does all our linear gradienting for us. This has many advantages and it has become a common practice in recent years. </p> <p>So, let’s import all the abstractions into our project! Or shouldn’t we? </p> <h2>Outsourcing automation can do harm</h2> <p>Outsourcing the automation of our CSS code can be harmful, as it introduces new vocabulary, potentially imposes solutions on our codebase that solve problems we may not have, and makes complex rules look deceivably simple. </p> <h3>It introduces a new vocabulary</h3> <p>The first problem is that we are replacing a vocabulary that all front-end developers know (CSS) with one that is specific to our project or a framework. We need to learn a new way to write <code>linear-gradient</code>. And, more importantly, a new way to write all the other CSS properties that the library contains a <code>mixin</code> for (Bourbon comes with 24 at the time of writing). Quite simple syntax in most cases, but it is new nonetheless. Sometimes it looks like its CSS counterpart, but it accepts different arguments. The more <code>mixin</code> frameworks in a project, the more new syntax to learn. Do we want to raise the requirement from ‘know CSS’ to ‘know CSS and the list of project-related functions to generate it’? This can escalate quickly. New vocabulary is potentially harmful, as it requires new team members to learn it.</p> <h3>It solves problems we may not have</h3> <p>A great advantage of abstracting things like <code>linear-gradient</code> into a <code>linear-gradient</code> mixin, is that you only need to make changes once. One change in the abstraction, and all <code>linear-gradient</code>s throughout the code will be outputted differently. Whilst this is true, we should not forget to consider which problem this solves. Will we need to reasonably often change our <code>linear-gradient</code> outputs? It is quite unlikely the W3C decides <code>linear-gradient</code> is to be renamed to <code>linear-grodient</code>. And if this were to happen, would I be crazy if I suggested Find and Replace to do this one time change? Should we insist on having abstractions to deal with changes that are unlikely to happen? Admittedly, heavy fluctuation in naming has happened before (looking at you, <a href="http://css-tricks.com/old-flexbox-and-new-flexbox/">Flexbox</a>, but I would call this an exception, not something of enough worry to justify an extra abstraction layer.</p> <p>Doesn’t abstracting the addition of CSS properties like <code>linear-gradient</code> qualify as overengineering?</p> <h3>It makes complex CSS rules look simple</h3> <p>Paraphrasing something I’ve overheard a couple of times in the past year: “if we use this mixin [from a library], our problem is solved automatically”. But if we are honest, there is no such thing.</p> <p>Imagine a mathematician shows us this example of his add-function: <code>add(5,2)</code>. We would need no argument over the internals of the function, to understand it will yield 7 (unless we are <a href="http://specterofreason.blogspot.co.uk/2011/06/kripkenstein.html">Saul Kripke</a>). Adding 5 + 2 yields 7.</p> <p>Now imagine a front-end developer showing us their grid function: <code>grid(700,10,5,true)</code>. As a curious fellow front-end person, I would have lots of questions about the function’s internals: are we floating, inline-blocking, do we use percentages, <code>min-width</code>s, <code>max-width</code>s, which box model have we set, what’s happening?</p> <p>Until CSS Grids are well supported, we can’t do grids in CSS. Yet we can, we have many ways to organise content grid-wise by using floats, display modes, tables or flexible boxes. Technically they are all ‘hacks’, and they have their issues: floats need clearing, inline-block elements come with spaces, tables aren’t meant for lay-out, etc. There is no good or bad, really. An experienced front-end developer will be able to tell which solution has which impact, and that is an important part of the job. </p> <p>CSS problems are often solved with clever combinations of CSS properties. Putting these in a black box can make complex things look simple, but it will not make the actual combination of CSS properties being used less complex. The solution will still be the same complex mix of CSS properties. And solving bugs requires knowledge of that mix. </p> <h2>Solve the problem first</h2> <p>When we use a <code>mixin</code>, we abstract the pros and cons of one solution into a thing that can just do its magic once it is included. Every time the problem exists in the project, the same magic is applied to it. Given a nice and general function name is used, we can then adjust what the magic is whenever we like. This is potentially super powerful.</p> <p>All I’m saying is: I think we add abstractions to our projects too soon, and make things more complex than necessary. We often overengineer CSS solutions. My proposal would be to solve a problem first, then think about whether to abstract the solution and <em>then</em> about whether to use a third-party abstraction. To solve CSS problems, it is much more important to understand the spec and how browsers implemented it, than which abstraction to use (see also <a href="http://www.heydonworks.com/article/confessions-of-a-css-expert">Confessions of a CSS expert</a>). An abstraction can be helpful and powerful, but it is just a tool.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/solving-problems-with-css/">Solving problems with CSS</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Solving problems with CSS">Reply via email</a></p> The web is fast by default, let’s keep it fast 2015-05-18T00:00:00Z https://hidde.blog/the-web-is-fast-by-default-lets-keep-it-fast/ <p class="intro">A major web corporation <a href="https://theguardian.com/media/2015/may/13/bbc-news-guardian-facebook-instant-articles">recently</a> started serving simplified versions of websites to load them faster<sup class="footnote" id="fnrev489507359556d7b7e0f23f-1"><a href="https://hidde.blog/the-web-is-fast-by-default-lets-keep-it-fast/#fn489507359556d7b7e0f23f-1">1</a></sup>. Solving which problem? The slowness of modern websites. I think this slowness is optional, and that it can and should be avoided. The web is fast by default, let’s keep it fast.</p> <h2>Why are websites slow?</h2> <p>There are many best practices for web performance. There are Google’s Pagespeed Insights criteria, like <a href="https://developers.google.com/speed/docs/insights/EnableCompression">server side compression</a>, <a href="https://developers.google.com/speed/docs/insights/LeverageBrowserCaching">browser caching</a>, <a href="https://developers.google.com/speed/docs/insights/MinifyResources">minification</a> and <a href="https://developers.google.com/speed/docs/insights/OptimizeImages">image optimisation</a>. Yahoo’s <a href="https://developer.yahoo.com/performance/rules.html">list of rules</a> is also still a great resource. </p> <p>If there is so much knowledge out there on how to make super fast websites, why aren’t many websites super fast? I think the answer is that slowness sneaks into websites, because of decisions made by designers, developers or the business. Despite best intentions, things that look like great ideas in the meeting room, can end up making the website ‘obese’ and therefore slow to end users.<sup class="footnote" id="fnrev489507359556d7b7e0f23f-2"><a href="https://hidde.blog/the-web-is-fast-by-default-lets-keep-it-fast/#fn489507359556d7b7e0f23f-2">2</a></sup> Usually this is not the fault of one person.<sup class="footnote" id="fnrev489507359556d7b7e0f23f-3"><a href="https://hidde.blog/the-web-is-fast-by-default-lets-keep-it-fast/#fn489507359556d7b7e0f23f-3">3</a></sup> All sorts of decisions can quietly cause seconds of load time to be added:</p> <ul> <li>A designer can include many photos or typefaces, as part of the design strategy and add seconds</li> <li>A developer can use <span class="caps">CSS</span> or JavaScript frameworks that aren’t absolutely necessary and add seconds</li> <li>A product owner can require social media widgets to be added to increase brand engagement and add seconds</li> </ul> <p>Photos and typefaces can make a website much livelier, frameworks can be incredibly useful in a developer’s workflow and social media widgets have the potential to help users engage. Still, these are all things that can introduce slowness, because they use bytes and requests.</p> <h2>An example: an airline check-in page</h2> <p>To start a check-in, this is the user input <span class="caps">KLM</span> needs in step one: </p> <ul> <li>ticket number</li> <li>flight number</li> </ul> <p><img alt="KLM's check-in page" height="461" src="https://hidde.blog/_images/telefoon-.jpg" title="KLM's check-in page" width="690" /> <em>What the check-in page looks like</em> </p> <p>For brevity, let’s just focus on this first step and see how it is done. What we would expect for us to submit the above details to <span class="caps">KLM</span>, is to be presented with a form that displays a field for each. However, at the time of writing, the check-in page of <span class="caps">KLM</span>.com presents us with:</p> <ul> <li>151 requests</li> <li>1.3 MB transferred</li> <li>lots of images, including photos of Hawaii, London, Rome, palm trees and phone boxes, various <span class="caps">KLM</span> logos, icon sprites and even a spacer gif</li> <li>over 20 JavaScript files</li> </ul> <p>From the looks of it, more bytes are being transferred than absolutely necessary. Let me emphasise, by the way, that this thing is cleverly put together. Lots of optimising was done and we should not forget there are many, many things this business needs this website to do. </p> <p>On a good connection, it is ready for action within seconds, and provides a fairly smooth UX. On <span class="caps">GPRS</span> however, it took me over 30 seconds to see any content, and 1 minute and 30 seconds to get to the form I needed to enter my details in. This excludes mobile network instabilities. On 3G, I measured 6 and 10 seconds respectively.</p> <p>Is there a different way? I mean… what if we <span class="caps">JUST</span> use plain <span class="caps">HTML</span>? As a thought experiment, not as a best practice or something we would realistically get signed off.</p> <p>Constructed with just <span class="caps">HTML</span>, the page weighs just over 2kb and takes 0.2 seconds to load on <span class="caps">GPRS</span>. This is what it would look like:</p> <p><img alt="A check-in page with just HTML" height="328" src="https://hidde.blog/_images/checkin-just-html-.png" title="A check-in page with just HTML" width="267" /> <em>Just <span class="caps">HTML</span>. Alas, it looks boring, but it is extremely fast</em> </p> <p>This is the web in its default state, and it is very fast. No added styles or interactions, just <span class="caps">HTML</span>. I’m not arguing we should serve plain <span class="caps">HTML</span>, but we should realise that everything that is added to this will make the page slower. There is plenty one can add before worrying about slowness: adding a logo, colours and maybe even a custom font can still leave us with a very fast page. </p> <p>Designing a fast website does not have to be boring at all. As Mark Skinner of cxpartners <a href="http://www.cxpartners.co.uk/cxblog/8-tips-for-designing-a-faster-website/">said</a>, “it’s about being aware of the performance cost of things you add and being deliberate with your choices”. </p> <h2>Performance budgets to the rescue</h2> <p>In a world where speed is the most important aspect of a website, the web <em>can</em> be incredibly fast (plain looking, but incredibly fast). If branding and business needs are taken into account, websites will be slower. As long as everyone involved is aware of that, this is a challenge more than it is a problem. </p> <p>The key question here, is how much slowness we can find acceptable. Just like a family can set a budget for how much spending they find acceptable, web teams can set a budget for how much slowness we find acceptable. Performance budgets (see Tim Kadlec’s <a href="http://timkadlec.com/2013/01/setting-a-performance-budget/">post</a> about this) are a great method for this.</p> <p>The idea of a performance budget, as Tim explains, is just what it sounds like: ‘you set a “budget” on your page and do not allow the page to exceed that.’ Performance budgets can be based on all kinds of metrics: load time in seconds, or perhaps page size in (kilo)bytes or number of <span class="caps">HTTP</span> requests. They make sure everyone is aware of performance, and literally set a limit to slowness.</p> <p>Agencies like <a href="http://clearleft.com/thinks/responsivedesignonabudget/">Clearleft</a> and the <a href="https://speakerdeck.com/tmaslen/moving-swiftly-the-story-of-how-bbc-news-fell-in-love-with-responsive-web-design#63"><span class="caps">BBC</span></a> (‘make the website usable [on <span class="caps">GPRS</span>] within 10 seconds’) have shared their experiences with using performance budgets. Advantages of setting a budget, they say, is that it ensures performance is part of the conversation. With the budget, avoiding additions that cause slowness no longer depends on a single developer, it becomes a team’s commitment. With the <a href="http://timkadlec.com/2014/05/performance-budgeting-with-grunt/">Grunt plugin</a> it can even be part of the build workflow and out-of-budget additions would, in theory, never make it to production.</p> <h2>Conclusion</h2> <p>The web is not slow by default, but still, many websites have ended up being slow. Apart from the best practices that can often be automated, there are many human decisions that have impact on page speed. A way to make page speed part of the conversation and optimising it part of a website’s requirement, is to set a performance budget.</p> <p><strong>Update 02/07/2015</strong>: Someone pointed me at <a href="https://www.klm.com/ams/checkin/web/kl/nl/en">this page</a> that provides a lighter check-in option</p> <h3>Links</h3> <ul> <li><a href="http://timkadlec.com/2013/01/setting-a-performance-budget/">Setting a performance budget</a> by Tim Kadlec</li> <li><a href="http://clearleft.com/thinks/responsivedesignonabudget/">Responsive design on a budget</a> by Mark Perkins (Clearleft)</li> <li><a href="http://www.cxpartners.co.uk/cxblog/8-tips-for-designing-a-faster-website/">8 tips for designing a faster website</a> by Mark Skinner (cxpartners)</li> <li><a href="https://vimeo.com/108328247">Design decisions through the lens of a performance budget</a> by Yesenia Perez-Cruz (video of her talk at Smashing Conference Freiburg 2014)</li> </ul> <h3>Notes</h3> <p class="footnote" id="fn489507359556d7b7e0f23f-1"><sup>1</sup> Or as Benjamin Reid <a href="https://twitter.com/benjaminreid/status/599098725210918913">tweeted</a>: ‘Facebook doesn’t think the web is slow. That’s their “legitimate” reason to stop users navigating off facebook.com. It looks better for them to say that rather than “we’re opening external websites in popups so that you don’t leave our website”.’</p> <p class="footnote" id="fn489507359556d7b7e0f23f-2"><sup>2</sup> As Jason Grigsby <a href="https://www.uie.com/brainsparks/2015/02/02/jason-grigsby-real-world-responsive-web-design/">said</a> </p> <p class="footnote" id="fn489507359556d7b7e0f23f-3"><sup>3</sup> As Maaike <a href="https://twitter.com/maaike/status/601358076780896256">said</a> (<code>lang=nl</code>)</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/the-web-is-fast-by-default-lets-keep-it-fast/">The web is fast by default, let’s keep it fast</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20The web is fast by default, let’s keep it fast">Reply via email</a></p> The accessibility tree 2015-05-26T00:00:00Z https://hidde.blog/the-accessibility-tree/ <p class="intro">At this month’s Accessible Bristol, <a href="http://tink.uk/">Léonie Watson</a> talked about improving accessibility by making use of <span class="caps">WAI</span>-<span class="caps">ARIA</span> in <span class="caps">HTML</span>, JavaScript, <span class="caps">SVG</span> and Web Components. </p> <p>The talk started with the distinction between the <span class="caps">DOM</span> tree, which I assume all front-end developers will have heard of, and the accessibility tree. Of the accessibility tree, I had a vague idea intuitively, but, to be honest, I did not know it literally exists.</p> <blockquote class="in-content"> <p class="in-content">The accessibility tree and the <span class="caps">DOM</span> tree are parallel structures. Roughly speaking the accessibility tree is a subset of the <span class="caps">DOM</span> tree. <br /> — <a href="http://www.w3.org/WAI/PF/aria-implementation/#intro_treetypes">W3C on tree types</a></p> </blockquote> <p>The accessibility tree contains ‘accessibility objects’, which are based on <span class="caps">DOM</span> elements. But, and this is the important bit, only on those <span class="caps">DOM</span> elements that expose something. Properties, relationships or features are examples of things that <span class="caps">DOM</span> elements can expose. Some elements expose something by default, like <code>&lt;button&gt;</code>s, others, like <code>&lt;span&gt;</code> , don’t.</p> <blockquote> <p>Every time you add <span class="caps">HTML</span> to a page, think ‘what does this expose to the accessibility tree?’</p> </blockquote> <p>This could perhaps lead us to a new approach to building accessible web pages: every time you add <span class="caps">HTML</span> to a page, think ‘what does this expose to the accessibility tree?’.</p> <h2>Exposing properties, relationships, features and states to the accessibility tree</h2> <p>An example:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>label</span> <span class="token attr-name">for</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>foo<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Label<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>label</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>checkbox<span class="token punctuation">"</span></span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>foo<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span></code></pre> <p>In this example, various things are being exposed: the property that ‘Label’ is a label, the relationship that it is a label for the checkbox <code>foo</code>, the feature of checkability and the state of the checkbox (checked or unchecked). All this info is added into the accessibility tree.</p> <p>Exposing to the accessibility tree benefits your users, and it comes for free with the above <span class="caps">HTML</span> elements. It is simply built-in to most browsers, and as a developer, there is no need to add anything else to it.</p> <h2>Non-exposure and how to fix it</h2> <p>There are other elements, like <code><span></span></code> and <code>&lt;div&gt;</code> that are considered neutral in meaning, i.e. they don’t expose anything. With <span class="caps">CSS</span> and JavaScript, it is possible to explain what they do, by adding styling and behaviour.</p> <pre class="language-markup"><code class="language-markup"><span class="token comment">&lt;!-- this is not a good idea --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>button<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>I look like a button<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">></span></span></code></pre> <p>With <span class="caps">CSS</span> and JavaScript, it can be made to look and behave like a button (and many front-end frameworks do). But these looks and behaviours can only be accessed by some of your users. It does not expose nearly enough. As it is still a <code>&lt;span&gt;</code> element, browsers will assume its meaning is neutral, and nothing is exposed to the accessibility tree.</p> <p>Léonie explained that this can be fixed by complementing our non-exposing mark-up manually, using <code>role</code> and other <span class="caps">ARIA</span> attributes, and the <code>tabindex</code> attribute.</p> <pre class="language-markup"><code class="language-markup"><span class="token comment">&lt;!-- not great, but at least it exposes to the accessibility tree --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>button<span class="token punctuation">"</span></span> <span class="token attr-name">role</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>button<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>I am a bit more button<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">></span></span></code></pre> <p>For more examples of which <span class="caps">ARIA</span> attributes exist and how they can be used, I must refer you to elsewhere on the internet — a lot has been written about the subject.</p> <h2>Exposing from <span class="caps">SVG</span></h2> <p>With <span class="caps">SVG</span> becoming more and more popular for all kinds of uses, it is good to know that <span class="caps">ARIA</span> can be used in <span class="caps">SVG</span>. <span class="caps">SVG</span> 1.1 does not support it officially, but <span class="caps">SVG</span> 2.0, that is being worked on at the moment, will have it <a href="https://svgwg.org/svg2-draft/single-page.html#struct-WAIARIAAttributes">built-in</a>.</p> <p><span class="caps">SVG</span> elements do not have a lot of means to expose what they are in a non-visual way (besides <code>&lt;title&gt;</code> and @<desc>), and this can be improved with <span class="caps">ARIA</span> labels. Léonie gave some examples, and wrote a <a href="http://www.paciellogroup.com/blog/2013/12/using-aria-enhance-svg-accessibility/">blog post</a> about <span class="caps">SVG</span> accessibility which I can highly recommend.</desc></p> <h2>Exposing from Web Components</h2> <p>Web Components, without going into too much detail, are custom <span class="caps">HTML</span> elements that can be created from JavaScript. For example, if <code>&lt;button&gt;</code> does not suit your use-case, you can create a <code>&lt;my-custom-button&gt;</code> element.</p> <p>At the moment, there are two ways of new element creation:</p> <ul> <li>an element based on an existing element (i.e. <code><my-custom-button></my-custom-button></code> is like <code><button></button></code>, but…). It inherits its properties/roles from the existing element if possible</li> <li>a completely new element. This inherits no properties/roles, so those will have to be added by developer that creates the element.</li> </ul> <p>The first method was recently nominated to be dropped from the specification (see also <a href="http://www.brucelawson.co.uk/2015/web-components-accessibility-and-the-priority-of-constituencies/">Bruce Lawson’s article</a> about why he considers this in violation with <span class="caps">HTML</span>’s priority of constituencies, as well as the many comments for both sides of the debate).</p> <p>Again, like <code>&lt;span&gt;</code> s used as buttons and with <span class="caps">SVG</span>, these custom elements, especially those not inherited from existing elements, scream for more properties and relations to be exposed to the accessibility tree. Some more info on how to do that in <a href="http://w3c.github.io/webcomponents/spec/custom/#semantics">the Semantics section of the spec</a>.</p> <h2>“Code like you give a damn”</h2> <p>Léonie ended her talk with a positive note: to build accessible websites, there is no need to compromise on functionality or design, as long as you “code like you give a damn”. This showed from her examples: many elements, like <code>&lt;button&gt;</code> expose to the accessibility trees, they come with some free accessibility features. And even if you use elements that do not come with built-in accessibility features, you can still use <span class="caps">ARIA</span> to expose useful information about them to the accessibility tree.</p> <p>Personally, I think the best strategy is to always use elements what they are used for (e.g. I would prefer using a <code>&lt;button type=&quot;button&quot;&gt;</code> for a button to using a <code><span></span></code> supplemented with <span class="caps">ARIA</span>). In other words: I think it would be best to write meaningful <span class="caps">HTML</span> where possible, and resort to <span class="caps">ARIA</span> only to improve those things that don’t already have meaning (like <span class="caps">SVG</span>, Web Components or even the <code>&lt;span&gt;</code> s outputted by the front-end framework you may be using).</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/the-accessibility-tree/">The accessibility tree</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20The accessibility tree">Reply via email</a></p> Responsive day out 3: the final breakpoint 2015-06-20T00:00:00Z https://hidde.blog/responsive-day-out-3-the-final-breakpoint/ <p>Yesterday I attended the third (and hopefully not final) edition of Responsive Day Out, Clearleft’s one day conference about all things responsive web design.</p> <p>The talks were very varied this year. There were practical talks about improvements to the web with features like Web Components, Service Workers and flexbox. There were also conceptual talks, which looked at meta issues surrounding responsive web design: how web designers and developers adopt new ways of working or choose not to do so, and how to work together.</p> <p>Like <a href="https://hidde.blog/en/blog/2014-06-29-responsive-day-out-2-the-squishening">last year</a>, the conference was hosted by Jeremy Keith, talks were divided into four segments, with three short talks in each segment, followed by a short interview-like discussion.</p> <p><img src="https://hidde.blog/_images/opening-.jpg" alt="" /> <em>Jeremy Keith opening Responsive Day Out 3</em> </p> <h2>Part 1: Alice Bartlett, Rachel Shillcock and Alla Kholmatova</h2> <p>In the first segment, Alice Bartlett looked at whether and how we might be able to come up with a business case for accessibility, Rachel Shillcock looked at the relationship between web design and accessibility and Alla Kholmatova did a fantastic talk about (libraries of) patterns and, amongst other things, how to name them.</p> <h3>The business case for accessibility</h3> <blockquote> <p>Coming up with a business case may be a much shorter route to getting everyone on board with accessibility</p> </blockquote> <p><a href="http://alicebartlett.co.uk/">Alice Bartlett</a> from the <a href="https://www.gov.uk/government/organisations/government-digital-service">Government Digital Service</a> opened with a convincing talk about how to sell accessibility. Designing and building websites accessibly is a no-brainer to web designers and web developers who are convinced by the moral case for accessibility. But to some, that argument won’t cut it. There may be people in your organisation that want to learn more about the return on investment, and instead of trying to make the moral case, coming up with a business case may be ‘a much shorter route’ to getting everyone on board with accessibility, Alice said.</p> <p>A business case is a document that proves that you have a problem and shows how you can solve it in the most cost effective manner. For accessibility this is hard, as there is not much evidence to show that accessibility solves the problems that we assume it solves. Sites that are accessible may be more maintainable, better for SEO or beneficial to usability, but, said Alice, there is hardly any evidence supporting such claims. See also Karl Groves’ <a href="http://www.karlgroves.com/category/accessibility-business-case/">series of blog posts</a> about this, and the <a href="http://www.karlgroves.com/2012/01/27/chasing-the-accessibility-business-case-conclusion/">conclusion of that series</a>.</p> <p>Litigation may prove to be a way out: if non-accessibility is something one can be sued for, accessibility may be the result of a strategy avoiding being sued. The problem with that approach, is that whereas the risk of being sued is likely to be substantial for <em>high profile</em> companies, it is unlikely to be big enough to make a case for <em>low profile</em> companies. This should not stop us from making low profile companies’ sites accessible, but it does show that coming up with a business case for accessibility is problematic.</p> <h3>Accessibility and web design</h3> <p><a href="https://www.rachilli.com/">Rachel Shillcock</a> is a web designer and talked about how she integrates accessibility in her web design workflow. She gave practical tips and discussed tools like Lea Verou’s <a href="https://leaverou.github.io/contrast-ratio/">Contrast Ratio</a> for determining WCAG colour compliance, <a href="http://squizlabs.github.io/HTML_CodeSniffer/">HTML Code Sniffer</a> that checks your front-end code for potential problems in web accessibility guidelines compliance, and <a href="http://khan.github.io/tota11y/">tota11y</a>, a similar tool that was recently launched by Khan Academy. Rachel made the moral case for accessibility: she emphasised that accessibility is a responsibility and that improving it can hugely improve your users’ lives.</p> <h3>Pattern libraries and shared language</h3> <p><a href="http://www.craftui.com/">Alla Kholmatova</a> talked about the pattern library she works on at <a href="https://www.futurelearn.com/">Future Learn</a>. One of the problems she highlighted, is the boundary between a component being just something on its own, and it having enough similarities to something else to form a shared component. Like in language, interpretations may vary. I may see two separate components, you may see one component and one variation. “Naming is hard”, Alla explained. Visual names like ‘pink button’ are easy, but will quickly become limiting and burdensome (to the project). Functional names may be better, but then you might end up with two components that have different functions, but are visually the same. Higher level functions could be the basis for better names. </p> <p>Alla emphasised that language is incredibly important here, shared language in particular. Pattern libraries and frameworks for modular design like <a href="http://bradfrost.com/blog/post/atomic-web-design/">atomic design</a> and <a href="http://www.google.com/design/">material design</a> are ‘examples of controlled vocabularies’, she said. Naming is the method teams use to establish such frameworks. The framework will be used by the team, therefore the naming should be done by the team that will use it. The language that is established should remain in use to stay ‘alive’ and keep its meaning. Because a name like ‘billboard’, one of Alla’s examples, is quite broad. By using it in daily conversations, it remains meaningful. It made me think of Wittgenstein, who <a href="https://en.wikipedia.org/wiki/Private_language_argument">held</a> that language only has meaning in virtue of the group / community it is used in.</p> <blockquote> <p>Many of their naming conversations […] are done with everyone involved: not just designers or developers, but also content producers and users.</p> </blockquote> <p>She explained how the team at Future Learn work on their shared language: they have a wall with all the (printed out) bits of design of their website for reference and overview. Many of their naming conversation takes place on Slack, and are done with everyone involved: not just designers or developers, but also content producers and users. They look at terminology of architecture and printing press for inspiration.</p> <h2>Part 2: Peter Gasston, Jason Grigsby and Heydon Pickering</h2> <p>In the second part, Peter Gasston talked about the state of web components, Jason Grigsby explained some of the puzzles of responsive images and Heydon Pickering showed how when viewing CSS as (DOM) pattern matches, clever CSS systems can be built.</p> <h3>Web Components</h3> <p><a href="http://www.broken-links.com/">Peter Gasston</a> gave an overview of Web Components, which provides a way for web developers to create widgets or modular components, that can have their own styles and behaviour (as in: not inherited from the page, but really their own). React and BEM have provided ways to do that with existing tech, Web Components brings it to the browsers. </p> <p>There are four key modules to Web Components: templates, HTML imports, custom elements and Shadow DOM. </p> <ul> <li>Templates offer a way to declare reusable bits of markup in a <code><template></template></code> element. Works everywhere but IE.</li> <li>HTML imports lets you import bits of HTML. Major problem: these imports block rendering (the imported file can link to stylesheets or scripts, which will need to be fetched). This may be replaced altogether by ES6 Modules.</li> <li>Custom elements let you have meaningful markup with custom properties. You create them in JS. The custom element names have a hyphen in them, because standard HTML elements will never have those, so browsers know which ones are custom. ES6 also offers a way to do this, possibly better, ES6 Classes. </li> <li>Shadow DOM: hide complex markup inside an element. This works by creating a shadow root (<code>createShadowRoot()</code>). Little agreement amongst browser vendors about other features than the <code>createShadowRoot</code> function. Still a lot to be defined.</li> </ul> <p>Custom elements in Web Components bring a lot of responsibility, as they are empty in terms of accessibility, SEO and usability. With standard HTML elements, browsers have those things built in. With custom elements, they <a href="https://hiddedevries.nl/en/blog/2015-05-26-the-accessibility-tree">become the developer’s responsibility</a>, Peter stressed. Potentially, there will be a lot of badly built Web Components once people start playing with them (like there are a lot of badly built jQuery plug-ins). The <a href="https://github.com/webcomponents/gold-standard/wiki">Gold Standard</a> Peter mentioned may be a helpful checklist for how to build a Web Component and do it well. Peter also said we should use the UNIX philosophy: ‘every component does one job [and does it really well]’.</p> <p>Peter said Web Components are good enough to be used now (but not for a business to depend on). He recommended using a library like <a href="https://www.polymer-project.org/1.0/">Polymer</a> for those who want to explore Web Components in more detail.</p> <h3>Responsive images</h3> <p>Jason Grigsby discussed Responsive Images, which has now shipped in most browsers and will work in others (IE and Safari) soon. His talk was about the why of responsive images. It has been designed to serve two use cases: resolution switching (best quality image for each resolution) and art direction (different image in different circumstances).</p> <p>One of the puzzles around responsive images, Jason explained, is when to add image breakpoints. What dictates when to add an image breakpoint? Art direction might dictate breakpoints; this can be figured out and is mostly a design/art direction concern. Resolution might also dictate breakpoints, but this is much harder to figure out. How do we figure out how many breakpoints to use? In many companies, three breakpoints would to mind (phone-tablet-desktop), but that’s pretty artificial. </p> <p>The ideal image width is the width it will have as it is displayed on the page. But in many responsive websites, images are sized with a percentage and can have many, many different widths, so often, some bytes will be ‘wasted’. So the question is: what is a sensible jump in file size? Maybe we should use performance budgets to make our choices about image resolutions? Important to note here, is that the larger the image, the larger the potential number of bytes wasted. That means we should have more breakpoints at larger sizes, as at larger sizes, differences are more expensive in bytes. </p> <p>We can distinguish between methods that tell the browser exactly which image to use when, and methods that let the browser choose what is best. In most cases, Jason recommended, the latter is probably best: we just let the browser figure out which image to use. </p> <h3>Solving problems with CSS selectors</h3> <p><a href="http://www.heydonworks.com/">Heydon Pickering</a> looked at making use of some powerful features of CSS (<a href="http://slides.com/heydon/solving-problems-with-selectors">slides</a>). He disagrees with those that say CSS is badly designed and should be recreated in JavaScript (‘pointless’) and showed in his talk how we can use the very design of CSS to our own benefit. CSS is indeed very well designed.</p> <blockquote> <p>Most grid systems are not grid systems, they are grid prescriptions</p> </blockquote> <p>Most grid systems out there, Heydon argued, aren’t much of a system. As they are not self-governing, they are more like grid <em>prescriptions</em>. Automatic systems can be done, using the power of CSS. Heydon suggested to look at CSS selectors as pattern matches. Matching containers full of content, we can look at how many bits of content we have, and let the browser come up with the best grid to display our content in. In other words: <a href="http://alistapart.com/article/quantity-queries-for-css">quantity queries</a>. With <code>nth-child</code> selectors, Heydon showed how we can create a ‘divisibility grid’: looking at what your total amount of columns is divisible by, we can set column widths accordingly. </p> <p>BEM-like conventions create order and control, but they throw out the baby with the bathwater by not using the cascade. The divisibility grid and quantity queries that Heydon create chaos, one might say, but as he rightly pointed out, this is in fact a ‘controllable chaos’.</p> <h2>Part 3: Jake Archibald, Ruth John and Zoe Mickley Gillenwater</h2> <p>The third segment started off with Jake Archibald, who talked about progressive enhancement in ‘apps’, followed by Ruth John who discussed a number of so-called Web APIs and lastly Zoe Mickley Gillenwater, with a talk about the many uses of flexbox on Booking.com.</p> <h3>Offline first</h3> <blockquote> <p>“A splash screen is an admission of failure”</p> </blockquote> <p><a href="http://jakearchibald.com/">Jake Archibald</a> looked at progressive enhancement on the web, and showed how progressive enhancement and web apps are a false dichotomy. He emphasised it is indeed a great feature of the web that web pages show content as soon as they can, as opposed to last decade’s native apps, that often show a loading screen until everything you will ever need has loaded. On the web, we don’t need loading screens, yet some web apps have mimicked this behaviour. Jake argued this is a mistake and we can do better: ‘a splash screen is an admission of failure’. On the web, we can actually have users play level 1, even when the rest of the game is still loading in the background.</p> <p><img src="https://hidde.blog/_images/progressive1-.jpg" alt="Jake Archibald on stage" /> <em>Jake Archibald making the case for progressive enhancement</em> </p> <p>Some web app slowness exists because all the required JavaScript is requested as one big lump, with a relatively big file size. Not a huge problem in ideal, fast WiFi situations, but quite a PITA for those with two bars of 3G on the go. Or for those accessing the web on what Jake referred to as Lie-Fi. </p> <p>People may say all the JavaScript should download first, as it is a ‘web app’, and that this is how ‘web apps’ work, but that will not impress users. We can actually load the essential bits of JavaScript first and others later. Although this will decrease total loading time, it can hugely increase the time to first interaction. This is more important than overall load time: people will likely want to use your thing as soon as possible. </p> <p>>A Service Worker can be put in place to make sure users can always access the cached version first, even when offline</p> <p>After the first load, assets can be stored in cache. A Service Worker can be put in place to make sure users can always access the cached version first, even when offline. Whilst the cached version is being displayed, everything else else can be taken care of in the background, you can notify the user when it is ready. I felt this is a bit like offering your restaurant guests a table and some bread and wine, whilst you prepare their starter. You don’t have to let them stand outside until everything is ready, that would get them unnecessarily annoyed.</p> <p>Service Workers, that allow for taking over the network management of the browser and thus for serving cache/offline first, can be used now. Not because they have support across all browsers ever made, but because they are pretty much an extra layer on top of your existing application. If your browser doesn’t understand this mechanism to get the app served from cache first, that’s okay, it will just be served a fresh version (as it would have been without a Service Worker). If it does, you can save your users from Lie-Fi.</p> <p>Link: <a href="https://jakearchibald.github.io/svgomg/">SVG OMG</a> (load it, turn WiFi off, load it again, it still works!)</p> <h3>Web APIs</h3> <p><a href="http://rumyrashead.com/">Ruth John</a> talked us through various different Web APIs, or as she likes to call them: client side web APIs. She showed interesting demoes of Geolocation, which gives access to a user’s location if they give permission, including a ‘watch’ function that can update so that you could build a sat nav application, Web Animation, which offers the animation properties from CSS in JavaScript, the Web Audio API, that lets one manipulate audio amongst other things, and finally the Ambient Light API, that gives us the tools to do useful little improvements for our users.</p> <h3>Flexbox</h3> <p><a href="http://zomigi.com/">Zoe Mickley Gillenwater</a> works at hotel booking website Booking.com, which is a hugely flexible website, as it is served in many different languages and on many different screen sizes and browsers.</p> <p>When designing for the web, Zoe explained, we can used fixed units like <code>px</code>, or relative units, like <code>rem</code> or <code>vw</code>. Relative units can be a useful ‘best guess’, let you be close to an ideal, <em>and</em> work in many different circumstances. Even better than flexible units, is designing without units at all. Flexbox allows you to do exactly this. It lets you tell the browser an element’s starting size and whether it can grow/shrink, and lets the browser figure out the math.</p> <blockquote> <p>[Flexbox] does responsive lay-outs without media queries</p> </blockquote> <p>Flexbox, Zoe showed, is great for improving whitespace and wrapping for better coherency in lay-out. It often does this better than floats, <code>inline-block</code> or <code>table-cell</code>, but can (and probably should) be used in conjunction with those, as they provide a usable feedback. It is also great for reordering: with its ‘order’ property, you can achieve visual improvements by setting an element to display in another place than your source order. Lastly, it does responsive lay-outs without media queries, as it will display within your constraints and figure out its ‘breakpoints’ all by itself.</p> <p>Zoe pointed out that the interesting difference between flexbox and other CSS features, is not really code, but our way of thinking about lay-out. It requires a bit of a mental shift. Responsiveness, Zoe concluded, is not binary, it is a continuum, and flexbox can help making your site more responsive. You can make lots of small minor changes to your site, each of which can make it more flexible. Browsers will make use of those improvements if they understand them, devices will make use of them if they are smaller or bigger than usual (most of them are, but all in different ways).</p> <h2>Part 4: Rosie Campbell, Lyza Gardner and Aaron Gustafson</h2> <p></p><p class="intro">In the final part, Rosie Campbell looked at the future of web design beyond the screens as we know them, Lyza Gardner pleaded for generalists in the web industry and Aaron Gustafson presented his idea of what we should expect next.</p><p></p> <h3>Beyond the screen</h3> <p><a href="https://medium.com/@RosieCampbell">Rosie Campbell</a> from the BBC talked us through some of the experiments she was involved with at the BBC Research lab. She noted that screens will only get weirder, and urged us to think about designing for such screens that don’t even exist yet. How? Stay agnostic to underlying hardware, she recommended. And reconsider assumptions: we are used to designing with rectangles, but future screens may be round, or indeed have completely different sizes. We should not be afraid of constraints, but embrace them as they can fuel creativity.</p> <h3>Skillsets</h3> <p><a href="http://www.lyza.com/">Lyza Gardner</a> talked about how the web designer/developer job has changed in recent years, and what that does to us as people that just try to work in the web industry.</p> <p>The web used to be much simpler, Lyza explained. In the beginning there was no JavaScript, there were no stylesheets, even images hardly had browser support. These constraints made working on the web interesting. This has changed hugely, as we now have a daily influx of new frameworks, tools and methodologies to learn about, consider adopting and perhaps specialise in. Because there is now so much information about so many different things we can do with the web, working on the web has become quite complex. There is more than anyone can possibly keep up with. This, Lyza said, can make us feel down and unsure.</p> <blockquote> <p>[Generalists] think and talk about the web with nuance</p> </blockquote> <p>The web industry celebrates specialists, we adore single subject rock stars, but we should be careful not to dismiss people that don’t specialise, but generalise. Generalists, unlike specialists, cannot show off their specialisms on their CV, and may not be great at fizzbuzz, but they have other things to offer. They can think and talk about the web with nuance. They synthesise and when combining synthesis with their skills, show how valuable they are. When given a problem they have not seen before, they can synthesise and do it. Generalists are beginners over and over again.</p> <p>We should be generalists, Lyza concluded, we should cultivate wisdom and share it.</p> <h3>Where do we go from here?</h3> <p>The day was concluded by <a href="http://www.aaron-gustafson.com/">Aaron Gustafson</a>, who looked at what’s next. The A List Apart article <a href="http://alistapart.com/article/responsive-web-design">Responsive web design</a>, Aaron said, was the first to provide a concrete example of the principles of <a href="http://alistapart.com/article/dao">A Dao of Web Design</a> (speaking of how valuable generalists are…). That article goes into the flexible nature of information on the web. Content created once, accessible anywhere, as it was envisioned by Tim Berners-Lee. </p> <blockquote> <p>Accessibility is core to the web, and it goes hand in hand with the flexible approach John Allsopp and Ethan Marcotte describe in their articles.</p> </blockquote> <p>Accessibility is core to the web, and it goes hand in hand with the flexible approach John Allsopp and Ethan Marcotte describe in their articles. Don’t make assumptions about how people want to access your website, just let them access it in any way they want, by providing solid mark-up of well structured content.</p> <p>Accessible websites have a benefit in the future of the web. There will be more controls and inputs, like gaze and eye/facial tracking. Voice will play a bigger role, too. You may have provided CSS with your content to display it beautifully across devices, but those users using voice will not see that. They will just be listening, so it is of utmost importance that your mark-up is well structured and the source order makes sense. That it is accessible. </p> <p>Responsive web design, Aaron concluded, is all about accessibility. It is about making things accessible in the best possible way. </p> <h2>Wrap-up</h2> <p>As may have become clear from my notes above, Responsive Day Out 3 was a day full of variety. I had the feeling it could have easily been called Web Day Out, and I guess that makes sense, as responsive web design has naturally grown to be a pleonasm in the past few years. </p> <p>I found a couple of common themes throughout the talks:</p> <ul> <li><em>Let the browser figure it out.</em> Throw multiple image types/resolutions at it, and let the browser decide which one to display, as Jason explained. Or like Zoe demonstrated, tell the browser roughly how you want your element to be with flexbox, and let the browser figure out the maths. Give it some relatively simple CSS instructions, and let it grid your content for you, as Heydon did.</li> <li><em>Soon, we will be given more responsibilities.</em> As Peter noted, Web Components will let us define our own components, which makes us responsible for setting up their usability and accessibility. Service Workers, as Jake showed, put us in control of network handling, so that we can decide how to handle requests (and respond to them with offline/cached content first). If we use Web Components or Service Workers, we explicitly choose not to let the browser figure it out, and provide our own algorithms. </li> <li><em>Responsive web design is all about accessibility</em>. Although it is hard to make a business case for it, accessibility is very important, as it is a core concept of the web, as Aaron mentioned, and, being mostly device-agnostic, our best bet at future proofing content for screens that don’t even exist yet, as Rosie pointed out.</li> <li><em>Make things as flexible as you can</em>. Good responsive design makes things very flexible. Flexbox and the non-binary improvements it creates, as Zoe discussed, make sure things work in many places at the same time.</li> </ul> <hr/> <p>Originally posted as <a href="https://hidde.blog/responsive-day-out-3-the-final-breakpoint/">Responsive day out 3: the final breakpoint</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Responsive day out 3: the final breakpoint">Reply via email</a></p> What kind of Web Components do we need? 2015-07-02T00:00:00Z https://hidde.blog/what-kind-of-web-components-do-we-need/ <p class="intro">Web Components will allow web developers to create their own elements: <a href="http://w3c.github.io/webcomponents/spec/custom/">custom elements</a>. Last week I attended the Web Component panel and accessibility break-out at Edge Conference, and left both sessions full of questions. One was: what kind of custom elements do we need?</p> <p>The idea of Web Components and specifically their custom elements, is that you no longer depend on the browser to provide you with elements: you can bring your own. Many blog posts about the subject emphasise how exciting this is. Yes, this is exciting new tech. It gives website owners lots of freedom, but also a big responsibility. I think Web Components have their use case for the web at large, but I can’t help but feeling that for many websites, it will be too costly to create and unnecessary to use custom elements.</p> <h2>Existing <span class="caps">HTML</span> elements come with benefits</h2> <p>Many of the existing, standardised <span class="caps">HTML</span> elements come with semantics, and browsers can do all kinds of smart things with them. Some examples:</p> <ul> <li>The <code>&lt;select&gt;</code> element lets a user pick one option from a list of options. Every browser can decide how to represent this best. My phone shows a fruit machine style thingy, an old-fashioned Windows style selector is shown on old Windows machines, and easy to recognise for users of such machines. A future version of Siri may be able to talk us through the options, in fact, some assistive technology already does this.</li> <li>The <code>&lt;video&gt;</code> element lets a developer point to a video, or indeed a couple of videos in different formats. The problem of how to play the video is then solved by the browser. Each browser chooses the best video player it can offer, and lets the user watch the video in it.</li> </ul> <p>With existing <span class="caps">HTML</span> elements, the browser takes care of a lot of your accessibility, usability and design. </p> <h2>Custom elements come with responsibility</h2> <p>Contrary to most existing elements, a <code>&lt;custom-element&gt;</code> is much like a <code>&lt;div&gt;</code> : it has no meaning to the browser, so browsers have nothing built-in to deal with it. It doesn’t expose to the <a href="https://hidde.blog/en/blog/2015-05-26-the-accessibility-tree">accessibility tree</a>, has no usability or default appearance. Indeed, this is what a component creator has to take responsibility for themselves:</p> <ul> <li>accessibility / semantics</li> <li>usability</li> <li>what it looks like</li> </ul> <p><a href="https://twitter.com/rogerjohansson/status/558585728314376194">For each platform</a>. </p> <p><a href="https://github.com/webcomponents/gold-standard/wiki">The Gold Standard</a> gives a great checklist for making Web Components “to be as predictable, flexible, reliable, and useful as the standard <span class="caps">HTML</span> elements”. </p> <p>To increase a component’s accessibility, one could provide meaning <a href="https://docs.google.com/presentation/d/1JWNEag775-e-fAHbE5wzxwUkzF1kRqmYFlnZP2SdUH0/view?pli=1#slide=id.p34">through <span class="caps">ARIA</span> roles and properties</a>. Or, if we use native elements within our components, we can have our cake and eat it too: when embedding existing elements, you would inherit their benefits. I have not been able to find a definite resource confirming this can be done.</p> <blockquote> <p>It is probably not easy to create a custom select or date picker that works as well as its native equivalent. </p> </blockquote> <p>To provide usability, you would have to provide ways to interact with your element for whichever method your user chooses (or is forced to use by personal or indeed corporate circumstances). This is hard, because in most cases, as a website, you do not know a lot about the circumstances under which you are accessed. It is probably not easy to create a custom select or date picker that works as well as its native equivalent. </p> <p>Design means designing for many different contexts: phones, watches, desktops, etc. And there are probably going to be contexts that we currently don’t know of: a future fridge with a web browser will probably know how to most suitably render a <code>&lt;select&gt;</code>, but it will not know how to deal with your <code>&lt;custom-datepicker&gt;</code> .</p> <p>Chris Heilmann once said it makes sense to <a href="http://christianheilmann.com/2012/03/15/the-foundation-of-the-web-platform-is-very-confusing/">use what already works and build on top of that</a>. I think this applies to custom elements, too. They would only have benefit, if they combine existing elements to bring something we need that does not exist yet.</p> <p>Does building Web Components sound complex? In the Web Components panel, Google’s Alex Russell noted that “tooling will save you”. Tools can make it much easier to build better Web Components, for example by making them render both on the server and the client for progressive enhancement. But aren’t <a href="http://www.quirksmode.org/blog/archives/2015/05/tools_dont_solv.html">tools the problem</a>?</p> <h2>Benefits of Web Components</h2> <p>Web Components are not just hard to build well, there are also many benefits to using them.</p> <p>With Web Components, browsers (will) give website owners the power to bring their own elements. This gives a lot of freedom and is a big addition to the web as a platform. It is innovation we should welcome.</p> <p>Web Components also bring developers the convenience of style/DOM encapsulation: if you work on a custom element’s <span class="caps">CSS</span>, you know it is only going to apply to that component. </p> <p>Thirdly, a Web Component can be very portable: once you have created a <code>&lt;custom-element&gt;</code> and built all its behaviour and style, you can then use it where you like. As Peter Gasston noted in the EdgeConf Slack channel, “[They take] more effort to build, less effort to use”.</p> <p>A fourth advantage of Web Components is for search engines: they can potentially start recognising widgets if they are used enough throughout the web, which would improve their search result listings.</p> <p>An additional benefit of Web Components as a project is that it helps <a href="https://github.com/domenic/html-as-custom-elements">find missing platform <span class="caps">API</span>s</a> (a fascinating project by Domenic Denicola).</p> <h2>What kind of custom elements do we need?</h2> <p>In summary, custom elements can be good for the web as a platform, for developers and potentially for users, too. But building custom elements that are accessible, well-designed and easy to use on all platforms, is not going to be easy, or cheap. So what kind of custom elements do we need?</p> <blockquote> <p>Building custom elements that are accessible, well-designed and easy to use on all platforms, is not going to be easy, or cheap</p> </blockquote> <p>Some say custom elements will be a bit like jQuery plug-ins: you need a carousel in your page, but instead of building it yourself, you peruse a third party carousel. You want your content to appear in tabs, so you go and use a third party tabs script. Instead of borrowing someone’s <span class="caps">CSS</span> and JS, you borrow their <code>&lt;fancy-carousel&gt;</code> or their <code>&lt;the-ultimate-awesome-tabs&gt;</code> , which have their styles and scripts nicely hidden inside their Shadow <span class="caps">DOM</span>. We should take care choosing only properly built ones. Also, we should be careful <a href="http://christianheilmann.com/2014/04/18/web-components-and-you-dangers-to-avoid/">not to repeat the “just another plugin doing $x” mistakes</a>.</p> <p>I have the feeling that custom elements make most sense for huge companies that have many different websites and apps that have or should have shared elements. Google, who came up with Web Components, have a search engine, maps, Word processing tools, online storage, a social network, an operating system and many other products. It makes lots of sense for them to want to share many of their controls across their products. And they have plenty of designers and developers available to work on the usability, accessibility and design of such components, so it is more feasible for them to do it well (and even they do not have <a href="http://www.brucelawson.co.uk/2014/on-the-accessibility-of-web-components-again/">unlimited time and resources</a>).</p> <p>The same probably goes for big social network enterprises like Twitter and Facebook. They could create things like a Twitter timeline widget for people to embed in their site. Currently, I advise clients against using those, as they come with privacy and performance issues. If offered as a custom element, these issues might still be there, but now buried away in the Shadow <span class="caps">DOM</span>. Instead, offering the data as <span class="caps">JSON</span>, as Twitter used to do, would probably be more helpful for developers. But I guess that would add less value for Twitter’s shareholders.</p> <p>Or perhaps media organisations like the <span class="caps">BBC</span>. Their video player seems a huge part of what they do, so they might have time to work on a custom element for it, that plays video exactly in the way they need it. For their own site(s), they have many, or perhaps for people to embed elsewhere. </p> <p>Web Components could also bring a big benefit to people that create ‘apps’, websites where people go to do stuff, or maybe even games. They might need very specific controls, that do not exist in browsers yet.</p> <h2>How about smaller sites?</h2> <p>I’m not sure about the use case for smaller websites. One of the messages of Web Components seems to be that we can soon control style and behaviour of all the elements. But that’s not the full story: it is also very hard to do it well. I am afraid we will end up with lots of badly built components, if we do not tell the full story. What if web agency clients start asking for cool, custom-designed and custom-behaving components, and the teams tasked with creating them do not have the budget to meet the <a href="https://github.com/webcomponents/gold-standard/wiki">Gold Standard</a>? Should we instead trust the capabilities of larger, Bootstrap-like projects, and use their components?</p> <blockquote> <p> What if web agency clients start asking for cool, custom-designed and custom-behaving components, and the teams tasked with creating them do not have the budget to meet the Gold Standard?</p> </blockquote> <p>Some have <a href="https://medium.com/@kaelig/why-web-components-will-make-the-web-a-better-place-for-our-users-38dc3154fc1d">suggested</a> Bootstrap and Foundation should start converting their components into Web Components, but I fail to see how that would solve a problem people actually have. It would be interesting to do it as a research type of thing, but to make them the main way to use Bootstrap or Foundation components just feels wrong.</p> <p>I’m not convinced either, that every company should come up with custom elements for all the things, just because they can. Most elements can be built very well with existing <span class="caps">HTML</span>, without costing as much design and development time. I feel many web projects will hardly have a use case for utilising custom elements, or the budget for creating them. They would overcomplicate things. It still feels like <a href="https://aerotwist.com/blog/polymer-for-the-performance-obsessed/">eating a 5 course dinner when all you wanted was a salad</a>.</p> <p>I hope Web Components will get used by those companies that have genuine use cases for which the current set of <span class="caps">HTML</span> elements cannot provide. That will help push the web forward, and potentially add new ways of interacting with the platform. We are given the chance to add new elements, before <span class="caps">WHATWG</span>, W3C or browser vendors have the time to do so. Or the chance to create elements that would not be suitable to be part of the web standards, yet very useful to one organisation’s strategy. But before that can happen, what we need most is <a href="https://hacks.mozilla.org/2015/06/the-state-of-web-components/">agreement amongst browser vendors</a>.</p> <p>So, what kind of Web Components do we need? Well-thought-through additions to the existing set of <span class="caps">HTML</span> elements, solving problems that aren’t solved by existing elements: yes, please. Many variations on improvements of existing elements like checkboxes and selects? As far as I am concerned, probably not. New elements built without considering accessibility or the huge diversity of browsing contexts? No, thanks.</p> <p><em>Update 03/07/2015:</em> Peter Gasston points out on Twitter that <a href="https://twitter.com/stopsatgreen/status/616897862484512768">a lot of potential value is in the use cases we haven’t thought of yet</a>. This is probably true, I may have to adjust my view when such cases arrive.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/what-kind-of-web-components-do-we-need/">What kind of Web Components do we need?</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20What kind of Web Components do we need?">Reply via email</a></p> Offline apps and user intent 2015-07-19T00:00:00Z https://hidde.blog/offline-apps-and-user-intent/ <p class="intro">The next problem being solved for the web is not having the network: apps that <a href="http://jakearchibald.com/2014/offline-cookbook/">work offline</a>. I think when designing such apps, we should consider user intent, and in particular <em>what</em> a user intends to be available offline.</p> <p>Web apps that work offline will download themselves into a user’s cache: their assets, their core app code, et cetera (see also: <a href="http://www.html5rocks.com/en/tutorials/service-worker/introduction/">service worker</a>). When the app itself is offlinified, the next choice is: which <em>content</em> should we make available offline? I think we should consider letting our users decide.</p> <p>My newspaper app lets me download newspapers and requires no further connectivity once the download is completed. As a user, this allows me to download a newspaper to my tablet before I leave home, take a seat in a local train and start reading. Great for commuting. It lets me not worry about the network. In theory, my tablet might have 3G, or could connect to the train’s WiFi system. In reality, that would probably result in me struggling to get any data when the train is in a tunnel, or trying to battle the train WiFi’s registration page. The alternative, downloading the paper on my home WiFi, which I know works, is much better. For this to go smoothly, it is crucial the newspaper app has a ‘download for offline usage’ button.</p> <p>A music subscription service I use, offers me the ability to have some music available offline. I use this feature a lot. If I need to catch the airport bus, I want to listen to that new album that came out. I know which. If I’m going for a long drive, I might make a playlist to listen to whilst driving in the UK’s beautiful, but not always well-networked country side. I create the playlist at home, and want it to be available on the go. So I think my music app with offline capability should let me choose what to make available offline. Spotify has a toggle that sets playlists to ‘available offline’, but it does not have UI to let a user download specific music (it behaves more or less like a hint). It will decide, based on how much connectivity and storage the device has. This makes sense, as often connectivity and storage are big uncertainties for the developer that builds the app, but it gets in the way of user intent.</p> <p>Some apps choose to offlinify the last <em>x</em> items (eg a news site), or the content that the user has visited (eg an encyclopedia). The latter is a form of user intent, the former is unrelated to it. Naturally, depending on context, these can be a good strategies, too.</p> <p>For the news and music player examples, honouring user intent can hugely improve a user’s experience. It may very well be possible to let the app decide what to offlinify when, but maybe your user just wants a particular thing to be offline. Today’s newspaper. Or, for that matter, last Tuesday’s issue, because their grandmother appears in it. This artist’s new album. This episode of that podcast. This <em>A List Apart</em> article. </p> <p>Technically, it is far from trivial to do for a web app. Without going into too much detail: you don’t know if your user/their browser will have cleared their/its cache, or how much storage they have available.</p> <p>In summary, I think if our app makes itself available for offline use, we should consider giving our users a choice in which content to make available offline.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/offline-apps-and-user-intent/">Offline apps and user intent</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Offline apps and user intent">Reply via email</a></p> The role of grid systems in component-based front-end builds 2015-12-08T00:00:00Z https://hidde.blog/the-role-of-grid-systems-in-component-based-front-end-builds/ <p>Grids… for long I have thought they are the trivial bit in front-end development. Many sites do not have much variation in column widths, so to use a ‘grid system’ would be a clear violation of the KISS principle. Now I think complex grid systems can be of great use in component-based front-end builds.</p> <p><em>Note that the following may soon be obsolete, when we start describing layout in CSS using CSS Grid Layout (not widely supported at the time of writing)</em></p> <p>My view is this: for large websites and organisations, in addition to having a component system, it makes sense to have one agreed-upon, shared-between-projects grid system.</p> <h2>What is a grid system?</h2> <p>By ‘grid system’, in this article, I mean a set of CSS rules written for the purpose of declaring grids in mark-up. These can be hand written, or generated by preprocessors (in which case they can be generated with custom options to fit a project better). Some agencies I worked with have <a href="https://github.com/lawlesscreation/just-another-grid-system">rolled their own</a>. Others use an open source one, such as <a href="http://getbootstrap.com/css/#grid">Bootstrap’s</a>. </p> <h3>Spanning columns through classnames</h3> <p>In this kind of grid system, grids are declared using classnames on HTML elements. Usually classnames are given to each row of columns, and then to each column within that row. A grid has a number of ’virtual’ columns (e.g. 12 or 16). Specific elements span a number of these virtual columns, e.g. a main column could be the first 8 out of 12, then the sidebar could be remaining last 4. In mark-up, classnames of each actual column determine how many virtual columns are spanned.</p> <h3>Complex structures full of features</h3> <p>Grid systems are, more often than not, convoluted structures of code. Not only do they contain percentages for any combination of columns imaginable, they often also have options to ‘skip’ columns, so that an element can start spanning columns after the columns it has skipped. Many also contain percentages per breakpoint, so that you can have different sets of columns per breakpoint. This results in many classnames; time consuming to write, or if generated, buried away in your preprocessor output. </p> <h3>As opposed to the introducing-columns-when-required approach</h3> <p>Note that there are other ways to go about columns and widths in websites. You could just add CSS rules for each grid variation required (eg, you would be done by just writing one for doubles, one for quarters, and perhaps one for three quarters). This is how websites have been built for a long time. I used to prefer this approach — depending on the project, I sometimes still do. It uses a lot less CSS and is very KISS.</p> <h2>How do they fit in component-based front-ends?</h2> <p>The cool thing about component-based front-ends is that none of the component code is committed to specific widths. The width of a component is determined by the container it happens to exist in. Or, if it does not sit in a container, by the window or viewport width.</p> <p>If your team decides to build pages using a grid system, this is their role: they force what the width is of any components that occur in the page.</p> <p>To have a super complex grid system, with perhaps more classnames generated than you might actually need, requires clear advantages to be worthwile. The amount of classnames comes with weight: Bootstrap’s default grid system is 8KB (minified). Yet, advantages do exist:</p> <h3>Separation of generic, reusable components and specific, non-reusable widths</h3> <p>You don’t want the development of a new component to involve widths, the width of things will be decided in the context of the page grid and the viewport it exists on. Therefore, a separation between things and their widths makes sense. If the grid is separate, it makes sense to be a powerful (or complex) <em>system</em> that fits many cases, rather than something that is decided case by case.</p> <h3>Great for teams in agencies or organisations</h3> <p>As a team (in an agency or elsewhere), it makes sense to use the same grid system or grid system generator for all projects, with only changes to their setup (eg number of columns, nature of breakpoints). This is not about developer convenience, it is about organisational consistency. You’re making sure all teams in your organisation do the same thing with their widths, just as they do the same thing with their components.</p> <h2>Conclusion</h2> <p>The main benefit of an agreed-upon, shared-between-projects grid system is this. For an organisation, <em>a great level of consistency can be achieved</em> if widths in all of their sites come from one system (just as it helps if components for all of their sites come from one system). </p> <p>Does that mean I think one grid system will fit all? No, adjustments are probably required sooner or later. That would mean new versions of ‘the grid system’ would get released. All projects within an organisation would be using ‘a’ version of ‘the grid system’. If this happens to be not the most recent version, the project team can decide whether to update to the latest version or not.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/the-role-of-grid-systems-in-component-based-front-end-builds/">The role of grid systems in component-based front-end builds</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20The role of grid systems in component-based front-end builds">Reply via email</a></p> Declaring grid layouts with ‘just’ CSS 2015-12-16T00:00:00Z https://hidde.blog/declaring-grid-layouts-with-just-css/ <p>CSS Grid Layout has been coming for a long time, browser support seems to be on its way (at last!). This is great news! It means we can soon use ‘just’ CSS to describe our lay-outs. But, arguably, this leaves us with a naming problem.</p> <h2>‘Just CSS’ vs classnames for lay-out</h2> <p>In the current situation, many lay-outs on the web work with <a href="https://hiddedevries.nl/en/blog/2015-12-08-the-role-of-grid-systems-in-component-based-front-end-builds">a combination of classnames-for-layout-purposes and CSS to go with it</a>. In the future, with CSS Grid Layout, classnames can just declare what a thing is. They then leave it to CSS entirely to describe how the thing is layed out. As Rachel Andrew points out in her recent 24 Ways article, this may mean <a href="https://24ways.org/2015/grid-flexbox-box-alignment-our-new-system-for-layout">the end of container, row and col-* type of classnames</a>:</p> <blockquote> <p>(…) my hope is that it will be the layout frameworks that tie our design to our markup. They have been a necessary placeholder while we waited for a true web layout system, but I believe that in a few years time we’ll be easily able to date a website to circa 2015 by seeing <code>&lt;div class=&quot;row&quot;&gt;</code> or <code>&lt;div class=&quot;col-md-3&quot;&gt;</code> in the markup.</p> </blockquote> <p><a href="https://www.w3.org/TR/css3-grid-layout/">CSS Grid Layout</a> is awesome, because it would provide web page layout with a separation that the makers of the web always <a href="http://www.w3.org/TR/html-design-principles#separation-of-concerns">encouraged authors to follow</a>: </p> <ul> <li>HTML is for what it is (structure)</li> <li>CSS is for what it looks like (style)</li> </ul> <p>But I feel that this leaves us with a problem not easily solved: <strong>how can we sensibly sname page areas</strong>? In examples of Grid Layout, there is usually a header, main content, sidebar and a footer. In reality, there can be lots of different combinations of column widths. There are usually many variations, possibly more than we could possibly come up with classnames for.</p> <h2>Naming page areas</h2> <p>When using classnames-for-layout-purposes, page areas are defined by presentational classnames that do not require further naming. We just name the components inside the containers, and give their wrappers/containers presentational names to form a grid structure.</p> <p>If we want to peruse the semantic classnames we have added to page areas to lay things out, we’ll need to give them sensible names. We can then apply grid CSS to each of them (and could do this reusably/automatically by clever preprocessor usage).</p> <p>My argument is that coming up with such names could prove quite hard: what’s a thing called that has a 35% column and a 65% column, in which the latter column is divided into four? Arguably, names like <code>col-6</code>, or even <code>col-md-6</code> are easier to work with (and yes, I’ve frowned upon them for long). </p> <p>Making it easy to work with is probably what we are discussing here. It’s mostly an issue between developers, for the browser or user doesn’t experience what we call things. They can benefit from separation between semantic usages of HTML elements and separation of concerns generally, but classnames aren’t read out by screen readers (like a title attribute), used to construct the accessibility tree (like some attributes are) or linked to by users (like IDs).</p> <h2>Conclusion</h2> <p>So I think there are two views, really. Some will argue we should think of our grid as a system separate from the rest of a site’s front-end, and as a thing that we can leave for months without touching it. In this case, when regarded as a separate thing, presentational grid classnames are seen as okay. Others will say grid-structures should just arise from grid definitions that belong to each semantically classed component. Especially for those, CSS Grid Layout will make it a lot easier to do this.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/declaring-grid-layouts-with-just-css/">Declaring grid layouts with ‘just’ CSS</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Declaring grid layouts with ‘just’ CSS">Reply via email</a></p> Scripts and stylesheets in WordPress sites 2015-12-23T00:00:00Z https://hidde.blog/scripts-and-stylesheets-in-wordpress-sites/ <p class="intro">WordPress is used by many different audiences. It is used by people who do not know much about code, as well as by experienced programmers<sup class="footnote" id="fnrev968640323567a6b9ef31ec-1"><a href="https://hidde.blog/scripts-and-stylesheets-in-wordpress-sites/#fn968640323567a6b9ef31ec-1">1</a></sup>. Expectations of plug-ins therefore vary.</p> <p>Some want plug-ins to automatically do everything. If they use a plug-in to integrate their Twitter stream into WordPress, they expect the plug-in to not only pull tweets from the Twitter <span class="caps">API</span>, they also want the necessary mark-up and <span class="caps">CSS</span> to display tweets in the front-end. Others will only expect a plug-in to do a specific task, leave front-end hooks for developers to output data surrounded by their own mark-up, styled by their own <span class="caps">CSS</span> and made interactive with their own scripts.</p> <p>My ideal WordPress plug-in is of the latter type. I write my own templates (mark-up, stylesheet and scripts). Then, in the mark-up, I simply replace all dummy strings of text with template tags. My ideal Twitter plug-in, for example, would take care of fetching tweets from Twitters <span class="caps">API</span>, and it would then expose an <span class="caps">API</span> to output tweet data (the tweet itself, its date, its author, avatars etc), allowing a developer to output the relevant strings of text where required.</p> <p>When I add a new plug-in (or a client requests one to be installed), I have made it a habit to make sure it does not add any <span class="caps">CSS</span> or JavaScript (plug-ins can add assets through <code>wp_head()</code> and <code>wp_footer()</code>). If it does, I usually undo the behaviour and add <span class="caps">CSS</span> or script to fit within the existing code.</p> <p class="footnote" id="fn968640323567a6b9ef31ec-1"><sup>1</sup> And some experienced programmers will never touch WordPress (different discussion)</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/scripts-and-stylesheets-in-wordpress-sites/">Scripts and stylesheets in WordPress sites</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Scripts and stylesheets in WordPress sites">Reply via email</a></p> JSCS vs JSHint 2016-01-05T00:00:00Z https://hidde.blog/jscs-vs-jshint/ <p class="intro"><span class="caps">JSH</span>int helps you enforce <a href="http://jshint.com/docs/options/">code correctness</a>, whereas <span class="caps">JSCS</span> helps you enforce a <a href="http://jscs.info/rules">code style</a>. </p> <p><span class="caps">JSH</span>int is deprecating its code style related features and plans to remove them from the next major releases (see <a href="http://jshint.com/docs/options/">docs</a>). Therefore, it makes sense to use both <span class="caps">JSCS</span> and <span class="caps">JSH</span>int. (Thanks <a href="http://jegtnes.co.uk/">Alex</a> for pointing me at this)</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/jscs-vs-jshint/">JSCS vs JSHint</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20JSCS vs JSHint">Reply via email</a></p> The website as an instantiation of your design system 2016-01-19T00:00:00Z https://hidde.blog/the-website-as-an-instantiation-of-your-design-system/ <p class="intro">In his talk at Beyond Tellerand last year, web designer Brad Frost talked about the website “as an instantiation of your design system”. I really liked that idea. </p> <p>Design can be defined by many things: it is a thought process, the result of abstract thinking, something that requires research and a sense of style. From a practical point of view, it can be described in terms of the materials it is made of. Paint, wood, glass, ink… This is slightly different for web design. Web design, in particular, is made of some very specific materials: <span class="caps">HTML</span>, <span class="caps">CSS</span>, JavaScript, typefaces and images.</p> <p>Design on the web, more than any other type of design, can be documented in a way that is powered by the materials it is made of. Pattern libraries can do this. </p> <h2>Pattern libraries</h2> <p>A pattern library is a set of components, in which each component can include:</p> <ul> <li>Documentation</li> <li>Mark-up in <span class="caps">HTML</span> (or Twig or Haml or Mustache)</li> <li>Style in <span class="caps">CSS</span> (or Sass or Less or Styles)</li> <li>Scripts in JavaScript (or Coffee Script)</li> <li>Images</li> </ul> <p>Each component has at least documentation and mark-up.</p> <p>The set of components, as a whole, describes the design system that exists in your website. The components, plus perhaps a couple of files like typefaces, a logo and an icon set (although they could be components of their own).</p> <h3>Advantages</h3> <p>The advantages of separating your design system out as front-end components are plentiful:</p> <ul> <li>great <em>reference</em> for all people involved in the project</li> <li>potentially a <em>better workflow</em>, as there is only one place where common patterns are created</li> <li>easier to <em>spot and avoid inconsistencies</em> in both design and code (‘Oh wait, we’ve already got a datepicker!’, ‘Actually, we can reuse most of that existing markup for this new button style’)</li> <li>more <em>testable</em> as everything is abstracted and nicely separated and organised, this makes it easier for a script (or anyone) to test</li> </ul> <h2>Zombie style guides</h2> <p>To create a style guide as an overview of your website’s design system and the corresponding code is one thing. To maintain it, is another. In her Fronteers 2015 talk, Anna Debenham referred to a phenomenon known as <a href="https://fronteers.nl/congres/2015/sessions/front-end-style-guides-anna-debenham">zombie style guides</a>, style guides that live separate from the web project they power, and are not actively maintained. They are no longer as useful as they were at the start of the project.</p> <p>To avoid that, a style guide should be what powers your actual website(s), so that your website(s) become instance(s) of your design system.</p> <h2>The website as an instantiation of your design system</h2> <p>This is what Brad Frost suggested in this talk at Beyond Tellerand in Düsseldorf (<a href="https://vimeo.com/144596023">Video</a>, scroll to 39:00):</p> <blockquote class="in-content"> <p class="in-content">“The website is one instantiation of your design system”</p> </blockquote> <p>I think this brilliant. In the ideal set up, there is a set of components, and then those components are used in places. The set is built, updated, improved, refactored etc <em>separately</em> from the places it is used in. The website, but also a front-end style guide are just examples of places.</p> <p>Brad quotes <a href="https://twitter.com/nathanacurtis/status/656829204235972608">Nathan Curtis</a>: </p> <blockquote class="in-content"> <p class="in-content">“A style guide is an artifact of design process. A design system is a living, funded product with a roadmap & backlog, serving an ecosystem.”</p> </blockquote> <h3>Copy/pasting mark-up vs “real” instantiation</h3> <p>One way a website could be an instantiation of a design system, is if all markup in the site is copied from the style guide. The copy/paste method is easiest to set up. </p> <p>A much better and more ideal way, is if the site uses code to grab a copy of the actual markup for a component. This markup could live in its own repository so that it can be modified, refactored and improved. For example:</p> <pre class="language-php"><code class="language-php"><span class="token function">includeMyComponent</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'button'</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> text<span class="token punctuation">:</span> <span class="token string double-quoted-string">"Click here"</span> <span class="token punctuation">}</span><span class="token punctuation">)</span></code></pre> <p>could render as this today:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>button<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Click here<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">></span></span></code></pre> <p>and render as this tomorrow, after an update to the component library:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>button<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Click here<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span></code></pre> <p>New mark-up, same include function.</p> <p>The holy grail, Frost concludes, is a “magical setup” that contains “all the lego bricks of a site”, and if we make a change, anywhere that lego brick is updated, it just magically updates. Like the example above. Ian Feather and his team at Lonely Planet have built a system that can do this, with their <a href="http://engineering.lonelyplanet.com/2014/05/18/a-maintainable-styleguide.html"><span class="caps">API</span> for components</a>.</p> <h2>The front-end style guide</h2> <p>The front-end style guide, like the website, can also be seen as an instantiation of the design system. It is just another place that consumes your organisation’s set of components.</p> <h3>Documentation</h3> <p>There is one important difference though: a front-end style guide should, in my opinion, serve as documentation. So not only should it consume the components themselves, it should consume components <em>with</em> their documentation.</p> <p>The person who builds a component, will have to write its documentation. This is essential, as a few month’s later, they may have left the team. Or they may still be on it, but have forgotten about what the component was for.</p> <p>Documentation of a component should explain what it is, what it is used for and what its options/parameters are.</p> <h2>Conclusion</h2> <p>To summarise my thoughts: I think web design is a special type of design as it can be documented with the same materials it is made of: markup, stylesheets, scripts et cetera. This can be done by structuring the design in the form of a system of components. This system can then power both the website and a showcase of documented components. Statically, or, ultimately, <em>dynamically</em>. </p> <p>For more info on different types of style guides and approaches to building ones that ‘live’, I can recommend watching Anna’s talk at Fronteers and Brad’s talk at Beyond Tellerand:</p> <ul> <li><a href="https://fronteers.nl/congres/2015/sessions/front-end-style-guides-anna-debenham">Anna Debenham – Front-end Style Guides</a> (Fronteers, Amsterdam, 2015, includes transcript so you can read instead of watch)</li> <li><a href="https://vimeo.com/144596023">Brad Frost – Style Guide Best Practices</a> (Beyond Tellerand, Düsseldorf, 2015)</li> </ul> <hr/> <p>Originally posted as <a href="https://hidde.blog/the-website-as-an-instantiation-of-your-design-system/">The website as an instantiation of your design system</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20The website as an instantiation of your design system">Reply via email</a></p> Making conference videos more accessible 2016-01-21T00:00:00Z https://hidde.blog/making-conference-videos-more-accessible/ <p>If conference videos are made more accessible, they can be shared with a wider audience. This is a great way to add value! Most Fronteers 2015 videos are now <a href="https://fronteers.nl/congres/2015/sessions">available with captions and transcripts</a>. In this post I will explain why we did it, how we got our transcripts made and what happened next. </p> <p>At <a href="http://fronteersconf.org/">Fronteers</a>, we have had our videos transcribed in the past <a href="https://fronteers.nl/congres/2011/sessions">2011</a>, <a href="https://fronteers.nl/congres/2012/sessions">2012</a>, but it was quite a time-consuming process and we’ve not always been able to find volunteers for it. In recent years, the process has improved a bit, so this year I thought it would be good to have them made again. </p> <h2>What and why</h2> <p>To make a video more accessible, <a href="http://webaim.org/techniques/captions/">WebAim recommends</a> having both captions and transcripts.</p> <p>A <em>caption</em> is like a subtitle, but in the same language as the video. It contains whatever is said in the video, and other sounds, such as laughter, applause and description of any music that is played.</p> <p>A <em>transcript</em> is a textual alternative for audio and video. On the Fronteers site, we use the content of the caption file and display it underneath the video.</p> <p>Captions and transcripts can benefit:</p> <ul> <li>people with partial or total inability to hear</li> <li>people for whom the video’s language is not their first</li> <li>people who do not have time to watch the video, prefer reading it or want to search for a specific thing a speaker said</li> <li>people watching the video in a noisy environment</li> <li>your website’s SEO optimisation strategy for search engines1! (really)</li> </ul> <h2>Amara via Vimeo</h2> <p>For our transcripts this year, we have been making use of a service called <a href="https://www.amara.org/en/">Amara</a>. It is integrated into Vimeo, which makes the process of ordering very convenient (we host <a href="https://vimeo.com/fronteers/channels">our videos</a> there). </p> <p>We used Amara’s paid service, but, at the time of writing, they also give users access to their editor on Vimeo, so that they can DIY the transcripts. Or you can access the same tool on <a href="https://amara.org/en/">Amara.org</a> and subtitle videos hosted anywhere (many formats supported). Both are free, but cost more time per transcript.</p> <p>Amara is bigger than just their Vimeo integration: they are a project of <a href="http://pculture.org/">a not-for-profit organisation</a> that aims to ‘build a more open, collaborative world’. In this post I will focus on how to do it with the version built-in to Vimeo.</p> <h2>The process</h2> <p>The Amara service can be used from within Vimeo. The way it works is that, as the uploader, you go to your videos’ settings and under “Purchase Amara professional services”, you click “Purchase”. You then select the language that you require, choose a price tier and enter payment details.</p> <p>You can also add a comma separated list of technical terms, to make sure the transcript reflects their spelling correctly. As an experiment, I decided to leave this field empty. </p> <p><img src="https://hidde.blog/_images/amara-purchase-.jpg" alt="Amara purchase button" /> <em>Purchase button on Vimeo</em> </p> <p>After submitting a video for transcription, each one took 3-6 working days to show up. The week after I had ordered them, they kept slowly coming in, giving me the time to check each one (see below). The quality was surprisingly good, with only very few minor corrections needed. This was despite not supplying a list of technical terms. </p> <p>When we were happy with the transcript, we also uploaded the video to our own website, where we included:</p> <ul> <li>the video (as a <code><video></video></code>, <em>obvs</em>) </li> <li>the subtitle file as captions (a <code><track /></code>) </li> <li>the transcript (which in our case was just the captions file as text)</li> </ul> <p>(Example: <a href="https://fronteers.nl/congres/2015/sessions/digital-governance-lisa-welchman">Digital governance by Lisa Welchman</a>)</p> <p>In the front-end outputted by our CMS, <a href="https://twitter.com/krijnhoetmer">Krijn</a> built something nifty to make it so that when you click a sentence in the transcript, the video skips to that part of the talk. Check out the example above to see it in action, it is very cool!</p> <p>If you want to do something similar, it is good to know that the caption that shows up in Vimeo can be downloaded as a WebVTT file. This is ‘just’ a text file with time stamps and sentences, so it can be opened and updated in a text editor of choice.</p> <h2>QA</h2> <p>In our case, we paid for our transcripts. The results were very good, and almost ready to go live. Just before that, I have gone through a few steps manually for each transcript:</p> <ul> <li>search for <code>[INAUDIBLE]</code> and have a listen to see if it really is inaudible. Sometimes it was added when the speaker said a technical term very fast (gulp.js, <code>console.log()</code>)</li> <li>search for <code>[?</code>, these are words that the transcriber was unsure about. Again, these could be technical terms. If the video is about web development and you’re a web developer, you can likely fix it.</li> <li>scroll through and gloss over the text</li> </ul> <p>!/_images/vimeo-amara-.jpg(Amara interface on Vimeo)! <em>Amara’s handy interface to check and adjust your captions</em> </p> <h2>Some notes</h2> <ul> <li>At the time of buying, Basic, Professional or Full Service captions were priced at $1.70, $2.80 and $3.95 per minute respectively (difference is in how many proofreaders are used), so it is not very cheap. A conference video (45-60 minutes) will cost between $100 and $150.</li> <li>From the Vimeo interface, you cannot get all languages transcribed. Our conference videos were in English, which was supported. Many of our meetup videos are in Dutch, which is not supported.</li> <li>I was amazed at how good the transcribers were at getting technical terms right, words like SVGOMG, Sass and JavaScript were spelled and capitalised correctly and consistently so. Ideal for when pedantry does occur within your target audience!</li> <li>Using Amara’s “Professional” tier, leaving the technical terms field blank still gives great results</li> <li>We used <a href="http://castingwords.com/">Casting Words</a> in the past, they work out slightly cheaper and offer integration with FTP and an API (but are not built into Vimeo)</li> </ul> <p>So, that’s it. I hope this helps conference organisers in deciding whether and how to transcribe their conference videos. If you have experience with other services or workflows, please do leave a comment below.</p> <p><em>Edit 26/01/2018: unfortunately, it is no longer possible to do the above through Vimeo.</em></p> <hr/> <p>Originally posted as <a href="https://hidde.blog/making-conference-videos-more-accessible/">Making conference videos more accessible</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Making conference videos more accessible">Reply via email</a></p> Turning off Heartbeat in WordPress made my day! 2016-02-08T00:00:00Z https://hidde.blog/turning-off-heartbeat-in-wordpress-made-my-day/ <p></p><p class="intro">Heartbeat API is a thing built into WordPress that sends a POST request every 15 seconds. It allows for interesting functionalities like <a href="https://pippinsplugins.com/using-the-wordpress-heartbeat-api">revision tracking</a>, but can also dramatically slow things down and even block editors from editing content (<em>if your connection is quite slow</em>).</p><p></p> <p>The “Edit” pages in WordPress use the Heartbeat API to detect connection loss. If they detect you’ve lost your connection, your ‘Update’/‘Publish’ button will get disabled until your connection is back. </p> <h2>Why?</h2> <h3>“Connection lost” message on slow connections</h3> <p>When I was working on a WordPress site this week, I accessed the internet through my 3G MiFi, and added a VPN for security (the less glamorous side of working remotely). It resulted in seeing the ‘Connection lost’ message all the time. It would usually appear before I could make any changes, and never disappear. In which case it stopped me from editing content.</p> <p><img src="https://hidde.blog/_images/connectionlost-.png" alt="Screenshot of error message: connection lost, saving has been disabled until you're reconnected, we're backing up this post just in case." />! <em>The error message</em> </p> <h3>High CPU usage</h3> <p>Others comment that <a href="http://www.inspire2rise.com/how-to-disable-wordpress-heartbeat-api.html">Heartbeat leads to high CPU usage</a>: imagine having multiple instances of WordPress edit pages open in a browser, each sending its own POST requests every 15 seconds.</p> <h2>Turning Heartbeat off</h2> <p>Only when I just turned the whole thing off, I was able to make changes to my page. Turning Heartbeat off can be done by simply deregistering the script: </p> <pre><code>add_action( 'init', 'remove_heartbeat'); function remove_heartbeat() { wp_deregister_script('heartbeat'); }</code></pre> <p>(via <a href="http://www.inspire2rise.com/how-to-disable-wordpress-heartbeat-api.html">Aditya Nath Jha</a></p> <hr/> <p>Originally posted as <a href="https://hidde.blog/turning-off-heartbeat-in-wordpress-made-my-day/">Turning off Heartbeat in WordPress made my day!</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Turning off Heartbeat in WordPress made my day!">Reply via email</a></p> World IA Day 2016 in Bristol 2016-02-20T00:00:00Z https://hidde.blog/world-ia-day-2016-in-bristol/ <p>This weekend I attended World IA Day in Bristol. The <a href="http://2016.worldiaday.org/">event</a> is organised simultaneously in 61 locations across 31 countries. The local one was put together by <a href="http://nomensa.com/">Nomensa</a>, an awesome Bristol web agency whom I had the pleasure of freelancing with for 3 months last year.</p> <p>The day offered a variety of talks: some more philosophical, others more practical. The overarching theme of the day was ‘information everywhere, architects everywhere’. Talks focused on what architecture is (and whether ‘architecting’, as Kanye West used it, is indeed a verb). It was about what it means that in the digital age, information can really go everywhere.</p> <h2>Simon Norris - From taxonomy to data and beyond</h2> <p>Simon’s talk gave us an interesting overview of the history of information architecture (IA). According to Simon, four paradigms characterise the development of IA: Classic IA, User-generated IA, Pervasive IA and Inversion. He related each one to a change of context.</p> <p>First spoken about in the sixties at companies like IBM, the discipline of IA started with the popularisation of the phrase by Richard Saul Wurman, and the publication of the book ‘<a href="https://hidde.blog/world-ia-day-2016-in-bristol/shop.oreilly.com/product/9780596527341.do">Information Architecture</a>’ by Morville and Rosenfield, also known as the Polar Bear Book.</p> <p>Simon considers IA as a ‘sister’ discipline of UX (separately, like chemistry and physics are separate disciplines). One does not supersede the other, they work together. IA is about the blending of the immaterial and the material, Simon said. In this view information itself is completely shapeless, and giving it shape is what IA is about.</p> <p>Simon discussed these four waves of IA:</p> <ol> <li> <p><em>Classic IA</em> - Context: the web was quickly becoming the most popular technology ever. Classic IA was about what to equip designers with to make sense of all the information that needs to go on a website. Simon said that for him, Classic IA was about defining taxonomies to aid the design of websites that support human decision making.</p> </li> <li> <p><em>User generated IA</em> - Context: the web had become a global phenomenon in many ways, it was bigger than what anyone expected. Another shift happened: User generated IA. It was almost the opposite of Classic IA: it was user orientated not designer orientated. Users were enabled to make their own taxonomies and with that, shape their own experiences. Example: delicio.us (now Delicious), the bookmarking website, lets users save URLs and manage them within taxonomies like tags and categories.</p> </li> <li> <p><em>Pervasive IA</em> - Context: people started to use computers everywhere. It was no longer a discrete activity, computing had become ubiquitous, and interaction started happening ‘cross channel’. IA was no longer about labeling and hierarchies, it became about sense making and place making. Resmini and Rosati wrote ‘Pervasive Information Architecture’. IA now had to consider changing and emerging experience across channels.</p> </li> <li><em>Inversion</em> - Context: digital is now influencing the physical world. The fourth wave is about ‘inversion’. There is now so much data, ‘big data’, that we could do analysis on, that we are urged to look at information in a completely new way, Simon said.</li> </ol> <p>Simon recommended reading “A brief history of information architecture” by Resmini/Rosati (<a href="http://journalofia.org/volume3/issue2/03-resmini/jofia-0302-03-resmini.pdf">PDF</a>).</p> <h2>Shaula Zanchi - The world is greater than the sum of its parts</h2> <p>Shaula works in ‘physical’ architecture and talked about how internal information is managed at her company. For each project there is a lot of information that they need to keep track of. One example of information is keeping track of samples used in the architectural process: which they had, where they were, where they came from, et cetera. </p> <p>They began making sense of their information and the relationships within it through a spreadsheet. Then they started using a database with some PHP, as a kind of Excel plus. They then started adding layout kind of things to what they had, so that it could look and feel more like what they now call Sample Library. It all became part of the bigger intranet project.</p> <p>A very interesting case study! </p> <h2>Team BBC</h2> <p>The next talk up was by what Simon called “Team BBC”: four smart people involved with the BBC’s information architecture.</p> <p><em>Dan Ramsden</em> talked about blending the day’s theme, ‘information everywhere’, with another: ‘uncertainty’. At BBC, he said, they literally have millions of pages online. This is a lot of content and information. The ratio of content producers to designers is roughly 83:1. Projects vary from simple projects with a clear direction and scope to more complex ones, with many uncertainties. Information architecture helps them hugely with these challenges. The most important IA adds to the BBC, Dan concluded, is that by defining a structure, we create meaning.</p> <p><em>Luisa Sousa</em> then talked about joining and becoming a User Experience Architect at the BBC. When she first started, she explained, Luisa felt like being in a box where she couldn’t move or see much. On her first project, a new website for GEL, she learned to stop worrying about the word ‘architect’ in her job title, and to start being involved as a problem solver, master of questions, designer and jelly bean eater. From her talk, I understood good information architects are able to put on many hats.</p> <p><em>Barry Briggs</em> talked about practical aspects of being a user experience architect. He emphasised how complex IA work can be, as there are many gaps between bits of information. He showed how flow charts can help. Not only do they help verifying IA work with stakeholders, they also help with dividing stakeholdership across different parts of the chart. Letting team members and stake holders be involved with specific parts of the flow chart, also aids working in parallel, Barry explained.</p> <p>Lastly, <em>Cyrièle Piancastelli</em> talked about advocating for UX at BBC. The best user experience, she explained, enables innovation, is an investment and is essential. The best way for user experience (and perhaps information architecture). At the BBC, as Dan also mentioned, there is lots of good content. When you are already sure about your content, the thing that you can make a difference with is <em>how your present it</em>, said Cyrièle. With good IA, we can make a difference.</p> <h2>Karey Helms - Making the invisible physical</h2> <p>Karey talked about how to make sense of complex data driven systems to design enterprise solutions. She discussed what makes enterprise UX so challenging and what physical prototyping is, and showed us some cool example projects. </p> <p>One of the major challenges Karey’s company had, is that many of their users are ‘situationally disabled’. Whether they are potentially under stress (healthcare patients) or wearing gloves (when working in a warehouse): they can be in complex situations, and interfaces need to be designed appropriately. I think this goes for users outside enterprise as well: we should always design for circumstances that we are aware or unaware of.</p> <p>Physical prototyping or model making, Karey explained, is used by her company to identify what ‘core components’ of a project are, to situate things in context and to explore interaction modalities.</p> <p>Karey showed some great and personal examples:</p> <ul> <li>the ‘party mode’ on her website that corresponds with a Philips Hue light on her desk. Information, she concluded from this project, is emergent, part of an ecosystem and not a fixed modality.</li> <li>the ‘burrito’ bot: it analyses use of emoji in personal communication between her and her husband, and then reports who the weeks’ best spouse was at the end of each week. From this she found that information has a large role in the design of systems, but also that it has broader implications and varying levels of fidelity.</li> </ul> <h2>Ben Scott-Robinson - Making money out of IA</h2> <p>Ben works for Ordnance Survey, Britain’s ‘national mapping agency’. Making maps, he explained, is in its core all about information architecture. His talk was about how OS makes money from IA. The main thing they produce, he said, clarity of information. Detailed information, in their case, used by the likes of governments and telecom providers. </p> <p>Despite the IA-like activities being at the core of the company, OS’ website was not ‘generating leads’ or selling products very well. This almost lead to the closure of the website, but this did not happen. They decided to work on a new website and have a strong focus on user testing during the process.</p> <p>Ben explained OS decided to make ‘happiness of users’ a key metric for their definition of success. Their company’s performance would be judged by how happy their users were. There was an big role for NPS (net promotor score), a number that expresses the chance a customer would recommend your company to others. NPS, they decided, equals happiness. When they first started, the NPS was very low, negative even. Then they started using UX processes like paper prototyping and card sorting. They built a new website, showed it to stakeholders. Some departments were unhappy as their bit wasn’t in the main navigation, but this is where the user testing sessions came in handy: there were many a user testing video they were able to show to back up their decision.</p> <h2>Dan Klyn - Everything needs to be actually architected</h2> <p>The last talk of the day was a great Kanye West-inspired keynote by Dan Klyn. A greatly inspiring talk, about whether architecting is a verb (compared with the word ‘designed’, he said, it is about something more fundamental than design). Dan emphasised that <a href="http://wildlyappropriate.com/2012/08/12/architecture-is-not-design/">architecture is not design</a>. He also talked about the difference between good design and better design, which he said is immeasurable.</p> <p><img src="https://hidde.blog/_images/klyn-.jpg" alt="Dan Klyn" /> <em>Dan Klyn</em> </p> <p>The reason we don’t call architects something like ‘building designers’, Dan said, is that they operate on a different level, being the level of human agreement. An interesting challenge in IA Dan mentioned is that of the ‘structural integrity of meaning across contexts’: the ‘mess’ that iTunes currently is, is an example of a product where this needs improvement.</p> <h2>Conclusion</h2> <p>I had a great time at World IA Day 2016 and learned a bunch about information, architecture and information architecture! Practical tips about different approaches and working together, but also theoretical ideas about the meaning of information architecture concepts. Also, I should definitely go and read the Polar Bear book.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/world-ia-day-2016-in-bristol/">World IA Day 2016 in Bristol</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20World IA Day 2016 in Bristol">Reply via email</a></p> Cascading and cognitive overhead 2016-02-23T00:00:00Z https://hidde.blog/cascading-and-cognitive-overhead/ <p>When I started out learning to build websites, the web world was just moving from adding style declarations to every single element, to a generalised approach where one small-ish set of rules would apply to all of a website’s pages.</p> <p>We transitioned from meaningless markup:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>font</span> <span class="token attr-name">size</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>-1<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>A smaller heading1!<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>font</span><span class="token punctuation">></span></span></code></pre> <p>to markup that described an element’s position in the page structure:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h3</span><span class="token punctuation">></span></span>A smaller heading<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h3</span><span class="token punctuation">></span></span></code></pre> <p>This was the magic of CSS: because our markup had meaning, we could contain the style of all the elements in just a small set of rules that would <em>sort of automatically</em> work for new pages.</p> <h2>Styling things that don’t even exist yet</h2> <p>With CSS, you don’t just style <em>that</em> heading, you style the general thing ‘heading’, including the ones on pages that don’t exist yet, with lengths you hadn’t imagined yet.</p> <p>Preparing for the unexpected is a large part of the art of authoring stylesheets. We don’t know what device a user is going to pick, we don’t need to know, but if it’s got a certain screen width, we can write rules to adapt the lay-out.</p> <h2>Cascade blaming</h2> <p>In modern approaches to CSS, some portray the cascade as a nuisance. In his (well-considered) <a href="http://zellwk.com/blog/rem-vs-em/">article about REMs vs EMs</a> (seriously, read it, it is good!), Zell Liew says:</p> <blockquote> <p>What throws people off is that 1em can take on different values in different parts of the code</p> </blockquote> <p>Harry Roberts <a href="https://twitter.com/csswizardry/status/702030165413650432">responded to this</a> on Twitter: </p> <blockquote> <p>This, in a nutshell, is why I hate ems.</p> </blockquote> <p>So about this ‘taking on different values on different parts of the code’: in any programming language that would be bad, a side effect, a bug, a problem. But for CSS, a declarative language, it is arguably <em>the whole point of it</em>. CSS is made to have a cascade: behaviour that inherits style declarations based on priorities.</p> <p>I would argue the <em>benefit</em> of CSS is that it does unexpected things. Instead of having to style every heading individually (result: expected behaviour), it will style each heading for us, including the ones that don’t exist yet when we’re writing the style rule (result: unexpected behaviour). </p> <p>This is something you need to keep in mind when writing stylesheets. Harry <a href="https://twitter.com/csswizardry/status/702030165413650432">replied</a> that the cascading behaviour of ems is ‘cognitive overhead’ that ‘isn’t worth it’. I concur it is cognitively <em>challenging</em>, and education is important (Harry personally does a lot of great CSS education), but so are many things in web development. </p> <h2>Complexity in CSS vs complexity in preprocessors</h2> <p>The benefit of cascading as a cognitively challenging thing: <a href="https://www.w3.org/TR/css-cascade-3/">it is clearly defined in specifications</a>. </p> <p>Many features of the modern day CSS approach, such as custom mixins and functions, are defined by the (very smart) people behind projects like Bootstrap, Bourbon, Inuit et cetera. They, too, bring cognitive overhead, but have only their documentations to refer to for help. </p> <p>Where the spec-defined complexities have always been explained in the spec, and books by people like Eric Meyer and Andy Clarke, many modern-day complexities in CSS are harder to learn. Arguably, they bring <em>more</em> cognitive overhead.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/cascading-and-cognitive-overhead/">Cascading and cognitive overhead</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Cascading and cognitive overhead">Reply via email</a></p> Perf mattered at the Fronteers Spring Conference 2016-04-01T00:00:00Z https://hidde.blog/perf-mattered-at-the-fronteers-spring-conference/ <p>On Friday 1 April I attended Fronteers Spring Conference at EYE in Amsterdam. The first of its kind, after <a href="https://fronteers.nl/congres">8 two day conferences in autumn</a>. IMHO, this one day spring thing is a fantastic format worth pursuing again!</p> <p>Fronteers has in recent years always taken place in Tuschinski, an old cinema with a very cool interior, an eclectic mix of styles like art deco and Jugendstil. <em>Cinema equals comfy seats</em>. The cool thing about <a href="https://www.eyefilm.nl/en">the new venue</a>, also a cinema, was that most of us had to get on a boat (for five minutes or so) to get there.</p> <p>The day was all about web performance (hashtag <code>#perfmatters</code>): making websites faster. It was divided into <a href="https://fronteers.nl/congres/2016-spring/schedule">three sections</a>, each with three 20 minute talks: the first on visual performance, the second on performance and accessibility and the last technical performance. Each section ended in a panel discussion with MC, eh, <em>host</em>, <strong>Phil Hawksworth</strong>. The day was then concluded with a keynote talk about money and the business case for web performance.</p> <h2>Visual performance</h2> <p><strong>Tobias Ahlin</strong> started the day off with some great tips for better performing animations (<a href="https://dl.dropboxusercontent.com/u/37961591/Presentations/Performant%20UI%20Animation.pdf">slides</a>). He recommended to only ever animate <code>opacity</code>, <code>transform</code> and <code>translate</code> properties, and suggested the use of pseudo elements to resemble animating other properties. An example: you cannot transition/animate <code>border</code>, but you can add a pseudo element, make it look exactly <em>like</em> a border and transition/animate that instead.</p> <p><strong>Paul Bakaus</strong> discussed the perception of performance. How a person <em>experiences</em> speed, he argued, may be a more important thing than actual, measurable numbers. Long activities, he said, can be memorised as short, and short ones can be memorised as long. He also emphasised how important context is for this: where and how you experience time can also influence what you feel about an interaction taking a certain time.</p> <p><strong>Bram Stein</strong> then talked about web typography, and more in particular the timing of custom font loading (<a href="https://speakerdeck.com/bramstein/web-fonts-performance-1">slides</a>). Browsers (and developers) make choices about what to do when your CSS wants to use a font that is not on the user’s system, the main options being FOIT or FOUT. FOIT is the flash of invisible text: a white screen until the requested font has downloaded. FOUT is the flash of unstyled text: rendering content in a fallback font <em>until</em> the requested font is downloaded and available. I could not agree more with him that FOUT is the best strategy: displaying any content at all is more important than displaying it in your font of choice. Web fonts are an enhancement. Bram stressed we should optimise how browsers load fonts with code, as most browser’s defaults are not great. This can be done with <code>prefetch</code> <a href="https://w3c.github.io/preload/">headers</a>, the <a href="https://drafts.csswg.org/css-font-loading/">Font Loading API</a> or its polyfill, Stein’s own <a href="https://github.com/bramstein/fontfaceobserver">Font Face Observer</a>.</p> <h2>Accessibility</h2> <p><strong>Marcy Sutton</strong> talked about ensuring accessibility in apps that rely on JavaScript (<a href="http://marcysutton.github.io/a11y-perf/">slides</a>). To get websites to perform well <em>and</em> accessibly, she encouraged us to think about how you impact users (eg those that want or have to interact with their keyboards or assistive tech). This means we should not only focus on the DOM tree, but also on the <a href="https://hiddedevries.nl/en/blog/2015-05-26-the-accessibility-tree/">accessibility tree</a>. In terms of performance, if your app relies on JavaScript to be usable with a keyboard or AT, she stressed, make sure this JavaScript is <em>in the critical path</em> and load it before the rest of your app. She also recommended to prefer native elements above custom ones, as they often come with free accessibility benefits. I feel this is <a href="https://hidde.blog/en/blog/2015-07-02-what-kind-of-web-components-do-we-need">especially important when thinking of Web Components</a>.</p> <p><strong>Karl Groves</strong> said that an important reason that we optimise for performance is because our clients want it and they’ll leave our sites or refrain from buying our stuff if we don’t and our website takes too much time before it becomes accessible. He said research (on physical businesses) showed that up to 83% could indeed leave a business if they had difficulty accessing it, and that this applies to the web. The most important question he said developers should ask is: “What is this thing and what does it do?”. This makes lots of sense, because the answers to those questions will likely remain the same whatever the device/context/user. Like Marcy, Karl mentioned the benefits of using native elements, and he showed <a href="https://www.youtube.com/watch?v=mydQJjf981g">an awesome video</a> that compares how ATs make sense of real <code>&lt;select&gt;</code> elements and their jQuery UI counterpart.</p> <p><strong>Estelle Weyl</strong> talked about how responsive web design is not (only) about making it ‘squishy’: with sites getting larger in file size, page weight really matters (<a href="http://instartlogic.github.io/fronteers/">slides</a>). An example she showed is that of <a href="http://www.cnet.com/how-to/use-youtube-feather-beta-for-low-bandwidth-connections/">YouTube Feather</a>, a super light replica of YouTube (100k instead of 1200k) that someone at Google made. She also explained how responsive images save time in both decoding and transferring, and said we should consider our user’s battery lives. Design, Estelle concluded, is not about making it pretty, it is about making it usable and intuitive (and I guess that includes fast).</p> <h2>Technical performance</h2> <p><strong>Yan Zhu</strong> went into the speed of TLS: when it was first on the table, people said it should not be deployed as it would be too slow. This is changing, with the likes of Netflix (which accounts for a huge part of bandwidth usage, especially in the US) switching to HTTPS. She said <a href="https://blog.cloudflare.com/tls-session-resumption-full-speed-and-secure/">session resumption</a> makes TLS less expensive by saving roundtrips. HTTP2 will also have impact as it allows multiple TLS connections at ones (and all regular supporting browsers will require HTTPS for it). HTTPS has in recent months become much easier to deploy on any site, with the public launch of <a href="https://letsencrypt.org/">Let’s Encrypt</a>, which has issued over 1.4 million certificates since its launch, which, in number, makes it one of the largest CAs out there.</p> <p><strong>Tobias Baldauf</strong> showed us some very clever tricks to get better performing images, including those ‘hero’ images that we all love. There were three parts to his proposal: use HTTP2, use progressive JPGs and optimise the ‘scan levels’ in those JPGs. Tobias showed a number of comparisons showing real speed differences between HTTP1.1 and HTTP2, and between progressive JPGs / optimised progressive JPGs and ‘regular’ JPGs. With HTTP2, progressive JPGs and optimised scan levels, he showed, you can get a recognisable image on screen after only 15% of the image has downloaded. Wow.</p> <p>Fronteers veteran <strong>Mathias Bynens</strong> blew everyone’s mind by explaining a very different phenomenon related to comparing the timing of downloads: the so-called <em>timing attack</em> (<a href="https://speakerdeck.com/mathiasbynens/front-end-performance-the-dark-side-at-fronteers-spring-conference-2016">slides</a>). He showed a number of different ways this can be used, but the main idea comes down to making requests to a site you think your victim visited, and use differences in server response times to find out about their status on that site (e.g. that they are logged in, have an account, or even have a certain age).</p> <h2>Round-up</h2> <p><strong>Kristian Sköld</strong> ended the day with an interesting keynote about a subject that was hardly discussed in the other talk: money. If you need your organisation’s support for spending time on web performance, you will want to make a business case and discuss money, as that is likely what the management will want to know about. Whatever you do, there should be a business case behind it, Kristian said. If you correlate pageviews/load time statistics with bounce rates, you will likely find that more people bounce if the site takes longer to load. This is a metric marketing/business people can work with and ultimately, approve the budget for. If better performance can shave money off the marketing budget, Kristian explained, making more money available to the IT/web department becomes simple math. </p> <p>My takeaways: </p> <ul> <li>We should be conscious of and minimise the amount of bytes we send down the wire</li> <li>Page speed is not just numbers, perception can also be a factor</li> <li>Fast websites do not have to be insecure: TLS is getting faster (so fast that Netflix is moving to it) and HTTP2 (HTTPS-only in all major browsers) lets us benefit even more from progressive JPGs</li> <li>Fast websites do not have to be inaccessible: resources that aid accessibility should be part of the <em>critical path</em> and if we use native elements, we get a lot of accessibility for free</li> <li>Paying attention to the amount of bytes sent to users can also help evil companies to track them</li> </ul> <p>What a fantastic day this was. We learned about keeping file sizes down and minimising bytes sent over the wire, about using the right tools for the right job and about advantages of HTTP2 and HTTPS. There were both specific and general talks about web performance issues, and as many as <em>three</em> accessibility talks. Lots of variety! Well done, <a href="https://fronteers.nl/congres/2016-spring/colophon">team Spring Conference</a>!</p> <h3>Other posts about the Spring Conference</h3> <ul> <li><a href="http://www.tomhartwig.nl/blog/fronteers-spring-2016-takeaways/">Tom Hartwig’s takeaways</a></li> </ul> <hr/> <p>Originally posted as <a href="https://hidde.blog/perf-mattered-at-the-fronteers-spring-conference/">Perf mattered at the Fronteers Spring Conference</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Perf mattered at the Fronteers Spring Conference">Reply via email</a></p> Font loading strategies 2016-04-21T00:00:00Z https://hidde.blog/font-loading-strategies/ <p>If one phrase from Bram Stein’s excellent Fronteers Spring Conf talk stuck with me, it was ‘always have a font loading strategy’. The point he made was that if you use custom web fonts in CSS, you should not rely on browser default behaviour, as that will often mean users see white pages with invisible text in case of font loading failure.</p> <p>In his article ‘Web fonts for president’, Zach Leatherman compares font loading strategies (or, mostly, lack thereof) of the 2016 US election candidates. What a great idea! It’s <a href="http://www.zachleat.com/web/president-web-font">a very interesting read</a>!</p> <p>Bram Stein <a href="http://www.bramstein.com/writing/web-font-loading-patterns.html">describes how to use his Font Face Observer on his blog</a>.</p> <p>(I realise this blog currently lacks a font loading strategy, since I recently updated the typeface, I’m working on that)</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/font-loading-strategies/">Font loading strategies</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Font loading strategies">Reply via email</a></p> Collaborative CSS 2016-05-08T00:00:00Z https://hidde.blog/collaborative-css/ <p></p><p class="intro">In “Meaningful CSS: style like you mean it”, Tim Baxter <a href="http://alistapart.com/article/meaningful-css-style-like-you-mean-it">argues for</a> replacing CSS approaches that heavily rely on classnames with a markup-centric approach. I think adding styling to HTML elements is hugely beneficial, but works best when combined with a class-based approach. We need a bit of both.</p><p></p> <p>In his article, Tim explains that in the past few years, HTML (especially when enriched with ARIA) has become much more expressive. So expressive, that we can throw away class-based approaches to styling. We can just style on HTML elements themselves, he says.</p> <h2>Your team’s standards vs web standards</h2> <p>The challenge in CSS is to find a way to apply the styles you want to the things you want to apply them to. Classes let you give your things <em>any</em> name. Classes are to “[represent] the various classes that the element belongs to”, <a href="https://html.spec.whatwg.org/multipage/dom.html#classes">says the HTML standard</a>. With a ‘class-based approach’, I mean approaches like OOCSS and BEM, that recommend you to define components or objects with just or mostly classnames.</p> <p>The most-used argument for a class-based approach to CSS is that it makes things easier for teams. Once a team agrees on the <a href="https://www.youtube.com/watch?v=OYOzUHnPJvU">preferred nomenclature</a> for a thing, they can consistently use those names within their team. </p> <p>But consistent standards already exist, in the form of web standards. Why not make those the baseline? Tim Baxter also says this:</p> <p></p><blockquote class="in-content">if there is any baseline level of knowledge we should expect of all web developers, surely that should be a solid working knowledge of HTML itself, not memorizing arcane class-naming rules</blockquote><p></p> <p>Yes, let’s add styling to HTML where we can! This is wonderful, because web standards for markup were made through a long process of mailing lists, IRC discussions and face to face meetings. They have already gone through the trouble of defining what things are on the web. </p> <p>Web standards define the difference between inputs for phone numbers and those for email addresses. They define the difference between a definition list and an unordered list. And the difference between quotations and paragraphs.</p> <h2>We need a bit of both</h2> <p>Adding style rules to native HTML elements, and use the power of some of the many attributes HTML comes with, sounds very sensible to me. Because the web standards people have already defined and documented what things mean in HTML, we can just use those semantics and be done with it. This also aids your users. Some of them may be using a screen reader or search engine to access your site.</p> <p>But there is a problem here. The issue with using ‘just’ HTML to apply CSS, is that HTML is simply not as expressive as the design languages that often underly our web projects. Many web projects contain various instantiations of the same, meaningful HTML elements. In such projects, the meaning cannot come just from the elements themselves. </p> <p>To be more precise, I think avoiding class-based approaches does not align with how web teams collaborate.</p> <h3>Some examples</h3> <p>Web standards document: </p> <ul> <li>what a form is</li> </ul> <p>Our project’s design language contains:</p> <ul> <li>a newsletter form</li> <li>a search bar</li> <li>a contact form</li> <li>a poll (why not?)</li> </ul> <p>These are all different types of forms, and would often <em>not</em> benefit from sharing style rules. The interaction designer has had user tests done and decided to do labels next to inputs in the contact form, and make the search bar expand when you click it. They’re all forms, but they’re all different. </p> <p>Web standards document: </p> <ul> <li>what an input with the type ‘submit’ is</li> </ul> <p>Our project’s design language has:</p> <ul> <li>the newsletter signup submit</li> <li>the search button</li> <li>the ‘Contact us’ form’s submit</li> <li>the button to submit your choice in the poll</li> </ul> <p>Again, I think their is much more difference in meaning than we can ever distinguish between with styling just <code>&lt;input type=&quot;submit&quot;&gt;</code> .</p> <h3>We can design beyond the list of available HTML elements</h3> <p>If we expect to be able to style just HTML elements, we should only allow designers to design one style for each HTML element. We would just hand them <em>the list of available HTML elements</em>, and they would create a design for each. That would be an insane process to follow. Unrealistic, too. Interaction designers have user journeys to worry about, they need to keep track of the whole picture. </p> <p>Designers for the web, rightly, design more than just individual HTML elements. This is why, for front-end developers, it makes sense to use <em>classes</em> like <code>.form--newsletter</code>, <code>.form--search</code> or <code>.form--contact</code>. Or, depending on whether they differ a lot, <code>.newsletter</code>, <code>.search-bar</code> and <code>.contact-us</code>.</p> <p>I have built websites where all the forms look the same, all the tables look the same and all the quotes looks the same. In those projects, they really exist, classnames are mostly unnecessary. Yet, most larger web projects are not like that. They have a lot of variations and for their meaning they cannot rely on HTML elements alone. </p> <p>We have to be pragmatic about this. We should collaborate on websites that go beyond just what native HTML elements have to offer. Creative combinations of markup can bring our users a great experience. Classes aid creative combinations. </p> <h3>Using classes to draw distinctions</h3> <p>So, I think we need to define blocks with classes, so that we can distinguish between all the different components that are in our project’s design language. There is no harm in adding classes for variations of those blocks, or elements within the blocks. After (a lot) of initial scepticism, I quite like BEM and have seen it work (but as with all best practices, it is <a href="https://vimeo.com/134190982">good to be critical</a>, the problems they solve may not be your problems).</p> <p>Classes are essential to do the work we need to do: style websites with a varied design language that creatively uses combinations of HTML elements. But using lots of classes should not stop one from using meaningful markup. CSS experts should always also be markup experts.</p> <h2>Conclusion</h2> <p>I really liked Tim Baxter’s article about styling with HTML elements and attributes, mostly avoiding classnames. It provokes thought and is a welcome alternative to the let’s-add-classes-to-all-the-things consensus. And I agree, adding styling to HTML elements is powerful, as they have inherent meaning that is specified in a standard. </p> <p>But I think HTML and ARIA are (still) not expressive enough to draw the distinctions our designers draw. Classnames are essential in making such distinctions. The best approach, imho, would be to combine both classes and meaningful markup.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/collaborative-css/">Collaborative CSS</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Collaborative CSS">Reply via email</a></p> Notes on CSS Grid Layout 2016-05-10T00:00:00Z https://hidde.blog/notes-on-css-grid-layout/ <p>In preparation of the <a href="http://www.gridlayout.eu/">Grid Layout Workshop in Amsterdam</a> this Friday, I read <a href="https://drafts.csswg.org/css-grid/">the grid spec</a>. I highly recommend doing this.</p> <p>This specification is a great read, even for those not familiar with reading CSS specs. It first introduces all the concepts with comprehensible examples, and then dives into the syntax in more detail (including diagrams that show exactly which properties can be used how, available shorthand syntaxes and the algorithms used to decide about sizing and alignment).</p> <h2>Why?</h2> <p>“We already have many clever combinations of HTML, CSS and JavaScript to do layout”, I hear you think, “so what do we need Grid Layout for?” All layout mechanisms we have used to date come with specific problems. Floats need clearing, inline-block grid elements need comments to remove spaces and make widths work, and tables misused an HTML element for layout. CSS Grid Layout addresses our layouting problems, and lets us ‘divide available space for layout into columns and rows using a set of predictable sizing behaviors’. Yeah! </p> <h2>New terminology</h2> <p>The grid spec introduces a number of new terms. A <strong>grid</strong> is a set of lines that divides the <strong>grid container</strong>. Within the grid container, columns or rows exist between the lines. Columns and rows can both be referred to as <strong>grid tracks</strong>. On the grid, each cell is called a <strong>grid cell</strong>. One or more cells can form a <strong>grid area</strong>, which can be occupied by <strong>grid items</strong>. </p> <p>I found it a bit confusing at first to see the difference between grid areas and grid items, but as I understand it, <em>grid items</em> are the bits of content that authors can specify to live in a specific <em>grid area</em>.</p> <h2>More alignment options</h2> <p>Some of the best new CSS properties that were introduced in flexbox, also work on grid containers (<code>justify-items</code>, <code>align-items</code>), grid items: (<code>justify-self</code>, <code>align-self</code>) and the grid itself (<code>justify-content</code>, <code>align-content</code>).</p> <p>See also: <a href="https://lists.w3.org/Archives/Public/www-style/2012Feb/0743.html">fantasai re: “Too Many Alignment Properties”</a></p> <h2>Naming lines and areas</h2> <p>With <code>grid-template-columns</code> and <code>grid-template-rows</code> you can not only specify how much space each grid cell takes up, you can also give the lines <em>surrounding</em> them names. So for a 3 column layout with a width of 25%, 50% and 25% respectively, you do something like:</p> <pre class="language-css"><code class="language-css"><span class="token property">grid-template-columns</span><span class="token punctuation">:</span> 25% 50% 25%</code></pre> <p>And if you want to lines surrounding the 50% area, you do:</p> <pre class="language-css"><code class="language-css"><span class="token property">grid-template-columns</span><span class="token punctuation">:</span> 25% [start-main-area] 50% [end-main-area] 25%</code></pre> <p>so that you can set a specific bit of content to live in the 50% area between ‘start-main-area’ and ‘end-main-area’.</p> <p>You can also define names for the areas themselves, using the ASCII art method (if a word appears multiple times, it means it spans multiple columns/rows):</p> <pre class="language-css"><code class="language-css"><span class="token property">grid-template-areas</span><span class="token punctuation">:</span> <span class="token string">"header header header"</span> <span class="token string">"main main sidebar"</span><span class="token punctuation">;</span></code></pre> <p>so that you can set a specific bit of content to live in the ‘header’, ‘main’ area or ‘sidebar’.</p> <h2>fr</h2> <p>The <code>fr</code> unit can be used to define <em>flexible lengths</em> and represents a fraction of the free space in the grid container. I think this is how it relates to <code>auto</code>: if all lengths are set <code>auto</code>, that would be equivalent to them all having <code>1fr</code>, but if they have different amounts of <code>fr</code>, the <code>fr</code> unit gives more control as they can give some grid tracks more space than others.</p> <h2>Changing visual order</h2> <p>The grid spec frequently talks about the <code>order</code> keyword, which lets you visually change the order of your document (this property also exists in flexbox). </p> <p>This makes that there are now two different orders to keep in mind:</p> <ul> <li><strong>document order</strong> / source order (this is what you see when you view source)</li> <li><strong>order-modified document order</strong> (this is the document order with all the ‘order’ properties in your stylesheet(s) taken into account)</li> </ul> <p>Browsers are supposed to paint in the order-modified document order (this is also good to know for if you’re setting <code>z-index</code>).</p> <p>The spec emphasises that <code>order</code> will only change your visual order, and not update speech order (for people that have your page read out to them) or navigation order (for people that use keyboards to navigate). Therefore it is important that the source order is sensible (this is an important accessibility concern).</p> <h2>Auto</h2> <p>Lots of things within grids can happen automatically. This is a bit complex to get your head around, but it is rather exciting (if you have not seen it, I can recommend fantasai’s CSS Day talk on <a href="https://vimeo.com/channels/cssday/134597090">defining auto</a>). The good news is: to use grids, you do not need to know how the auto algorithms work, they just do. </p> <p>With grid properties, you can set your grid exactly how you want it to be (‘explicit grid’). If you forget something or position an element outside of the bounds of your grid, the grid algorithm will create ‘implicit’ grid tracks.</p> <h2>Grids in grids</h2> <p>Grid items can be grids themselves (they are then ‘subgrids’), but this is still being discussed by the CSS Working Group. With <code>display: subgrid</code>, the subgrid would be able to inherit the cols/rows of its parent.</p> <h2>Thoughts</h2> <p>This is exciting! I really look forward to using CSS grids in my daily work. </p> <p>I do think the transition to actually <em>using</em> the new properties for page layout will come with some problems, especially around giving grid areas names that can be shared across everyone working on the same site, and letting grid areas be occupied by components (as component libraries are the deliverable of many front-end developers these days).</p> <p>And if that all works, should we give content managers controls to set content to flow in specific columns (perhaps the CMS would show a representation of the grid on various different viewports?).</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/notes-on-css-grid-layout/">Notes on CSS Grid Layout</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Notes on CSS Grid Layout">Reply via email</a></p> ConfConf 2016-05-24T00:00:00Z https://hidde.blog/confconf/ <p>A conference about conferences, isn’t that super meta? It is, a bit. Most web conferences aim to bring web people together and inspire them to do better work. ConfConf in Bristol did something similar for those who organise conferences.</p> <p>Having originally been conceived as a joke between two event organisers, ConfConf became a real thing for the first time last year. It turned out that the event provided real value: with all the knowledge sharing, organisers were able to learn a lot from each other. </p> <p>This year, the event was held in Bristol, and I attended as part of a group representing <a href="http://fronteers.org/">Fronteers Conference</a>. The audience was small enough to have group discussions and not need mics, but big enough to have lots of conf-organising experience between them. These are my notes of the day.</p> <h2>The human side of event organisation</h2> <p>Marc Thiele, organiser of the Beyond Tellerand conference in Düsseldorf, gave the first talk. He walked us through his process and the tone of voice he tries to convey. </p> <p>If one thing stood out from his talk, it is that communication plays a huge role in everything he does. It sets the tone of the event, Marc explained. </p> <p>He makes a point of being very friendly to every single person involved with his event: attendees (including previous attendees), speakers, suppliers, even the venue staff. Being friendly includes checking in with people, being prepared to patiently answer the same questions over and over and being interested in everyone at the event. This goes a long way. For instance, if you need your A/V to think with you about new ideas, it helps if you get along with them. </p> <p>Communication is also about being very clear. Marc took us through the various emails he sends to attendees, speakers and others, to make sure everyone has all the information they need.</p> <h2>Getting bums on seats</h2> <p>John Davey, who is responsible for the ‘Reasons to’ conferences, talked about what he does to sell tickets. He recommended selling tickets early, making use of social media (on accounts that matter to your target audience rather than those with huge numbers) and doing so creatively. </p> <p>John likes people who pull faces and, as his slides confirmed, is quite good at this himself. </p> <p>He emphasised communication should be provocative (never rude though) and not bland. Creative communication and attention to detail also helps convince potential attendees of the quality they will get. </p> <p>John gave some tips to increase ticket sales: by setting limits on based on quantity or time, you can create an urgency; you can be loyal to past attendees and email them with a special discount; you can also use the audience of your sponsors for promotion (their coverage/promotion could be more valuable than money).</p> <h2>Panel: all things to all people: striving for the impossible</h2> <p>In the first panel, there were discussions about curating a quality and diverse lineup, single track vs multi track and dealing with criticism.</p> <p>Some organisers said they think of speaker names first, others think about talk subjects first and then come up with names for each subject. I like content-first, as it makes it much easier to explain to speakers why you want <em>them</em>. This increases your chance of getting speakers to agree to come to your conference.</p> <p>We also discussed conferences with tracks. Having a single track can sometimes force people to sit in talks they would normally not attend. Marc Thiele said he likes that and tries to play with that. Rachel Andrew recommended that, in multi track conferences, speakers state the experience level at the beginning of their talk, to allow people to leave if the level is not what they were looking for (better for speaker and attendee).</p> <p>The panel also talked about video: most conference organisers that attended said they had their talks recorded (some said they no longer did for cost reasons). Brief discussion followed on making videos available accessibly. At Fronteers we provide transcripts and captions for all our talks (see <a href="https://hiddedevries.nl/en/blog/2016-01-21-making-conference-videos-more-accessible">my blog post about how we do this</a>).</p> <h2>What do speakers really want?</h2> <p>For her talk, Rachel Andrew did a survey amongst conference speakers and shared her results. She illustrated those brilliantly with personal experiences (she speaks at a <em>lot</em> of events) and gave a huge number of tips. There was a lot more in her talk than I can cover here, but I will try my best.</p> <p>She talked about how important it is to be clear to speakers. What it is you do, what you expect a speaker to do where, when and for which audience and what you offer in return. Speaking is expensive, especially for those speakers who are freelancers / run a business. If your event makes a profit, you should pay speakers; only if you organise a community event you may get away with not paying. </p> <p>Another thing Rachel talked about is to be helpful: make sure they have your contact details (and make sure there is always someone on phone duty), have professional audio/video people (‘agressive A/V people are a thing’, Rachel’s survey showed) and try to get post talk feedback to them (best filter it for constructive notes).</p> <p>Rachel also said all speakers should be treated equally (rockstars <em>and</em> newcomers). That means they require equal pay, but also equal taking care of and being friendly to. If you are going to differentiate, best be extra helpful to newcomers rather than rockstars. If you have newcomers, inexperienced or vulnerable speakers (in any way), covering expenses can make a huge difference: paying their expenses and fees can empower them.</p> <h2>Panel: the future of conferences</h2> <p>In the ‘future of conferences’ panel, we discussed structure, and techy vs creative events.</p> <p>Thomas van Zuijlen of Fronteers asked whether the “Fronteers model” (2 days of ‘just’ 45 minute talks) is going to die out in favour of newer models like the “responsive day out model” (1 day with sessions of three 20 minute talks followed by a panel discussion). Most of the panel agreed that the old model is likely there to stay, but new structures are interesting and bring in new benefits: more concise talks, easier to cover subjects that are too new to be suitable for a full length talk, etc).</p> <p>The panel touched on the difference between events about technology and those about creativity. Some noted that the ones about creativity and inspiration are much harder to sell tickets for. One reason for this, the panel concluded, may be that it is easier to get management approval for attending a conference, if it is easier and more tangible what the conference covers (Angular vs creativity).</p> <h2>The conference survival handbook: extreme edition</h2> <p>Cat organises the international Smashing Conference as well as ConfConf itself. Cat’s talk was about a subject that will be familiar to anyone who has organised an event before: conference nightmares. There is so much that could potentially go wrong! Cat talked about known knowns, known unknowns and unknown unknowns. </p> <p><em>Known knowns</em> are things that can be planned for, like not running on time, slow registration process, speakers illnesses and poor WiFi. To avoid running off schedule, Cat recommended planning time for getting everyone seated without gaps, factor in welcomes and introductions and being very clear to speakers about how long they are on for. To make registration smoother, she said events should avoid requiring ticket print outs and have one person available to investigate in case someone shows up and their badge is not there. She also mentioned preregistration, which can be good, but requires extra plain badges as people tend to forget theirs on the conference day.</p> <p><em>Unknown knowns</em> are things that happen on the day: a speaker oversleeps, someone is angry or rude on Twitter or a complaint is made. The crux of solving such issues is being ready for them when they happen: having people available that can react quickly is important. Cat mentioned at Smashing, she asks speakers to be on site a minimum of 3 times the travel time between hotel and venue.</p> <p><em>Unknown unknowns</em> are things that almost never happen: the projector’s bulb blowing (ask A/V staff if they have a spare), power cuts (again, ask venue for their backup plan) or natural disaster (take insurance).</p> <h2>Wrap-up</h2> <p>If there is one thing that I learned from this day, it is that taking care of all the little details, being very friendly and communicating clearly are very important additions to your main conference organising duties. Probably thanks to having had an experienced speaker (hi PPK!) and a very friendly personality (hi Krijn!) amongst our founding organisers, I realised during some of the talks, many of these things have been in the FronteersConf handbooks for years. But I also heard many things we could improve on.</p> <p>It’s been great to hear from some seasoned organisers and a speaker. And it was very useful to exchange knowledge on the day and in the pub afterwards. ConfConf showed me that there are many types of events, as well as styles of organising. Recommended for all (web) conference organisers!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/confconf/">ConfConf</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20ConfConf">Reply via email</a></p> Reasons to make digital products accessible 2016-06-01T00:00:00Z https://hidde.blog/reasons-to-make-digital-products-accessible/ <p>Yesterday I attended <a href="https://www.ncdt.nl/">NCDT</a>, the Dutch conference for digital accessibility. Hundreds of people whose work somehow involves digitally exposing information gathered in Utrecht.</p> <p>The interesting thing about NCDT, I found, is that many attendees work in roles that require them to <em>organise</em> accessibility within their organisations, having to convince management and stakeholders of accessibility benefits. As a front-end developer, I usually only have to convince designers and interaction people. Convincing the whole of a company seems lots harder!</p> <p>Here are some reasons for accessibility that I heard on the day, in no particular order.</p> <h2>Because we ought to put users before egoes</h2> <p>The excellent Gerry “top tasks” McGovern could not have said it clearer in his talk: “we measure production, not consumption. If we want digital excellence, we must measure actual use”. Many organisations put out web pages because some employee made the page and is excited about it. They put out web designs, because the designer made something pretty and the team liked it. They contain web copy that their content marketeers think provides value. But your website should not be about your employees, your designers or your content marketeers, it is about the users and what <em>they</em> want. That’s what websites should invest in, McGovern said. The users on your website should be put before the egoes in your organisation. Therefore: always be user testing.</p> <h2>Because it could be illegal not to</h2> <p>Users who cannot access your website, could potentially sue you. Eric Velleman of the Accessibility Foundation explained how. He showed there are currently a number of Dutch laws and regulations that make it illegal for companies to have an inaccessible website. Important to note: in The Netherlands, no one actually got one of those laws to be applied to them by a judge. In America however, judges <a href="https://www.w3.org/WAI/GL/wiki/Legal_Settlement_Agreements_that_Reference_WCAG">have ordered large companies</a> to pay sums of money and/or make their website more accessible. </p> <p>More legislation is coming: an EU wide Directive is <a href="https://www.accessibility.nl/nieuws/2016/05/europa-akkoord-over-richtlijn-digitale-toegankelijkheid-van-overheden">being implemented</a> by EU member states. The Netherlands also recently agreed <a href="https://www.accessibility.nl/nieuws/2016/01/tweede-kamer-stemt-in-met-vn-verdrag-over-gelijke-rechten-voor-mensen-met-een-beperking">it will ratify</a> the 2006 United Nations Convention on the Rights of Persons with Disabilities. The “College voor de rechten van de mens” was appointed as the regulator for this convention, and this will be where people can go to complain if they cannot access a particular site. At this time, it is not clear what the Dutch authorities will do in terms of fines or sentences. It is unlikely, Velleman said, that companies will get sued for inaccessibility.</p> <h2>Because our organisation has embedded inclusive design</h2> <p>Jonathan Hassell talked about embeddding accessibility throughout organisations (he was the main author of <a href="https://access8878.co.uk/">BS 8878</a>, the British standard / code of practice on this subject). He said what’s more important than making accessibility checklists mandatory, is valuing accessibility <em>as an organisation</em>. To do this, the top needs to be on board, training needs to be in place (staff might leave), it should be embedded in company policies and it should be in a process that can be used over and over again. </p> <p>Having accessibility is embedded in all those different ways, can really make it part of an organisation, which can ensure the organisation makes more accessible products, now <em>and</em> later.</p> <h2>Because there is passion for #a11y at the top</h2> <p>Jake Abma, head of accessibility of a major Dutch bank (the orange one) held a talk about how he got support for his radical idea to embrace digital accessibility practices. It was a truly inspiring story. He convinced his manager to get him 2 hours a week to spend on accessibility, this later became 4 hours, a day and even two days. Later others got time too, and currently, the bank has a dedicated accessibility team. They have their own accessibility guidelines (which is a superset of WCAG and other standards), do lots of accessibility testing and have “accessibility champions” across teams. They ensure doing the accessible thing is part of their process (in scrum terms: it’s in their definition of done). At a bank! </p> <p>Part of what worked is that there were some people in the top of the hierarchy who had visual impairments: there was a passion for accessibility at the top. Otherwise, to get support for spending time on accessibility, Jake explained, is a matter of small steps. Focus on those people who do like the idea and most importantly, do not give up.</p> <h2>Conclusion</h2> <p>I am just a front-end developer. For me, accessibility is usually about practical things like checking the colours that come in from designers, getting my markup semantics right and providing alternatives (in all kinds of ways). </p> <p>At NCDT, I saw that it is not just about single team members (“we not me”, said Jon Hassell). This makes sense. Especially for large organisations, there can be a lot of company politics involved, and it is some people’s job to work these politics every day.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/reasons-to-make-digital-products-accessible/">Reasons to make digital products accessible</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Reasons to make digital products accessible">Reply via email</a></p> The internet does forget 2016-06-21T00:00:00Z https://hidde.blog/the-internet-does-forget/ <p>Although it may be very exciting to make new things for the web, it’s important to think about archiving what we have made before. This requires one to think about the long term, and about whom we trust with our content.</p> <p>Last week, <a href="https://adactio.com/">Jeremy Keith</a> held <a href="https://www.eventbrite.nl/e/icons-9-jeremy-keith-tickets-25476675422">a lecture</a> about digital preservation at Amsterdam’s university of applied sciences. This is a write-up of his talk.</p> <h2>Why keep old websites?</h2> <p>“This is for everyone” is the <a href="https://twitter.com/timberners_lee/status/228960085672599552">message</a> that appeared behind Tim Berners-Lee, the inventor of the web, when he made a surprise appearance during the London 2012 Olympics ceremony. The web is meant for <em>everyone</em>. It is there not just to consume, but also to create for, Jeremy said.</p> <p>Geocities used to be where people with hobbies hosted websites to share with the world what they did. Over 30 million of them. Websites about pets, football clubs, fan sites, you name it. From a web designer’s point of view, they were not necessarily the most beautiful or user-friendly websites. But, Jeremy said, “an ugly website that we find ugly today, may be the first website made by the future president of the United States“. </p> <p>When Geocities shut down, no backup plans were made. We were looking at the removal of over 30 million websites, to be gone forever. This was a threat. It would have been where archeologists of the 2090s would have found what we were up to in the 1990s. </p> <p>Other than their cultural significance, existing websites can also break the web if they are removed from it. This is because links to them will break.</p> <p>Luckily, in the case of Geocities, the Web Archive team stood in and managed to <a href="http://blog.archive.org/2009/08/25/geocities-preserved/">save a large part of these websites</a>.</p> <h2>Third parties</h2> <p>If recent history is an indication, trusting your content to third parties only is not a good idea, Jeremy emphasised. Geocities was bought by Yahoo!, so was Tumblr. Many websites that offer to host your content for you are bought by some big internet company at some point. We trust our content to these start-ups. But rarely, when they close, they offer a way to export the data. They do usually thank you for being on their <a href="http://ourincrediblejourney.tumblr.com/">incredible journey</a>.</p> <p><a href="http://indiewebify.me/">Indieweb</a> type of solutions can help here: there are tools that let you publish on your own platform as well as on third parties, so that you always have your own content.</p> <h2>Hard work</h2> <p>The good news is that the web, Jeremy said, is actually very suitable for being preserved. Apps you build now will likely not work on devices from 5 years in the future, whereas websites probably will (as long as someone pays the web hosting bill).</p> <p>The saying “the internet never forgets” is not actually true, Jeremy explained. The internet does forget, a lot of things get deleted and are then gone forever. One has to work hard to keep things online, preferably on their own URLs (to not break the web). </p> <p>Preserving your websites requires one to think about the long term: you will have to make sure to keep paying your hosting bills, for one thing. But what about when you pass, are there any hosting companies that will let you include hosting fees in your will? Some compelling questions to think about!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/the-internet-does-forget/">The internet does forget</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20The internet does forget">Reply via email</a></p> Progressive Web Apps Dev Summit 2016-06-22T00:00:00Z https://hidde.blog/progressive-web-apps-dev-summit/ <p>This week I had the pleasure of attending the Progressive Web Apps Dev Summit, an event organised by Google in the beautiful city of Amsterdam. These are my takeaways from the event.</p> <p><img src="https://hidde.blog/_images/1466613887-opening-.jpg" alt="The auditorium" /> <em>The screen was immense</em></p> <h2>Progressive Web Apps: what and why?</h2> <p>What an ‘app’ is, depends on who you ask. When we are talking about apps on mobile devices, they are usually things with specific capabilities. They help users do things, integrate well with device capabilities, can be opened from a home screen and are able to work full screen and offline. At the moment, apps with all those capabilities are usually not <em>mobile websites</em>, but <em>app store apps</em>.</p> <p>From a technical perspective, there are only a couple of things that separate mobile websites from app store apps. But in terms of user experience, these differences are enough for people to prefer app store apps to web apps.</p> <p>To solve this UX gap between native and web, Google came up with the concept of Progressive Web Apps. It’s a set of open web standards that lets developers turn their ‘website’ into a ’web app’, in a progressive manner. </p> <p>What’s a <em>progressive</em> manner? If your site already functions as a website, by adding stuff to it, it can become more app-like. Browsers that don’t support this ‘stuff’ will get what they already got before. Supporting browsers, however, will get the benefits. As an extra. The idea is that over time, more browsers will fall in the supporting browsers bracket. It is a bit like using rounded corners in CSS, knowing that some browsers will take advantage of it, others will ignore it. Users will likely not notice they are missing out, but will get a better experience if they aren’t. </p> <p>With progressive web apps, we can ‘earn our space on the home screen’ (Alex Russell), ‘stop blaming being offline on the user’ (Jake Archibald) and ‘give the user a page they can interact with faster‘ (Surma). Whereas native apps are things you go out, buy and download, PWAs are basically an up-sell: you download them by visiting the page, and keep them if you like to.</p> <h2>The summit</h2> <p>Google have been great hosts! They drove us to the venue with a shuttle bus, let us in for free, provided lots of fancy food and drinks throughout the two days and used <a href="https://soundcloud.com/terramonk/pwa-amsterdam-2016">exciting intro tunes</a> between speakers, who presented on a huge wall-to-wall screen. They really are serious about saving the web in its fight against native apps.</p> <p>It wasn’t just a Google party though. Google sent lots of their developer relations people, but so did others: there were people from all major browser vendors (except Apple) and they even did talks. There were also folks from businesses that built PWAs, such as the Nigerian online marketplace Konga and the Amsterdam-based Booking.com. This made the whole event much more like an open web standards event than a Google marketing event. </p> <h2>New technologies</h2> <p>Progressive Web Apps is not one technology. It is one name for a set of technologies that you can use to progressively expose app-like qualities to go with your regular website. A marketing term, if you will. There were talks about most of the different technologies.</p> <ul> <li><strong>Service Workers</strong> give developers control over the network, by exposing the decision process for network activity to JavaScript. What they effectively do, is to enable <em>reliable performance</em>: apps can now deal with Lie-Fi or offline connections by serving alternatives (for instance, a cached site). Service Workers can make your site work offline first, as you get to decide how the network requests from your app are handled.</li> <li>The <strong>streams</strong> and <strong>fetch</strong> APIs can be used from Service Workers, a good intro to them is <a href="https://jakearchibald.com/2015/thats-so-fetch/">Jake Archibald’s blog post</a> or <a href="https://www.youtube.com/watch?v=qDJAz3IIq18&list=PLNYkxOF6rcIAWWNR_Q6eLPhsyx6VvYjVb&index=3">his talk</a> at the dev summit.</li> <li>In the majority of supporting browsers, <strong>HTTPS</strong> is an important part of progressive web apps, as a lot of the tech (geolocation, getUserMedia, HTTP/2, push notifications) requires it to work. Emily Schechter explained HTTPS brings three security properties: <em>identity</em> (be sure this site really is this site), <em>confidentiality</em> (be sure about who can read your data) and <em>integrity</em> (be sure that nothing can modify your data). HTTPS used to be hard to set up, expensive and slow. It’s now easy to implement, cheap and fast, Emily showed.</li> <li><strong>Push Notifications</strong> can provide great benefits for users if applied properly. Owen Campbell-Moore discussed do’s and don’ts: good notifications are timely, relevant and precise. He also discussed the flow of asking users for permission to send notifications. It is important to do this at a good time.</li> <li>By having a manifest file and matching <a href="https://developers.google.com/web/fundamentals/engage-and-retain/app-install-banners/web-app-install-banners">some other criteria</a>, you can now make your app quality for <strong>Add to homescreen</strong> notifications. What the heuristics are differs per browser / platform. Interestingly, if a user sees ‘Add to homescreen’, they have already downloaded the site. So, as Alex Russell pointed out, the question really means: ‘would you like to <em>keep</em> it?’</li> </ul> <h2>Making it better for users</h2> <p>Progressive Web Apps seem to be about making it better for the users, and many of the talks discussed how to do that.</p> <ul> <li><strong>UI performance</strong> is important, Paul Lewis talked about using things like <code>will-change</code> and debugging by knowing when your code triggers repaints.</li> <li>Surma talked about improving <strong>network performance</strong> by using Service Worker and HTTP/2.</li> <li><strong>Accessibility</strong> is an essential part of delivering a good user experience, as well. Rob Dodson discussed three steps to ensure accessibility: nail the <a href="http://webaim.org/standards/wcag/checklist">WebAIM WCAG checklist</a>, always be managing focus and provide proper semantics (either with meaningful native elements, or with ARIA). Look at <a href="https://www.w3.org/TR/wai-aria-practices-1.1">WAI-ARIA best practices</a>.</li> <li>Daniel Appelquist shared an interesting principle about <strong>URLs</strong>, “the one web principle”: “content provided by accessing a URI yields a thematically coherent experience when accessed from different devices”. It’s useful for all (not the least users) to let a URL always present the same thing, regardless of which device it is accessed from. See also: responsive web design.</li> </ul> <h2>Other browser vendors</h2> <p>The event did not just feature speakers from Google, other browser vendors were invited to the stage as well.</p> <ul> <li>Ben Kelly from <strong>Mozilla</strong> talked about how they joined the Service Worker effort in 2014, and focused on parts like security, improving the spec, documenting <a href="https://developer.mozilla.org/en-US/Apps/Progressive">PWA technologies on the Mozilla Developer Network</a> and making the <a href="https://serviceworke.rs/">Service Worker Cookbook</a>.</li> <li>Patrick Kettner shared <strong>Microsoft</strong>’s perspective. They, too, are very excited about Progressive Web Apps. He also showed how to make a fallback using AppCache (‘it is a douchebag, but it can be a useful fallback’) and talked about <a href="https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API">IndexedDB</a> and <a href="http://dexie.org/">Dexie.js</a>.</li> <li><strong>Opera</strong>’s Andreas Bovens showed that Opera already support lots of PWA features and will support more in the near future. He also talked about UX patterns that relate to Progressive Web Apps, considerations to make, and choices to give to (or hide from) users.</li> <li>Junkee Song and Daniel Appelquist from <strong>Samsung Internet</strong>, who make the default browser on Samsung devices (almost 10% market share in Europe) and are a major committer into the Chromium project. They also work on browser experiences for GearVR, Samsung’s virtual reality goggles and try to provide a ‘continuous browsing experience’ between phone and VR.</li> </ul> <h2>Examples in the wild</h2> <p>Throughout the two days, we saw some presentations by people who have actually released progressive web apps ‘in the wild’. It was inspiring to see how they made those apps work for their organisation. PWA tech gives developers tools to do stuff, but it will not make your decisions for you (that’s a good thing).</p> <ul> <li>Jesse Yang showed how <strong>Booking.com</strong> made their confirmation page work offline. They did not tell users, giving the team opportunity to play with it without a lot of risk. They also experimented with ‘Add to homescreen’ and found most people ignored it.</li> <li>Andreas Bovens mentioned <a href="https://pwa.rocks/">pwa.rocks</a>, a site by Opera that tries to list interesting Progressive Web Apps (pull requests welcome).</li> <li><strong>The Washington Post</strong> made a <a href="https://washingtonpost.com/pwa">PWA</a> that downloads lots of text to the user’s cache , to make that available offline, and downloads images later.</li> <li>The team at <strong>Konga</strong>, Nigeria’s <a href="https://dev.opera.com/articles/pwa-nigeria-kenya-interview/">largest online market place</a>, recently built a PWA using custom web components. They use background sync for analytics, tracking offline events and an offline checkout experience. Major obstacles are making things modular, getting Safari support and the learning curve for new developers.</li> </ul> <h2>Concerns</h2> <p>This whole post may sound like everything is peachy, but there are also concerns about Progressive Web Apps.</p> <p>iOS support is a concern. Apple were invited to the event, but other than Microsoft, Opera, Mozilla and Samsung, they did not attend (<a href="https://twitter.com/jonathandavis/status/745362104018833409">because of other commitments</a>, and they <a href="https://twitter.com/jonathandavis/status/745362760800731137">really want to</a> attend future events). Their absence was noticeable: they are a large player and we all would have liked to know what they think about these new standards. </p> <p>And what about the URL? They are an integral part of the web, as it is what people use to point to stuff and share things. However, for apps to get a ‘Add to homescreen’ prompt on Chrome and others, the ‘hide URL bar’ setting is compulsory. In apps that run full screen, URLs cannot be copied. Opera Mobile are experimenting with a gesture that lets you ‘pop out’ of an app, back to the browser, so that users can see, copy and hack URLs. Great idea, I think!</p> <p>Another matter is the risk of heavy reliance on complex JavaScript. Admittedly, complex JavaScript is not compulsory for something to be a Progressive Web App, but it is what all of the apps demonstrated at the summit were using as their tool of choice. I’m not sure if this concern is a concern with PWAs, or with the let’s-do-it-all-with-JavaScript trend. Service Workers can be added to super simple websites like this blog, too (why not?).</p> <p>The event was actually great at addressing many of these concerns, and culminated in a panel session moderated by Jeremy Keith (who published the brilliant <a href="https://adactio.com/journal/10708">Regressive Web Apps</a>) .</p> <p><img src="https://hidde.blog/_images/panel-.jpg" alt="Panel discussion" /> <em>Panel discussion moderated by Jeremy Keith</em></p> <h2>The future</h2> <p>Two things are important about PWAs: firstly, they are a set of <em>open</em> web standards, which means all browsers can implement them in somewhat the same way and developers can be fairly sure things will work inter-operably. Secondly, browser vendors seem to be very excited about adding support for these standards, which increases their chance of being a safe bet.</p> <p>It was exciting to hear about the technologies, and to see that a lot of them already work on a great deal of platforms. Most of the major browser vendors expressed how much they liked the idea, so it is realistic to say support will increase in the short term. This, and the fact that all PWA techniques can be regarded as a ‘progressive enhancement’ (with some leniency as to what that term means), entails that we can build Progressive Web Apps today.</p> <p>Hopefully, we will do so responsibly. Native apps really only work on their particular platforms. PWAs, in theory, can be built to work universally. For everyone with a web enabled device. This is awesome! Major browser vendors are behind the idea, and I think as developers we should be, too. </p> <p>To keep this post somewhat concise, I did not do each talk right here. If you’ve had to miss the event, it was recorded and videos are <a href="https://www.youtube.com/watch?v=9Jef9IluQw0&list=PLNYkxOF6rcIAWWNR_Q6eLPhsyx6VvYjVb">available on YouTube</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/progressive-web-apps-dev-summit/">Progressive Web Apps Dev Summit</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Progressive Web Apps Dev Summit">Reply via email</a></p> Some pointers on default cursors 2016-08-06T00:00:00Z https://hidde.blog/some-pointers-on-default-cursors/ <p>Every so often in a project, the issue comes up of whether cursors on buttons should be ‘the hand’ or default. The spec says they should be default, but many people (myself included, until recently), are unaware. Many designers I’ve worked with want pointer-cursors regardless of what the spec says.</p> <p>This is the thing: links (<code>&lt;a/&gt;</code>) go to somewhere else, buttons ( <code>&lt;button&gt;</code> s) let users perform actions. The ‘hand’ indicates to a user that their cursor is on a link, which will take them somewhere. And can do so in another tab, copy/paste the link, drag it to another window, et cetera. Other interactive elements on the page (buttons, for example) just get a default cursor. TL;DR: <a href="https://medium.com/simple-human/buttons-shouldnt-have-a-hand-cursor-b11e99ca374b#.eummmkmz2">the hand does not mean clickable</a>.</p> <h2>What the standards say</h2> <p>The above is not my personal opinion, it is what the <a href="https://www.w3.org/TR/css-ui-3/#propdef-cursor">CSS spec</a> says and what all browsers do by default. You can see this when you hover buttons in your OS, or look at the browser buttons to switch tabs. Or on the ‘Search’ button of Google dot com.</p> <p>Apple’s OS X Human Interface Guidelines also say the ‘hand’ means <a href="https://developer.apple.com/macos/human-interface-guidelines/overview/themes/">the content is a URL link</a>.</p> <p>Microsoft’s guidelines are clear, too:</p> <blockquote> <p><strong>To avoid confusion, it is imperative not to use the hand pointer for other purposes</strong>. For example, command buttons already have a strong affordance, so they don’t need a hand pointer. The hand pointer must mean “this target is a link” and nothing else. (Emphasis theirs)</p> </blockquote> <p>If we manually add a hand cursor to a button, we suggest to a user that they will be taken elsewhere, while they won’t. We would be breaking an <a href="https://www.interaction-design.org/literature/book/the-encyclopedia-of-human-computer-interaction-2nd-ed/affordances">affordance</a> that was put into the web. It’s like <a href="https://twitter.com/tbaxter/status/761148603213705216">taping a sticker that says ”Push me” over a well designed door handle</a> (see also: <a href="http://www.tinybigstudio.com/blog/norman-doors">Don Norman</a>).</p> <p>Clearly, standards say <strong>the hand is just for links</strong>. And there’s a great argument to be made to <a href="https://github.com/getchopstick/chopstick-boilerplate/issues/122#issuecomment-236821737">not mess with browser defaults</a>. </p> <h2>Using ‘the hand’ anyway</h2> <p>Many people apply a pointer cursor to their buttons anyway. I have done so, too. I’ve heard many say they add the pointer to <em>improve</em> usability. In addition, Bootstrap and various other CSS frameworks also apply pointer cursors to their button (note that Normalize used to, but <a href="https://github.com/necolas/normalize.css/commit/170455d6f6850d3b5eefdaab7b36c8c327ca8678">recently removed them</a>).</p> <p>Whether we just did not know about the standard way, or purposefully ignored it to improve things for our users, ‘the hand’ on buttons is somewhat becoming a de facto standard. It is done all over the place, so <strong>some users may now expect hand cursors on buttons</strong>.</p> <p>Basically, I think there are now two standards.</p> <p>There is a further complication: in practice, there is a grey area between buttons and links.</p> <ul> <li>A “Back to top” link is literally a link to the top of the page, but, especially when it animates the user back to the top, it feels like it performs an action, too.</li> <li>In a tabs component I recently built, each tab is marked up as a link to an area in the page. Visually, clicking it, ‘opens’ a tab. That’s an action, right? But what if you use a modifier key and open it in a new tab? That would also still work.</li> <li>How about a button that says “Log in”. Sounds like an action, but what if the button is a link and just takes the user to a page where they can login?</li> <li>What about a button in a <code>&lt;form method=&quot;POST&quot; /&gt;</code>? You can submit <a href="https://twitter.com/krijnhoetmer/status/760125442204508160">in a new tab</a>, which makes it a bit like a link, but it also submits data, which makes it more like a button that performs an action. Or a form with <code>GET</code>, which should have <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html">no side effects</a> at all?</li> </ul> <p>I find that in team discussions, we talk about something being a ‘button’, yet in my HTML, I use the <code>&lt;a /&gt;</code> . Or even the other way around, occasionally.</p> <h2>Conclusion</h2> <p>The question is, does apply the ‘wrong’ cursor really matter? When I asked around on Twitter, some said applying hand cursors wrongly is a non-issue, as <a href="https://twitter.com/eworm_/status/760888814210576385">it confuses no one</a> and it’s <a href="https://twitter.com/wesoudshoorn/status/760908578278543360">non-hand cursors that cause usability issues</a>.</p> <p>However much I think <a href="https://xkcd.com/927/">existing standards</a> are the best to follow, I guess we have pretty much reached a situation where there are two standards, and either one is okay to use. Especially since things on the modern web are often not clearly a link <em>or</em> a button. Striving for consistency, at least within the same website, is probably the best thing we can do for your users.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/some-pointers-on-default-cursors/">Some pointers on default cursors</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Some pointers on default cursors">Reply via email</a></p> Things I learned at From the Front 2016 2016-09-15T00:00:00Z https://hidde.blog/things-i-learned-at-from-the-front-2016/ <p>This week I visited the <a href="https://2016.fromthefront.it/">6th From the Front conference</a> in Bologna, which this year was themed The Frontend Guide to Life, The Universe and Everything. It was my second time at the conference, having visited their first in 2012. Great to be back!</p> <p>Below I share with you my takeaways from two days of From the Front. I have written a summary of each talk, occasionally mixed with personal opinion. </p> <p><img src="https://hidde.blog/_images/fromthefront-.jpg" alt="Opening slide with From the Front 2016 branding" /> <em>The Frontend Guide to Life, The Universe and Everything</em></p> <h2>We can develop personally to deal with the enormous amount of change in the 2016 web</h2> <p><strong>Lyza Danger Gardner</strong> talked about <em>overchoice</em>, ‘the idea of an overload of choice’. Having worked on the web since the nineties, she already worked on the web when tables were commonly used for layout and CSS was a novelty. Browsers improved very slowly. The complete opposite is now true: browsers take feedback very seriously. New features get added very quickly into the browsers that people use. This also means there is a lot to learn. When Lyza spent 6 weeks in the woods, <em>six</em> weeks without working on web stuff at all, she felt she had to relearn the trade. And this is from someone who has worked on the web for a very long time. </p> <p>Having the feeling that everyone else is smarter or that it is all just too much and you want to quit the trade altogether, can make individual developers unhappy. “We really want change, yet change is killing us, too”, Lyza said. She explained how she made some personal choices in order to take back responsibility for her own happiness.</p> <h2>Its built-in robustness makes the web great for progressive enhancement</h2> <p><strong>Jeremy Keith</strong> shared with us a story of how the web was invented. Its main virtue, he explained, is that it is deliberately dumb: it provides simple mechanisms to transmit packages (TCP/IP), mark up documents (HTML) and declare what they look like (CSS). Beyond these mechanisms, the web does not care. It does not care what you name things, or what protocols you build on top of it. Super powerful, right from the start. It is also designed to be robust; browsers will not throw errors if you forget to close your HTML element or use a CSS property that they do not recognise. Instead, they will parse what they can parse. JavaScript is a bit different, as it will throw errors when you make a syntax error. This difference lets us divide front-end tech in two categories: the resilient and declarative (HTML, CSS) and the fragile and imperative (JavaScript). </p> <p>Jeremy noted some websites now rely on JavaScript, which is fragile, to display content. He then made a strong argument for progressive enhancement. His strategy is to (1) identify core functionality, (2) build this with the simplest tech and (3) enhance. If you get (1) and (2) right, you can go crazy in step (3) and use tech that does not necessarily have broad browser support, without witholding core functionality from people. Service Workers, WebGL, push notifications, anything! This approach can take more time if you are not used to it, but it is definitely possible, even on large scale corporate websites (some might say they would benefit the most). </p> <h2>We can make non-default things in HTML accessible to more users with ARIA, keyboard support and focus management</h2> <p><strong>Léonie Watson</strong> explained how to make our web applications more accessible (<a href="https://ljwatson.github.io/decks/2016/fromthefront/index.html">slides</a>). The important part is that everything in our web application exposes three things: their <em>accessible name</em>, their <em>role</em> and the <em>state</em> they are in. This is easy for things that already exist in the web platform, like links, buttons and form elements. Browsers already know their names, roles and states. In other words, default HTML elements are already accessible out of of the box.</p> <p>It gets more complex when we want to use things that don’t exist as such. Tabs, for example. Léonie showed us how to mark up tab links and tab panels in a way that is most usable for users of assistive technologies, and explained how ARIA attributes can help here. She also showed how to build in keyboard support and manage focus.</p> <h2>With radio buttons and checkboxes we can use logic to make HTML emails more interactive</h2> <p><strong>Mark Robbins</strong> is an expert in interactive email HTML. He showed some perplexing techniques for making emails interactive. The trick: making extensive use of the ‘states’ that can be styled with CSS. Things like <code>:hover</code>, <code>:active</code> and <code>:focus</code>, but also <code>:checked</code> (a lot of that). By including a number of radio buttons / checkboxes (and nested labels for them), the document can have logic that can be targeted from CSS. For more advanced logic, a ‘punched card’ can be coded in radio buttons and allow for even more complex hiding and showing. </p> <p><img src="https://hidde.blog/_images/1474143141-punchedcard-.jpg" alt="Slide ‘Punched card coding’ with CSS that is applied to radio button states" /> </p> <p>Using the above, Mark created galleries, interactive games, live shopping cards that can even update prices (using CSS counters), form validation, analytics that work by fetching background images based on <code>:checked</code> states and 3D views of products utilising CSS animations on 3D transforms. At the end of his talk, Mark revealed that <em>even his slide deck was built as an HTML email</em>: he had been presenting everything from Apple Mail. Mind. Blown. While Mark was talking I wondered about the accessibility of it all, and later I found his company has posted <a href="http://blog.rebelmail.com/accessibility-in-email/">Accessibility in email</a> and <a href="http://blog.rebelmail.com/accessibility-in-email-part-ii/">Accessibility in email part II</a>.</p> <h2>All problems can be solved with CSS</h2> <p><strong>Sara Soueidan</strong> showed us some of the work she had been doing on the upcoming redesign of Smashing Magazine. First, she talked about SVG and when to use or avoid it. She said that ‘not only should the image be a good candidate for SVG, the SVG should also be a good candidate for the image’: too many shadows/gradients/paths might mean a large file size and make an image less suitable for SVG (and more suitable for PNG). She also talked about scalable type: type can scale with the viewport when using <code>vw</code>/<code>vh</code> units, but then the need for minimum and maximum font sizes arises (<code>font-size: calc(16px + 3vw</code> can help here; 16px will work as your minimum size).</p> <p>Some absolute highlights of Sara’s talk: </p> <ul> <li>she showed how a seemingly impossible article layout could be done with CSS</li> <li>she explained how she made whole blocks with links in them clickable while retaining the focus order she intended</li> <li>she talked us through building custom ordered lists with CSS counters </li> <li>she showed a method to do better underlines using text-shadow in the same colour as the background-colour. </li> </ul> <p>This talk once more showed how incredibly flexible CSS is if used by smart people: everything is possible.</p> <h2>We should regularly reflect and listen to our gut feeling</h2> <p>Conference organiser <strong>Marc Thiele</strong> talked about the changes he had made in his life, recently and less recently, and the events in his life that triggered those changes. They lead to many good things, including his first Flashforum conferences years ago, and his current Düsseldorf/Berlin based conferences about the web in general. He explained that it is important to make time to reflect on the past and encourages the audience not to be afraid to make changes. </p> <h2>Apprenticeships can be a great thing for the web</h2> <p><strong>Dan Mall</strong> ended the first day with a talk that strongly encouraged us to start an apprenticeship program within our companies. He shared his experiences with doing so in his own company. Apprenticeships encourage the best form of learning, he emphasised. They don’t just teach things you can learn in a school, they also teach people how to be a professional, act with customers and sell their services. They can decrease the gap between the best of our industry and people who have an interest in joining our industry. To take an apprentice does not have to be expensive or time consuming, Dan’s personal experience showed. Averages from 10 apprenticeships his company hosted, show a cost of about $7000 and a time investment of about 36 hours per apprentice (over a period of 9 months).</p> <h2>We can improve perceived performance by reducing passive phase waiting time</h2> <p>In his talk about the psychology of performance, <strong>Denys Mishunov</strong> said research showed that people who have to wait too long for specific things on your site, may end up <em>disliking your entire brand for it</em>. Reducing this waiting time and improving performance is not just about numbers, it is about experience as well. Denys discussed two phases in waiting, which he referred to as the <em>active</em> phase and the <em>passive</em> phase. Active waiting is waiting while your brain is still busy with other stuff, passive waiting is just waiting. A wait with an idle brain is perceived as a longer wait. Naturally, active waiting is a lot less frustrating, so a way to improve perceived performance is to make the passive phase shorter (even if that makes the active phase longer). In code, Denys explained, this can be done by taking advantage of <a href="https://www.w3.org/TR/resource-hints/">resource hints</a> (<code>dns-prefetch</code>, <code>preconnect</code>, <code>prefetch</code>, <code>prerender</code> and <code>preload</code>). In interaction design, it can be done by letting people do stuff while they wait, for example adding meta info to a photo that’s currently uploading.</p> <h2>Serving over HTTP/2 may the best thing you can do now to increase your site’s performance</h2> <p><strong>Patrick Hamann</strong> explained to us why it would make sense from a performance point of view to start serving your websites over HTTP/2, given that we have already done other performance optimisations. Slow websites are often slow because of latency, and HTTP/2 fixes a large part of that. The major inefficiency of HTTP/1.1 is ‘head of line blocking’. HTTP/2 fixes this with its ‘multiplexing’ approach: bits of data that are called ‘streams’, of which multiple can go over one (!) TCP connection. A stream carries messages that are made up of frames, like its header and its actual data. Frames are binary, as opposed to data sent as plain text in HTTP/1.1. The advantage of that is that they can interleave, the disadvantage is that they are no longer human-readable. Streams can also have weights attached to them, and with HPACK their headers can be stored in referencable IDs so that they don’t need to be endlessly repeated. Special <code>PUSH_PROMISE</code> can inform the browser about resources it is going to send, saving requests.</p> <p>To start using HTTP/2 you need HTTPS (Let’s Encrypt helps here) and a server that can handle HTTP/2 (many servers can now) and use its features. If you use CDNs, you also need to make sure they can do HTTP/2. Support is really getting there, and that means HTTP/2 is pretty much ready for adoption.</p> <h2>Voice User Interfaces are coming</h2> <p><strong>Ben Sauer</strong> talked about user interfaces that are controlled by voice (VUI). Systems like Amazon Echo, Apple’s Siri and Microsoft’s Cortana. These companies are currently all heavily investing in voice technology and computers that are all around you all the time (‘ubiquitous computing’). They are also trying to normalise voice interactions, by showing their tech in social contexts, making it a lot less weird to be talking to your computer. With voice interfaces, Ben explained, apps will become more plain, or possibly invisible. The brand will likely be less invisible, too: if you ask your voice-based assistent what the name of a song is, you won’t go into a branded app interface, and you don’t need to know it uses the Shazam brand for it. </p> <p>VUI still needs a lot of work, as it is not so good at large amounts of input, dealing with natural breaks in speech and working out fuzzier tasks. And then there is privacy, a huge issue in my opinion: a lot of VUI requires a microphone to be always listening (and this would be great for your ex or the police to listen in, too). </p> <h2>Your design system will thrive when you group modules by function and get their naming right</h2> <p><strong>Alla Kholmatova</strong> did not try to convince us to come up with design systems for our sites, as <em>every site already has one</em> (paraphrasing her). A lot of her talk was about how to make it work better, through documentation and cross discipline collaboration. Integral to Alla’s approach is separation by function (not form): you try to figure out which things on your site have the same functional role, and group those together. Naming is incredibly important when working on the design of a site as a team: once something has a name and can be found under that name in a pattern library, it becomes a thing, it ‘comes into existence’ . </p> <p>Alla shared five tips with us: </p> <ul> <li>Give your modules names that relate to the system, not to a specific page. Functional names (related to what something does) usually work better.</li> <li>You’ll likely have some modules that are generic and others that are specific. Let their naming reflect this. It’s okay if a specific thing is at some point changed to be a generic thing or vice versa.</li> <li>Name things collaboratively and make a point of always referring to the things by the names you’ve given them. This takes effort, but it is very helpful.</li> <li>Use names with personality, as they tend to stick better. You can use metaphors borrowed from other industries, or even from films. If names are not remembered by team members, you risk duplicate modules being created. Good names inspire other names, Alla said, and before you know it a family of names starts to grow.</li> <li>If it’s hard to come up with a name for a module, this may be a sign that there’s something not right about the module, you may need to go back to the drawing board. </li> </ul> <p>Another interesting thing Alla shared is that at Future Learn, spacing in modules is part of their design system. They distinguish between types of modules: spacious, regular and ‘cosy’.</p> <p>Finally, Alla recommended reading <a href="http://www.howtomakesenseofanymess.com/">How to make sense of any mess</a> by Abby Covert, and looking at the <a href="https://www.viget.com/articles/visual-loudness">Visual Loudness Scale</a> that Tom Osborne wrote about.</p> <h2>CSS Modules is a JS powered CSS pipeline that addresses concerns with the CSS language</h2> <p><strong>Hugo Giraudel</strong> explained what CSS Modules are: a JS powered CSS pipeline that gives CSS namespacing, amongst other things. “CSS is broken”, Hugo said, because it has a global namespace, does not come with dependency management and has no mechanism to share configurations. CSS Modules lets you have all three, and can be plugged into various JS pipelines. Definitely a fascinating concept! It’s easiest to set up with Webpack, but can be used in Browserify or even Gulp. Hugo made a solid case for CSS Modules, however I personally strongly disagree with his premise: that CSS is broken and needs fixing. I admit CSS does not check all boxes that programming languages do, but I think that is because CSS is not a programming language (probably something for another blogpost).</p> <h2>Visual regression testing is most helpful when used on isolated components</h2> <p><strong>Varya Stepanova</strong> showed us her approach to visual regression testing, the process of keeping track of visual differences between versions of your application. Instead of automatically testing whole pages, Varya said it is a lot more helpful to test isolated components. She demoed the Gulp plugin she built to do isolated visual regression testing. It uses PhantomJS to take screenshots (see on <a href="https://github.com/SC5/sc5-styleguide-visualtest">GitHub</a>). Varya also explained the business value of having a component library with automated visual regression tests on each component: it makes the UI more stable and ultimately lets teams work faster. </p> <h2>If we want to do the good thing, we need to design features on websites with empathy</h2> <p>The last talk of day 2 was by <strong>Beth Dean</strong>. She shared her fascinating employment history with us, and explained how all these different things she did made her realise the importance of considering emotions in web design. “A lot of people live in a world that is not designed for them”, she said. Ill-considered design choices can give individual users of your site a terrible experience, for example when you send Mother’s Day marketing to someone who’s mother recently passed away. Part of the solution to this problem is to ensure that design teams are very diverse (in age, gender, ethnicity, etc). In addition, it is important for designers to be aware of any privilege they may have, and to have an attitude of empathy towards users.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/things-i-learned-at-from-the-front-2016/">Things I learned at From the Front 2016</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Things I learned at From the Front 2016">Reply via email</a></p> Review: Inclusive Design Patterns 2016-09-21T00:00:00Z https://hidde.blog/review-inclusive-design-patterns/ <p>This week Heydon Pickerings’ Inclusive Design Patterns came out. As I was quite fond of his previous work, I insta-bought the ebook version (hard copy will be available from October). </p> <p>The book does not (only) show you how to write front-end code in an accessible manner, it teaches you how to <em>think like an inclusive designer</em>. That is, a designer that considers <a href="https://the-pastry-box-project.net/anne-gibson/2014-July-31">the widest range of people possible</a>. Heydon does go into the code involved, but that is mostly in support of the inclusive thinking he advocates.</p> <p><img src="https://hidde.blog/_images/inclusive-design-.png" alt="Book cover" /></p> <h2>It’s all about making things work for people</h2> <p>The book shows why creating accessible websites is not a ’bureaucratic box-ticking’ exercise (IDP, 121). It’s not just a matter of slapping on the right ARIA attributes, it is all about envisioning what would give people the best way to experience your site. Designing the best way for people to use your thing. If ARIA helps with that, fine. However, Heydon warns, <em>never fix something with JS and ARIA if it could be done with HTML and CSS</em>.</p> <p>Inclusive design, says Heydon, has this as its object: ‘the user’s ability to <em>actually get things done</em>’ (IDP, 121; emphasis his). Throughout the book, it becomes apparent that making a product accessible is not a matter of always doing X or always doing Y. You have to always consider (and then test) what works best, has wide browser support and gives the best results. </p> <p><em>Inclusive Design Patterns</em> is full of interesting things, like how to use Schema to make search results for your site more accessible, what screen readers voices say and how to tweak that, and giving users feedback on form input with live regions. It contains many real world examples, like filter widgets and ‘Load more’ interactions. Clever ways of making things work. There really is something to be learned for everyone in this book. Highly recommended! (<a href="https://shop.smashingmagazine.com/products/inclusive-design-patterns-by-heydon-pickering-ebook">Buy the ebook</a>)</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/review-inclusive-design-patterns/">Review: Inclusive Design Patterns</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Review: Inclusive Design Patterns">Reply via email</a></p> Leaving the Fronteers board: what happened 2016-12-01T00:00:00Z https://hidde.blog/leaving-the-fronteers-board-what-happened/ <p>This week I resigned from the Fronteers board. I tweeted about it earlier, but didn’t express myself as carefully as I would have liked to do. In this post I hope to explain things properly.</p> <p>TL;DR: <em>Fronteers members democratically voted to hire an external company ran by two former conference team members to take care of the logistics of its conference organisation. Personally it made sense for me to leave the board as a consequence. I think Fronteers has a bright future, and the decisions made can help make Fronteers more professional, and possibly more fair, as less pressure will be put on volunteers that spend too much time on Fronteers.</em></p> <p>Also, there should be no confusion over this: this was a perfectly reasonable proposal, which was accepted by a majority of the Fronteers members who came out to vote. Personally, I feel the decision is bad for Fronteers as an organisation that is <strong>multi-faceted</strong>: meet-ups, workshops, conferences, a job board and lots of community outreach. It puts the conference and its organisers first by making that facet a paid job, and is bad for the other facets. I suspect less volunteers will be likely to choose and spend a lot of time on Fronteers for free. In a year’s time, I think Fronteers should probably review what today’s decision meant for all of these facets.</p> <p>The discussion was one between people with good intentions and people with good intentions. People who love Fronteers and people who love Fronteers.</p> <h2>My tweet</h2> <p>I tweeted this: </p> <blockquote> <p>Yesterday I resigned from the @fronteers board after members voted in favour of a proposal that lets some volunteers charge for their work.</p> </blockquote> <p>This tweet was phrased harsher than I intended. I did not mean any nastiness, but can see that it came across as such. I really should have used different words.</p> <p>What happened is that people, who were previously volunteers, left the conference team. At the same time they put a proposal forward to Fronteers members, that offered conference organising services through their company. Where I said volunteers would get paid, the nuance is that the company of former volunteers would get paid.</p> <p>I want to clarify that all of this happened through a <em>fair member consultation</em> in which <em>all members were able to vote</em>. There was no nepotism. </p> <p>I was planning to leave at some point anyway, as it is almost 10 years ago since I first volunteered for Fronteers (at the first conference). I’ve been involved with most aspects of Fronteers since: more conferences, workshops, marketing, meetups, the board, finances, partnerships, et cetera. The situation brought me to do that a bit earlier and a bit more abrupt.</p> <h2>What happened at the members meeting</h2> <p>Fronteers members voted to hire an external company to take care of the logistics of its conference organisation.</p> <h3>The problem being solved</h3> <p>Fronteers can take a lot of its volunteers’ time. Some volunteers have literally spent 1-3 days a week, for years, working on stuff like the yearly conference. Evenings, weekends, but also lots of day time. Freelancers amongst them had to balance this with their client’s time and had to give up billable time to work on Fronteers tasks. Employees amongst them required lenience from their employers. This has been the case for years and is far from ideal.</p> <p>It has taken me a lot of time to see the above as a problem, as it all seemed so natural. I also realised that it was in fact a problem that affected me, too. Evenings, weekends, day time. Life/Fronteers balance is important, and it is up to individuals to make sure they make that balance.</p> <h3>The arguments in favour</h3> <ul> <li>The proposed solution was ready to execute as it was well defined, with plenty of room for Fronteers to negotiate whatever boundaries necessary.</li> <li>The members who brought the proposal into vote had done years of volunteer work for Fronteers. To hire their company made perfect sense: they had experience specifically with Fronteers Conference, spent years organising it for free and contributed a lot to what it is now.</li> <li>They did a fair proposal: their ballpark figures constituted a price that would be hard to get on the market, many commercial conference organisers cost a lot more.</li> <li>If Fronteers were to hire a company to help with logistics, that <em>company</em> could be held responsible and accountable for various aspects.</li> <li>Fronteers already outsourced tasks to third parties, such as catering, WiFi and flight booking</li> <li>Finally, someone recognised The Problem and tried to do something about it.</li> </ul> <h3>The arguments against</h3> <ul> <li>The proposed solution only solved The Problem for some members. Others also spent evenings, weekends and day time. </li> <li>This would be weird for Fronteers volunteers that have to work together with the supplier (weirder than working with a caterer, hotels or venues).</li> <li>I suspected the proposed supplier would be hard to separate from the people behind the company, as they were former conference team members. </li> <li>Fronteers Conference is the product of years of volunteer effort. Can anyone ever earn any money from that? (This argument regards the caterers, hotels, travel agents etc as fundamentally different third parties, as they are <em>not</em> ran by former volunteers, which is both snarky to even mention <em>and</em> pretty much the case)</li> <li>I suspected this would completely change how Fronteers works and possibly cause volunteers to leave.</li> </ul> <p>One last point is that others in Fronteers history who have also faced The Problem, are not going to be paid for their past efforts (this includes those who made this proposal). But this makes sense: none of these people acted as a separate supplier, and applying the new rules to volunteers retroactively would be overdoing it.</p> <p>To get around of some of my concerns, I co-signed Arjan’s proposal which asked the board to investigate the intricacies around paying all <em>active</em> Fronteers volunteers (financially, legally, ethically, etc), i.e. those who spend a <em>lot</em> of time on Fronteers. If all active people were paid, there would be less weirdness. Unpaid people could still remain, and could feel happy to do a lot less work.</p> <h2>My personal context</h2> <p>To give you an idea of where I’m coming from, I would like to share some of my Fronteers history (feel free to skip ahead to the next section). After I was approached to volunteer at the first conference in 2008, I continued volunteering for every single conference until 2013. In the first few years I was a ‘runner’, in the last years I joined the actual team. I was given responsibilities like sponsorship, volunteers, marketing, visual design, speaker curation and even had the honour to be the chair in my last year.</p> <p>I also took on other tasks within Fronteers: I briefly chaired the marketing and workshops teams, and after I joined the board in 2014, I became treasurer in 2015. The last year was one of my heaviest: I helped Fronteers transition to a new bookkeeper, organised the preparation of two sets of accounts (2014 and 2015), restarted the workshops team and organised four workshops, helped organising four meetups and kept in touch with various organisations for our new front-end community support program.</p> <p>I’ve very much enjoyed (most of) this. I made many friends, had fun, learned loads and met many friendly Fronteers fans who appreciated the stuff Fronteers did for the community. Yet it did cost me a lot of time. Evenings, weekends, day time.</p> <p>I resigned from the board immediately after the vote. I had spent about a week contemplating doing this in case of a vote in favour of the proposal. The reason? I accept the decision, but assumed the proposal would take time to work out, and foresaw a backlash that would take the board’s attention for a while. I decided that I did not want to spend my free time on dealing with the situation. I was looking forward to spending the last year of my 3 year board term organising workshops, meetups, community support and possibly the new website. The acceptance of both proposals radically changed the board’s priorities, and I could not see myself stay yet ignore that. I saw an early end as the best way to solve <em>my</em> Fronteers/life balance.</p> <h2>What now?</h2> <p>Both the proposal to hire a supplier and the proposal to investigate paying Fronteers volunteers were accepted at the members meeting. The vote happened and this is now the direction in which Fronteers is moving. The board and others (like Peter-Paul Koch) have constructively started thinking about how to carry out the proposals. This will be a complex task, because there are a lot of questions about the details and conditions. </p> <p>The 2017 conference will be fine too. It’s going to be the tenth year of Fronteers! The idea is that a team of volunteers will be erected to organise the conference, and that they will be in charge of contracting Eventstack (and any details concerning that contract).</p> <p>Personally, I committed to keep carrying out my treasurer tasks until the end of the year, including making sure the accounts for 2016 are prepared and transferring all I know to my successor. I will also continue chairing workshop team, and hope to organise many more workshops in the new year. After, I hope to get some new hobbies.</p> <p><em>Update: from 1 April I have left the workshop team, I am now no longer involved with organising things for Fronteers</em></p> <hr/> <p>Originally posted as <a href="https://hidde.blog/leaving-the-fronteers-board-what-happened/">Leaving the Fronteers board: what happened</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Leaving the Fronteers board: what happened">Reply via email</a></p> On initialising JavaScript from markup 2017-01-10T00:00:00Z https://hidde.blog/on-initialising-javascript-from-markup/ <p>In <a href="https://medium.com/simple-human/dont-initialise-javascript-automagically-85a1231914ce#.tv3mx6qa7">Don’t initialise JavaScript automagically</a>, Adam Silver argues that we should not rely on markup to trigger bits of JavaScript. I disagree with the advice he gives, and think markup is great place to trigger behaviour. Where else?</p> <p>A quick disclaimer up front: I believe that when it comes to how to trigger JavaScript, there is no good or bad. There is personal preference though, and mine is a markup-based approach. </p> <p>In this post I will go into three of Adam’s concerns with that approach. They are about <em>what</em> behaviour is being triggered, <em>how many times</em> and whether <em>hiding complexity</em> is a problem. His post does not go into any non-markup-based initialisation methods, so I can only guess what such methods would involve. </p> <h2>What you’re triggering</h2> <p>With markup to trigger behaviour, Adam explains, <strong>it is harder to know <em>what</em> you’re initialising</strong>. I think this depends on how your declare the behaviour. Enforcing a solid naming approach is essential here. </p> <p>This is an approach I like:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>#section1<span class="token punctuation">"</span></span> <span class="token attr-name">data-handler</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>open-in-overlay<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> Section 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span></code></pre> <p>Let’s assume a website consistently uses the data-handler attribute (see <a href="https://hiddedevries.nl/en/blog/2015-04-03-progressive-enhancement-with-handlers-and-enhancers">my earlier post about handlers</a>), with as its value a verb that corresponds to a function name. In the codebase for that website, it will be trivial to see what you are initialising.</p> <p>In the example, the initialised JavaScript will open a thing called “Section 1” in an overlay. The function name is pretty much self-documenting, and it will live wherever your team decided functions to live.</p> <p>Another approach is the syntax <a href="http://conditionerjs.com/">ConditionerJS</a> uses: </p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>http://maps.google.com/?ll=51.741,3.822<span class="token punctuation">"</span></span> <span class="token attr-name">data-module</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>ui/Map<span class="token punctuation">"</span></span> <span class="token attr-name">data-conditions</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>media:{(min-width:40em)} and element:{was visible}<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> ... <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span></code></pre> <p>Conditioner (it’s <a href="https://www.smashingmagazine.com/2014/04/frizz-free-javascript-with-conditionerjs/">frizz-free</a>) does not use verbs as a naming convention, but expects module names in a <code>data-module</code> attribute. All modules use the same convention for declaring they exist. Again, there is no confusion as to which behaviour is being triggered. </p> <p>In the above examples agreed upon data attributes are used to declare behaviour. The reason why I think they are intuitive, is that they look very similar to standard HTML. Take this link:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>#section1<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Section<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> Section<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span></code></pre> <p>We could see this as a ‘link’ module, that has two options set in its attributes: <code>href</code> tells the browser where it needs to take the user, <code>title</code> sets up which text to display in a tooltip when the user hovers a link. </p> <p>Or this image:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>img</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>temple.jpg<span class="token punctuation">"</span></span> <span class="token attr-name">alt</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Four monks in front of a temple<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span></code></pre> <p>This ‘image’ module comes with two settings: <code>src</code> tells the browser where the image is, <code>alt</code> can be used by browsers to display to users if fetching the image fails. With <code>srcset</code> and <code>sizes</code>, even more attributes are available to trigger behaviour. </p> <p>In summary: custom attributes are great to declare custom behaviour, because HTML already has lots of native attributes that declare native behaviour. This doesn’t mean we’re <em>doing</em> behaviour in HTML: we’re doing behaviour in JavaScript, and are merely using the markup to declare the nature and conditions of this behaviour.</p> <h2>How many times you’re triggering</h2> <p>When you trigger JavaScript for each occurrence of classname or attribute, you do not know <strong>how many times you are triggering</strong> it, says Adam. </p> <p>Correct, but is this a problem? This phenomenon is quite common in other parts of our work. In a component based approach to markup, you <em>also</em> don’t know how many times a heading or a <code>&lt;p&gt;</code> is going to be on a given page. In CSS, you <em>also</em> style elements without knowing on which pages they will exist (or not), or how many times.</p> <h2>Hiding complexity</h2> <p></p><blockquote class="in-content"> [Defining behaviour in markup] is magical. […] Automagical loops obfuscate complexity. They make things appear simple when they’re not.</blockquote><p></p> <p>It’s unfair to markup-based initialisation concepts to label them ‘magical’, as if that is something we should at all times avoid. The label makes it sound like there is a simpler and more sensical alternative, but is there? </p> <p>We are always going to be applying script to DOM elements, whether we define where scripts run in the scripts themselves, or in the markup they apply to. Neither is more or less magical.</p> <p>Besides, if using classes or attributes to trigger behaviour is magical, is using classes to trigger CSS also magical? </p> <p>For example:</p> <pre class="language-css"><code class="language-css"><span class="token selector">h2</span> <span class="token punctuation">{</span> <span class="token property">color</span><span class="token punctuation">:</span> red<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>Your browser ‘automagically’ applies a red colour to all the headings. Its algorithms for this are hidden away. That’s good. We can declare a colour, without knowing exactly how our declaration is going to be applied. This is very powerful. It is this simplicity that has helped so many people publish great stuff on the web.</p> <p>The same goes for my HTML examples earlier. The fact that link title tooltips and alt texts are just attributes, makes them easier to use. The fact that the browser’s logic to ‘use’ them is obfuscated is a benefit, if anything.</p> <p>Abstracting the complexities of initialisation away also helps to keep code DRY. There is one method for initialisation, which is testable and maintainable. Everything else is just suitable function names declared on well-structured HTML, which themselves are also testable and maintainable.</p> <h2>Conclusion</h2> <p>I think defining behaviour in markup is absolutely fine, and it is probably one of the most powerful ways to define behaviour out there. Looping through elements with specific attributes helps developers write DRY, maintainable and testable JavaScript code. Not looping through elements would do away with most of those advantages, without any clear wins.</p> <p>There is something magical about how DOM structures work together with the styles and scripts that are applied to them, but that will always be the case, regardless of where our initialisation happens. I would be interested to see examples of approaches that do not use markup to infer what behaviour a script needs to apply where, but until then, I’ll be more than happy to use some of the above methods.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/on-initialising-javascript-from-markup/">On initialising JavaScript from markup</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20On initialising JavaScript from markup">Reply via email</a></p> Using JavaScript to trap focus in an element 2017-01-29T00:00:00Z https://hidde.blog/using-javascript-to-trap-focus-in-an-element/ <p>For information on how to accessibly implement the components I’m working on, I often refer to <a href="https://www.w3.org/TR/wai-aria-practices-1.1/">WAI-ARIA Authoring Practices</a> specification. One thing this spec sometimes recommends, is to <em>trap focus in an element</em>, for example in a modal dialog while it is open. In this post I will show how to implement this. </p> <h2>Some history</h2> <p>In the early days of the web, web pages used to be very simple: there was lots of text, and there were links to other pages. Easy to navigate with a mouse, easy to navigate with a keyboard. </p> <p>The modern web is much more interactive. We now have ‘rich internet applications’. Elements appear and disappear on click, scroll or even form validation. Overlays, carousels, AJAX… most of these have ‘custom’ behaviour. Therefore we cannot always rely on the browser’s built-in interactions to ensure user experience. <em>We</em> go beyond default browser behaviour, so the duty to fix any gaps in user experience is on <em>us</em>.</p> <p>One common method of ‘fixing’ the user’s experience, is by carefully shifting focus around with JavaScript. The browser does this for us in common situations, for example when tabbing between links, when clicking form labels or when following anchor links. In less browser-predictable situations, we will have to do it ourselves.</p> <h2>When to trap focus</h2> <p>Trapping focus is a behaviour we usually want when there is modality in a page. Components that could have been pages of their own, such as overlays and dialog boxes. When such components are active, the rest of the page is usually blurred and the user is only allowed to interact with our component.</p> <p>Not all users can see the visual website, so we will also need to <a href="https://www.w3.org/TR/wai-aria-practices/#dialog_modal">make it work non-visually</a>. The idea is that if for part of the site we prevent clicks, we should also prevent focus.</p> <p>Some examples of when to trap focus:</p> <ul> <li>user opens a modal in which they can pick a seat on their flight, with a semitransparent layer underneath it</li> <li>user tries to submit a form that could not be validated, and is shown an error message; they can only choose ‘OK’ and cannot interact with the rest of the page</li> <li>user opens a huge navigation menu, the background behind the navigation is blurred (“Categorie kiezen” at <a href="http://www.hema.nl/">Hema.nl</a>)</li> </ul> <p>In these cases we would like to trap focus in the modal, alert or navigation menu, until they are closed (at which point we want to undo the trapping and return focus to the element that instantiated the modal).</p> <h2>Requirements</h2> <p>We need these two things to be the case during our trap:</p> <ul> <li>When a user presses <code>TAB</code>, the next focusable element receives focus. If this element is outside our component, focus should be set to the first focusable element in the component.</li> <li>When a user presses <code>SHIFT TAB</code>, the previous focusable element receives focus. If this element is outside our component, focus should be set to the last focusable element in the component.</li> </ul> <h2>Implementation</h2> <p>In order to implement the above behaviour on a given element, we need to get a list of the focusable elements within it, and save the first and last one in variables.</p> <p>In the following, I assume the element we trap focus in is stored in a variable called <code>element</code> .</p> <h3>Get focusable elements</h3> <p>In JavaScript we can figure out if elements are focusable, for example by checking if they either <a href="https://github.com/matijs/is-interactive-element">are interactive elements</a> or have <code>tabindex</code> .</p> <p>This gives a list of common elements that are focusable:</p> <pre class="language-javascript"><code class="language-javascript"><span class="token keyword">var</span> focusableEls <span class="token operator">=</span> element<span class="token punctuation">.</span><span class="token function">querySelectorAll</span><span class="token punctuation">(</span><span class="token string">'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> <p>This is an example list of common elements; there are many <a href="https://allyjs.io/data-tables/focusable.html">more focusable elements</a>. Note that it is useful to exclude disabled elements here.</p> <h3>Save first and last focusable element</h3> <p>This is a way to get the first and last focusable elements within an <code>element</code> :</p> <pre class="language-javascript"><code class="language-javascript"><span class="token keyword">var</span> firstFocusableEl <span class="token operator">=</span> focusableEls<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">var</span> lastFocusableEl <span class="token operator">=</span> focusableEls<span class="token punctuation">[</span>focusableEls<span class="token punctuation">.</span>length <span class="token operator">-</span> <span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span></code></pre> <p>We can later compare these to <code>document.activeElement</code> , which contains the element in our page that currently has focus.</p> <h3>Listen to <code>keydown</code></h3> <p>Next, we can listen to <code>keydown</code> events happening within the <code>element</code> , check whether they were <code>TAB</code> or <code>SHIFT TAB</code> and then apply logic if the first or last focusable element had focus.</p> <pre class="language-javascript"><code class="language-javascript"><span class="token keyword">var</span> <span class="token constant">KEYCODE_TAB</span> <span class="token operator">=</span> <span class="token number">9</span><span class="token punctuation">;</span> element<span class="token punctuation">.</span><span class="token function">addEventListener</span><span class="token punctuation">(</span><span class="token string">'keydown'</span><span class="token punctuation">,</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token parameter">e</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>e<span class="token punctuation">.</span>key <span class="token operator">===</span> <span class="token string">'Tab'</span> <span class="token operator">||</span> e<span class="token punctuation">.</span>keyCode <span class="token operator">===</span> <span class="token constant">KEYCODE_TAB</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token keyword">if</span> <span class="token punctuation">(</span> e<span class="token punctuation">.</span>shiftKey <span class="token punctuation">)</span> <span class="token comment">/* shift + tab */</span> <span class="token punctuation">{</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>document<span class="token punctuation">.</span>activeElement <span class="token operator">===</span> firstFocusableEl<span class="token punctuation">)</span> <span class="token punctuation">{</span> lastFocusableEl<span class="token punctuation">.</span><span class="token function">focus</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> e<span class="token punctuation">.</span><span class="token function">preventDefault</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token comment">/* tab */</span> <span class="token punctuation">{</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>document<span class="token punctuation">.</span>activeElement <span class="token operator">===</span> lastFocusableEl<span class="token punctuation">)</span> <span class="token punctuation">{</span> firstFocusableEl<span class="token punctuation">.</span><span class="token function">focus</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> e<span class="token punctuation">.</span><span class="token function">preventDefault</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> <p>Alternatively, you can add the event listener to the first and last items. I like the above approach, as with one listener, there is only one to undo later.</p> <h2>Putting it all together</h2> <p>With some minor changes, this is my final <code>trapFocus()</code> function:</p> <pre class="language-javascript"><code class="language-javascript"><span class="token keyword">function</span> <span class="token function">trapFocus</span><span class="token punctuation">(</span><span class="token parameter">element</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token keyword">var</span> focusableEls <span class="token operator">=</span> element<span class="token punctuation">.</span><span class="token function">querySelectorAll</span><span class="token punctuation">(</span><span class="token string">'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token keyword">var</span> firstFocusableEl <span class="token operator">=</span> focusableEls<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">var</span> lastFocusableEl <span class="token operator">=</span> focusableEls<span class="token punctuation">[</span>focusableEls<span class="token punctuation">.</span>length <span class="token operator">-</span> <span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">var</span> <span class="token constant">KEYCODE_TAB</span> <span class="token operator">=</span> <span class="token number">9</span><span class="token punctuation">;</span> element<span class="token punctuation">.</span><span class="token function">addEventListener</span><span class="token punctuation">(</span><span class="token string">'keydown'</span><span class="token punctuation">,</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token parameter">e</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token keyword">var</span> isTabPressed <span class="token operator">=</span> <span class="token punctuation">(</span>e<span class="token punctuation">.</span>key <span class="token operator">===</span> <span class="token string">'Tab'</span> <span class="token operator">||</span> e<span class="token punctuation">.</span>keyCode <span class="token operator">===</span> <span class="token constant">KEYCODE_TAB</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>isTabPressed<span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token keyword">return</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token keyword">if</span> <span class="token punctuation">(</span> e<span class="token punctuation">.</span>shiftKey <span class="token punctuation">)</span> <span class="token comment">/* shift + tab */</span> <span class="token punctuation">{</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>document<span class="token punctuation">.</span>activeElement <span class="token operator">===</span> firstFocusableEl<span class="token punctuation">)</span> <span class="token punctuation">{</span> lastFocusableEl<span class="token punctuation">.</span><span class="token function">focus</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> e<span class="token punctuation">.</span><span class="token function">preventDefault</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token comment">/* tab */</span> <span class="token punctuation">{</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>document<span class="token punctuation">.</span>activeElement <span class="token operator">===</span> lastFocusableEl<span class="token punctuation">)</span> <span class="token punctuation">{</span> firstFocusableEl<span class="token punctuation">.</span><span class="token function">focus</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> e<span class="token punctuation">.</span><span class="token function">preventDefault</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>In this function, we have moved the check for tab to its own variable (thanks <a href="https://twitter.com/detonite">Job</a>), so that we can stop function execution right there.</p> <h2>Further reading</h2> <p>See also <a href="https://allyjs.io/tutorials/accessible-dialog.html#trapping-focus-inside-the-dialog">Trapping focus inside the dialog</a> by allyjs, <a href="https://www.w3.org/TR/wai-aria-practices/#dialog_modal">Dialog (non-modal)</a> in WAI-ARIA Authoring Practices and <a href="http://zufelt.ca/blog/can-modal-dialog-be-made-work-properly-screen-reader-users-web">Can a modal dialog be made to work properly for screen-reader users on the web?</a> by Everett Zufelt.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/using-javascript-to-trap-focus-in-an-element/">Using JavaScript to trap focus in an element</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Using JavaScript to trap focus in an element">Reply via email</a></p> The importance of web standards and design for accessibility 2017-02-21T00:00:00Z https://hidde.blog/the-importance-of-web-standards-and-design-for-accessibility/ <p>Yesterday I attended the Inclusive Design and Accessibility meetup (“idea11y”) at De Voorhoede in Amsterdam, which was about development tools, graphic design and, the surprise act, the accessibility of React apps.</p> <p><a href="https://twitter.com/zersiax">Florian Beijers</a>, who currently interns at Microsoft, talked about his experience using text editors. He showed us popular editors like Sublime Text and Atom, and how they are impossible to use for him as a blind user. Some just read out BLANK BLANK BLANK, due to bugs in the underlying framework (<a href="http://electron.atom.io/">Electron</a>, in Atom’s case). It was easy for us all to conclude that the products had not looked into accessibility much. During the talk and Q&A two questions arised: why does this happen, and how hard is it to make products accessible? The why, Florian said, seems to be a combination of <em>lack of knowledge</em> and <em>lack of education</em>, which then also causes accessibility bugs to be deprioritised. If you don’t know that your designs or your code places a burden on some of your users, why make improvements? Then the how. According to Florian, <em>adhering to standards</em> can help a great deal in making things accessible. An example is labeling: if you do not use the standard way of labeling controls in your application, your user’s accessibility tools will not understand them.</p> <p>Design consultant <a href="https://twitter.com/designbypxlgirl">Agnieszka Czajkowska</a> <a href="http://www.slideshare.net/AgnieszkapxlgirlCzaj/pretty-accessible-20">talked</a> about accessibility from a design point of view. She emphasised that good design can help a great deal in removing barriers for some of your users. To come to good design, she said, it is important to include users early on, do <strong>accessibility by default and avoid treating it as an optional feature</strong>. This is something I personally see a lot in projects: specific user stories or backlog items for accessibility (‘as a user, I want all the things to be accessible’). It doesn’t work like that, every task should include doing it accessibly. In the Q&A, the discussion moved towards flexibility of interfaces. Some people need more contrast or larger fonts. If an interface is flexible enough, they can use their browser settings to do this. Agnieszka said this comes down to <strong>giving users agency</strong>: make sure your interface allows for rather than hinders user preferences. In her talk, she showed a practical example of this: on a site she used, text overlapped with other text when she set a larger font size. With responsive design, it is perfectly possible to avoid this.</p> <p>De Voorhoede’s <a href="https://twitter.com/jbmoelker">Jasper Moelker</a> stepped in at the last minute to do a <a href="https://github.com/jbmoelker/presentations/blob/master/react-html-still-matters-2016-10.pdf">lightning talk</a> that he had done before for the ReactNL conference. In the talk, he used examples from the React docs and showed how they performed in three browsers: Chrome (a modern browser), Opera mini (a proxy browser) and Lynx (a text browser). Sadly, most of the examples worked great in Chrome, hardly in Opera mini and not at all in Lynx. He then showed how to rewrite the examples by using semantic HTML. Basic markup 101 like pairing <code>label</code>s with <code>input</code>s and wrapping form controls in <code>form</code> elements helped a great deal and made some of the examples work in all three browsers. Takeaway: <strong>semantic markup is extremely important</strong>. It is a great strategy to ensure your application is understood by the largest amount of browsers/devices possible. Again, as Florian also concluded, following existing standards helps a great deal. Another strategy Jasper recommended is to choose ‘mount nodes’ wisely: some turn their whole <code>body</code> into one big React app, which does nothing without React. Instead, you could turn specific parts of your page into mini React apps, and have the rest of the page contain sensible defaults. The latter likely deals more gracefully with failures.</p> <p>This was my first idea11y meetup, and I have had a great evening. Many thanks to the organisers for putting this event up and De Voorhoede for their hospitality. I am looking forward to attending again!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/the-importance-of-web-standards-and-design-for-accessibility/">The importance of web standards and design for accessibility</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20The importance of web standards and design for accessibility">Reply via email</a></p> Perfwizardry 2017-03-09T00:00:00Z https://hidde.blog/perfwizardry/ <p>When Harry Roberts <a href="https://twitter.com/csswizardry/status/829677401449852928">tweeted</a> he would be free to give a workshop in The Netherlands this week, <a href="https://twitter.com/pm5544">Joël</a> approached <a href="https://xebia.com/">Xebia</a> and <a href="https://fronteers.nl/">Fronteers</a> and made it happen. Almost 20 of us gathered in the Wibautstraat in Amsterdam and spent a whole day getting all nerdy about web performance.</p> <p>Harry told us all about how to sell performance, how (and what) to measure and which tools to use. And of course, how to fix the problems you measure. He also went in to how all of this is impacted by HTTP/2 and Service Workers (spoiler: turn them off when performance testing). The workshop came with plenty of theory, which I liked, as it helped understand how things work in practice. We ended by scrutinising a number of actual websites using the things we learned.</p> <p>Please find some of my notes below.</p> <h2>Selling performance</h2> <ul> <li>When trying to sell performance to others in your company, tune the message towards the audience. With performance, it is easy to get all excited about all the technical stuff, especially as a developer. Concurrent downloads in HTTP/2 may interest your audience less than the forecast of paying less for bandwidth.</li> <li>Use stats. If your company does not keep them, you can also refer to stats of others, <a href="https://wpostats.com/">WPOstats</a> is great.</li> <li>Your users may have capped data plans, they may be in an area with poor network conditions. Think of the next billion internet users, they may not have fast iPhones and great WiFi. See also <a href="https://whatdoesmysitecost.com/">What does my website cost</a> and <a href="https://www.webworldwide.io/">Web World Wide</a>.</li> </ul> <h2>What to measure</h2> <ul> <li>Testing on your own device with your own network helps and it is easy, but it is nowhere near as valuable as Real User Monitoring (RUM). There are services that help with this, such as <a href="https://speedcurve.com/">SpeedCurve</a> and <a href="https://www.pingdom.com/">Pingdom</a>. Google Analytics also provides some rudimentary RUM tools.</li> <li>Beware of metrics such as <em>page weight</em>, <em>number of requests</em> and <em>fully loaded</em>. It depends on your situation if and how those apply to your performance strategy. </li> <li>Perceived performance is better to focus on, although it is harder to measure. Many automated tools require thorough evaluation. Human judgment is essential.</li> <li><a href="https://sites.google.com/a/webpagetest.org/docs/using-webpagetest/metrics/speed-index">Speed Index</a> is a good metric to focus on. It is a ‘user-centric measurement’: the number is based on visual completeness of a page.</li> <li>You can use Speed Index’s median as a metric in <a href="https://webpagetest.org/">Web Page Test</a> by adding <code>?medianMetric=SpeedIndex</code> at the end of your Web Page Test url. </li> </ul> <h2>The network and requests</h2> <ul> <li>TCP/IP comes with <strong>head of line blocking</strong>: if one of the packages fails to come through, the server will request it again and hold up other packages in the meantime.</li> <li>The network is hostile, assume it will work against you.</li> <li>Beware of the difference between <strong>latency</strong> and <strong>bandwidth</strong>. Latency is how fast a certain path can be travelled, bandwidth is how much we can carry on our journey. Compare it with a motorway: latency is how fast we can drive, bandwidth is how many lanes are available for us to use.</li> <li>The <code>Connection: Keep-Alive</code> header will leave a connection open for other transfers to happen, preventing new connections (with new DNS looksups, handshakes, etc) having to start all the time.</li> <li><a href="https://hpbn.co/">High Performance Browser Networking</a> by Ilya Grigorik is a great book and it is available online for free. It is very technical, the mobile section is especially great.</li> <li>Avoid redirects, they waste your user’s time. This is especially true on mobile, where requests are even more fragile. </li> <li>Beware of whether your URLs have a trailing slash. If you are not precise about where you link to, you can cause redirects to happen. For example, if your ‘About’ page is on <code>yoursite.com/about/</code>, you link to <code>yoursite.com/about</code> and you’ve set up a redirect, you can save your user from this by just linking to the right path in the first place.</li> <li>Elimate 404s, as they are not cached (this is a feature).</li> <li>Make use of cache, do not rely on it.</li> <li>Use compression, for example gzip.</li> <li>Concatenate your files to circumvent the HTTP’s limit on concurrent downloads (stop doing this when using HTTP/2).</li> </ul> <h2>Resource hints to increase performance</h2> <p>In which was likely <em>the</em> most exciting section of the workshop, Harry went into <a href="https://www.w3.org/TR/resource-hints">resource hints</a>: DNS Prefetch, Preconnect, Prefetch and Prerender. Web performance hero Steve Souders talked about these concepts at his <a href="https://fronteers.nl/congres/2013/sessions/pre-browsing">Fronteers 2013 talk “Pre-browsing”</a>. <a href="http://caniuse.com/#search=resource%20hints">Browser support for resource hints</a> has improved massively since.</p> <ul> <li>If you use both <code>dns-prefetch</code> and <code>preconnect</code>, set the <code>preconnect</code> header first, the browser will then skip over the <code>dns-prefetch</code> header as it will have already prefetched the DNS.</li> <li><strong>Long request chains</strong> are expensive: this is what happens when you include a CSS file, which imports another, which then requests a font, etc. The browser will only know about the font when it has parsed the second CSS file. With the <code>preload</code> you can tell the browser to preload assets, so that it already has them when the second CSS file requests them.</li> </ul> <h2>Anti patterns</h2> <ul> <li>Avoid Base64 encoding as it has little repetition and therefore gzips badly.</li> <li>Don’t use <strong>domain sharding</strong> (the practice of using different domains to allow for more concurrent downloads) for any assets that are critical to your site, such as your (critical) CSS. </li> <li>Many of today’s best practices are HTTP/1.1 oriented. When you start serving over HTTP/2, beware some may become anti patterns.</li> </ul> <h2>The future</h2> <ul> <li>If you serve over HTTP/2, you can <a href="https://http2.akamai.com/">benefit</a> from multiplexing and concurrency (download all assets at the same time), improved caching, much smaller headers and Server Push, which lets the server send files the user did not yet request </li> <li>Service Workers can speed up things tremendously as you can use them to have more granular control over what you serve from where.</li> </ul> <p>Although I was familiar with most of the concepts covered, I did pick up lots of things that I did not know about. There were also practical examples, and Harry explained everything with lots of patience and at <em>just</em> the right speed. If Harry is coming to your town with his performance workshop, I would recommend coming along.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/perfwizardry/">Perfwizardry</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Perfwizardry">Reply via email</a></p> My last day at Fronteers 2017-03-31T00:00:00Z https://hidde.blog/my-last-day-at-fronteers/ <p>So… tomorrow is the end of me volunteering at Fronteers. As of then, I am no longer part of Fronteers’ workshop team. With that, I am officially no longer volunteering at Fronteers. Time for a round-up! </p> <h2>Front-what?</h2> <p><a href="https://fronteers.nl/about">Fronteers</a> is the professional association for front-end developers in The Netherlands. It has about 500 paying members. Some of those volunteer to put up conferences, workshops, meetups, a job board and a Slack community. It was founded in 2007 by <a href="http://quirksmode.org/">PPK</a>, <a href="http://arjaneising.nl/">Arjan</a> and <a href="http://tomgreuter.nl/">Tom</a> and has grown and changed in many ways since.</p> <p>In this post I will look back at my volunteering for Fronteers, and share some things that I learned. </p> <p>The cool thing about Fronteers is that it is an organisation that is bigger than its individual volunteers. Although it often heavily depends on the spare time of specific people, stuff can go on. Even when people leave and new people come in. Fronteers history shows this is not always easy and not every detail survives. Often, new, awesome details come into existence, too. Progress happens. </p> <h2>Round-up</h2> <p>For those who find it interesting, I’d like to share a bit of my history at Fronteers. With my apologies for what is sort of blowing my own trumpet – quitting after all those years is quite a big deal to me.</p> <ul> <li>I volunteered at six conferences (2008-2013), of which I was in the organising team of three, one as the chair. I was able to add a few new things to the mix, like subject-first speaker selection and a practical case studies session.</li> <li>I organised meetups about <a href="https://fronteers.nl/bijeenkomsten/2010/setup">the semantic web</a> (with SETUP), <a href="https://fronteers.nl/bijeenkomsten/2011/lable">healthcare and online news</a> (with Lable), <a href="https://fronteers.nl/bijeenkomsten/2012/vpro">RequireJS and MVC</a> (with VPRO), <a href="https://fronteers.nl/bijeenkomsten/2016/mirabeau">Progressive Web Apps</a> (with <a href="https://twitter.com/torgo">Dan</a> and <a href="https://twitter.com/branmovic">Bran</a>), <a href="https://fronteers.nl/bijeenkomsten/2016/toegankelijkheid">accessibility</a> (with <a href="https://twitter.com/thomatronic">Thomas</a> and <a href="https://twitter.com/mrenty">Michiel</a>) and <a href="https://fronteers.nl/bijeenkomsten/2016/muziek-en-het-web">music</a> (with Thomas and Michiel)</li> <li>I was involved with about 12 workshops (some in 2012, some in 2016/2017), including <a href="https://fronteers.nl/blog/2012/12/workshop-future-css-door-bert-bos">one about CSS with one of the inventors of CSS</a></li> <li>I had two sets of accounts prepared as treasurer and transitioned us away from the accountants that did not deliver many of their promises (it was quite the chase)</li> <li>I worked on getting 61 of our <a href="https://hiddedevries.nl/en/blog/2016-01-21-making-conference-videos-more-accessible">conference videos captioned</a> (with <a href="https://krijnhoetmer.nl/">Krijn</a> and <a href="https://twitter.com/janitatop">Janita</a>)</li> <li>I chaired the marketing team from 2011 to 2013 (and was team member from 2008), which produced legendary pens, notebooks, promotional slides, as well as BEERS with the Fronteers logo on</li> </ul> <p>More recently, in August last year I revived the workshops team. With the support of <a href="https://www.linkedin.com/in/rachidlechheb">Rachid</a> and <a href="http://nl.linkedin.com/in/sharonmartens">Sharon</a> back then, joined by <a href="https://twitter.com/timseverien">Tim</a> later, we managed to put up a one day workshop every month from September (with one cancelled). This is still happening, with the <a href="https://fronteers.nl/workshops/creatieve-data-visualisatie-nadieh-bremer">April one</a> sold out and an exciting one for May in the pipeline (soon to be announced). I found it a lot of fun to be involved with this. It’s all volunteer work, but you get to spend the association’s money on good teachers to provide affordable workshops for all. What’s not to like?</p> <h2>I learned things</h2> <p>I’ve really enjoyed doing all of these things! My feelings about my recent stint at the workshops team is a general theme in most of the things I’ve been able to do at Fronteers. It is an organisation with international connections (and goodwill), money to pay for activities that aim to improve front-end development, and an endless stream of ideas waiting to make it into reality. </p> <p>Working for Fronteers I learned a lot, although hardly about front-end development. </p> <p>I learned, for example, that you can try getting things done by yourself, but working together with people who complement you makes it a lot easier. </p> <p>I discovered that work in an association like Fronteers involves a lot of politics. It takes time to convince people of your ideas, and to learn who needs to be convinced most (this can be the oppposite of what you expected). This takes patience. </p> <p>On the subject of politics: at times, there would be different ideas at how to go ahead. If we would be working together at a large business, strict hierarchy would have dictated the decision making process. With a group of volunteers that all put lots of love (and time) into their work, debates can be more heated. At these times it is extremely important to look at the bigger picture, because the heat is usually only within the team. Outsiders, or attendees, will likely just see an awesome conference, meetup or workshop.</p> <p>I found it’s so hard to get it right (we often did not), and that sometimes the best ideas come in hindsight. </p> <p>I learned to live with <em>not</em> realising ideas, because of time constraints. I tried setting up a system to manage contacts between Fronteers and the outside world, organise more meetups outside of Amsterdam, redesign all of the website with <a href="https://krijnhoetmer.nl/">Krijn</a> (we even had one of the best Dutch agencies on board to help), present the financial budget in a way that is less boring and organise meetups specifically to bring volunteers together to work on organising shared activities. Time was a constraint.</p> <p>I also learned that me being personally delighted about a subject or speaker would not guarantee lots of attendees for an event. Especially in the week before <a href="https://nl.wikipedia.org/wiki/Sinterklaas">Sinterklaas</a>. </p> <p>Or that it is important in volunteering to learn to say ‘no’ before it is too late. This helps with focus, and with being able to meet promises and expectations. </p> <p>I’ve gotten to know this fantastic feeling that goes with putting on something that people enjoy to attend, whether it be workshops, meet-ups or conferences.</p> <h2>Thanks and goodbye</h2> <p>I’m very grateful to <a href="http://krijnhoetmer.nl/">Krijn</a> and <a href="http://arjaneising.nl/">Arjan</a> for inspiring me to start volunteering at Fronteers, and to <a href="http://quirksmode.org/">PPK</a>, <a href="http://tomgreuter.nl/">Tom</a>, <a href="http://have-skill.com/">Sander</a> and <a href="http://twitter.com/jacokoster">Jaco</a> for trusting me to organise things within the professional association they chaired. They were always encouraging as well as very forgiving and patient with regards to my mistakes. </p> <p>I should also thank all other volunteers that I had the pleasure of working with, many of whom who have become friends. You know who you are. </p> <p>I’m going to be focusing on other things now, and become a consumer of Fronteers activities. It has truly been a blast!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/my-last-day-at-fronteers/">My last day at Fronteers</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20My last day at Fronteers">Reply via email</a></p> How to make inline error messages accessible 2017-04-04T00:00:00Z https://hidde.blog/how-to-make-inline-error-messages-accessible/ <p>On one of my projects I am helping a governmental organisation to take their application forms to the web. They are mostly very complex forms (for reasons). We do our best to help people fill out the forms correctly and identify incorrect input to them where we can. In this post I will go into some ways to do this accessibly.</p> <p>Commonly, when an error occurs, an error message is inserted into the page. If you want to do this accessibly, some things to look at are identifying errors as errors, notifying the (screenreader) user of new content and describing what happened in clear language. Below, I will go into how you can improve things in those three areas.</p> <p>As per <a href="https://www.w3.org/WAI/WCAG21/Understanding/error-identification.html">WCAG 3.3.1 Error Identification</a>, this is what we need to do:</p> <blockquote> <p>If an input error is automatically detected, the item that is in error <strong>is identified</strong> and the <strong>error is described to the user in text</strong>. </p> </blockquote> <h2>Yes, we can script it</h2> <p>Before we go into identifying validity and error messages, a little note about using JavaScript.</p> <p>In the old days, a form submit would just trigger the same page to reload, now with error messages where applicable. In 2017, this is still a good practice, but it can be hugely enhanced by preventing the submit and displaying errors client side. And why wait until the submit? You could insert an error message as soon as a user tabs out of a field.</p> <p>Shouldn’t accessible forms avoid JavaScript? No, on the contrary. They can use JavaScript to inform users about errors as they occur. Combined with a server side approach, this can give us the best of both worlds.</p> <p>Needless to say: using good old HTML elements is key to your forms to be successful. In this post I go into some ARIA techniques, but always keep in mind that <a href="https://www.w3.org/TR/using-aria/#rule1">the first rule of ARIA is to not use ARIA</a>. Paraphrasing, this rule means that if you can do it with HTML, don’t use ARIA. The exception to this for things that are not available in HTML. Whether error messages getting injected into the page fall under that umbrella is a case of ‘it depends’. There is the native Constraint Validation API, but it is problematic in many ways (see <a href="https://medium.com/samsung-internet-dev/native-form-validation-part-1-bf8e35099f1d">PPK’s 3 part article on form validation</a>), so in this article I am assuming we are rolling our own validation with JavaScript. </p> <h2>Indicating a field has invalid input</h2> <p>When you detect a field is invalid, you can apply the <code>aria-invalid</code> attribute to it. Then, make sure your scripts are watching the relevant field, so that you can remove the attribute once it no longer applies.</p> <p>If you were using native HTML form validation, you could style invalid input using the <code>:invalid</code> pseudo class. If your JavaScript is determining what’s valid our not and the <code>aria-invalid</code> attribute is added/removed appropriately, it provides a convenient way of indicating invalid input:</p> <pre class="language-css"><code class="language-css"><span class="token selector">[aria-invalid]</span> <span class="token punctuation">{</span> <span class="token property">border-color</span><span class="token punctuation">:</span> red<span class="token punctuation">;</span> <span class="token property">border-right</span><span class="token punctuation">:</span> 5px<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>(<a href="https://codepen.io/hidde/pen/GEMaQz">Codepen</a>)</p> <p>Adding and removing the <code>aria-invalid</code> attribute also helps users of screen readers recognise they are on an invalid field. Fields with the attribute are read out as being invalid in <a href="https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA21">JAWS, NVDA and VoiceOver</a>.</p> <h2>Conveying that an error message appeared</h2> <p>When your script has detected input of a field is not valid, it inserts an error message into the page. Make sure it is easy to see that this is an error message, for example by using a combination of colors, an icon and/or borders. It also helps if you indicate that it is an error by prefixing the actual message with ‘Error: ’.</p> <p>To make sure our error messages are read out to users with screen readers, we need to ensure the accessibility tree is notified of the newly inserted content. </p> <p>There are two ways that are roughly equivalent, both making use of ARIA attributes: live regions (<code>aria-live</code>) and <code>role=alert</code> (avoid using both at the same time). They turn an HTML element into a live region, which means that a screenreader will read out changes to that element. A change could be that something is appended to the element. Note that for this to work, the element itself has to be present in the DOM on page load. Live regions or <code>role=alert</code> <a href="http://www.pauljadam.com/demos/aria-alert-validation.html">work in VoiceOver and most versions of JAWS and NVDA</a>.</p> <p>In the implementation I describe below, this would be the flow:</p> <ul> <li>User makes mistake in field 1, tabs to field 2</li> <li>Script detects mistake, reads out that field 1 is incorrect (or conveys it through big red error message appearing)</li> <li>Meanwhile, user is in field 2 and can decide to go back and fix, or continue and fix later</li> </ul> <h3>Live region</h3> <p>To turn an HTML element into a live region, add <code>aria-live</code> to it. There are various modes, depending on whether you want updates to be read out immediately or not. In our case, we do want that, and will use <code>aria-live=&quot;assertive&quot;</code> :</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">aria-live</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>assertive<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token comment">&lt;!-- insert error messages here --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span></code></pre> <p>If we are watching for fields to become incorrect, it makes sense to apply the same functionality in reverse. If the field is changed and input is now valid, we can remove the errors. We need our live region to be aware of both addition and removal of error messages. With <code>aria-relevant</code> we can set it up to do exactly this:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">aria-live</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>assertive<span class="token punctuation">"</span></span> <span class="token attr-name">aria-relevant</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>additions removals<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token comment">&lt;!-- insert error messages here --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span></code></pre> <p>(<a href="https://codepen.io/hidde/pen/eRGwer">Codepen with live region examples</a>) </p> <p>If we want to control whether we need the whole region to be read out, we can use <code>aria-atomic</code> . If it is set to true, the whole live region will be read out if anything changes. It defaults to true. It depends on your situation which setting fits best. If your error messages are displayed in a question-specific live region, this might make sense. If error messages for the whole form live in one live region, it may be a bit too much.</p> <h3><code>role=alert</code></h3> <p>Instead of manually setting up a live region, you can also give the error are a <code>role=alert</code> :</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">role</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>alert<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token comment">&lt;!-- insert error messages here --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span></code></pre> <p>This <a href="https://www.w3.org/TR/wai-aria/roles#alert">turns it into an assertive live region automatically</a>, with <code>aria-atomic</code> set to true.</p> <h2>Focus management</h2> <h3>When inserting a new error message</h3> <p>There is no need to do anything with focus after you have inserted an error message. When you insert it as the user tabs to the next field, they will likely have focused the next field. Intercepting <code>TAB</code> to steal their focus and bring it back to the error message would result in an unexpected experience for the user. I would consider this an anti-pattern.</p> <h3>When preventing submit, because there are still errors</h3> <p>If you have prevented submit, because there are still errors on the page, it could be useful to send focus to a list of errors that you have prepared at the start of the form. Bonus points if each item on that list is a link to the invalid item, to make it easier to correct.</p> <p>Note that if you use this approach, it may conflict with your assertive live regions, as they will get read out before your list of errors. It may be better in this case to choose between the two approaches.</p> <h2>Language</h2> <p>The above is a quite technical approach that optimises the situation for screenreader users. Another accessibility feature that can be optimised and will improve things for all of your users is the use of language. </p> <p>Whether your form is complex or simple, make sure your error messages are easy to understand. Use clear and concise language. Be helpful in explaining what is wrong and how it can be fixed. This aids the user to complete the form as smoothly as possible.</p> <h2>In summary</h2> <p>In this post, I have discussed three ideas to improve the accessibility of dynamically added error messages:</p> <ul> <li>identify a field as being currently invalid with the <code>aria-invalid</code> attribute</li> <li>notify the user when a new error message has appeared, by inserting them into a live region / <code>role=alert</code> </li> <li>always make sure you explain what went wrong and how to fix it in clear and concise language</li> </ul> <p>Any feedback is welcome!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/how-to-make-inline-error-messages-accessible/">How to make inline error messages accessible</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20How to make inline error messages accessible">Reply via email</a></p> On hiding content 2017-04-11T00:00:00Z https://hidde.blog/on-hiding-content/ <p>Sometimes you want parts of your page to be invisible. For example, because all of your application is on a single page. The <code>hidden</code> attribute in <a href="https://html.spec.whatwg.org/multipage/interaction.html#the-hidden-attribute">the HTML standard</a> is made for this. In this post I will explain how the attribute works, how it differs from <code>[aria-hidden]</code> and how it relates to just hiding with CSS.</p> <h2>What it is</h2> <p>This may be somewhat superfluous, but let’s start with looking at what ‘hidden’ means. Other than ‘not visible’, it also <a href="https://html.spec.whatwg.org/#the-hidden-attribute">indicates that an element is not relevant</a>. </p> <p>For modern websites, think of “not relevant” as <em>no longer</em> relevant, or <em>not yet</em> relevant. There’s a thing in your HTML structure, it is not in view and users cannot do anything with it. It just sits there, waiting to be consumed by some script. </p> <h2>How the hiding works</h2> <p>There is a part of the HTML spec that recommends what browsers should include in their built-in stylesheets. For elements with the <code>hidden</code> atribute, it <a href="https://html.spec.whatwg.org/multipage/rendering.html#hidden-elements">prescribes</a> using <code>display: none</code>. Interestingly, this means hidden elements are treated the same as elements like <code>head</code>, <code>script</code> and <code>title</code>: not displayed (<a href="https://mathiasbynens.be/notes/css-hidden-elements">not usually, anyway</a>).</p> <p><a href="https://www.paciellogroup.com/blog/2016/01/the-state-of-hidden-content-support-in-2016/">Most browsers do this</a>, but it takes little effort to set it explicitly in your CSS:</p> <pre class="language-css"><code class="language-css"><span class="token selector">[hidden]</span> <span class="token punctuation">{</span> <span class="token property">display</span><span class="token punctuation">:</span> none<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>It then works not only in browsers that have the above lines in their built-in stylesheet, but also in all others (that understand attribute selectors). I would recommend doing this. By default, most browsers also set elements with <code>hidden="false"</code> to <code>display: none</code>, so when something should no longer be hidden, best just remove the attribute, rather than changing its value.</p> <h2><code>aria-hidden</code> vs <code>hidden</code></h2> <p>There is also a <code>aria-hidden</code> attribute. It differs in default behaviour: an element with <code>aria-hidden</code> is hidden from (just) screen readers, an element with <code>hidden</code> is hidden from all modalities, <em>including</em> screen readers. </p> <p>Their default visibility seems to be the only difference, as both attributes will take the element out of the <a href="https://hidde.blog/en/blog/2015-05-26-the-accessibility-tree">accessibility tree</a>.</p> <p>If you want nobody to be able to interact with a part of your page, I would recommend using the <code>hidden</code> attribute. This also follows the first rule of ARIA: “Don’t use ARIA if there is a native HTML alternative”. In any case, best don’t use both at the same time, as that approach is <a href="https://www.w3.org/TR/wai-aria/states_and_properties#aria-hidden">known to cause conflicts</a>.</p> <h2>Hiding with attributes vs hiding with CSS</h2> <p>Is invisibility not just a visual thing, you might wonder? Why bother with an attribute if all the browser does is use CSS anyway?</p> <p>In addition to it being a visual thing, hidden content is also a semantic thing. It describes not just what something looks like, it describes the thing’s meaning within the page structure. Therefore, it still makes sense to use the attribute over the styling.</p> <h2>More information</h2> <ul> <li>Marcy Sutton did a <a href="https://egghead.io/lessons/html-5-visible-vs-hidden">great screencast</a> showing different ways of hiding content including a demo of how they play out in screenreaders</li> <li><a href="https://html.spec.whatwg.org/#the-hidden-attribute">The <code>hidden</code> attribute in the HTML spec</a>. See also the part about the <code>inert</code> attribute and how it differs from <code>hidden</code>.</li> <li><a href="http://stevefaulkner.github.io/HTML5accessibility/tests/hidden-2016.html">Steve Faulker’s hidden content test results</a></li> </ul> <hr/> <p>Originally posted as <a href="https://hidde.blog/on-hiding-content/">On hiding content</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20On hiding content">Reply via email</a></p> Mom-jokes as part of corporate culture 2017-04-20T00:00:00Z https://hidde.blog/mom-jokes-as-part-of-corporate-culture/ <p>Dutch retail giant Coolblue showed the world this week that they have a new meeting room, named ‘Your Mom’. They explained in a <a href="https://blog.coolblue.nl/vergaderkamers-bij-coolblue-je-moeder">blog post</a> how this name sets the stage for all sorts of mom-jokes. I think this is not really OK. </p> <img src="https://hidde.blog/_images/jemoeder.png" alt="Screenshot of tweet: ‘“Waar zit je” “In Je Moeder” Lees hier over de vergaderkamers bij Coolblue’, photo of meeting room" /> <p><em>The tweet</em></p> <h2>Personal context versus corporate culture</h2> <p>Before I continue: I am just commenting as <em>a</em> member of the tech community on <em>a</em> situation in a company that does a lot of recruitment in the tech community. Why do I do this as I don’t even work there? What’s my business here? In all modesty, I am just a developer that would like the tech community to be inclusive. I am trying to figure out which things get in the way of this (and how). </p> <p>The problem, I think, is not with jokes or even inappropriate jokes. Fun is fine! Have fun at work. Banter. As a person, between you and other people. Cross the line, or choose not to. Be as politically correct as you like, I guess. Be childish if you like. Your jokes reflect on <em>your</em> person, they get <em>you</em> in trouble (or don’t). Person-to-person gives context for judging whether lines are being crossed. Unless you are in higher management, on a stage, in public: your jokes likely don’t harm that much.</p> <p>If you are a company (or manage/represent one), this is different. <em>Companies</em> should be wary of jokes that have sexual aspects in them, because <em>their</em> language creates a corporate culture. You can see this in the example: they’ve painted a mom joke onto a meeting room, their corporate blog explains why this is funny. It has gone from a joke between people who work there, to a joke that is part of the company’s culture.</p> <h2>What’s wrong with a mom-jokes culture</h2> <p>If a joke that crosses the line is on a wall and on a corporate blog, it no longer reflects on one person. Leaving taste out of this discussion, there are problems with getting your corporate culture wrong: it is not good for recruitment, it is not good for your employees and it is not good for the tech industry. </p> <h3>For recruitment</h3> <p>In terms of recruitment, you will likely change the set of people you can pick from. Maybe you will get to pick from more people who like mom-jokes (and, sure, they could be excellent at their work), but you will likely also miss out on people who see them as a red flag. Especially in tech, and especially in the light of recent scandals. You will end up with a less diverse company. Diversity is a good thing (there’s loads written about this elsewhere; the recent film <a href="http://www.imdb.com/title/tt4846340/">Hidden Figures</a> illustrates how diversity got NASA into space).</p> <h3>For employees</h3> <p>A mom-jokes culture can make the environment less welcoming and possibly less safe for your employees. If you have an issue you’d like to report to HR, let’s say with regards to something horrible like harassment, can you still be sure it is going to be taken seriously? The HR department being part of the management of a company that has mom-jokes <em>in</em> its corporate culture seriously changes this. If one colleague made an inappropriate comment, you can report to the company. If the company itself makes inappropriate comments part of its DNA, where can you go? </p> <h3>For the tech industry</h3> <p>This is the one where my worries are probably most appropriate, as I don’t recruit or work for the company, but I do work in tech: a tech giant with a mom-joke culture makes the tech industry look less professional. It makes the tech industry look less attractive to a diverse group of people. Like I said above, diversity is a good thing. The industry should be cautious not to miss out.</p> <h2>Conclusion</h2> <p>I have nothing against jokes, but as an industry I think we owe it to ourselves to make sure that inappropriate jokes don’t become part of company cultures, as this can harm those companies as well as the tech industry as a whole. </p> <p>Mom-jokes get in the way of diversity, by attracting people who like such jokes, and repelling those who don’t. This isn’t necessary. There is so much fun to be had in the world without such side effects, we really can do better!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/mom-jokes-as-part-of-corporate-culture/">Mom-jokes as part of corporate culture</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Mom-jokes as part of corporate culture">Reply via email</a></p> Book tip: Turing’s vision 2017-04-21T00:00:00Z https://hidde.blog/book-tip-turings-vision/ <p>When I visited New York last year, I picked up a copy of Chris Bernhardt’s book <a href="https://mitpress.mit.edu/books/turings-vision">Turing’s Vision: The Birth of Computer Science</a>, which dissects one of Alan Turing’s most interesting papers. I’ve been recommending it to various people since, so I thought I would write about it here.</p> <p><img src="https://hidde.blog/_images/turing.jpg" alt="Book with Alan Turing on the cover, title: Turing's vision: the birth of computer science" /> <em>The book</em> </p> <p>The book aims to explain a number of complex ideas from computer science and mathematics to the general public. “The reader doesn’t have to understand much mathematics — high school provides enough”, Bernhardt explains.</p> <p>Personally, I’ve had to skip over bits and pieces, but generally, I’ve found it quite accessible. It takes us back to the historical and philosophical basis for many concepts that are still there in modern-day programming: encoding, regular expressions, Lambda calculus, recursive functions, functions that break on certain input, arrays… </p> <h2>On computable numbers</h2> <p>Turing is well known for his leading role in decrypting messages from the German’s Enigma devices for the allied forces, a history recently turned into a <a href="https://www.imdb.com/title/tt2084970">film worth watching</a>. He also came up with the <a href="https://plato.stanford.edu/entries/turing-test/">Imitation Game</a> thought experiment to tell humans and computers apart, now known as the ‘Turing test’ (and familiar to all internet users as <a href="https://en.wikipedia.org/wiki/CAPTCHA">CAPTCHAs</a>). This book does not focus on those things.</p> <p>The paper central to this book is called ‘On computable numbers, with an application to the Entscheidungsproblem’. <em>Entscheidungsproblem</em> is German for ‘decision problem’: it is the question whether we can write algorithms that can decide if certain mathematical statements are true or false. The problem was defined by Hilbert, one of the biggest mathematicians of his time. He thought such algorithms did exist. The book goes into various examples of decision problems.</p> <p>Turing wanted to prove Hilbert wrong. To do this, Turing had to define what an algorithm was; he explained this by breaking complex calculations down into simpler parts. He also defined the very concept of computation, using the concept of ‘Universal Machines’, machines that, he proved, can compute anything that is computable. In 1936, this was all still as theoretical as it gets. We <em>have</em> modern computers now; at the time a computer was the job title of a person hired to do calculations. </p> <h2>Conclusion</h2> <p><em>Turing’s Vision</em> is quite theoretical, but it is a great read for people who are interested in the early days of computing. It’s a good mix of mathematics, philosophy and computer science, and helps to understand in detail the paper that started it all. </p> <p>Want to <em>hear</em> more about this book? There’s an <a href="https://mitpress.mit.edu/sites/default/files/Bernhardt_podcast.mp3">interview with the writer</a> (mp3, 8MB).</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/book-tip-turings-vision/">Book tip: Turing’s vision</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Book tip: Turing’s vision">Reply via email</a></p> Where focus goes when following in page links 2017-04-24T00:00:00Z https://hidde.blog/where-focus-goes-when-following-in-page-links/ <p>Today I learned about the <a href="https://html.spec.whatwg.org/multipage/interaction.html#sequential-focus-navigation-starting-point">sequential focus navigation starting point</a>, which helps browsers decide what to do with focus when you link to content that is not focusable. </p> <h2>Finding out which element has focus</h2> <p>In a given web page, there can only be one thing that ‘has focus’. As most working with focus management problably know, this is how to find it (<a href="https://html.spec.whatwg.org/multipage/interaction.html#dom-document-activeelement">roughly speaking</a>):</p> <pre class="language-javascript"><code class="language-javascript">document<span class="token punctuation">.</span>activeElement</code></pre> <p>(Type this into your Dev Tools’ console or <code>console.log</code> it from scripts).</p> <p>When you tab through a page and check <code>document.activeElement</code> in between each tab, you will see it is always set to the thing that has focus. </p> <p>Similarly, if you build a custom widget with JavaScript and manually shift focus, you can use the above to verify that focus has shifted the way you expected. If that thing is in view, you should also see the focus outline visually (assuming you have not set <code>outline</code> to <code>none</code>). </p> <h2>What happens when you follow an in page link</h2> <p>This is what I mean by an in page link mechanism:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>#the-hague<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>The Hague<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span> <span class="token comment">&lt;!-- lots of HTML --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>the-hague<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span><span class="token punctuation">></span></span>Our stores in The Hague<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">></span></span>We have two stores in The Hague, one is at De Passage<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">></span></span>. <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span></code></pre> <p>(<a href="https://codepen.io/hidde/pen/mmrMKZ">view on Codepen</a>)</p> <p>When you follow the link to “The Hague”, focus does not shift to the “The Hague” <code>div</code>, as the console will tell you after activating that link:</p> <pre class="language-javascript"><code class="language-javascript"><span class="token operator">></span> document<span class="token punctuation">.</span>activeElement <span class="token operator">&lt;</span> <span class="token operator">&lt;</span>body<span class="token operator">></span><span class="token operator">&lt;</span><span class="token operator">/</span>body<span class="token operator">></span></code></pre> <p>Focus was moved to <code>body</code>, not to <code>div#the-hague</code>. The reason is that <code>div#the-hague</code> is not a focusable element (<code>div</code>s, by default, are not), so the browser returns focus elsewhere, in this case the <code>body</code>.</p> <h2>The focus navigation starting point</h2> <p>Something interesting happens with the above example in some browsers. When you <code>TAB</code> after following the link, it <em>does</em> go to the next focusable thing from <code>div#the-hague</code>.</p> <p>I wasn’t sure what was going on, so I asked on <a href="https://www.paciellogroup.com/blog/2015/07/anybody-can-be-an-a11y-slacker/">A11Y Slackers</a>, where <a href="https://twitter.com/sundress">Alice</a> pointed me at the following. There is a browser feature called the <a href="https://html.spec.whatwg.org/multipage/interaction.html#sequential-focus-navigation-starting-point">sequential focus navigation starting point</a>, which is a position in the document from which the browser decides where to go when the user presses <code>TAB</code> or <code>SHIFT TAB</code>. </p> <p>What happened after activating the link in my example is that, though the focus did not move, the focus navigation starting point did. </p> <p>I’ve made a <a href="https://codepen.io/hidde/pen/QvKGqa">Codepen to illustrate the above</a>, and the situations in which the linked content have implicit and explicit tabindex.</p> <h3>Other ways of shifting the focus navigation starting point</h3> <p>Browsers don’t just shift this navigation starting point when you following internal links. The spec also recommends browsers to do this when users <a href="https://html.spec.whatwg.org/multipage/interaction.html#sequential-focus-navigation">click somewhere in the document</a>.</p> <h3>Browser support</h3> <p>Not all browsers support the sequential focus navigation starting point. In my tests, it worked in Opera, Chrome and Firefox, but not in Internet Explorer 11 or Edge. </p> <h2>Further reading</h2> <ul> <li>Rob Dodson on <a href="https://developers.google.com/web/updates/2016/03/focus-start-point">removing headaches from focus management</a></li> <li><a href="https://html.spec.whatwg.org/multipage/interaction.html#sequential-focus-navigation-starting-point">Sequential focus navigation starting point</a> in the HTML spec</li> </ul> <hr/> <p>Originally posted as <a href="https://hidde.blog/where-focus-goes-when-following-in-page-links/">Where focus goes when following in page links</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Where focus goes when following in page links">Reply via email</a></p> How to customise a file upload control 2017-05-02T00:00:00Z https://hidde.blog/how-to-customise-a-file-upload-control/ <p>If your website lets users upload files, you have probably compared the default file upload control with custom solutions. In this article I will show you can have both, using a method that uses the default input, but looks completely custom. </p> <h2>The default file upload</h2> <p>This is a <a href="https://html.spec.whatwg.org/multipage/forms.html#file-upload-state-(type=file)">default file upload</a>:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>file<span class="token punctuation">"</span></span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>file-upload<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>label</span> <span class="token attr-name">for</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>file-upload<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Upload a file<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>label</span><span class="token punctuation">></span></span></code></pre> <p>It is one of those HTML elements that has a lot of usability and accessibility built in. </p> <p>To name a few things that you get for free when using the native <code>&lt;input type=file&gt;</code> :</p> <ul> <li>it can show the file name of the upload file</li> <li>it can be used with just a keyboard</li> <li>on phones, it will let your user take a photo or choose to select files from specific apps</li> <li>on desktop browsers, it will let your user browse the file system </li> <li>it can be set to allow <code>multiple</code> files to be selected</li> <li>it can distinguish between file types with its optional <code>accept</code> attribute</li> <li>it exposes a useful <code>files</code> DOM attribute for usage in your scripts (as well as a slightly less useful <code>value</code>)</li> <li>it integrates with your browser’s built in error mechanism</li> </ul> <h2>File input that matches your brand</h2> <p>Something you probably don’t get for free is a smooth integration with your brand’s design guidelines. They might prescribe buttons to be blue or rounded corners everywhere.</p> <p>The HTML example above related the input with a corresponding label. I used corresponding <code>for</code> and <code>id</code> attributes, but wrapping the <code>input</code> inside a <code>label</code> works just as well. </p> <p>In all browsers, you will find that you don’t actually have to click the input to activate it: clicking the label will do. Because of this, the trick, which I learned from <a href="https://krijnhoetmer.nl/">Krijn</a>, is simple: hide the <code>&lt;input/&gt;</code> and style the <code>&lt;label&gt;</code> .</p> <h3>Hide the input</h3> <p>You want to hide the input, but do that in a way that screenreaders don’t assume it does not exist. The method for hiding is to make it ‘visually’ hidden, but not actually hidden to assistive technologies.</p> <p>This is one way: </p> <pre class="language-css"><code class="language-css"><span class="token selector">input[type="file"]</span> <span class="token punctuation">{</span> <span class="token property">opacity</span><span class="token punctuation">:</span> 0<span class="token punctuation">;</span> <span class="token comment">/* make transparent */</span> <span class="token property">z-index</span><span class="token punctuation">:</span> -1<span class="token punctuation">;</span> <span class="token comment">/* move under anything else */</span> <span class="token property">position</span><span class="token punctuation">:</span> absolute<span class="token punctuation">;</span> <span class="token comment">/* don't let it take up space */</span> <span class="token punctuation">}</span></code></pre> <p>There are various different approaches to this, the important thing is that the method does not render the input unusable (as <code>visibility: hidden</code> would, for example), or move it off screen (as <code>left: -9999em</code> would), as that would move any native error messages off screen as well. </p> <h3>Style the label</h3> <p>Now, only the label is visible and you can style it however you like. You can make it look like a button, add background gradients, drop shadows, whatever your heart desires.</p> <h3>Add focus styles</h3> <p>It would be good to add the focus styles that your input had to the label. You can select this in CSS as follows: </p> <pre class="language-css"><code class="language-css"><span class="token selector">input[type="file"]:focus + label</span> <span class="token punctuation">{</span> <span class="token property">outline</span><span class="token punctuation">:</span> 2px solid<span class="token punctuation">;</span> <span class="token comment">/* example focus style */</span> <span class="token punctuation">}</span></code></pre> <h2>TL;DR</h2> <p>To make a custom file upload control, use a standard file upload and label, then visually hide the input and style the label.</p> <p><em>Update</em>: On Twitter, <a href="https://twitter.com/imgiseverything/status/859783201216237568">Phil</a> pointed out that if you use the above example, users can’t see the file name of what they’ve uploaded. This is a great point; in my own implementation I’ve used some JavaScript to access the input’s <code>files</code> property <code>onchange</code> of the input, which I then inserted into the page if it had changed (I’ve created a <a href="http://codepen.io/hidde/pen/LyLmrG">Codepen</a> to show how to do this)</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/how-to-customise-a-file-upload-control/">How to customise a file upload control</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20How to customise a file upload control">Reply via email</a></p> Accessibly labelling interactive elements 2017-05-05T00:00:00Z https://hidde.blog/accessibly-labelling-interactive-elements/ <p>All interactive elements should have accessible names, says the <a href="https://www.w3.org/TR/using-aria/">W3C about using ARIA</a>. They can also have descriptions. Names and descriptions can help your users figure out which elements they are interacting with, and what they are for. In this post I will explain implicit and explicit labelling methods and discuss how to future-proof your labels.</p> <h2>Accessibility tree</h2> <p>Besides a DOM tree, browsers build an accessibility tree when they render pages. It contains all interactive elements, so that it is easier for assistive technology (AT) to expose a page and its controls to their users. Being aware of how your markup influences the accessibility tree helps a great deal in making your app work for those users.</p> <p><a href="https://html.spec.whatwg.org/multipage/dom.html#interactive-content">Interactive elements</a> are things like links, buttons, form inputs and <code>&lt;details&gt;</code> with a <code>&lt;summary&gt;</code> and <code>&lt;audio&gt;</code> with a <code>controls</code> attribute.</p> <p>An accessibility tree contains <em>accessible objects</em>, which can have these name-related properties:</p> <ul> <li>accessible name</li> <li>accessible description</li> </ul> <p>The properties that result in an accessible <em>name</em> are often called <em>label</em>, this is why from the next section I will be calling them labels.</p> <h3>Name vs description</h3> <p>Both the accessible name and the description can provide text alternatives for interactive elements. The difference between the two is that the description is <em>more detailed</em> than the name, and that it is additional, where a name is essential. Generally, it is more useful to provide a name and no description rather than the other way around.</p> <h3>Inspecting the tree</h3> <p>If you want to look at the accessible objects in pages you are building, install the <a href="https://chrome.google.com/webstore/detail/accessibility-developer-t/fpkknkljclfencbdbgkenhalefipecmb">Accessibility Dev Tools</a> in Chrome. With those turned on, go to a website of choice, inspect an element and look at the properties under the Accessibility tab. If you’re on Windows, <a href="https://www.paciellogroup.com/resources/aviewer/">aViewer</a> lets you browse what accessibility APIs of multiple browsers are exposing. </p> <h2>Labelling with standard HTML</h2> <p>Most of the time, browsers can compute these things from your HTML structure. To make this work, just use standard HTML conventions. With those, your accessible names and descriptions are implicitly exposed.</p> <h3>Labels</h3> <p>This structure, for example, uses a <code>&lt;label&gt;</code>:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>label</span> <span class="token attr-name">for</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>element-1<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Phone number<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>label</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>tel<span class="token punctuation">"</span></span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>element-1<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span></code></pre> <p>The browser infers the accessible name for the input from the label, so no extra work is required, the input will appear in the accessibility tree with a sensible name. </p> <p>You can also label an interactive element without rendering the label on screen, with a <code>title</code> attribute:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>audio</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>great-song.mp3<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Great song<span class="token punctuation">"</span></span> <span class="token attr-name">controls</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>audio</span><span class="token punctuation">></span></span></code></pre> <p>‘Great song’ will be used as this audio fragment’s accessible name, so a user trying to figure out what this audio file is, will be presented with a label.</p> <h3>Descriptions</h3> <p>There are various native ways to associate a description with an element, for example: </p> <ul> <li>a <code>&lt;legend&gt;</code> in a <code>&lt;fieldset&gt;</code></li> <li>a <code>&lt;caption&gt;</code> in a <code>&lt;table&gt;</code></li> </ul> <p>None of the above are interactive elements, though. This is because for interactive elements, there is no implicit method to add a description without ARIA. </p> <h2>Labelling with ARIA</h2> <p>For some elements there are no labelling methods that use standard HTML. The <code>&lt;label&gt;</code> element, to name one, is just there for form controls. WAI-ARIA allows for more explicit association of labels, with these two properties: <code>aria-labelledby</code> and <code>aria-describedby</code> .</p> <h3>Labels</h3> <p>With the <code>aria-labelledby</code> attribute, you can use another element as the label for your interactive element. This is for cases where no native labelling method is available.</p> <p>The value of <code>aria-labelledby</code> should be the ID of the element that labels it. You can even add multiple IDs (separated with spaces). Use with care, as in many cases this would cause the label to be unhelpfully long.</p> <p>Example:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>label-lasagna<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Lasagna recipe<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">></span></span>To make this lasagna, just follow these 10 simple steps! <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>/posts/name-change<span class="token punctuation">"</span></span> <span class="token attr-name">aria-labelledby</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>label-lasagna<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Read more<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">></span></span></code></pre> <p>“Read more” is not a useful label, as you can imagine what would happen if this component is repeated a couple of times on a given page. A screenreader user tabbing through the links on the page would just hear:</p> <p><code>Link Read more Link Read more Link Read more</code></p> <p>As the title above the text, I have chosen something that <em>would</em> work well as a label for the link text. I’ve associated it with <code>aria-labelledby</code> . In many screenreaders, a user that tabs over the link will hear ‘Link Lasagna recipe’ instead of ‘Read more’ (<a href="https://www.powermapper.com/tests/screen-readers/labelling/a-aria-labelledby/">PowerMapper</a> have comprehensively tested this technique).</p> <p>Another example: </p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h3</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>label-song-4<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>4: It never entered my mind<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h3</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">></span></span>The fourth song, “It Never Entered My Mind” is a show tune from the 1940 Rodgers and Hart musical Higher and Higher (1940), where it was introduced by Shirley Ross. The Miles Davis recording was used in the movies Runaway Bride (1999) and the Lenny Bruce biopic Lenny (1974).<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>audio</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>4-mind.mp3<span class="token punctuation">"</span></span> <span class="token attr-name">controls</span> <span class="token attr-name">aria-labelledby</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>label-song-4<span class="token punctuation">"</span></span><span class="token punctuation">></span></span></code></pre> <p>This exposes ‘4: It never entered my mind’ as the accessible name of our audio fragment. When a user tabs onto the audio button, a screenreader should read out the title (this is in theory; in practice, support for <code>aria-labelledby</code> on <code>&lt;audio&gt;</code> is actually <a href="https://www.powermapper.com/tests/screen-readers/media/audio-aria-labelledby/">quite bad</a>).</p> <p>If, for some reason, your label is not visible on screen and you want to add it for screenreaders only, you can also use <code>aria-label</code> with the actual label text as its value. I would not recommend this in most cases — if a label is helpful, why only show it to some of your users?</p> <h3>Descriptions</h3> <p>The <code>aria-describedby</code> lets you associate an element with another element as its description.</p> <p>Example:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>checkbox<span class="token punctuation">"</span></span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>accept-terms<span class="token punctuation">"</span></span> <span class="token attr-name">aria-describedby</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>small-print<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>label</span> <span class="token attr-name">for</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>accept-terms<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Accept our terms<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>label</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>small-print<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Note that upon accepting our terms, you also agree to us calling you with offers for beautiful kitchens, mortgage plans and magazine subscriptions.<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">></span></span></code></pre> <p>The small print text will display, but by associating it with <code>aria-describedby</code> you make it easy for assistive technologies to provide a description for the input to their users.</p> <p>This can help screenreader users that are tabbing through the form, to make a better choice about whether to accept the terms.</p> <h2>Future-proofing labels and descriptions</h2> <p>Arguably, the best labels and descriptions are the ones that are up to date. The ones that have been added properly and provide useful, sensible text, explaining what a control is for. </p> <p>This is harder than it may sound. As Mark Pilgrim concludes in <a href="https://blog.whatwg.org/the-longdesc-lottery">his post about longdesc</a>, a theoretical solution does not necessarily provide ease of use to your users. He cites statistics that say that “less than 1% of images that provide a longdesc attribute are actually useful”. Wow! </p> <h3>Risk of breakage</h3> <p>One way less useful labels can make their way into your product, is because of human error or even unintended sloppiness. By yourself, by another team member, by a team member 3 years from now. A developer could add the proper associations now, only for someone later in the process to break it unintentionally.</p> <p>Maybe one of the content editors forgot that a heading was associated as a button’s label, and changes it into something that no longer labels it. Or it could be that a developer isn’t aware of the latest <code>aria-*</code> attributes and breaks something. Note that such breakages can happen without anyone noticing.</p> <h3>Avoiding breakage</h3> <p>An approach to get most out of your labels in the long run: make sure the labels and descriptions can be seen by everyone on your product team and by all of your users. It then happens where everyone can see it, which helps fixing any breakage as it happens. </p> <p>Another thing that can help is to have a component based approach. In a component, you would usually associate variables rather than actual values (i.e. <code>aria-labelledby=&quot;&quot;</code> instead of <code>aria-labelledby=&quot;might-forget-this-is-here&quot;</code> .)</p> <p>Lastly, I would recommend making sure the labelling approach is addressed in documentation and that all testers / reviewers in your team(s) are aware of what the attributes do, so that they can spot any issues before they go live.</p> <h2>In conclusion</h2> <p>To help all users make sense of your page, ensure all interactive elements are properly labeled and have descriptions where appropriate. There are several native techniques to do this, as well as ARIA attributes.</p> <p>To associate <em>labels</em> with interactive elements, always prefer native methods as they will have the best browser support and there is most chance your users and other developers are familiar with them. If native labelling really is not possible, use <code>aria-labelledby</code> (if label is rendered on screen) or <code>aria-label</code> (if label is not rendered on screen). To associate <em>descriptions</em> with interactive elements, use <code>aria-describedby</code> .</p> <h3>Further reading</h3> <ul> <li><a href="https://www.paciellogroup.com/blog/2015/01/the-browser-accessibility-tree/">The Browser Accessibility Tree </a>, article by The Paciello Group with examples of accessibility trees in Firefox, IE and Chrome for <code>video</code> elements</li> <li><a href="https://www.smashingmagazine.com/2015/03/web-accessibility-with-accessibility-api/">Web Accessibility with the Accessibility API</a> by Léonie Watson and Chaals McCathie Nevile on Smashing Magazine</li> <li><a href="http://usability.com.au/2013/04/accessible-forms-1-labels-and-identification/">Labels and identification</a> at Web Usability</li> <li>The spec on <a href="https://w3c.github.io/html-aam/#accessible-name-and-description-computation">how labels and descriptions are computed</a></li> </ul> <hr/> <p>Originally posted as <a href="https://hidde.blog/accessibly-labelling-interactive-elements/">Accessibly labelling interactive elements</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Accessibly labelling interactive elements">Reply via email</a></p> I, Daniel Blake 2017-05-24T00:00:00Z https://hidde.blog/i-daniel-blake/ <p>In what was a truly inspiring afternoon at the client last week, we watched the English film <em>I, Daniel Blake</em>. It is about a carpenter of nearly the pension age, who applies for income support following a heart attack.</p> <p>The client is a semi-government organisation that builds software for citizens to manage income support applications online. When I first watched <em>I, Daniel Blake</em> when it came out in November last year, I was moved, but also inspired. This film was about the very thing we were working on, and there was so much to be learned from it.</p> <p>The plot of the film, which won the Palme d’Or at Cannes in 2016, is fairly simple (spoilers ahead). Mr Blake wants to apply for income support, as his doctor has told him he should not work. For some reason, his application gets denied. A mountain of bureaucracy follows soon after. The staff tell him he could appeal, but as an appeal could take months, they recommend him to apply for job seekers’ allowance instead. He does so, but is then asked to prepare a CV and apply for jobs, which he ends up getting offered but cannot take because of the aforementioned doctor’s advice. Mr Blake patiently jumps through all the hoops the system forces upon him, until the point he does not want to take it anymore.</p> <p><img src="https://hidde.blog/_images/blake.jpg" alt="On the left a man in front of graffiti that says I, Daniel Blake; on the right staff in an office" /> <em>Stills from the film</em> </p> <h2>People as numbers</h2> <p>In the film, Mr. Blake often tells staff he engages with about his heart condition. He’s the example of a perfectly reasonable person. Yet he finds they ignore what he says, and are only willing to look at what the system says about him (which is: ‘application denied’).</p> <p>The film shows a bureaucratic system that regards people as applicants, service users or ‘clients’: like numbers. I don’t think that is <em>inherently</em> good or bad. All software that deals with people represents them as fields in a database. I guess this aids efficiency: if all people are in a database, it is easier to make estimates, identify people and their details, et cetera. This only turns into a problem when people are also <em>reduced</em> to numbers. If the number are the <em>only</em> thing the system is interested in.</p> <p>What happens to Daniel Blake is an example of the latter. Was he treated humanly, a heart attack and a doctor’s recommendation would be plenty of indication for the system to just give him the income support he applied for. Now that he is treated only as a number, the system forces him to jump through hoops needlessly.</p> <h2>Human judgment</h2> <p>Services that used to be mostly physical are transforming to their mostly digital equivalents. Although I am just a front-end developer, I am often involved in teams that realise such transformations. Most of my work revolves around trying to make interfaces easier to use and being inclusive to all who need to use them. <em>I, Daniel Blake</em> was a good reminder that those ambitions can still leave people frustrated.</p> <p>However user-friendly we try to make our interfaces, a digital service is not going to help everybody. Sometimes the best interface is an actual human being that helps people. Machine judgment is great and efficient, but the system needs human judgment. Equipped with appropriate authorisations, humans trump digital services: the very person sending Mr. Blake to a cv workshop could have just authorised his income support (and gotten on with the next applicant – now <em>that’s</em> efficiency). To help him skip the hoop-jumping.</p> <p>It was fantastic to get the chance to watch this film with colleagues, and I can’t recommend it enough to peers who work on digital services (government or otherwise). I’ve heard some say it is overly dramatic. It may be, but I found it realistic and close to reality, too. Looking forward to hearing what others think about it!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/i-daniel-blake/">I, Daniel Blake</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20I, Daniel Blake">Reply via email</a></p> ICONS: five questions about screen readers 2017-06-02T00:00:00Z https://hidde.blog/icons-five-questions-about-screen-readers/ <p>This week I attended the last ICONS meetup of this academic year, which had as its speaker Léonie Watson. She shared five questions related to screen readers.</p> <p>ICONS is an event organised by the design department of the Hogeschool van Amsterdam. They invite (web) design related speakers, as well as students and people working in the web industry, so that they can meet each other and learn stuff. Awesome! I took some notes of Léonie’s talk, please find them below. </p> <p><img src="https://hidde.blog/_images/leonie.jpg" alt="Léonie presenting; slide about dom manipulation" /> <em>Léonie Watson in Amsterdam</em></p> <h2>Five questions</h2> <h3>Who</h3> <p>Some might think screen readers are just used by blind people. Léonie explained they have a broader audience: people with impairments in the autistic spectrum use them (screen readers provide a way to navigate information with less distraction) and people with some forms of dyslexia (as listening may be easier for them than reading). In the future, many others may use audio to navigate information: think about digital assistents like Siri and Cortana, or voice interfaces in the car.</p> <h3>What</h3> <p>A screen reader, Léonie explained, ‘translates on-screen content into synthetic speech’. Some can also do braille, but equipment for this can be costly. They are available on most platforms, including mobile platforms. Some are free (NVDA, VoiceOver), others can be quite expensive (JAWS). They don’t read the whole page as if it were plain text (as they used to do in the old days), they interpret a page structure and let their users benefit from shortcuts. For instance, a screen reader user could navigate through just headings, or press the ‘read next paragraph’ shortcut. </p> <h3>Where</h3> <p>Most of the interpretation for screen readers happens on the OS level. Things in the OS expose their role, name and state, and through platform level accessibility APIs, this information is referred to the screen reader. There exist accessibility mappings between the OS and the browser. Note that browsers don’t always support all accessibility features: they sometimes support a new web platform feature, without also accessibility supporting it. Which means: </p> <blockquote> <p>(…) it is usable by people who rely on assistive technology, without developers having to supplement with ARIA or other additional workarounds.</p> </blockquote> <p>(source: <a href="http://html5accessibility.com/">HTML5 Accessibility</a>, a website that holds information on accessibility support in browsers)</p> <h3>When</h3> <p>In the browser, an accessibility tree is generated based on information in the DOM tree. This process basically means that the browser is figuring out what the role, name and state of things are, and puts them in a tree. Screenreaders use platform APIs to access information in this tree, and then make all the shortcuts possible for their users. </p> <p>A quick note on this: as a front-end developer, you can directly influence what information gets exposed by making sure you use a semantic HTML structure and get your labelling right (see also: <a href="https://hiddedevries.nl/en/blog/2017-05-05-accessibly-labelling-interactive-elements">Accessibly labelling interactive elements</a>). States are harder, but there are native HTML attributes available for this (i.e. <code>hidden</code> and <code>open</code>, as well as ARIA polyfills).</p> <h3>Why</h3> <p>Then, the last question: why? This was mostly aimed at designers and developers <em>making</em> websites: why would they support screen reader users? Léonie gave lots of reasons: it feels good, it’s fun to work on something others enjoy using (isn’t that why we add subtle animations, choose good looking and nicely readable fonts, make our stuff load fast etc). Secondly, it is a professional responsibility to ensure what you make is usable. Thirdly: as a designer or developer, you have a choice (as opposed to the users that rely on screen readers to access your product). </p> <p>These five questions are certainly something to think about when you are making websites that are used by people who rely on screen readers. And that’s very likely to be every website or web application. </p> <p>It was a pleasure, as always, to hear Léonie talk about using screen readers and share her knowledge. Thanks to the HvA for setting up this event!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/icons-five-questions-about-screen-readers/">ICONS: five questions about screen readers</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20ICONS: five questions about screen readers">Reply via email</a></p> Browser API Special and CSS Day 2017-06-16T00:00:00Z https://hidde.blog/browser-api-special-and-css-day/ <p>This week, the 5th edition of the yearly CSS Day took place. It was preceded this year by something called Browser API Special: a full day about JavaScript APIs. </p> <p>I’ve done a quick writeup below, with some of my takeaways and some things I thought were quite brilliant. If you’re interested in more of CSS Day, the organisers have announced there will be another edition next year, updates for which are available through the <a href="https://cssday.nl/2018">newsletter</a>. If you want to experience more of this year’s edition, there will be videos!</p> <h2>Access to almost <em>everything</em> through JavaScript</h2> <p>The general theme of Browser API Special was that browsers are starting to expose <em>so much stuff</em> via JavaScript. Animation, virtual reality, payments… more and more is made available through useful (and some less useful, see below) DOM APIs. </p> <p>The day started with <strong>Rachel Nabors</strong>, who explained how CSS transitions, CSS animations and SVG animation standard SMIL are now combined into one Web Animations API. This API provides a bunch of methods to let us animate stuff on the web more efficiently. Her examples were helpfully based around Alice in Wonderland. This made the code examples much easier to understand (<code>cake.animate()</code> instead of <code>foo.animate()</code>).</p> <p>Then <strong>Peter-Paul Koch</strong> <a href="https://quirksmode.org/presentations/Spring2017/formvalidation_CSSDay.pdf">counselled us</a> (PDF) on the usefulness of <code>:valid</code>/<code>:invalid</code> in CSS and the <a href="https://developers.whatwg.org/association-of-controls-and-forms.html#association-of-controls-and-forms#the-constraint-validation-api">Constraints Validation API</a>. The latter is a standard that, in theory, lets us offload the logic of dealing with form validation and requiredness onto the browser. It and the CSS pseudo classes contain <em>some</em> helpful stuff, but there are issues with timing (errors on <code>keypress</code> or <code>submit</code>, where <code>blur</code> would make more sense), customisability (can’t change what the error message is) and stylability (can’t style error messages).</p> <p><strong>Philip Walton</strong> then went into how to polyfill stuff in CSS, or in other words: add custom functionality to it. Wait, wut, extending CSS via JavaScript? Yes! Suppose you would like to have a <code>random()</code> function in CSS that you could use within <code>calc()</code>, what would you need to do to make it work? Browsers let us access the CSS Object Model, but using that to then try and replicate cascading and media queries and what not <em>after</em> the browser has already evaluated all its stuff raises the question: <em>why doesn’t the browser help us a bit here</em>? Houdini has a set of low-level JavaScript APIs that let us access the stuff browsers do when parsing CSS (paint, layout, parsers, etc), which is awesome as it lets us interact with our custom functionality right in the browser dev tools.</p> <p><strong>Ruth John</strong> <a href="https://github.com/Rumyra/Talk-Web-Audio">showed</a> us that websites that are enhanced with audio aren’t always an awful thing: wonderful experiences can be made with it as long as we’re considerate and subtle. She also showed what the code looks like to interact with fragments of audio. From creating a new <code>AudioContext</code> to using that to do all sorts of wonderful things. You can use Web Audio API to create your own sounds or do so with the help of MIDI devices. Very inspiring! </p> <p><strong>Ada Rose Edwards</strong> asked us all to put on the VR headsets that had been handed out during the breaks, and showed us some cool demos of WebVR. There was even one that had ourselves in it, which was an interesting experience. At some point it had 178 of us logged in at the same time. </p> <p><strong>Mike Taylor</strong> <a href="https://miketaylr.com/pres/browser-api-day/">shared</a> all sorts of weird things that are now in browsers and probably will be in browsers for the foreseeable time, for all kinds of weird and usually historic reasons. He explained it is good if functions don’t have all sorts of side effects, and that <code>window.showModalDialog</code> does. How stuff gets capitalised is complex and various mistakes have slipped into browsers regarding this. Vendor prefixes can be hard to get out of browsers once they are no longer needed.</p> <p><strong>Patrick Kettner</strong> went into Progressive Web Apps and kind of showed how turning your app into one can benefit your app’s potential: it can show up in the Windows app store (as Bing indexes PWAs and can automatically add them into the store if you want that), and lets you access platform APIs for things like Bluetooth and media keys from the browser.</p> <p><strong>Chris Wilson</strong>, who was the first to implement CSS in a browser (<em>way</em> back), talked about both managing credentials of users (and ways to make that easier for users) and the Web Payments API. This lets the browser be aware of a user’s payment methods and allow users to pay from their browser. Lots of food for thought, i.e. what sort of new payment providers will come up, and will it be useful if the Dutch iDeal system hooks into this (I think it already works very well on mobile, but this may vary per bank)?</p> <p>There was so much stuff in today’s talks that, had you asked me five years ago, I would have thought could only be done in native apps. Native apps have traditionally been able to do more with hardware than web apps, but that seems to have rapidly changed. This is a good time to be a web developer.</p> <h2>The history, current state and future of CSS</h2> <p>Day two had everything in it from the history to the future of CSS. Generally speaking, I was very pleased to see into how much detail many of the speakers went. As someone who writes CSS almost daily, I benefit a lot from its simplicity. A lot of things happen automatically and ‘just’ work. To make that possible, specifications and browsers <em>do</em> tend to get quite complex and detailed. CSS Day 2017 was a great chance to learn more about those details, and will likely help me get even more out of CSS.</p> <p>CSS-inventors <strong>Bert Bos</strong> and <strong>Håkon Wium Lie</strong> opened the day. I had seen both talk before, but never in the same room. They used their session to reflect on stylesheets: what would they have done differently, what are they happy with? The syntax, absolute positioning, collapsing margins and scrollbars were some things the two would have liked to have a second chance at. </p> <p><img src="https://hidde.blog/_images/howcome-bert.jpg" alt="Howcome bert" /> <em>Bert and Håkon looking at the first proposal for “Cascading HTML stylesheets”. “HTML” was dropped from the name, as there were other markup languages around and stylesheets seemed fit for those, too.</em></p> <p>An interesting aspect in the discussion: CSS was meant for <em>documents</em>, which is what Bert and Håkon had a history in, as opposed to <em>UIs</em>. There has been talk about a second language to do UI styles. An example of a difference: documents benefit from collapsing margins and text flowing the way it does, but that kind of stuff can get frustrate styling UIs. </p> <p>Another fascinating topic was that they would have loved CSS to consider wholes rather than parts. In order for something like ‘make all p’s display in italics’ to work, an alghoritms can do this thing by thing. In order for something like grid to work, an alghorithm needs to consider the whole (sub)tree and place stuff. </p> <p>A general theme I took from Bert and Håkon’s discussion was that so much effort was put into <em>keeping CSS as simple as possible</em>. Stuff like the cascade: it was put in so that authors can write a lot less CSS. Food for thought! </p> <p>After this magnificent opening, <strong>Rachel Andrew</strong> <a href="https://www.slideshare.net/rachelandrew/what-i-learned-about-layout-vis-css-grid">talked to us</a> about CSS Grids. I loved how the talk really went into the nitty gritty, and I have lots to look up at home: blockification and inlinification for example, and the difference between outer and inner display types. Rachel also went into why subgrid is not happening (yet) and what makes it hard to replicate with other CSS properties. She also explained how CSS Grid’s writing mode awareness impacts its syntax. Lastly, a great tip she gave: if you’re confused about what your Grid is doing: try and use longhand syntax to make debugging easier.</p> <p>After the break, <strong>Mark Boulton</strong> gave us an introduction in grid design for the web. After a bit of graphic design history, and making the argument against just using 12-column grids for everything (hello Bootstrap!), he explained a grid design method: start with a constraint, base units on that constraint and then create a grid based on those units. All of this, he emphasised, fits the best order to grid design: start with content and base a grid around that, not the other way around.</p> <p><strong>Jen Simmons</strong> talked about Writing Modes in CSS: a standard that lets us build websites with content in all modern (spoken) languages, whether they are written horizontally or vertically, left to right or right to left. There are major differences here in languages: Arabic (rtl), Mongolian (vertical, ltr) and Han-based languages (vertical, rtl or horizontal, ltr). Inline direction and block direction are important aspects in understanding Writing Modes (check the spec for details). If you’ve switched writing modes (with <code>lang</code> and <code>dir</code> attributes), the browser will then do its stuff (create space for elements; apply cursors, etc) with the correct writing mode in mind. </p> <p><img src="https://hidde.blog/_images/jen.jpg" alt="Jen" /> <em>Jen Simmons with her slide that shows examples of ‘logical properties’ in CSS: rather than ‘left’ and ‘right’, ‘start’ and ‘end’ are more meaningful as they are direction-agnostic.</em></p> <p>Variables may be a thing most CSS developers know from preprocessors, but they have become a (well-supported) thing in CSS. With <code>--foo: bar</code> we can set custom properties, and <strong>Gregor Adams</strong> <a href="http://slides.com/gregoradams/css-variables-are-a-game-changer#/">showed</a> some amazing examples of what can be done with that. A supports table where properties were updated within <code>@supports</code> queries so that they only got the <code>true</code> value when the feature is supported (this works because they are scoped), as well as an actual working calculator. Awesome stuff! </p> <p>The author of many modern CSS specs, <strong>Tab Atkins</strong>, was in today to <a href="http://www.xanthir.com/talks/2017-06-16/">tell us</a> all about Houdini, which is a set of JavaScript APIs (and some CSS stuff) that makes CSS extendible by its users. If the community goes ‘we’d like masonry in CSS’ or ‘can we have a random() function?’, it will soon be able to add those things to CSS themselves, using JavaScript. His talk contained near future stuff like methods to <a href="https://www.w3.org/TR/css-properties-values-api-1/">register custom properties</a>, as well as new things that are yet to be finalised, like custom units and custom paint functionality. And then there was stuff that really does not (yet) exist: a <code>CSS.parseRule()</code> method so that we don’t have to reimplement all stuff browsers do with CSS in our own JS libraries, custom functions and custom <code>@-</code> rules.</p> <p><img src="https://hidde.blog/_images/tab.jpg" alt="Tab" /> <em>Tab Atkins introducing what could be quite a simple way to define custom functions in CSS (does not exist yet)</em></p> <p>The last block of talks started with CSS-Tricks and CodePen founder <strong>Chris Coyier</strong>. In a talk full of questionable pop music, but also many tasteful examples, he showed us best practices for making a fan site for our favourite band. Four properties were central to his talk: <code>shape-outside</code>, <code>offset-path</code>, <code>clip-path</code> and <code>d</code>. He demoed how they can help making a lyrics page have more interesting visual effects. All four are awesome properties well worth checking out, but <code>d</code> stood out to me: its value is a <code>path()</code> function that lets you override a <code>path</code> in an svg. I had no idea this sort of stuff could be done! </p> <p>Closing this wonderful day was <strong>Stephen Hay</strong>. He talked about various things that people with bad intentions can do to exploit security issues caused by bad (but also good) CSS. Who would have thought that using classnames could lead to vulnerabilities? Some stuff is luckily no longer possible, like adding JavaScript into the <code>url()</code> method of CSS backgrounds and looking into a user’s browsing history with <code>getComputedStyle</code> on visited links. Stephen also discussed dark patterns, like unsubscribe flows that lure you into resubscribing.</p> <p>I’ve had a blast! After having worked as conference staff for the first 4 editions, this year I had the honour to work on the design part of CSS Day, doing poster, slide and badge designs with silly CSS jokes on. I was happy (<em>almost</em>) all of it worked out well. And that I got to watch all the talks!</p> <p>The talks were just fantastic. There are a lot of specs and APIs that I will have to read up on, but I’ve also learned plenty of practical stuff to use at work straight after this weekend. It was awesome to see how much effort spec writers and browser makers put into making stuff easier and simpler for both end users and web developers. They also do more complex stuff: Houdini comes to mind. Although that might not be fair: Houdini will help people extend CSS, and although the <em>extending</em> itself may be complex for people who normally write CSS, making <em>use</em> of extensions can be made very simple. Just like existing CSS properties and functionalities.</p> <p>For those who have missed this year’s edition, as I said before, there will be a <a href="https://cssday.nl/2018">UX Special and CSS Day</a> next year: 14-15 June 2018 is the date to save!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/browser-api-special-and-css-day/">Browser API Special and CSS Day</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Browser API Special and CSS Day">Reply via email</a></p> Pseudo classes vs pseudo elements 2017-06-22T00:00:00Z https://hidde.blog/pseudo-classes-vs-pseudo-elements/ <p>Something I thought I knew, but found out this week that I did not: the exact difference between pseudo classes and pseudo elements in CSS.</p> <p><strong>Pseudo classes</strong> let you style an element based on its <em>state</em>, says <a href="https://developer.mozilla.org/en/docs/Web/CSS/Pseudo-elements">MDN</a> (<code>:checked</code>, <code>:valid</code>, <code>:disabled</code>). This also implicates that they refer to an <em>existing</em> element: something that is already in the DOM available to style. </p> <p>As a rule of thumb, what a pseudo class offers, you could have achieved with a classname. Not that that would be very practical – for most pseudo classes you would need to detect some stuff with JavaScript to work out the state and add that class; so yay CSS for providing this!</p> <p><strong>Pseudo elements</strong> let you style things that are not actually elements. They can be parts of existing elements (<code>::first-letter</code>, <code>::first-line</code>), including parts that exist temporarily (<code>::selection</code>). Generated content also falls within the pseudo elements bracket (<code>::before</code>, <code>::after</code>). </p> <p><img src="https://hidde.blog/_images/rachel-andrew.jpg" alt="Rachel andrew" /> <em>Rachel Andrew said it beautifully at CSS Day 2017: “The more I know about CSS, the more I realise I don’t know” (photo: Bernardo Baquero)</em> </p> <p>Thanks <a href="https://krijnhoetmer.nl/">Krijn</a> for pointing me to this.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/pseudo-classes-vs-pseudo-elements/">Pseudo classes vs pseudo elements</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Pseudo classes vs pseudo elements">Reply via email</a></p> Coherence, Lego and how naming things is hard: Patterns Day 2017 2017-07-01T00:00:00Z https://hidde.blog/coherence-lego-and-how-naming-things-is-hard-patterns-day-2017/ <p>Pretty much all of my projects in recent years have involved pattern libraries: setting them up, promoting their usage and coding actual patterns. So when Jeremy Keith of Clearleft announced he would host a Patterns <em>Day</em>, I bought a ticket instantly. A full day of design system nerdery sounded like a great thing to travel to Brighton for. And it was definitely worthwile…</p> <p>Pattern libraries can be hard to get right: not only do you need to gather patterns and put them in a library, you’ll likely also want to avoid code repetition, make sure they integrate with your application code, get others in your organisation to care for and use the library and find a way to make the distinct modules you’ve created form one sensible whole. Patterns Day conference covered all of these subjects and more. </p> <p>Audio of the day is available as <a href="https://huffduffer.com/adactio/tags/patternsday">podcast on Huffduffer</a>, videos have also been recorded and will probably follow soon.</p> <h2>The talks</h2> <p>The conference had a fantastic start with <strong>Laura Elizabeth</strong>, who talked about selling design systems. She said they are great as they ensure consistency, shared vocabulary and understanding of the medium for less technical people. They also have problems: keeping them maintained is hard, they are a lot of work (often underestimated), and there is a chance they won’t be worth the investment. Laura explained that making the case for design systems can be a two step process: first, find a common pain, then gather data. According to her, a pattern library works when the need for it is <em>equal to or larger than</em> the effort require to build it (and that effort is usually huge). My main takeaway from this talk was: if you want to do well at selling your pattern library, be aware of potential shortcomings and gather data to support your claims. </p> <p>The second talk of the day was by <strong>Ellen de Vries</strong> (we’re not related, not as far as I know anyway). Her talk was lots more theoretical and went into what it means for a system to be coherent. One way to improve coherence, and this is something we can learn from architecture, is to look at more than just the parts and consider the usage of our designs by people and the larger world around the design (when a performance area is designed for a park, the designer could consider what the charge for attending concerts should be). A story in books or films can be defined as personal experience in space over time. A story in books is a more fragmented experience: content guidelines can help users make more sense. </p> <p>After the break, <strong>Sareh Heidari</strong> took the stage. She works at BBC News and told us about both their design language (<a href="http://www.bbc.co.uk/gel">GEL</a>) and their approach to CSS architecture (<a href="https://github.com/bbc/grandstand">Grandstand</a>). Turning things into a pattern helps avoiding the repetition of CSS. Grandstand has namespaced objects and utilities, but also mixins to aid localising typography and grids. These mixins effectively turn direction-dependent properties into direction-agnostic ones, so that one rule can be used in generation of stylesheets for both left-to-right and right-to-left languages. Sarah also emphasised how important communication is, if you want to keep your codebase lightweight (challenge those who want to add new variations, they might not be absolutely necessary). </p> <p><img src="https://hidde.blog/_images/img9872.jpg" alt="Sareh Heidari presenting at Patterns Day" /> <em>Sareh Heidari explaining mixins for localisation</em> </p> <p>In the next talk, <strong>Rachel Andrew</strong> discussed two bits of software I use almost daily: Fractal (a component library tool) and Perch (the CMS this website runs on). She recommended making your pattern library the single source of truth for UI styles (as <a href="http://patterns.perchcms.com/">the Perch one</a> is for Perch’s UI), and choosing a pattern library approach that makes renaming trivial (as Fractal does) so that you don’t need to worry too much about naming. A pattern page is like a reduced test case, Rachel said, and they’re great for experimenting in isolation. I had never thought of it like that, but realised that is certainly something I use pattern pages as.</p> <p><img src="https://hidde.blog/_images/img9874.jpg" alt="Rachel Andrew presenting at Patterns Day" /> <em>Rachel Andrew showing Perch’s Fractal instance</em> </p> <p>After the lunch break, <strong>Alice Bartlett</strong> talked about the Financial Times’ <a href="http://origami.ft.com/">Origami</a> pattern library, specificly about what’s next when you’ve built your actual library. She explained templating is ok for a specific stack, but hard (impossible?) to do right if your organisation has multiple stacks. No templating at all is likely a bad idea that causes duplication and makes simple changes like classnames hard. Serving CSS/JS is easy if you serve everything always (can work if your site is not too complex), but separation can be done. Origami has a repo for each individual pattern so that projects that use it can use just what they need (or include just that from the Origami CDN if they don’t want to bother with asset management). Rule for all of this: choose the simplest for the job (the best tooling is no tooling!). Alice also went into non-technical aspects of pattern library success in big organisations: have fantastic documentation, put effort in making sure people in your organisation are aware the pattern library exists (so: do marketing, basically) and have a support channel and incident reports. </p> <p><strong>Jina Anne</strong> did something completely different and read a story to us, which was beautifully illustrated on the slides that complemented it. I’l have to refer you to the videos for this. </p> <p><strong>Paul Robert Lloyd</strong> let us look at the bigger picture, with some interesting examples from architecture. He asked a number of thought-provoking questions about how our choices are informed: is there room for irrationality when our design systems embrace mathematical precision, do the tools we use dictate our approach to design systems (like Photoshop’s ’New File‘ screen asking for dimensions), does culture affect our decisions and do we serve the interests of the organisation we work for or those of the people affected by our work?</p> <p>The last talk of the day was by <strong>Alla Kholmatova</strong>, who has spent years researching design systems and how companies use them. For <a href="http://designsystemsbook.com/">her forthcoming book</a>, she interviewed style guide people from various large companies. Her talk was about three aspects where design system implementations can differ: strictness, modularity and organisation. The first is about how strictly the system is enforced: are there rules that no one can differentiate from and strict processes for new pattern addition? Or is the system quite loose, and do you rely on your people’s familiarity with the design principles and allow for flexible and expertimental use of those? Modularity then: do you stictly separate everything into modules (high investment, but potentially cost saving in the long term) or is it acceptable to produce designs that are quite specific (and potentially easier to build, but harder to scale)? And lastly, organisation: is it centralised or distributed? Is there one team that creates and vets everything (more reliable, but potential bottleneck), or can people across all teams contribute (more autonomy, but potentially dilutes creative direction)? These three aspects provide a great way to think about what kind of design system works for your organisation. With examples from AirBnB to TED, Alla showed that different companies make different choices on these scales, and she recommended us to make our own choices: ’the right design system is probably not someone else’s design system‘, she concluded.</p> <p><img src="https://hidde.blog/_images/img9873.jpg" alt="Alla Kholmatova presenting at Patterns Day" /> <em>Alla Kholmatova: the right system for you is not someone else’s system</em></p> <h2>Takeaways</h2> <p>These are some of my takeaways and things I felt recurred across the different talks:</p> <ul> <li>Moving from a static page comp approach to working on pattern libraries can completely change our way of thinking about making websites. A pattern page as an isolated test case is one of those things. </li> <li>Wholes are just as important as parts: it’s great we spend time on isolated components, but the end user experiences however they’ve ended up being used together, it is important not to lose sight of that. </li> <li>There are many complex solutions (like static asset APIs, versioning, templating to serve multiple stacks), but your organisation’s problems may not require them. Keep it simple if you can, introduce more complex solutions if your research shows you have to.</li> <li>Marketing your pattern library is a thing, especially in bigger organisations. People can also build web products using their own code or Bootstrap. It’s unlikely for others to promote your pattern library, so if you want it to be success you’ll have to put your sales hat on.</li> <li>We aren’t the first people to solve these kind of problems: architects (of buildings) have long worked with modules and wrote at length about making them work in wholes. </li> </ul> <p>In his closing remarks, Jeremy asked if he should do another Patterns Day next year. For what it’s worth, I would love to attend another one! There’s lots more to discuss and a year later, more of our shared problems will have likely been solved by people. I would love to hear more about, for instance, how to test for accessibility in a pattern library world.</p> <p>I’m looking forward to bringing some of the stuff I learned into practice when coming back to work next week!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/coherence-lego-and-how-naming-things-is-hard-patterns-day-2017/">Coherence, Lego and how naming things is hard: Patterns Day 2017</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Coherence, Lego and how naming things is hard: Patterns Day 2017">Reply via email</a></p> Did CSS get more complicated since the late nineties? 2017-07-03T00:00:00Z https://hidde.blog/did-css-get-more-complicated-since-the-late-nineties/ <p>The first hour of <a href="https://cssday.nl/2017">CSS Day 2017</a> was truly memorable, as the very inventors of the language took the stage. They brought back memories of the early days of CSS. It was the year 1994. There were lots of documents and they needed styling. </p> <p>One of the things that stood out for me was their discussion of what they wanted CSS to be: as simple as possible. This is a thing today’s CSS language still resembles. Want something to have a red color? <code>something { color: red; }</code> is all you need. But while the language itself is simple, the structures we build with it today are often not. </p> <p>Really, ‘simple’ is not a qualification suitable for the CSS codebases I have worked on in the recent past. The same might go for you. Near the end of the session, someone mentioned Internet Explorer has a maximum of 6000 or so CSS rules allowed (<a href="https://blogs.msdn.microsoft.com/ieinternals/2011/05/14/stylesheet-limits-in-internet-explorer/">4095, actually</a>). Bos and Lie wondered whether anyone would need that many rules. With some embarrassment, I’ll admit that I once worked for a large Dutch consumer brand where we encountered this maximum, and ended up splitting our stylesheet into two separate stylesheets. </p> <p><img src="https://hidde.blog/_images/screen-shot-2017-07-03-at-23.10.13.png" alt="Screenshot" /> <em>Screenshot of the proposal for Cascading HTML Style Sheets</em> </p> <h2>Simplicity was a core design principle</h2> <p>From the <a href="http://1997.webhistory.org/www.lists/www-talk.1994q4/0153.html">early mailing lists</a> and <a href="https://www.w3.org/People/howcome/p/cascade.html">the proposal of Cascading HTML Style Sheets</a> to Håkon Wium Lie’s <a href="http://www.wiumlie.no/2006/phd/">PhD thesis about stylesheets</a>, which reads as a detailed account of CSS’s genesis: there is quite a bit of information on the web about how CSS was designed. Keeping it simple was a core principle. It continued to be — from the early days and the first implementations in the late nineties until current developments now.</p> <h3>Authors can specify as much or little as they want</h3> <p>CSS authors can use the language to just set a font and line height for a document and leave it at that, or they can completely change the appearance of it. The <a href="http://www.wiumlie.no/2006/phd/#cascading">cascade</a> ensures this: even if no rules are applied by the CSS author, there is still the browser stylesheet or even user stylesheet to provide hints as to what the page should look like. Yes, the cascade is a principle that provides simplicity, not complexity.</p> <h3>It is not a programming language by design</h3> <p>CSS is a declarative language on purpose. It could have been a Turing-complete <em>programming</em> language, which would have been more powerful, but bad for simplicity: <a href="http://www.wiumlie.no/2006/phd/#h-321">difficult to read and expensive to maintain</a>. As Bert Bos mentioned in the session: ‘we wanted it to be so simple that everyone would be able to use it’.</p> <h3>They are agnostic as to which medium they are used for</h3> <p>From the early days, CSS has had <code>@media</code> constraints, so that authors could write different CSS rules for media like print and screen. All optional; if not specified, the rules would apply to all. They came up with ways to specify <em>which</em> medium some style rules are for, but most importantly, they thought about the applicability of the language outside the medium they were looking at then.</p> <h3>It is stream-based</h3> <p>Browsers can do <em>progressive rendering</em>, which means they show the document incrementally, while it is still downloading. It was important for CSS not to break that principle, which is the reason CSS is “stream-based” (as opposed to being a <a href="http://www.wiumlie.no/2006/phd/#h-66">transformation language</a>, which would allow more features, but also increase complexity). </p> <p>To summarise: CSS itself was kept simple, and it was designed to support unknown as well as existing stuff (and to not break that). It is non-intrusive, which I think is a characteristic that is hard to find in complex systems.</p> <h2>What has changed since?</h2> <p>So, let’s look at what makes modern CSS complicated. With modern, I mean after the late nineties. I think there are a couple of things. </p> <h3>Websites have become more than documents</h3> <p>CSS was made to style documents. At the time, they were things like a long Word document — think academic papers, reports and the like. Early CSS features aided those kind of documents: there was generated chapter and section numbering, ability to style the first line and page margins.</p> <p>Although we still call web pages documents, (I mean, who doesn’t <code>document.querySelectorAll</code> ?), they are often more than that. We now have loads more websites where you <em>do</em> stuff, rather than just read things: from transferring money to booking travel.</p> <h3>Tooling</h3> <p>I think hardly anyone still writes CSS by hand, I mean, in a <code>.css</code> file. I do it on some sites that I run myself, but it’s been a long time since I’ve seen it in my client’s codebases. </p> <p>Often, the reason is that CSS is written per component, with different files, and tooling is used to combine them into one file (<code>@import</code> would be too many HTTP requests). Other reasons are variables and mixins that are used with the goal of DRYer code (the latter, I think, can be <a href="https://hiddedevries.nl/en/blog/2015-04-20-solving-problems-with-css">quite problematic</a>).</p> <h3>Graphic design for the web professionalised</h3> <p>Early web pages often hadn’t a dedicated or professional designer. Most modern websites do. There are specialised teams caring in detail for branding and user experience, and this demands a careful approach to writing CSS. Front-end development teams adjusted their practice, they sometimes agree upon a systematic approach to classnames. They often prefix classnames with the project name (for this site, I could start all classnames with <code>hv-</code>). Some companies distinguish between objects and utilities and prefix those (<code>hv-o-thing</code>, <code>hv-u-thing</code>). Also, they have agreed on mostly using classnames as selectors, not IDs or tags. Attribute selectors are controversial in some companies (I personally love them). </p> <h3>Control over content and markup</h3> <p>CSS has always been able to work on unknown markup, but things have gotten more complicated in the sense that more content is now user generated, content changes faster (i.e. on news websites) and more markup has been abstracted by powerful and complex CMSes.</p> <h3>Component based architecture</h3> <p>Lots of companies have switched to a component-based approach, where they design and build components that can then be put together in whichever way they see fit. For CSS, this means that elements can be inside different parts of the DOM tree. This is why many CSS authors that work on component libraries choose to create different ‘scopes’ (in classnames, with something like BEM).</p> <p>Although things have changed, the basic idea is still that values/properties apply to things, and as an author, that’s the only thing you need to worry about. You don’t have to have build steps and you still don’t have to specify how styling, including complex grids, should be computed. You don’t even have to specify what everything looks like, as there are defaults and your own settings cascade. However, if you want to have build steps or have more fine-grained control, you can! Houdini will provide the latter, while keeping the basic ideas of CSS, like the cascade and media constraints, for you to use.</p> <p>I think lots has changed since the early nineties, but not really things that touch on how we apply CSS to structured markup. </p> <h2>Today</h2> <p>Most of the early-day <em>thinking</em> about CSS still applies today (and is still very much there in more recent additions to CSS specs). That is kind of amazing to me, because it is over 20 years old. In the world history, that does not seem like much. But looking at what kind of devices and browsers existed then, it is quite astonishing.</p> <p>I like to believe that the simplicity of CSS as a language is one of the reasons that it still works so well. Efforts to componentise CSS (to get programmatic scope) and <a href="https://medium.com/seek-blog/a-unified-styling-language-d0c208de2660">bring CSS into JS</a> can bring huge benefits and make things more manageable. But they definitely also increase complexity. Increasing complexity is a choice, and in the early days, the web community chose simplicity over complexity. They had good reasons for that choice, and it is a choice that has served many for over 20 years. </p> <p>Modern websites <em>are</em> different and so are our coding practices, but in the grand scheme of things, not a lot has changed. If we are to willingly increase complexity of our CSS code with shiny new tools, that’s fine, and CSS is quite suitable to build tooling on top of. But, we should have good reasons for introducing complexity (and definitely read more about <a href="http://www.wiumlie.no/2006/phd/">CSS’s making of</a>).</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/did-css-get-more-complicated-since-the-late-nineties/">Did CSS get more complicated since the late nineties?</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Did CSS get more complicated since the late nineties?">Reply via email</a></p> Professional developers 2017-07-10T00:00:00Z https://hidde.blog/professional-developers/ <p>The other day I watched a talk in which the speaker criticised PPK for trying to come up with a definition of a ‘real developer’. Many people have said it is ridiculous to frame developers with words like that. The wording is probably inapt. But is there much inherently wrong with setting <em>standards</em> for what a real/good/professional/sufficient way to exercise our trade is? In this post I will look into that question.</p> <p>For me personally, ‘real’ feels ok to use in the context it was used in, but then I am not a native speaker of the English language and I only know some connotations of the adverb. Obviously, its opposite is ‘fake’, which isn’t a nice thing to call anyone. I think the intended meaning of ‘real’ in that particular talk is similar to ‘professional developer’, which is the word I will use here, hopefully not being overly controversial.</p> <p>We need diversity! With ‘our industry’s diversity needs’, I mean that a large part of us web developers, myself included, think it is very important that the web industry <strong>welcomes all</strong>, should strive to be as diverse as possible and possibly have mechanisms in place to ensure it is very attractive for newcomers to join the industry.</p> <h2>The web is for everyone</h2> <p>The amazing thing about the web is, <em>it is for everyone</em>. This is a phrase that applies to having a place on the web, as well as working on websites. Nobody should be stopped from running their own Vengaboys fan page, or their website with hiking tips in Seoul. Or with their search engine, or their social medium, although those arguably do require some legal framework to operate in. My point is: you don’t need anyone’s permission. Everyone can make and have a website.</p> <p>The web technology community should also be a welcome environment to <em>everyone</em>. Everyone should be welcome to contribute stuff, no matter whether you’ve played with Service Workers or CSS animations on your Vengaboys fan page or while working for Facebook. </p> <p><img src="https://hidde.blog/_images/everyone.jpg" alt="Everyone" /> <em>At the London 2012 Olympics opening ceremony, Tim Berners-Lee tweeted “This is for everyone”. The letters simultaneously showed on the big screen. Source: <a href="http://www.telegraph.co.uk/sport/olympics/picturegalleries/9433047/London-2012-Olympics-Opening-Ceremony.html">Telegraph / PA</a>.</em></p> <h2>Are standards acceptable sometimes?</h2> <p>However, if someone is a web developer and is doing paid web development work, I don’t think it is unreasonable to have some expectations. If a web developer is working on the system that lets me download my bank statements, a system that lets me apply for a new parking permit at the local council or a system that shows me the latest news, I think they <em>should</em> know what they are doing. </p> <p>This is because I want to make sure my bank information is transferred securely, my parking application is treated confidentially, my news site is not hacked and filled up with fake news, and my public television’s live TV thing streams fast and in HD.</p> <p>Critical websites should be:</p> <ul> <li>secure with data</li> <li>accessible</li> <li>fast </li> <li>solid</li> </ul> <p>So, everyone can do stuff on the web, by all means. But if they’re doing this professionally, especially on society critical systems, we can expect them to have a certain skill level.</p> <h2>Other industries do have standards</h2> <p>What if someone said: </p> <ul> <li>that dentist is not a professional dentist, as she does not know what the side effects of her anaesthetics are</li> <li>that pizza chef is not a professional pizza chef, as he buys ready-made dough</li> <li>that accountant is not a real accountant, as he is unaware of the legal obligations that are involved with running a Limited company</li> <li>that mortgage advisor is not a real mortgage advisor, as she does not know the implications of a 5 year fixed interest rate as compared to a 10 year fixed interest rate</li> </ul> <p>Would the above statements be offensive or scare new people from the respective industries? I beg to differ, I don’t think they are. </p> <p>Note that when I say dentist, pizza chef, accountant or mortgage advisor, I am talking about those who do it as their profession and charge their clients for their services. Needless to say, all of those people could have interns or apprentices for whom it is absolutely fine to not know all the tricks of the trade.</p> <h2>But which standards?</h2> <p>Who knows what ‘knowing what you’re doing‘ means? What’s the industry body that prescribes what the good and the right is? I think this is a question that is extremely hard to answer, especially for the web, as there are many ways to do things. But let’s not give up there, at least not for this thought experiment.</p> <p>Let’s look at some other industries first. Pizza makers, dentists, accountants and financial advisors all have industry bodies that decide for the whole industry what’s right and what’s wrong.</p> <p>Pizza makers have the <em>Associazione Verace Pizza Napoletana</em>, and I quote:</p> <blockquote> <p>Its mission is to promote and protect in Italy and worldwide the “true Neapolitan pizza“ (“verace pizza napoletana“)</p> </blockquote> <p>Accountants have the body of <a href="https://en.wikipedia.org/wiki/Chartered_accountant">Chartered Accountants</a>:</p> <blockquote> <p>Chartered Accountants were the first accountants to form a professional accounting body, initially established in Scotland in 1854. The Edinburgh Society of Accountants (1854), the Glasgow Institute of Accountants and Actuaries (1854) and the Aberdeen Society of Accountants (1867) were each granted a royal charter almost from their inception. </p> </blockquote> <p>Now I’m not saying a member of a royal family needs to get any say in this, I just want to point out that for other industries it is quite acceptable to have some form of standard.</p> <p>Lawyers in The Netherlands have to go on courses yearly and if they do not show up or fail to collect all the credits the bar prescribes, they could lose their license.</p> <p>I think it would be okay to have expectations of professional developers, and looking at other industries, there are ways to establish them. Web technology changes a lot, and there are many specialisations, but the same goes for law and accountancy. </p> <h2>How to do this for front-end developers?</h2> <p>Who should do this and how they should go about it? Can a team of, say, 5 people just come in and make a list of requirements that will be taken seriously by the community? Are basic HTML, CSS and JavaScript like the tomato sauce for pizza chefs, or is it understanding of MVC and two-way data binding? These questions are beyond the scope of this article, but they are certainly difficult problems that would have to be solved. I think we can all agree it will be a huge challenge for the web industry to find <em>people</em> as well as <em>ways</em> to establish standards for professional exercise of our trade.</p> <p>In conclusion, I think having certain expectations of developers that build critical systems seems sensible. If we want to have high quality things on the web (in terms of security, performance, accessibility, etc), having standards could help. When it comes to critical systems like banks, government and news, we even should! </p> <p>As I said above: the web is for everyone, it is relatively easy to start making stuff for it and I don’t think that should ever change. <em>For most websites</em>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/professional-developers/">Professional developers</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Professional developers">Reply via email</a></p> This website now uses Grid Layout 2017-07-11T00:00:00Z https://hidde.blog/this-website-now-uses-grid-layout/ <p>Ever since the <a href="http://www.gridlayout.eu/">Grid Layout spec review workshop</a> in Amsterdam last year, I’ve been wanting to try this stuff out on a real project, in a real browser. Now that the spec is rapidly <a href="http://caniuse.com/#feat=css-grid">gaining browser support</a>, I thought this blog would be a good place to practice with it. I’ve jotted down some of my findings and thoughts. </p> <p>So, it is really happening! Earlier this year, most major browsers shipped Grid Layout into their browsers <em>in one month</em>. It was awesome, never has a major new CSS feature been adopted this fast across browsers. </p> <p>Before, we recreated grids with tables, floats and flexible boxes. For some developers, frameworks were helpful when trying to do that on scale. With grid, those things are no longer needed. Grid is great, because, contrary to older grid systems that use CSS to come to layouts, <a href="https://rachelandrew.co.uk/archives/2017/07/01/you-do-not-need-a-css-grid-based-grid-system/">CSS Grid Layout <em>is</em> the lay-out system</a>. </p> <p>So why would you not use it? A fallback lay-out will either cost lots of time and limit your creativity, or look different from your grid-based lay-out, the most important question to ask here is: can you live with the “websites do not need to look exactly the same in every browser” philosophy? This philosophy has become more and more popular. It was always a wise strategy, but the multi-device world kind of forced us into it. Which is good, I think. There are already lots of viewports and lots of different ways to access the same structured content. For this website, it was an easy choice to make, because it’s only my own website. For client websites, it’s a developers role to look at <a href="https://rachelandrew.co.uk/archives/2017/07/04/is-it-really-safe-to-start-using-css-grid-layout/">which compromises are worth making</a>.</p> <p>Good places to learn more about Grid Layout are <a href="https://www.w3.org/TR/css-grid-1/">the spec</a> and the examples, blog posts, tweets and presentations by <a href="http://jensimmons.com/">Jen Simmons</a>’ and <a href="http://rachelandrew.co.uk/">Rachel Andrew</a>, they have both done way more interesting stuff wit Grid Layout than you can find in this post (I mean, <a href="http://labs.jensimmons.com/2017/01-005.html">Monopoly</a>, <a href="http://labs.jensimmons.com/2017/01-011.html">Mondriaan</a> and more). Rachel has a full <a href="https://thecssworkshop.com/">workshop on CSS Grid Layout</a>.</p> <p><img src="https://hidde.blog/_images/screen-shot-2017-07-12-at-09.20.59.png" alt="Screen Shot 2017 07 12 at 09.20.59" /> <em>The Grid on this site as viewed through Firefox’ Dev Tools</em> </p> <h2>My implementation</h2> <p>These are some things I found interesting when I worked on this website’s Grid Layout implementation:</p> <h3>A lot less markup</h3> <p>Markup-wise, I have mostly been removing things. I had containers in place for layout reasons, most of those are gone now. The reason: when you define a grid on an element X, the things you can lay out on the grid are the direct children of X. If those are container elements, you’re placing containers onto the grid. This can be useful if you want to group things (make <code>div</code>isions, if you like), but often you want to lay the content itself out against your grid lines. In that case, best remove containers, or use <code>display: contents</code>, which lets elements behave as if the container that wraps them does not exist (<a href="http://caniuse.com/#feat=css-display-contents">little browser support</a> at the time of writing). </p> <h3>Numbered and named grid lines</h3> <p>With Grid Layout, you can name your ‘tracks’ (areas formed of multiple rows/columns), but also the lines that surround them. I did not name all my lines, but I did name the ones surrounding my main content area. Named lines are very helpful: they make the <code>grid-*-start</code>/<code>grid-*-end</code> declarations much easier to read.</p> <h3>The <code>body</code> as the grid</h3> <p>I declared my grid on the <code>body</code> element, because I figured that I wanted to align everything that is in the body onto the grid. On more complex websites, I think grids could work well for just one component/composition, for example an overview of products.</p> <h3>Grouping starts/ends</h3> <p>Not all grid locations are unique. In fact, I found that I ended up aligning a lot of the items to similar places, so I grouped them by location. Many appear in my ‘main content’ column, others are elsewhere. For locations other than main, I used the line numbers to declare where the content should go.</p> <pre class="language-css"><code class="language-css"><span class="token selector">.page-title, .page-meta, .entry-content, .bio</span> <span class="token punctuation">{</span> <span class="token property">grid-column-start</span><span class="token punctuation">:</span> main-content-start<span class="token punctuation">;</span> <span class="token property">grid-column-end</span><span class="token punctuation">:</span> main-content-end<span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token selector">.comments, .about</span> <span class="token punctuation">{</span> <span class="token property">grid-column-start</span><span class="token punctuation">:</span> 2<span class="token punctuation">;</span> <span class="token property">grid-column-end</span><span class="token punctuation">:</span> main-content-end<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>Above I set the title, meta info, entry content and bio to appear in my <code>main-content</code> column (lines on either side are identified with <code>-start</code> and <code>-end</code>, respectively). Then I set the comments section to start after the first column (so on the second grid <em>line</em>) and to end where the <code>main-content</code> column ends.</p> <h3>Larger grid gaps on larger screens</h3> <p>For larger screens, I’ve decided to increase the <code>grid-gap</code>, so that my content can make more use of the available space. I found too much increase made things look weird, so I have only gone from <code>1em</code> (on small screens, where I don’t use grids) to <code>2em</code> and then to <code>4em</code>. In layouts that are more exciting than this one, I can imagine changing these values can have more dramatic effects.</p> <h3>A low-fi fallback</h3> <p>My fallback is a very simple and plain lay-out, focused on having readable content. Anyone who comes to the fallback should have no problem to read posts, find out about me or my background or get to my contact details. But they will not always see the optimal lay-out for their screen (in my case, this goes for users with a screen width larger than <code>50em</code>). The percentage of people seeing the lay-out as intended will grow over time.</p> <h3>Width of main content based on characters</h3> <p>My main content area uses the <code>ch</code> unit for sizing: depending on your viewport you will see about 50, 60 or even 70 characters on a line. Typographer Robert Bringhurst recommends 45 to 75 characters in his classic <em>Elements of typographic style</em>, and suggests increasing leading (<code>line-height</code>) with line length. This is trivial in CSS if you use unitless line-heights: they grow with the font-size.</p> <h3>Still quite specific</h3> <p>Grid allows you to <em>not</em> be specific and let the browser decide stuff for you. For instance, you can leave the sizes of the grid as well as placement onto the grid to the browser. The <a href="https://www.w3.org/TR/css-grid-1/">Grid Layout spec</a> opens with an example of a game board that makes use of all available space, using just fractions and <code>auto</code> values. </p> <p>There are other functions too, like the <code>minmax()</code> that lets you declare minimum and maximum sizes, leaving everything else for the browser to figure out. </p> <p>In the grid on this site, I have still been quite specific about sizes, as one of my main components is a blog entry, and I wanted to base its width on an amount of characters per line. </p> <h2>Where to define how content flows</h2> <p>As you can see above, I’ve grouped things together that are unrelated, for the sole reason that their position on the grid is the same. It still feels a bit odd to be doing this, but it works well for me and for this blog. </p> <p>I’m not sure how it would work on Big Websites where components can appear anywhere. Some could probably decide on fixed templates where the template name (this could be a classname on the body) determines the page’s positioning of items (<code>.page--dashboard</code>, <code>.page-product</code>, <code>page--insurance-detail</code>). </p> <p>Other sites will require more flexibility. Maybe on those, you could determine the <code>grid-column-start</code>/<code>grid-column-end</code> values somewhere in the CMS, which would then generate an inline style (or maybe CSS-in-JS could help (?)).</p> <h2>Websites do not need to look exactly the same across breakpoints</h2> <p>With Grid Layout, not only can your website look quite different depending on Grid support, you can also choose to have completely different layouts across breakpoints. This way, you can really make sure your content has the right widths so that it is easy to read and navigate. And you can make those choices differently depending on the screen size that is available. </p> <p>Previously, layout was quite intertwined with the structure of HTML documents and the classnames within them. With Grid, structure is still important, probably <em>more</em> important, but in a different way. Content still flows in the order of your HTML document, but you no longer need to depend on HTML to do things like laying two items out next to each other.</p> <h2>Conclusion</h2> <p>I’ve had fun experimenting with Grid Layout on this website and look forward to making use of its features in other projects. Stuff like <code>min-content</code> and named grid areas look incredibly useful. I also look forward to letting more stuff be automatically handled by the grid algorithms that browsers now ship with. And to use all the alignment stuff that came to CSS with flexbox and is available in Grid too. Oh, the possibilities!</p> <p>I hope to see many more websites adopting grid layouts (ones that look more <em>interesting</em> than this one) and documenting their findings. As Jen Simmons said: <a href="http://jensimmons.com/post/feb-27-2017/learn-css-grid">this truly is a revolution in graphic design on the web</a>. Lots to explore!</p> <h3>Further reading:</h3> <ul> <li><a href="https://www.w3.org/TR/css-grid-1/">CSS Grid 1.0</a>, the official spec by Tab Atkins, Elika J. Etemad and others</li> <li><a href="http://gridbyexample.com/">Grid by Example</a> by Rachel Andrew</li> <li><a href="http://jensimmons.com/post/feb-27-2017/learn-css-grid">Learn CSS Grids</a> by Jen Simmons</li> <li><a href="https://cm.engineering/getting-to-know-css-grid-layout-818e43ca71a5">Getting to know CSS Grid Layout</a> by Chris Wright</li> <li><a href="https://14islands.com/blog/2017/03/07/playing-with-CSS-grids/">Playing with CSS grids</a> by Marco Barbosa</li> </ul> <hr/> <p>Originally posted as <a href="https://hidde.blog/this-website-now-uses-grid-layout/">This website now uses Grid Layout</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20This website now uses Grid Layout">Reply via email</a></p> Testing the accessibility of pattern libraries 2017-07-13T00:00:00Z https://hidde.blog/testing-the-accessibility-of-pattern-libraries/ <p>When assessing how accessible your website or app is, auditors will likely want to look at whole pages. But perhaps most of what you are working on is individual components. I mean, this is how lots of companies work nowadays. Can pattern libraries be tested for accessibility? And if so, what do we test? In this post I will address those questions and look at accessibility testing in different levels of pattern library driven development. </p> <p>Note that this post is mostly about whether it <em>can</em> be done, as opposed to <em>how</em>, which is a subject all of itself. I may do a post about that later.</p> <p>A pattern is a reusable piece of your user interface, also known as component or module. It often <strong>documents the UI design</strong> and is made of code that <strong>runs in the browser</strong>. Examples of patterns: buttons, messages, accordions, headers, sliders, breadcrumbs and tooltips. A pattern library is a collection of such patterns and slightly more than that. As Alla Kholmotova says in her upcoming book <a href="https://www.smashingmagazine.com/design-systems-book/">Design systems</a>, it is “a tool to capture, collect and share design patterns and guidelines for their usage.”</p> <p>With our interface separated into building blocks, it would be great if we can do our accessibility testing pattern by pattern, too. Can we? Well, <strong>yes and no</strong>. </p> <p>Let’s start with the bad news. To be able to say something about how accessible your whole <em>site</em> is, you need to <a href="https://www.w3.org/TR/WCAG20/#cc2">assess whole pages</a>, WCAG2 says: </p> <blockquote> <p><strong>2. Full pages:</strong> Conformance (and conformance level) is for full Web page(s) only, and cannot be achieved if part of a Web page is excluded.</p> </blockquote> <p>But there’s good news, too: there are heaps of accessibility issues that can be spotted on a pattern level, or criteria that can be marked as sufficiently met. Let’s look at how that would work.</p> <h2>What auditors test your site for</h2> <p>When deciding whether something is easy to access for as many people as possible, auditors will make sure four things are the case. They’ll want your site to be: </p> <ul> <li>Perceivable</li> <li>Operable</li> <li>Understandable</li> <li>Robust</li> </ul> <p>In WCAG2, the accessibility guidelines, there is a number of criteria categorised under each of these main principles. Knowing those criteria is a great way to learn about making more accessible interfaces. There are quite a few. The <a href="https://www.w3.org/TR/WCAG20/">actual spec</a> is a good place to read about them and it is also the official norm. There is also the <a href="http://webaim.org/standards/wcag/checklist">WebAIM checklist</a>, which has slightly more developer-friendly wording and (opinionated) recommendations on how to meet the criteria — it’s a great resource!</p> <p>Although you cannot formally claim your site’s WCAG2 conformance based on audits of just its components, as we’ve seen above, you can look at many of the criteria on a component level. This can have advantages in comparison with testing whole pages. </p> <h3>Patterns as isolated test cases</h3> <p>At the Patterns Day conference last month, <a href="http://rachelandrew.co.uk/">Rachel Andrew</a> mentioned something interesting about patterns. She said that working with reusable interface components, where each one has its own page, made her realise that those work quite well as <em>isolated test cases</em>. I feel this also goes for some accessibility tests: there is a number of criteria where isolation aids testing.</p> <h3>Component-specific guidance is available</h3> <p>Not only can isolating patterns be useful in the testing phase, there is also lots of documentation for accessibility-proofing components specifically. <a href="https://www.w3.org/TR/wai-aria-practices/">WAI ARIA Authoring Practices</a> describes of common patterns how to get them accessible, with examples of keyboard operability and what should happen to focus. There is also Heydon Pickering’s <a href="https://inclusive-components.design/">Inclusive Components Club</a>, which describes in detail what optimisations can be made and how they help whom.</p> <h2>Individual patterns</h2> <p>Let’s look at some things that can be tested when looking just at individual patterns. In order to avoid this to become too high level, I will give some suggested questions for specific, real-world-ish use cases.</p> <h3>Collapsible (“Show/hide”)</h3> <ul> <li>Is it visually clear where the focus is? (<a href="https://www.w3.org/TR/WCAG20/#navigation-mechanisms-focus-visible">Focus visible</a>) </li> <li>Is information about the state of the collapsible exposed to the accessibility tree?</li> <li>Is there enough colour contrast between background and foreground? (<a href="https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast">Contrast minimum</a>)</li> <li>Can the collapsible be expanded using a keyboard only? (<a href="https://www.w3.org/TR/WCAG20/#keyboard-operation-keyboard-operable">All functionality operable through keyboard interface</a>)</li> </ul> <h3>Form field</h3> <ul> <li>Does the field have a label? (<a href="https://www.w3.org/TR/WCAG20-TECHS/G131.html">Provide descriptive labels</a>)</li> <li>Is the label properly associated with the input?</li> <li>Does the icon that appears next to the input when there’s an error have a text alternative? (<a href="https://www.w3.org/TR/UNDERSTANDING-WCAG20/text-equiv-all.html">Provide text alternatives for non-text content</a>)</li> <li>Are error messages conveyed to assistive technology (<a href="https://www.w3.org/TR/UNDERSTANDING-WCAG20/minimize-error-identified.html">Identify and describe errors</a>)?</li> </ul> <h3>Video player</h3> <ul> <li>Is it easy and clear how to stop the video?</li> <li>Is there a way to display transcripts and include captions? (<a href="https://www.w3.org/TR/UNDERSTANDING-WCAG20/media-equiv.html">Provide alternatives to time-based media</a>)</li> <li>Can the video player controls be used with just a keyboard? (<a href="https://www.w3.org/WAI/WCAG20/quickref/#qr-keyboard-operation-keyboard-operable">Make all functionality available from a keyboard</a>)</li> </ul> <p>Assuming your final page only has pattern libary markup, CSS and JS, all of the above things will yield the same test result in isolation and when used in a page. This is what makes them suitable to test on a component level.</p> <p>I think for most components, there’s a whole lot of accessibility criteria that can be tested. There is also a number of things where we need whole pages, and in some cases, whole pages with the real data. So let’s look at those next. </p> <h2>Whole pages</h2> <p>Some criteria can only be tested in the context of a full page. Some examples:</p> <h3>Headings</h3> <ul> <li>Are no heading levels skipped?</li> </ul> <h3>IDs</h3> <ul> <li>Do skip links refer to existing IDs? (<a href="https://www.w3.org/TR/UNDERSTANDING-WCAG20/navigation-mechanisms-skip.html">Have a mechanism to bypass blocks of content that are repeated on multiple pages</a></li> <li>Are there no duplicate IDs in the page?</li> </ul> <h3>Tab order</h3> <ul> <li>Can we tab through the page and does tabbing make sense?</li> </ul> <h2>Whole pages with real data</h2> <p>Lastly, there are also some aspects that can only be tested when pages are composed and they have real content in them. For instance:</p> <h3>Language</h3> <ul> <li>Is the language comprehensible?</li> <li>Is it identified which language the page is in? (and, if different: parts of the page) (<a href="https://www.w3.org/TR/WCAG20/#meaning-other-lang-id">Make sure human language is programatically identifyable</a>)</li> </ul> <h3>Video player</h3> <ul> <li>Are all the people in the video <a href="https://www.w3.org/TR/WCAG20-TECHS/G159.html">identified in the transcript</a>?</li> <li>Do the captions appear at the correct times?</li> </ul> <h3>Alternative content</h3> <ul> <li>Can I find out what’s happening in that graph without seeing it?</li> <li>Does the <code>alt</code> attribute of that image describe what’s in the image (if it is not decorative)?</li> </ul> <h2>TL;DR</h2> <p>Although claiming a site meets the WCAG2 criteria has to be based on research of full pages, there are lots of things you can figure out and tackle while working on components with mock data. Above, I have given some examples of such things. I’ve also shown some examples of criteria that would require full and/or finished pages to be properly assessed. </p> <p>As always, your mileage may vary! I would recommend checking the components you have against the WCAG2 criteria to see which ones can be checked on component level and which require full pages. Hopefully, the examples give an idea of what kind of things can be tested on which level, and when to run (automatic) accessibility tooling through patterns or full pages.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/testing-the-accessibility-of-pattern-libraries/">Testing the accessibility of pattern libraries</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Testing the accessibility of pattern libraries">Reply via email</a></p> Enabling people with accessible technology and positive thinking 2017-07-21T00:00:00Z https://hidde.blog/enabling-people-with-accessible-technology-and-positive-thinking/ <p>Yesterday I attended the Inclusive Design and Accessibility meetup (“idea11y”) in Rotterdam. The central theme of the evening, I think, was that accessible technology has the <em>unique ability to enable people</em>. </p> <p>Last night’s meetup marked the first anniversary of idea11y (congrats!), it has been running regularly since the first one. Recently, I have been attending regularly, too. These meetups are always full of interesting content from different perspectives.</p> <p>First, UX designer <a href="http://deanbirkett.name/">Dean Birkett</a> (of AssistiveWare) talked about undertaking usability testing for the products his company makes: products that enable people with impairments. He specifically explained products that enable people to communicate. The users of these products are people who can not or no longer talk, some literate, some illiterate. He showed examples of people using their tools for anything from editing movies in Final Cut Pro to simply saying ‘I love you’ to their loves ones. He talked about the challenges of usability testing: he did a lot of that remote, and sometimes they involved the user’s support network. Main takeaways: don’t let people tell you that you can’t do usability tests, there are always ways; and do tests your products with users, as it is their problems you’re trying to solve. </p> <p>The second speaker was <a href="http://boboffereins.nl/">Bob Offereins</a> (of Microsoft), who talked about what he calls “Inclusive Life Design”: it is all about looking at people around us in terms of impedements rather than impairments. They’re really two labels for one thing: an impairment mostly sounds like an impossibility, ‘impedement’ makes one think of something that can be overcome, it’s a much more positive label. Bob shared his story: at a younger age he was diagnosed with an eye disease, which meant at the time he was labelled by the authorities and people around him. He explained how important it is to believe in the power of people, and encouraged us to believe in our own power, be unafraid of making mistakes and open to new ideas. Which in his case meant: don’t believe in boundaries or labels put onto you by others, think in possibilities! Very inspiring. </p> <p>Dean showed how his company’s technology enables people, Bob explained how we can enable ourselves (and others) by being open minded and believing in what we <em>can</em> do. Some great food for thought!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/enabling-people-with-accessible-technology-and-positive-thinking/">Enabling people with accessible technology and positive thinking</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Enabling people with accessible technology and positive thinking">Reply via email</a></p> Small steps 2017-08-21T00:00:00Z https://hidde.blog/small-steps/ <p>Last Friday, De Volkskrant exposed <a href="https://www.volkskrant.nl/4511704">how much trouble the Dutch tax office has had</a> in recent years to build software and manage its IT projects. Below I’ve listed the four main things they lack according to the article.</p> <p>The responsible State Secretary, Eric Wiebes, admitted publicly that IT is “the tax office’s Achilles’ heel”. The report goes into the tax office’s 600 plus (!) IT systems and the estimated 750 million euros of tax that isn’t collected due to outdated technology. That is just sad!</p> <p>They based some of the story on internal review documents, and interviewed a contractor, who gave details of a number of things many developers will recognise as serious red flags.</p> <p>So, what did they lack, what should they have done differently? I thought I’d summarise some findings on this blog. Note that these might come across as common sense if you work for a fairly modern digital company.</p> <p><img src="https://hidde.blog/_images/vk.png" alt="Screenshot of Volkskrant article, headlined (in Dutch) “Verstrikt geraakt in een Gordiaanse ict-knoop”" /> <em>The article in De Volkskrant, 18 August 2017</em></p> <h2>Take small steps</h2> <p>Some managers at the Tax Office preferred a rather traditional way of working: to <strong>build a fully featured product at once</strong>. All or nothing.</p> <p>The alternative to this approach is to <strong>build a simple, minimum viable product first</strong> and then extend that with relatively small features when and if they are needed. It is the de facto standard for software development and what all modern, successful companies do in some way or another. </p> <p>There is a difference in the two approaches from a management point of view: the modern approach requires active involvement, decision making and taking responsibility. When new stuff is added feature by feature, someone, whether it be a project manager or product owner, needs to know what the features are and take bold decisions about priorities. It also takes honesty and putting yourself in a vulnerable position: you’re sharing your work more often and give people the chance to comment. For the greater good!</p> <h2>Distribute responsibilities</h2> <p>The article also gives details of how management repeatedly <strong>made uninformed decisions</strong>. Tax Office managers ‘made decisions about IT without any technical insight’, which lead to non-vulnerable systems being replaced unnecessarily, and critically vulnerable systems being left without a replacement. ‘Often, the directors didn’t know for which part of the new technology they were responsible’, an external auditor said. Another issue is that <strong>no one seemed to know what systems were for</strong> and how they were supposed to save money. </p> <p>In big IT projects, I think it is not inherently bad if management is not aware of all the technicalities involved. This stuff can easily get complex. It’s not uncommon in technical meetings that a majority of the room does not understand what is being discussed (sadly, this really happens). Because of that, people can say nothing and make it sound like something. Given all that, management, if not technically inclined themselves, <strong>should have themselves informed by other people who understand the full, technical picture</strong>.</p> <h2>Test early, test often</h2> <p>Software <strong>wasn’t regularly tested with reality</strong> (as in: the IT reality wasn’t checked with the real world reality). There was <strong>hardly any contact between the developers and the case workers</strong> that were the intended audience for the software. Nobody kept an eye on whether the systems being built did what they thought they would do.</p> <p>As an organisation that produces software, if you don’t regularly test your stuff for bugs, with users, for accessibility, for security or with reality… you are just being overly confident — delusional, perhaps. Pride goes before destruction, and haughtiness before a fall. Software needs to be tested, and this needs to be done as early and often as possible. This is to verify that stuff does what it should do, and also that stuff still does what it used to do.</p> <h2>Work together</h2> <p>Another thing the article goes into is that the more traditional members of the team were less prone to come into work, they worked from home most days, some <strong>came in only once every fortnight</strong>, for meetings. From an employee point of view, this might sound like a fantastic benefits package. But to be fair, if it leads to bad software that you are partly responsible for, I’m not so sure I would go for it. </p> <p>Communication (with team members, with management, with clients) is arguably the most important skill in modern software development. This is not impossible when working from home, with the right A/V and good internet speed you can do your dailies from a distance. However, especially in large and complex organisations, it is essential to be on site regularly, to make it easy to verify assumptions.</p> <h2>Conclusion</h2> <p>The above principles are extremely common in almost all modern and mature digital organisations. Companies like Amazon, Google and my bank seem to effortlessly produce interfaces that are easy to use, have few bugs and are able to disrupt people’s lives in a way that is often so positive. I think aspects like taking small steps, distributing responsibilities, testing early and working together help these companies to have success. </p> <p>The Dutch Tax Office has a long way to go, but I am really hoping it will manage to shift into this direction, too. In the meantime, I try to be vigilant of the above symptoms when they occur at the projects I work on. I am also curious to hear if you have worked in any organisations that had problems like these, and if so, how you tried to solve them.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/small-steps/">Small steps</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Small steps">Reply via email</a></p> Accessibility Design Drive 2017-09-04T00:00:00Z https://hidde.blog/accessibility-design-drive/ <p>Last week, for roughly one hour each day, I participated in the <a href="https://medium.com/mozilla-open-innovation/join-mozilla-and-stanfords-open-design-sprint-for-an-accessible-web-f6ee4bbf3fe6">Accessibility Design Drive</a>, organised by Stanford University and Mozilla to make Firefox more inclusive by collaborating in diverse teams. It was a fun thing to be part of, and great to learn from others!</p> <p>The people who joined this were a very varied bunch, over 100 in total. There were lots of people from the States and India, but also a number from Europe and elsewhere. Some had impairments, some were accessibility practitioners and some were both. A lot of students joined, too!</p> <p>They grouped us into teams by time zone, and during the week, some of us were moved around to other teams, so that we could meet and work with more different people. We were working in a <a href="https://medium.com/@niloufar_s/decentralized-design-for-disabilities-and-inclusion-5c1bc1ae5ad4">decentralised design process</a>, with as its goal the inclusion of more perspectives in the design process.</p> <p>Time-wise it was challenging. Many of us, myself included, had to squeeze the time into our after work hours, and the one hour wasn’t always enough.</p> <h2>What did we do?</h2> <h3>Identify roadblocks</h3> <p>On the first day, we got some links for reading and got to know our fellow team members. The first team exercise was to figure out what kind of roadblocks each of us (or people close to use) experienced when accessing the web.</p> <p>I read <a href="https://www.w3.org/WAI/intro/people-use-web/stories">How people with disabilities use the web</a> for inspiration.</p> <h3>Find patterns</h3> <p>The day after, our team had become slightly bigger by this point, we were asked to identify patterns from our observations from the day before.</p> <h3>Think of solutions</h3> <p>The third day, I was moved to another team by now, was all about thinking what we could do about the problems we had identified. And mainly, how could something in Firefox help solve the problems. So the question, really, would be: ‘what can a <em>browser</em> to improve accessibility?’</p> <p>I found it difficult to come up with <em>many</em> solutions and decided to ask some friends, as well as Twitter: </p> <blockquote> <p>If you could add a feature to a browser to improve accessibility to the web for people, what would it be? #a11y </p> </blockquote> <p>(<a href="https://twitter.com/hdv/status/903138470473998337">Me, on Twitter</a>)</p> <p>Lots of great responses came in, a couple I liked in particular: </p> <ul> <li>auto fix color accessibility issues (<a href="https://twitter.com/bobhilt/status/903148715338108928">Bob</a>)</li> <li>allow for styling of form elements like radio buttons, checkboxes and selects (<a href="https://twitter.com/karlgroves/status/903155852898701312">Karl</a> and <a href="https://twitter.com/asinnema/status/903156915236212736">Anneke</a>)</li> <li>make it easy and obvious for users to change the appearance of a site to personal preferences (<a href="https://twitter.com/dugboticus/status/903154846425128960">Alistair</a>)</li> </ul> <h3>Prototype</h3> <p>On the fourth day, we were asked to choose three ideas and turn them into a storyboard, which, I learned, is an unpolished visual representation of how an interface idea could work in the real world. We started by describing the approach in steps, as a sequence of actions.</p> <h3>Test</h3> <p>The fifth and last day was all about testing. We were asked to communicate our thoughts to someone from their target audience, ask them about their thoughts, learn from this and then refine. In our team, this was the day we failed to do the main thing and did not test with users because we were time constrained. We did work on fine tuning the descriptions of our most important ideas.</p> <h2>Problems that browsers could solve</h2> <p>I’m a lazy front-end developer and happy with anything I don’t need to build myself. I’ll gladly leave things to the browser. Browsers are much better than I could ever be at interoperability, ensuring keyboard access and providing information to platform accessibility APIs. Over the past week, I realised there are even more things the browsers could improve for users regarding accessibility.</p> <p>One thing I noticed in the discussions we had in our team, is that some accessibility issues follow from poor decision making by people who make websites. Browsers could theoretically resolve many of those. Examples: too little color contrast (browser could autocorrect), removal of focus outlines (browser could let the user override) and too much motion (the latter has been resolved with a <a href="https://drafts.csswg.org/mediaqueries-5/#prefers-reduced-motion">media query for reduced motion</a>).</p> <p>Problems people have with forms could be solved by browsers, too. What if they provided native methods to style form elements like <code>select</code> and <code>radio</code>/<code>checkbox</code> inputs? Developers currently resort to non-native ways, which are not necessarily the most accessible, hence making forms harder to use for some users.</p> <p>The above suggestions may be nothing more than public daydreaming, but I think it’s awesome that browser makers like Mozilla are so serious about accessibility. I am looking forward to seeing some feature ideas from this Accessibility Design Sprint make it into Firefox.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/accessibility-design-drive/">Accessibility Design Drive</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Accessibility Design Drive">Reply via email</a></p> ICONS: work on stuff that matters 2017-09-05T00:00:00Z https://hidde.blog/icons-work-on-stuff-that-matters/ <p>This morning I attended ICONS, an event to kickstart the new term of Communication and Multimedia Design, which is a course given in Amsterdam. The event was for students, but they invited others to tag along. So I did. Three speakers shared their views on what I can only paraphrase as: to do something that matters.</p> <p><strong>Marrije Schaake</strong> (<a href="https://eend.nl/">eend</a>) explained how not to lose your job in digital to robots. Robots will find it most challenging to take over jobs that require creativity, humanity and leadership. So, a good way to keep your job is to focus on making digital products more human. One needs human skills for that. One needs <em>empathy</em>: the skill to put yourself in someone else’s shoes. So that you can solve their problem. The good thing, Marrije told us, is that we can train our empathy skills: you can interview people to find out about their problems and study them in their natural habitat (like the practice of <em>ethology</em>). Find out what it is they want to do, what impediments they have and what they would <em>not</em> want to happen. This way, it gets easier to find real solutions to solve real problems. Problems that matter.</p> <p><strong>Johan Huijkman</strong> (<a href="https://q42.nl/">Q42</a>) talked about digital accessibility. He showed lots of examples of actual users that benefit from accessibility optimisations. And he explained that those users are everywhere and that they could be you (now or at an older age). He demonstrated how important it is to do the basics (according to Derek Featherstone, 80% of accessibility issues can be resolved by keyboard testing and proper markup), to work together, to test with real users and to keep things straightforward and usable (to avoid cognitive overload). By designing inclusively, we can make our digital products matter for people. </p> <p>The multi-award-winning <strong>Astrid Poot</strong> (<a href="http://familievanfonk.nl/">Familie van Fonk</a>) taught us how to be successful, and showed the students that the common cliches about being successful as a digital creative person make no sense at all. You don’t need to be a man, overly rational, extremely confident, focused, disruptive or good looking to be extremely successful. Being professional is about other things, do something that matters. Why launch a new brand of tonic water if you can help children visit art museums or prepare for going to the hospital?</p> <p>This idea of making stuff that matters is something I have been thinking about for a while. So many good designers and developers work on products that solve problems of big corporations, not of society. I don’t have much against big corporations, we probably need them, but using technology to improve people’s lives seems like the best way to spend our time. Whether that’s for a government or some big corporation, or with a trendy design or fancy framework, those questions are secondary, I think.</p> <p>What a cool event, and what a great way for CMD students to start their year! I hope they were as inspired as I was, and employ the critical intuitions during their term.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/icons-work-on-stuff-that-matters/">ICONS: work on stuff that matters</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20ICONS: work on stuff that matters">Reply via email</a></p> Brique: a conference about challenging reality 2017-09-28T00:00:00Z https://hidde.blog/brique-a-conference-about-challenging-reality/ <p>This week I attended <a href="http://brique.nl/">Brique</a>, a design conference by the lovely people of <a href="https://fabrique.nl/">Fabrique</a> in Rotterdam’s Kunsthal. It felt like a Dutch dConstruct for designers, like Creative Mornings meets This Happened. I had a great day!</p> <p>The programme was extremely well-curated, with a great variety of talks, but an overlapping theme as well. Every talk approached the subject of reality. Some were about how to experience it, through inquiry, investigative journalism or photography. Others talked about how to shape reality to tell a story, with animation, graphs, VR or even classic cars. And then there were talks about how to change reality for the greater good, to decrease income gaps and make solar power work.</p> <p><img src="https://hidde.blog/_images/presenter-in-front-of-brique-logo-slide.jpg" alt="Presenter in front of Brique logo slide" /> <em>Photo credit: Fabrique on Twitter (<a href="https://twitter.com/fabrique/status/913332499484471296">original</a>)</em> </p> <p>Stop motion filmmaker <strong>Rogier Wieland</strong> showed some of <a href="http://rogierwieland.nl/">his work</a> and the process it involves. He makes animation films, mostly with stop motion. The attention to detail was nothing more than impressive, and it shows in the result. It did seem like a lot of work, but lots of fun too (see also <a href="http://rogierwieland.nl/about/">the photos on their website</a>. </p> <p>Philosopher <strong>Bas Haring</strong> talked about the daily life curiosity that brings him so much: when he encounters something he just does not understand, he investigates the thing. Whether it is the history of the Panama Channel, the economy or why someone would claim that homosexuality is not natural. This attitude of inquiry often brings him to more questions and answers. Interestingly, it also inspired him to write multiple popular philosophy books.</p> <p><strong>Jeffre Jackson</strong> explained that asking ‘seriously?’ is his “standard mode”. Reality isn’t always what it seems, he said, and part of why is that we don’t know everything. We need to inquire, ask questions and realise we don’t know everything. Withhold judgment, he advised. Throughout his talk, he referenced the humanist Michel de Montaigne, whom he said “would have loved the web”. Great stuff! Still in doubt whether I should get <a href="https://www.amazon.com/Select-Essays-Michel-Montaigne/dp/1452652589">Montaigne’s essays</a>.</p> <p><strong>Ionica Smeets</strong>, mathematician and professor in explaining scientific research to the world. She talked about the fascinating subject of a language used by experts talking to non-experts. She explained that one way to make sure your word usage is accessible is to ask the people you talk to for a summary of what you’ve just said. It might appear they misunderstood. Or filled in blanks wrongly. She also showed how graphs can be extremely misleading, and how some use them to tell stories their way.</p> <p>Storyteller <strong>Steye Hallema</strong> did the first VR talk that overwhelmed me, mostly because of the meaningful examples. I had seen VR talks at tech conferences before, Steye’s talk had a different angle: he talked about what kind of stories can be told with VR and how. VR, he said, is a bit like extracting consciousness from your brain and passing it around the room. He showed us how VR was applied to <a href="https://www.youtube.com/watch?v=i51Xd9VzzxY">swap genders</a>, make <a href="https://www.youtube.com/watch?v=BufN_qkP58E">a music video</a>, and experience a peep show. VR is hard, he said, from which I concluded: only use it when it improves how the story is told. He showed many examples where VR adds a new level and lets the public experience stories in ways that aren’t possible in traditional film.</p> <p>Lawyer <strong>Aernoud Bourdrez</strong> enlightened us about conflict resolution. He talked about Shapiro’s five emotional aspects: appreciation, affiliation, autonomy, status and role, and ensuring to cover them all in every negotiation move. He also showed how to use this to obtain art, with some entertaining examples, such as how he managed to <a href="https://www.vice.com/sv/article/5gednd/aernoud-bourdrez-ryan-dunn-jackass-x-ray-toy-car-rectum-876">get the original x-rays of a car that is stuck in the Jackass’ Ryan Dunn’s buttocks</a>.</p> <p><strong>Martijn Kieft</strong> of tv programme <a href="https://www.vpro.nl/programmas/tegenlicht.html">Tegenlicht</a> told us how his tv programme looks at things that aren’t typically in the news, but have a huge impact with how they shape the world. Some of these things are very abstract, such as the process of creating money or negotiating for disinvestment in companies that harm the earth. For something to make the news, it requires images, but one needs creativity to find imagery if your subject is an abstract process.</p> <p>Architect <strong>Kristian Koreman</strong> talked about how his team challenge reality with the projects they do. They don’t always do projects because clients ask for them, they sometimes give unsolicited advice. I like the idea of that. He showed how they helped the city of New York with a project around gentrification – quite a problem here, but a much bigger problem there. They studied differences between poor and rich and tried to come up with ways to challenge that reality.</p> <p>Photographer <strong>Otto Snoek</strong> talked about his Europa project: he left his home city of Rotterdam to travel Europe and photograph people there. With his photos rotating in the background, he shared his thoughts about photography, Rotterdam and the world, and read three short stories.</p> <p>Closing the day was the technologist, designer and philosopher <strong>Koert van Mensvoort</strong>. He showed some product designs to make us think about the future of our society: new technological possibilities arise, but are we comfortable with what can be achieved? He showed us the ‘speculative products’ he developed to start a discussion, and different kinds of in vitro meat products, some real and some imagined. He also talked about what ‘nature’ is, and argued the traditional definition should be widened to include hard to control human-made systems (such as financial markets and the internet). And that we should have the ambition for technology to become part of our nature, rather than just to the job they were invented for. More about how technology becomes part of nature in <a href="https://www.youtube.com/watch?v=EXJB4Ync82c">this TED Talk Koert gave</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/brique-a-conference-about-challenging-reality/">Brique: a conference about challenging reality</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Brique: a conference about challenging reality">Reply via email</a></p> On recruiting for specific technologies 2017-10-12T00:00:00Z https://hidde.blog/on-recruiting-for-specific-technologies/ <p>I recently had a conversation with a recruiter that went more or less like this:</p> <ul> <li><strong>He</strong>: Are you available for a project?</li> <li><strong>Me</strong>: What kind of project?</li> <li><strong>He</strong>: I have one React project and one Angular project</li> </ul> <p>In my head, I have trouble classifying projects in terms of the specific front-end frameworks that power them. We’re using technology, sure, but what are we using it for?</p> <p>My ideal client knows the answer to the latter question and leaves implementation mainly to the team. The longer I’ve worked as a front-end developer, the more I’ve realised that specific technologies don’t matter that much, especially in projects that run for more than a couple of months. </p> <p>Anyone can learn how to operate a gearbox or figure out how to reverse in a specific type of car. But where are we driving to? Ok, silly metaphor, but hopefully it gets my point across. We’re putting stuff on the people’s screens. It’s mostly about <em>what</em> and <a href="https://hiddedevries.nl/en/blog/2017-09-05-icons-work-on-stuff-that-matters">making stuff that matters</a>, but those are (mostly) not front-end things. </p> <p>Front-end wise, I think these things are probably key: </p> <ul> <li>are we making a fast website, i.e. do we optimise assets and avoid sending unnecessary bytes to the client?</li> <li>are we making a usable website, i.e. have we provided ease of use, rather than confronting our users with problems resulting from our complex business logic?</li> <li>are we making a website that doesn’t exclude people, i.e. do we have all users in mind when hiding and showing content and is our interface keyboard accessible?</li> </ul> <p>I don’t want to be all millennial and display overly unrealistic idealism, but these things seem quite basic to me. Why strive for less? Of course, in actual interviews, it would be interesting to gloss over technologies to use to reach those goals, but I can’t see how filtering for them works as a recruitment strategy.</p> <p>In order to find good people to solve your development problems, problem-solving and people skills are probably going to help much more than previous experience with specific tricks of the trade.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/on-recruiting-for-specific-technologies/">On recruiting for specific technologies</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20On recruiting for specific technologies">Reply via email</a></p> Web Components as compositions of native elements 2017-10-19T00:00:00Z https://hidde.blog/web-components-as-compositions-of-native-elements/ <p>I wrote <a href="https://hiddedevries.nl/en/blog/2015-07-02-what-kind-of-web-components-do-we-need">a post about Web Components</a> about two years ago, wondering what kind we would need, if any. More companies have recently started adopting web components. I’m starting to get more excited about them, and think they can be very helpful to encapsulate compositions of elements.</p> <p><em>Please note: this isn’t a recommendation for ‘switching to Web Components’, at the time of writing browser support is weak and the ‘components without libraries’ is not reality yet. I’m only exploring the theoretical argument.</em></p> <h2>We have all the elements we need…</h2> <p>At university, I learned something about Conway’s Game of Life: it can do super complex things with only <a href="https://en.wikipedia.org/wiki/Conway's_Game_of_Life#Rules">four simple rules</a>. It has been used to implement things as spectacular as <a href="http://www.rennard.org/alife/english/logicellgb.html">Boolean logic</a>, a <a href="https://codegolf.stackexchange.com/questions/88783/build-a-digital-clock-in-conways-game-of-life/">clock</a> and a <a href="http://rendell-attic.org/gol/tm.htm">Turing Machine</a>. Similarly, I have always thought the small set of existing HTML tags is enough to build interfaces suitable for anything. From your local grocer to rocket science (for most websites, with some exceptions). We have all the elements we need.</p> <p><img src="https://hidde.blog/_images/glidergun.gif" alt="Glidergun" /> <em>Glider Gun in Game of Life</em> (<a href="https://en.wikipedia.org/wiki/Conway's_Game_of_Life#/media/File:Gospers_glider_gun.gif">source</a>) </p> <p>To have the capability of creating one’s own elements seemed like fun to me, but unnecessarily complicated. At first sight, it seemed puzzling to me: how many companies are there with the resources to implement Web Components and implement them well (fast, usable and accessible)? Two problems still stand out to me: the need for polyfilling and the fact that going custom means having to provide custom usability and accessibility.</p> <h3>Web Components require polyfilling</h3> <p>To get Web Components working in most browsers, we need to use some sort of polyfill or framework. This puts our problems on users. Maybe they don’t have a fantastic connection or a brand new device. To put it bluntly, they might now experience issues they would not have had to experience if it weren’t for our custom element usage.</p> <h3>Custom makes usability and accessibility harder</h3> <p>Custom elements are custom, so browsers and device don’t ‘know’ what they are for. This means:</p> <ul> <li>they can’t provide a perfect UI that seamlessly matches the platform (as they do for native elements like <code>select</code>), which could result in reduced usability</li> <li>they can’t give assistive technology information about semantics, which could result in reduced accessibility</li> </ul> <p>When the (Shadow) elements inside a web component are native elements, part of this problem goes away, as for those native elements, browsers would likely have perfect UIs and good exposure to assistive technologies.</p> <h2>…but we don’t have all the compositions of elements</h2> <p>Maybe providing new “primitive” HTML elements isn’t the point of Web Components. Although the basic building blocks are there, we often combine basic elements. We combine them to create our own things, our own components, patterns, modules or widgets. We may have all the required elements, we don’t have all the required <em>compositions of elements</em>.</p> <p>Components are often that: compositions of existing elements, complemented with JavaScript and CSS to make a New Thing. The question is: do we want to encapsulate our New Things, so that they are actual, separate things?</p> <p>We do this without Web Components, too. In front-end pattern libraries, each pattern often has its own folder, its own CSS file and its own scripts. In React or Vue, developers often blend markup, style and behaviour together in one piece of JavaScript. </p> <h2>A web standards way to compositions of elements</h2> <p>In recent years, the web standard gods have worked on lots of new stuff that allow developers to have more access to and influence on the web platform. And more control. Numerous new APIs have been released to give developers access to stuff that only the OS could access, like location and Bluetooth, and to stuff that only browsers could access, like stylesheets and the network. Getting access to the set of elements that exist, and being able to extend that, makes sense in that bigger picture. </p> <p>Web Components provide a component model to web standards, <a href="https://infrequently.org/2017/10/web-components-the-long-game/">so that we can stop using complex tools</a>. Yup, less or no external tooling is part of the argument for web components.</p> <p>With components that are part of web standards, we need less reliance on frameworks, says Alex Russell in his post <a href="https://infrequently.org/2012/04/bedrock/">Bedrock</a>:</p> <blockquote> <p>We observed that most of what the current libraries and frameworks are doing is just trying to create their own “widgets” and that most of these new UI controls had a semantic they’d like to describe in a pretty high-level way, an implementation for drawing the current state, and the need to parent other widgets or live in a hierarchy of widgets.</p> </blockquote> <p>In that 2012 (!) article, he observes that creating widgets becomes the core of what modern web development looks like: </p> <blockquote> <p>Let that picture sink in: at 180KB of JS on average, script isn’t some helper that gives meaning to pages in the breech, it is the meaning of the page. Dress it up all you like, but that’s where this is going.</p> </blockquote> <p>So, creation of components, widgets, modules, reusable patterns for user interfaces on the web is commonplace — most web teams do it in some way or another. Frameworks provide ways to do this, but Web Components provide a standardised way to do this. See also: <a href="https://infrequently.org/2017/10/web-components-the-long-game/">Web Components, the long way</a>.</p> <h2>The bright side</h2> <p>I think the decision to go all Web Components shouldn’t be taken lightly, as many organisations may not have the problems they solve, but there are definitely upsides to them. The future for web components is looking quite bright.</p> <h3>Accessibility</h3> <p>Native elements do a great job at having accessibility built in, i.e. if you use a <code>select</code> you can be quite sure most of your users will be able to select stuff with them, even if they use assistive technologies to access your site, even if they have colour blindness. At the point of usage, you don’t need to worry (much) about how accessible it will be. </p> <p>If you build your own component now, you will likely use some JavaScript to make accessibility provisions. There’s some risk they get lost when being copy/pasted. With Web Components, those provisions are not in the markup, they are an integral part of the component. They will be there every time you use the component’s <a href="https://twitter.com/heydonworks/status/920926821088137217">terse syntax</a>.</p> <p>Even better, if the <a href="https://wicg.github.io/aom/spec/">Accessibility Object Model</a> becomes a thing in browsers and Web Components are better implemented, we can set accessibility properties and states directly in JavaScript.</p> <h3>Real encapsulation</h3> <p>With custom elements, you can have scope in HTML and CSS, not just in JavaScript. </p> <p>IMHO, this is a solution for a problem that is not a problem, but I realise people disagree about this. The advantage of this solution is that you never need to worry about where you use a component, as it will have exactly the styles you’ve applied to it. Personally, I will probably still take advantage of CSS’s cascade.</p> <h2>Conclusion</h2> <p>And that’s what I’d like to end this with: the pre web component web is not going to go anywhere. If your website is not extremely complicated, it still makes lots of sense to just write HTML, CSS and JavaScript, keep things simple and stay away from custom elements and Shadow DOM. Peruse that cascade, do some simple DOM scripting, leverage all that built-in usability and accessibility, and be done with it. </p> <p>If you have quite a complex codebase that is componentised through a framework like React, it would make sense to look at Web Components, the web standards way to build encapsulated components. In the future, when they are supported across the board. That isn’t the case at this time, so for now, they are still just theoretical awesomeness.</p> <p><em>Update 24 October: removed parts that suggested I was recommending Web Component usage today; added a note at the top to clarify.</em></p> <hr/> <p>Originally posted as <a href="https://hidde.blog/web-components-as-compositions-of-native-elements/">Web Components as compositions of native elements</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Web Components as compositions of native elements">Reply via email</a></p> New challenges 2017-10-23T00:00:00Z https://hidde.blog/new-challenges/ <p>This month is my last at Wigo4IT, and I’m excited to start new projects at Mozilla and the Dutch Ministry of Internal Affairs.</p> <h2>Leaving Wigo4IT</h2> <p>For years, I’ve wanted to work on front-end code for the public sector, inspired by the awesome user-centered design work that the <a href="https://www.gov.uk/government/organisations/government-digital-service">Government Digital Service</a> (GDS) have done in the UK. While I lived there, I wasn’t in London, the closest I got to the GDS was working for <a href="https://nomensa.com/">Nomensa</a> and sitting <em>near</em> a team that did a GDS project.</p> <p>Back in the Netherlands, I was quite excited when <a href="https://informaat.nl/">Informaat</a>, a user experience agency, approached me and asked me for a project they did for local government. Long story short: I spent a bit of last year and a large part of this year contracting for them at <a href="http://wigo4it.nl/">Wigo4IT</a>. Wigo4IT is a cooperation of the four largest Dutch municipalities, who work together on software related to social welfare. </p> <p>I worked on a portal where people can apply for income support. The role of our front-end team was to build a responsive component library that can be used to create WCAG 2.0 compliant pages. The project was full of challenges related to web forms, front-end pattern libraries and theming. It was also a lot of fun to advocate for accessibility as part of the project, and my first time to have the JAWS screen reader software available to test on. I learned a lot about differences between the public and private sector, on many levels.</p> <h2>New challenges</h2> <h3>Mozilla</h3> <p>As of next month, I will join Mozilla for a couple of months as a freelance front-end developer. I will be working for the <a href="https://wiki.mozilla.org/ParticipationSystems">Participation Systems</a> team, the team that has as its goal to make it easier and more effective to contribute to Mozilla projects for all. I am incredibly excited (and slightly scared) about getting the chance to work with some brilliant minds. </p> <h3>Government</h3> <p>I have also recently started to work on two projects for the Dutch Ministry of the Interior and Kingdom Relations together with <a href="http://askatticus.nl/">Atticus</a>: one to apply a redesign to a set of government data related websites, and another one related to accessibility guidelines conformance statements. I love this, because this is the Ministry where a lot of the official Dutch accessibility information and guidelines are published.</p> <h3>CSS Workshops</h3> <p>Lastly, this year I will also be giving <a href="https://fronteers.nl/workshops/css-layout-hidde-de-vries">my first workshop</a> (organised by Fronteers). Two times, in fact. It’s going to be about modern CSS Layout, including flexbox and CSS Grid Layout. I hope I’ll convince the attendees that those who haven’t yet can now safely abandon Bootstrap for layout, and that we can have lots of fun exploring and using new layout-related properties and thinking.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/new-challenges/">New challenges</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20New challenges">Reply via email</a></p> The web is ready for great graphic design 2017-11-29T00:00:00Z https://hidde.blog/the-web-is-ready-for-great-graphic-design/ <p>There was a time when front-end developers would frown upon (former) print designers that designed for the web. At their usage of ‘perfect’ yet unrealistic content, and their creative ideas that were impossible to build with web tech. If this frowning since has scared print designers away from web design, I hope that they return in 2018. New CSS possibilities are ending the unrealistic content problem and the generic layout problem. It’s a great time to build layouts in CSS!</p> <h2>Problems solved</h2> <h3>The unrealistic content problem</h3> <p>It is now not as common, but I’ve still seen it happen in the past few years. A designer presents a design. The content lines up beautifully, because it is picked to fit perfectly. Headlines that only ever need one line, that sort of thing. It can result in beautiful and balanced visual design. But it doesn’t take many years of front-end experience to know that such designs risk breakage as soon as the template is hooked up to a CMS. The content is updated, and boom, it no longer fits. With new or real content, either the design loses some of its tidiness, or the CMS is set up to force character constraints on content. That leaves the design tidy, but the content inflexible.</p> <p><img src="https://hidde.blog/_images/null/three-blocks-with-the-same-titles-same-photos-and-same-intro-text.png" alt="Three blocks with the same titles, same photos and same intro text" /> <em>When content for one of the blocks changes, it will not be trivial to line up</em> </p> <p>Most of these problems have to do with <strong>keeping things the same height</strong> and <strong>doing advanced alignment</strong>. These are both requirements that are super easy to do on paper and in design software. Easy to do when making a static comp. I guess. But CSS never had tools for doing this flexibly and with unknown content (table layout excepted).</p> <p>In the <a href="https://fronteers.nl/workshops/css-layout-hidde-de-vries">CSS Layout workshop</a> I ran for Fronteers last week, I tried to emphasise that recent updates to CSS mean that the above is soon (or now, actually) no longer an issue. CSS Grid Layout (and flexbox, to some extent) will let us have our cake and eat it, too. We can make things line up or be the same height in a whim, regardless of content. We get flexible units like <code>ch</code> and <code>fr</code> that make it easier to line things up in a way that was always quite sensible, but never quite feasible. Unrealistic content, then, is less of a problem, as we have actual alignment options, rather than CSS trickery. </p> <h3>The defensive design problem</h3> <p>Every so often, contracting for agencies, the designer of a new website would come to me and ask ‘What kind of layout framework are you using? What’s the grid, are we doing Bootstrap or Foundation?’ Sometimes the agency had already listed one of these as a requirement during recruitment. I often found that the in-house developers were used to dictating these kinds of things. Lucky bastards! The reason is probably practical: when producing website after website, it makes sense for a team to start optimising things and have one way of doing grids. When working with contractors, it is useful if that one way is a broadly used open source framework. But it also seems oddly out of order: it can be a lot like solving problems before you have them.</p> <p>The thing with CSS layout frameworks is that there is a fixed amount of stuff they can do. The things that are generic enough to make it into the framework. They speed up things, and are super helpful for prototyping and even creating production sites. But they don’t just create a generic <em>way of working</em>. They also create a generic <em>look of websites</em>. I’m <a href="http://adventurega.me/bootstrap/">not the first</a> to conclude that.</p> <p><img src="https://hidde.blog/_images/null/screenshot-of-website-that-says-hey-look-it-is-every-bootstrap-website-ever.png" alt="Screenshot of website that says Hey look, it is every Bootstrap website ever" /> <em>Defensively designed websites tend to look the same</em> </p> <p>Web design with CSS frameworks in mind is, I think, to design defensively. The approach gives a lot of certainty about whether something can be built, which leads to happiness throughout the team, including product owners.</p> <p>2018 may be the year that we no longer need to design defensively. Because Grid Layout is here. By ‘here’, I mean in our users’ browsers. In The Netherlands, on average 85% of users use browsers with full or partial (IE11) <a href="https://caniuse.com/#search=grid">Grid Layout support</a>.</p> <p>With CSS Grid Layout, <a href="https://www.rachelandrew.co.uk/archives/2017/07/01/you-do-not-need-a-css-grid-based-grid-system/">we no longer need frameworks, CSS now is the framework</a>. This is great, we can now solve problems when we have them. With something that is a <a href="https://en.wikipedia.org/wiki/Web_standards">web standard</a>.</p> <h2>New challenges</h2> <p>There are new challenges, too. The stuff Grid (and flexbox, to some extent) does, can be unexpected to those who have not mastered the <a href="https://www.w3.org/TR/css-grid-1/">spec</a>. That’s probably most of us. They have documented Grid’s behaviour exceptionally well there, but it is perhaps only in real life designs that we will get a feeling of how it all works. For instance, what autoplacement does and how to leverage features like <code>minmax</code> and <code>min-content</code> to get our designs exactly how we want them.</p> <h3>Letting it go</h3> <p>Grid Layout has a lot of ‘leave it to the browser’ kinds of settings. Rather than ‘make this thing 400px wide’, you set things like ‘make it fit roughly between 40 and 60 characters’. More than ever, it is clear that CSS isn’t about exactly specifying what we want.</p> <p>John Allsopp famously discussed this in <a href="https://alistapart.com/article/dao">A Dao of Web Design</a>, over 17 years ago. He talks about “to suggest the appearance of a page, not to control the appearance of a page”. For this, he says we need to let “go of control”: </p> <blockquote> <p>It is the nature of the web to be flexible, and it should be our role as designers and developers to embrace this flexibility, and produce pages which, by being flexible, are accessible to all. The journey begins by <strong>letting go of control, and becoming flexible</strong>.</p> </blockquote> <p>(Emphasis mine).</p> <p>“Letting go of control” is about letting the browser decide based on our hints. Browsers are good at this. They have all the knowledge: what device they’re running on, how much space is available, what fonts are available, which settings the user has set, et cetera. But it isn’t necessarily something all web teams like to do, I found. </p> <h3>Communicating flexibility</h3> <p>Even if we as CSS developers have mastered the spec, we still need to be able to communicate and explain the consequences of our code to designers, product owners and stakeholders. This is key. It requires us to explain stuff to the rest of our team. Results that struck us as unexpected will likely strike them even more.</p> <p>Historically, we’ve seen a lot of website owners like the idea of their websites looking exactly the same everywhere. But it is now clear to most that this is no longer feasible. The case for flexibility has become lots stronger in our current multi-device reality. The internet is on so many devices: fridges, cars and watches with browsers now exist. This reality has powered the responsive design argument, and think it can power the flexible layout argument, too.</p> <h2>Conclusion</h2> <p>So, yes, the web is ready for great graphic design. The flexibility it was invented with has recently flourished with the surge of responsive web design. We now have CSS layout methods that let us embrace flexibility and they have good browser support. <a href="http://labs.jensimmons.com/">Cool experiments</a> are done with CSS Grid Layout. </p> <p>The case for using flexible layout methods will require clear communication between front-end developers and the rest of the team, as well as in-depth knowledge of these new lay-out tools. But I think we can do this. We’ve done it before with responsive web design, and we can do it again!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/the-web-is-ready-for-great-graphic-design/">The web is ready for great graphic design</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20The web is ready for great graphic design">Reply via email</a></p> What to use Grid Layout for? Some ideas. 2017-12-06T00:00:00Z https://hidde.blog/what-to-use-grid-layout-for-some-ideas/ <p>If you have learned how to use Grid Layout, you might wonder what to use it for. In this post, I will give some use cases where I think Grid will excel.</p> <p>In the last two weeks I gave two workshops on CSS layout techniques. Heavily inspired by Jen Simmons’s remarkable <a href="http://labs.jensimmons.com/">Grid Layout experiments</a>, I picked three posters that <a href="https://designmuseum.org/designers/wim-crouwel">Wim Crouwel</a> designed. Crouwel is a graphic designer that has been making use of grids for a long time, including for all the characters in his <a href="https://www.moma.org/collection/works/139322">New Alphabet</a> typeface. His work is iconic and I was quite excited to see some of it could easily be built for the web using CSS Grid Layout.</p> <p>I liked how working on non-real world examples played out, as the focus was really on applying all those different properties, rather than writing production-ready code. Old posters are great to try this stuff out on.</p> <p>After the workshop, <a href="https://michaelhastrich.nl/">Michael</a> asked me what we can use Grid Layout for in the real world, if not for recreating iconic posters from the history of graphic design. I talked to others about this and found various people weren’t sure what to use Grid Layout for in actual websites for clients. </p> <p>I’m sure we can use it for a lot more than recreating old posters. There definitely are good use cases, so I thought I would make a list of where I believe Grid can help us create cool stuff.</p> <h2>Use cases</h2> <h3>To show what’s on offer</h3> <p>Grids are perfect for showcasing things, inspire visitors, communicate to them what kind of stuff we have on offer, in a very broad way. </p> <p>We can do these things with old-school layout methods. However, using CSS Grids they can <a href="https://hiddedevries.nl/en/blog/2017-11-29-the-web-is-ready-for-great-graphic-design">look more exciting</a>, it is trivial to make some things appear more prominently than others and it is easier to have the browser deal cleverly and responsively with content differences. </p> <ul> <li>For an online supermarket: a listing of products with prices, reduced prices, product names</li> <li>For a library: a page with reviews of the five books that have recently come out and have great reviews.</li> <li>For an airport: an overview of the tax-free shopping available</li> <li>For a railway company: a selection of exciting holiday destinations, weekends away, day trips</li> </ul> <p>These are all listing pages that want to inspire people to find stuff, whether it be groceries or books. They can benefit from things only Grid offers.</p> <h3>For one-pagers with a lot of different sections</h3> <p>Many front-end developers will have had to code them if they worked on marketing sites in the past five years: one-page websites in which every section is quite different. They often have lively designs. Lots of differences between sections makes it hard to code systematically. </p> <p>With Grid Layout you can keep the markup of these sections nice and plain and choose a sensible and consistent source order, while still allowing yourself to go wild creatively on each section. </p> <h3>To display a schedule</h3> <p>We can use grids to display information about what’s happening at a given event, conference. Note that proper markup will be extra important here, as for accessibility reasons we want to make sure the content makes sense without its Grid Layout.</p> <h3>For embedded layouts that fill the entire screen</h3> <p>If you’re building an interface that is supposed to go full screen on some physical product, Grid Layout might be quite a helpful way to distribute space. </p> <p>A while ago, I built an interface for a Dutch department store that would be used by the cashier when you pay. It had things like your products on and stuff about loyalty card usage. This kind of interface runs full screen in some sort of embedded browser.</p> <p>Some use cases:</p> <ul> <li>your digital tv interface</li> <li>the self-check-in screen in an airport</li> <li>the screen you see when you return books at the library</li> <li>a screen that shows information on the next train</li> </ul> <p>With a grid that is based on viewport units (<code>vw</code>/<code>vh</code>) and/or fractions, space distribution and alignment may get a lot easier. (I have to admit, in my case the screen ran a browser that was almost identical to IE7 and the system’s output gave me only <code>table</code>s to work with).</p> <p><img src="https://hidde.blog/_images/screenshot-of-grid-specification-that-shows-how-a-game-could-be-built-flexibly-with-grid-layout.png" alt="Screenshot of Grid specification that shows how a game could be built flexibly with Grid Layout" /> <em>The Grid Layout Spec has an <a href="https://www.w3.org/TR/css-grid-1/#adapting-to-available-space">example of a game that always fits on your screen</a>. The required markup/CSS is ridiculously little.</em> </p> <h2>An example</h2> <p>Imagine we have a grid with cards in it for a supermarket’s weekly offers. </p> <p>All offers take one spot in the grid using autoplacement. However, <em>some</em> offers are more prominent, and we could make them use two rows:</p> <pre class="language-css"><code class="language-css"><span class="token selector">.offer</span> <span class="token punctuation">{</span> // regular offer code goes her <span class="token punctuation">}</span> <span class="token selector">.offer--prominent</span> <span class="token punctuation">{</span> <span class="token property">grid-row</span><span class="token punctuation">:</span> span 2<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>I don’t work at a supermarket’s marketing department, so my knowledge of its possible marketing strategies is lacking, but maybe there are other offers. Perhaps one that will expire after this week. This is people’s last chance, so we make it use three columns and two rows.</p> <pre class="language-css"><code class="language-css"><span class="token selector">.offer--last-chance</span> <span class="token punctuation">{</span> <span class="token property">grid-row</span><span class="token punctuation">:</span> span 2<span class="token punctuation">;</span> <span class="token property">grid-column</span><span class="token punctuation">:</span> span 3<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>This is stuff that is trivial in a Grid Layout and impossible to do so easily and flexibly using traditional methods like <code>display: inline-block;</code>. For those of us who have used floats, <code>inline-block</code> and even tables to do lay-out, using Grid Layout may be a bit of a mental shift. I suspect this applies a lot less to people who learn CSS layout today, as they will start in a reality where the new stuff already exists.</p> <h2>Conclusion</h2> <p>There are plenty of uses cases where Grid Layout would be a sensible implementation choice. I have listed some examples above, but I am sure there are more — please leave a comment or tweet if you have found other ideas.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/what-to-use-grid-layout-for-some-ideas/">What to use Grid Layout for? Some ideas.</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20What to use Grid Layout for? Some ideas.">Reply via email</a></p> #yallhands 2017-12-17T00:00:00Z https://hidde.blog/yallhands/ <p>Last week I was at Mozilla’s All Hands in Austin, Texas (hence the hashtag). <a href="https://wiki.mozilla.org/All_Hands">All Hands</a> is an all company event where the people who work for Mozilla come together in one city. Staff, but also prominent volunteers, contributors and community leaders. It’s all about sharing experiences and meeting people.</p> <p>It was my first All Hands, and the first time for me to meet any of the <a href="https://twitter.com/hmitsch/status/941725507753775104">people</a> I have <a href="https://hidde.blog/en/blog/2017-10-23-new-challenges">worked with</a> for the past six-ish weeks. The week went by faster than I could have imagined. I had been warned for this. Beforehand, I had heard great things about the event, but, wow, it was incredible! So many people met, so many productive sessions had, so many <a href="https://twitter.com/dekonstructed/status/940999035284017152">stickers acquired</a> and various American foods tried. </p> <p>Throughout the week I was in many meetings in various settings with colleagues from <a href="https://medium.com/mozilla-open-innovation">Open Innovation</a>, as well as with the IT department whom we collaborate with for identity and access management work (the IAM project). We made plans, shared ideas, talked about planning and discussed our processes. Tons of things that are easier to do in person. For me personally, it was great to learn <em>that</em> and <em>how</em> our daily work fits in the broader Open Innovation and Mozilla goals.</p> <p>Below, I’ve provided a couple of links to projects and ideas for y’all.</p> <h2>Plenaries</h2> <p>A plenary session opened the week, featuring most of the people leading Mozilla, including CEO Chris Beard and Executive Chairwoman Mitchell Baker. There was a lot to celebrate about 2017 for Mozilla. The launch of <a href="https://blog.mozilla.org/blog/2017/11/14/introducing-firefox-quantum/">Firefox Quantum</a> which had been years in the making, projects like <a href="https://voice.mozilla.org/">Common Voice</a> that want to facilitate machine learning of voices for all, the <a href="https://research.mozilla.org/rust/">programming language Rust</a> that gained a lot of momentum and an MDN that is <a href="https://blog.mozilla.org/blog/2017/10/18/mozilla-brings-microsoft-google-w3c-samsung-together-create-cross-browser-documentation-mdn/">supported by all major browser vendors</a>. All these initiatives are means to support Mozilla’s mission: to have a web that puts people first and empowers, rather than one that facilitates harassment, walled gardens, fake news and digital exclusion. Sillicon Valley <a href="https://www.nytimes.com/interactive/2017/10/13/opinion/sunday/Silicon-Valley-Is-Not-Your-Friend.html">isn’t necessarily society’s friend</a>. These are things that need fixing. Katharina Borchert explained that, as these fixes need an answer that goes beyond technology, Mozilla has set up a policy team. Mozilla focuses on <a href="https://www.mozilla.org/en-US/foundation/issues/">five issues</a> in particular. </p> <p><img src="https://hidde.blog/_images/null/chris-beard-in-front-of-slides-with-new-york-times-article-titled-sillicon-valley-is-not-your-friend.jpg" alt="Chris Beard in front of slides with New York Times article titled Sillicon Valley is not your friend" /> <em>“Even mainstream media are noticing”</em> </p> <p>Throughout the week I learned about lots of different projects that clearly work towards this mission. I picked up lots of dots and it was great to see how well they all connected. For example, later in the day, I attended the Mozilla Foundation’s plenary session. Some of the Mozilla fellows presented their work on things like <a href="https://advocacy.mozilla.org/en-US/net-neutrality">Net Neutrality</a>, the <a href="https://internethealthreport.org/">Internet Health Report</a> and privacy. All things that help fix what’s currently broken on the web.</p> <h2>Electives</h2> <p>On Wednesday afternoon I attend various electives: sessions open to anyone, focused on a specific subject. There was a lot of good stuff to choose from, I ended up going to the ones about the Photon Design System, WHATWG and a design system approach to Mozilla’s websites.</p> <h3>Photon Design System</h3> <p><a href="https://html.spec.whatwg.org/multipage/">Photon</a> is the design system used by the people who build Firefox. It was created because browser engineers and designers wanted it, to make it easier to have the same look and feel across the browser, on all the platforms it works on. Currently it is ‘just’ a website that documents the design choices, but the team are looking in turning the style guide into a living style guide. In a fun post-it note exercise we looked at the pros and cons of <strong>Design Tokens</strong>. They are <a href="https://github.com/FirefoxUX/design-tokens">design decisions abstracted into JSON files</a>, so that they can be reused. In CSS or Sass, but also in design software like Sketch. This setup can create an application agnostic approach to documenting design, because the tokens are easily shareable between platforms and people.</p> <p><img src="https://hidde.blog/_images/null/design-tokens-pin.jpg" alt="Design Tokens pin" /> <em>It was fun to think about Design Tokens</em> </p> <h3>WHATWG</h3> <p>At the session of standards community WHATWG, I learned about their recent <a href="https://blog.whatwg.org/working-mode-changes">changes to dealing with intellectual property rights</a> and what they mean for contributing. The new IPR agreement and way of working was developed together with all major browser vendors: Apple, Google, Microsoft and Mozilla. They all have representatives in the Steering Group. Spec contributors of all of those companies now contribute to the Living Standard/WHATWG-version of specs like <a href="https://html.spec.whatwg.org/multipage/">HTML</a>, rather than the W3C version (as GitHub activity shows). The session was quite positive and people seemed eager to work together with others including W3C, and minimise confusion for developers and browser implementors.</p> <h3>From wagile to agile with mozilla.org</h3> <p>Craig Cook, front-end developer at mozilla.org held an elective about design systems. Mozilla has hundreds of websites, some quite old and some brand new. Many of those have been developed in a process that started as agile but quickly became waterfall, something he ironically referred to as <strong>wagile</strong>. Design systems can help here, because if multiple sites make use of one design system, it is only that system that needs updating rather than individual sites. That would really offer the flexibility in process that wagile lacked. Other than process it will likely improve user experience, as human brains are good at pattern recognition, having reusable patterns leverages that. As someone who works on some Mozilla sites now and in 2018, I look forward to seeing the design system flourish.</p> <h2>Lightning talks</h2> <p>I also attended a number of lightning talks. Some facts from those:</p> <ul> <li>you can have <a href="https://yurydelendik.github.io/old-man-sandbox/rust-wasm-hey/hey.html">sourcemaps for Web Assembly (wasm) compiled Rust code in the browser</a>, which can make wasm debugging as straightforward as JavaScript debugging</li> <li>user testing showed that action-oriented users of MDN are better served with a <a href="https://twitter.com/mozhacks/status/941421346550173696/photo/1">live preview CSS editor</a>.</li> <li>the <a href="https://people.xiph.org/~jm/demo/rnnoise/#music_player">RNNoise project</a> teaches computers to reduce noise with recurrent neural networks</li> <li>incremental Rust compilation is coming, which will make things a lot faster</li> <li>Web of Things is a horizontal stack and open source approach to Internet of Things, for which Mozilla submitted the <a href="https://iot.mozilla.org/wot/">Web Things API spec</a></li> <li>there is talk about a Rust-powered version of Ember</li> <li><a href="https://voice.mozilla.org/">Common Voice</a> aims to create an open source data set that can be used by anyony who wants to teach machines about recognising voices; it has collected as much as 500 hours worth of speech data</li> </ul> <p><img src="https://hidde.blog/_images/null/speaker-with-slide-that-shows-mdn-docs-about-box-shadow-with-a-css-editor.jpg" alt="Speaker with slide that shows MDN docs about box shadow with a CSS editor" /> <em>CSS editor in MDN</em></p> <p>This week has given me a lot of energy, despite the inevitable shortage of sleep. It has been a lot of fun to be part of this. It was refreshing to meet this super global community, with different countries and cultures represented. I am looking forward to Q1 of 2018, and the work that lies ahead. Because executing things is even more fun than planning them!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/yallhands/">#yallhands</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20#yallhands">Reply via email</a></p> 2017 in review 2017-12-29T00:00:00Z https://hidde.blog/2017-in-review/ <p>Inspired by <a href="https://nienkedekker.com/blog/2017-a-post-mortem">Nienke</a>, I’d like to share some of my highlights and learnings of 2017.</p> <h2>Highlights</h2> <h3>Projects</h3> <p>2017 was the first full year working via my Dutch company, after I had hiddedevries.nl Limited struck off the English companies registry as part of my personal Brexit. The Dutch company was there since January 2007. It’s been over ten years now, but it feels so much shorter. </p> <p>This year, I really, really wanted to focus on work with social impact (in government, culture or non-profit). How millennial! But really. In a world that is more and more powered by technology, choosing what kind of technology to work on and which people benefit from that technology seemed super important. This was not easy per se. If I’m honest, as a contractor, the kind of work I can do largely depends on what kind of projects I am approached for. Recruiters usually laughed when I mentioned my preference. But I feel it would be sad if all the bright minds of our industry helped some webshop create a better checkout flow and sell more tvs, if we could have helped citizens get the support they need. I tried being proactive, but luck and chance were probably as important. Anyway, I got to do some pretty impactful projects this year. </p> <ul> <li>At Wigo4IT I worked on a web page where people can apply for income support from their local government (for the cities of Amsterdam, Rotterdam, Utrecht and The Hague)</li> <li>At Logius I worked on a website where Dutch governmental organisations can generate an accessibility statement</li> <li>At KOOP I worked on the redesign of various data-heavy websites, like overheid.nl and wetten.nl</li> <li>For Web Conferences Amsterdam, I worked on visual design for the CSS Day and PhoneGap Day EU conferences (building upon <a href="http://the-haystack.com/">Stephen</a>’s designs)</li> <li>I made various small changes to websites of Xander Publishers, Trio42, Stichting Piet de Vries and others</li> <li>I joined Mozilla’s Open Innovation team as a contractor, and my contract was extended until far into 2018</li> </ul> <h3>Conferences and events</h3> <p>I have attended a couple of conferences this year:</p> <ul> <li><a href="https://cssday.nl/">CSS Day</a>, which this year was a two day event about CSS and Browser APIs (<a href="https://hiddedevries.nl/en/blog/2017-06-16-browser-api-special-and-css-day">write-up</a>)</li> <li><a href="http://pgday.phonegap.com/eu2017/">PhoneGap Day EU</a> </li> <li><a href="http://brique.nl/">Brique</a>, a design conference by Fabrique</li> <li><a href="https://patternsday.com/">Patterns Day</a>, about pattern libraries (<a href="https://hiddedevries.nl/en/blog/2017-07-01-coherence-lego-and-how-naming-things-is-hard-patterns-day-2017">write-up</a>)</li> <li><a href="https://fronteers.nl/congres/2017">Fronteers 2017</a>, its tenth edition and the first where I had no responsibilities whatsoever, great catching up with people</li> <li>the year opening of Communication & Multimedia Design in Amsterdam, which I thought had a ‘work on stuff that matters’ theme to it (<a href="https://hiddedevries.nl/en/blog/2017-09-05-icons-work-on-stuff-that-matters">write-up</a>)</li> <li>Web Accessibility Live (which has no website, but it was great to see <a href="https://twitter.com/detonite">Job</a> and <a href="https://brucelawson.co.uk/">Bruce</a> speak)</li> </ul> <h3>Speaking</h3> <p>This year I also stepped out of my comfort zone and did my first public speaking, thanks to <a href="https://nielsleenheer.com/">Niels</a> and <a href="https://tink.uk/">Léonie</a> for encouraging me.</p> <ul> <li>I talked about hiding content (<a href="https://hiddedevries.nl/en/talks/2017-10-04-hiding-content/">slides</a>) and the basics of accessibility (<a href="https://hiddedevries.nl/en/talks/2017-09-21-toegankelijk-bouwen/">slides</a>, <a href="https://www.youtube.com/watch?v=vUMSeuj_Dz0">video</a>), at meetups. </li> <li>At Fronteers Jam Session, I did an even shorter version of my talk about hiding content</li> <li>At Inclusive Design 24, I spoke about the argument for accessibility from philosophical ethics (<a href="https://hiddedevries.nl/en/talks/2017-11-16-a11y-ethics/">slides</a>, <a href="https://www.youtube.com/watch?v=Wk1uErzMA2Q">video</a>)</li> <li>For Fronteers, I hosted two workshops about CSS Layout, which, to my own surprise, sold out. It’s awesome to see so many people excited about new lay-out techniques</li> </ul> <p>Also to my own surprise, I thoroughly enjoyed preparing and giving talks. So much, that I would love to do more in 2018. Nothing much planned so far, but the CSS Layout workshop is <a href="https://fronteers.nl/workshops/css-layout-hidde-de-vries">running again</a> and there may be another workshop in the first half of 2018.</p> <h3>Writing</h3> <p>On this blog I published 32 posts, some longer than others, some more interesting than others. There were also many posts that did not make it past the Draft stage, I guess that will always be the case. Writing can take up a lot of time, but I can recommend it to everyone working in the web field. It helps understand stuff better, can expose what you don’t know yet and also just to align thoughts. </p> <p>These are some of the most read:</p> <ul> <li><a href="https://hiddedevries.nl/en/blog/2017-07-03-did-css-get-more-complicated-since-the-late-nineties">Did CSS become more complicated since the late nineties?</a></li> <li><a href="https://hiddedevries.nl/en/blog/2017-07-11-this-website-now-uses-grid-layout">This website now uses Grid Layout</a></li> <li><a href="https://hiddedevries.nl/en/blog/2017-04-04-how-to-make-inline-error-messages-accessible">How to make inline error messages accessible</a></li> <li><a href="https://hiddedevries.nl/en/blog/2017-05-05-accessibly-labelling-interactive-elements">Accessibly labelling interactive elements</a></li> <li><a href="https://hiddedevries.nl/en/blog/2017-04-11-on-hiding-content">On hiding content</a></li> </ul> <h3>Volunteering</h3> <p>On April 1st this year I stopped volunteering at Fronteers, after over 8 years. It’s been a lot of fun and I learned a lot, yet it felt very good to step down. </p> <p>The decision has given me a lot of free time, which was good. But I couldn’t really help myself and did organise a small event with <a href="https://www.linkedin.com/in/sharonmartens">Sharon</a>: a <a href="https://hidde.blog/hanzi">film screening</a> of Hanzi the movie, its European premiere. Responses were great, some people even suggested we could do a monthly design documentary meetup in Rotterdam. That would be very cool. </p> <h2>Things I learned</h2> <p>Finally, some random things I learned:</p> <ul> <li>In two projects I was involved in we had official WCAG 2.0 audits, it was great to get feedback on our accessibility efforts. Before the auditor came I had done all I could to be 100% compliant, but they found several issues anyway, most of which we were able to resolve, others we could use as leverage to convince people of different prioritisation. Because accessibility is, as many things, team work.</li> <li>I presented a couple of sprint review demos. It was fun to try and explain our technical projects to an audience with various less technical people in it. I learned to switch quickly between more and less technical narratives. </li> <li>Remote working can be tiresome, especially working across time zones. I’ve had to force myself to do some non work things in my days to balance stuff out. Knowing when to ignore notifications late at night is acceptable and also key.</li> <li>I wrote a lot of vanilla JavaScript, I owe a lot this year’s progress to <a href="https://twitter.com/matijs">Matijs</a>, his patience is A+</li> <li>Learned loads about how big organisations manage projects and how to be political about getting accessibility to be a priority. For example: be nothing but positive and constructive in meetings (this is a skill I’ve had to get much better at). I owe a lot of this year’s progress in that part of work to <a href="https://twitter.com/jeroenhulscher">Jeroen</a>. who is very good at this stuff</li> <li>It’s been good to plan for holidays. However much it might seem like they’re not necessary, they absolutely are.</li> </ul> <p>Some resolutions for the next year: </p> <ul> <li>More reading of books and newspapers, less looking at my phone </li> <li>More public speaking if I can</li> <li>Better time management</li> <li>Help other people get started with a personal blog like this one (get in touch if you need proofreading/advice)</li> </ul> <p>I am looking forward to 2018. Happy new year!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/2017-in-review/">2017 in review</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%202017 in review">Reply via email</a></p> Form events when submitting with keyboard 2018-01-11T00:00:00Z https://hidde.blog/form-events-when-submitting-with-keyboard/ <p>The other day I was building a form, and I was surprised how event firing works when you press <code>ENTER</code> on the keyboard.</p> <p>When you’re on a form field in most browsers, pressing <code>ENTER</code> on the keyboard triggers the browser to submit the form. This is called <a href="https://html.spec.whatwg.org/#implicit-submission">implicit submission</a> (thanks <a href="https://twitter.com/timseverien">Tim</a>). I suspected pressing <code>ENTER</code> would cause a <code>submit</code> event to be fired on the form, but it is more nuanced than that. </p> <p>‘ENTER’ submits the form, even if it contains no submit button. If the form does contain one or more submit buttons:</p> <ul> <li>pressing <code>ENTER</code> results in a <code>click</code> event on the submit button of the form</li> <li>when the submit button is clicked, it submits the form, which triggers a <code>submit</code> event on the form</li> </ul> <p>In the above, “the submit button” is the first submit button that exists in your form, the HTML spec calls this the form’s <a href="https://html.spec.whatwg.org/#implicit-submission">default button</a>.</p> <p>What surprised me, is that functions that listen to the <code>click</code> event on your default button, run <em>before</em> the form’s <code>submit</code> event is fired. Running <code>event.preventDefault()</code> on the form’s submit event will not stop that click handler from running (thanks <a href="https://twitter.com/matijs">Matijs</a> for helping me figure this out).</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/form-events-when-submitting-with-keyboard/">Form events when submitting with keyboard</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Form events when submitting with keyboard">Reply via email</a></p> My ideal newspaper app is not very smart 2018-01-12T00:00:00Z https://hidde.blog/my-ideal-newspaper-app-is-not-very-smart/ <p>For about 6 years, I have mostly stopped reading my daily paper physically, unless sipping lattes in a coffee shop. I used its app instead. In those years, they released various updates, and these updates got me thinking about what I want from a newspaper app. </p> <p>My app-based news consumption was somewhat of a necessity. I was abroad and kiosks abroad very rarely sell Dutch dailies. I’ve since really come to like reading digitally, and it also saves paper and sending screenshots to friends is useful. </p> <h2>My ideal</h2> <p>Ideally, the app just downloads a PDF and lets me browse through that page by page. A screen that has all pages would be useful, too, so that it is easy to jump to that one cartoon that I know will be on the last page. Yup, that doesn’t contain links and isn’t easily updated, and it doesn’t peruse some of the unique features of the web platform. It’s boring, simple and not very smart. To read articles you even need to zoom in, as the text is not HTML, it’s not responsive, it’s literally a PDF (it does contain plain text for users who need or prefer this).</p> <p>Two things I like about the PDF-style newspaper reader: first, it looks like the newspaper everyone else buys from the kiosk, second, this formatting is the one a editing team of smart people have chosen over the course of their night. Up until moments before the thing really needs to go to press, they can still tweak things. After that time, that’s it: the paper of that day. </p> <p>The good thing about producing one paper a day rather than a continuous stream of news is that the daily deadline forces decisions about what’s most important. Even if that means the occassional ‘when this went to press, we only knew 80% of the election results’. I can live with that. It is good for my sanity to take in one thing a day rather than continuous streams of news. </p> <p>I like artificial intelligence, but for some things human judgment clearly wins. Let alghorithms calculate my fastest route to work or what the best way is to distribute food droppings in a war zone. For news, I think intentional prioritisation and placement in the page are best left to humans.</p> <h2>Their innovations</h2> <p>Two things De Persgroep have added to their Volkskrant app:</p> <ul> <li>ads that take over the whole screen</li> <li>animated page switch</li> </ul> <p>I probably don’t need to explain what’s underwhelming about the addition of ads. This doesn’t belong here. </p> <p>An animated page switch is cool, it keeps the interface fresh, but my tablet is too old to do the animation, causing it to freeze for a few seconds halfway an animation. </p> <p>Both the ads and the animation slowed down the app considerably. This meant that, over the years, my digital paper became harder to read. That is remarkable for what is essentially a PDF reader. </p> <h2>What I’m not looking forward to</h2> <p>What I’m mostly concerned about is that my news will be displayed like it is on the newspaper’s website. This is great when one wants to see the latest news at a glance, but, with the bath water, it would throw away the <em>daily</em> carefuly curated prioritisation that news physical papers offer.</p> <p>With CSS Grid Layout, the kind of layouts that are mostly unique to newspapers, are now possible in browsers. But until the process of filling a web based newspaper grid becomes a process similar to filling the physical paper with content, and I think having one daily thing that doesn’t change (much; small updates could be useful), I’m hoping the PDF-viewer version will stay on offer. Otherwise I would likely switch back to paper.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/my-ideal-newspaper-app-is-not-very-smart/">My ideal newspaper app is not very smart</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20My ideal newspaper app is not very smart">Reply via email</a></p> Making password managers play ball with your login form 2018-01-13T00:00:00Z https://hidde.blog/making-password-managers-play-ball-with-your-login-form/ <p>Secure passwords are long and unique. Therefore, remembering them all is impossible for most human beings. Hence the popularity of password managers. If you’re building a login form, these are some tips to improve the experience for password manager users.</p> <p>With ‘playing ball’ in this post, I mean that password managers recognise your login form and let you use their features on your fields. Things like password generation, offering to save credentials for a host name and filling in the password for you in a secure way. Ideally, password managers work in both of these cases: on first time visit (when they offer to store credentials) and on recurring visits (when they let you use stored credentials).</p> <p><img src="https://hidde.blog/_images/1password-suggesting-browserstack-credentials-to-be-used-for-site.png" alt="1Password suggesting Browserstack credentials to be used for site" /> <em>1Password recognises it has a pair of credentials for this site</em></p> <p>Password managers come with all sorts of heuristics to detect username and password fields. Yet, they sometimes still fail to recognise them. For this reason, Firefox’s password manager complements <a href="https://dxr.mozilla.org/firefox/source/toolkit/components/passwordmgr/src/nsLoginManager.js#626">its heuristics</a> with a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1119454">recipe system</a>, where users can describe specific instructions for specific hosts. I believe some password managers have hard-coded field recognition for popular websites in order to make them work.</p> <p>You might think, isn’t recognising my fields the job of a password manager? Isn’t this their problem? I have good news. Mostly, yes. Password managers are built to work with all login forms that <strong>follow best practices</strong>. Doing nothing special is an option. It will often give you a form that performs well across password managers. But if things don’t play out, this post may contain some pointers to look at.</p> <p><img src="https://hidde.blog/_images/null/password-manager-popup-add-to-last-pass.png" alt="Password manager popup add to last pass" /> <em>Last Pass playing ball</em> </p> <h3>Security considerations</h3> <p>Password managers that automatically fill in credentials can be prone to coffeeshop hacker attacks (over HTTP) , as shown by Silver, Jana et al in their paper <a href="http://www.cs.columbia.edu/~suman/docs/suman_pwdmgr.pdf">Password Managers: Attacks and Defenses</a> (pdf). They also provided a number of measures that password managers can take to prevent this, including only allowing filling in passwords after user interaction. </p> <p>There is also a risk of <a href="https://freedom-to-tinker.com/2017/12/27/no-boundaries-for-user-identities-web-trackers-exploit-browser-login-managers/">leaking password information to third party scripts</a>. The article explains actions against this include having the login form on a separate domain, ad blockers, and disabling autofilling altogether (as <a href="https://twitter.com/rmondello/status/956236674320576513">Safari will do by default</a>). At the same time, more transparency could be provided with browser warnings or permission requests before autofilling.</p> <h2>Use standard HTML form practices</h2> <p>Make sure your form fields are in a <code>&lt;form&gt;</code> element that has an <code>action</code> and a <code>method</code> attribute defined on it.</p> <p>Another think to look for, is that <code>input</code> elements are associated with a <code>label</code> through their ID (with <code>for</code>) or by being wrapped in one. </p> <p>Using the right input type can also help: <code>type="text"</code> or <code>type="email"</code> for the username / email address, and <code>type="password"</code> for the password.</p> <h2>The <code>autocomplete</code> attribute</h2> <p>The <code>autocomplete</code> attribute on your username and password inputs can help password managers or browsers figure out what your fields are for. Actual autocompleting, as mentioned above, could be a security risk, if it is done by password managers on page load, rather than after user interaction, or if it happens on pages where protocol or host name are off.</p> <p><a href="https://stackoverflow.com/questions/3868299/is-autocomplete-off-compatible-with-all-modern-browsers/21348793#21348793">Major browsers ignore autocomplete=”off”</a>, some do this <a href="https://matthew.noorenberghe.com/comment/847#comment-847">specifically for username and password fields</a>, as they deem it more secure than users using very easy-to-remember passwords. </p> <p><a href="https://www.chromium.org/developers/design-documents/create-amazing-password-forms#TOC-Use-autocomplete-attributes">Google recommend using autocomplete attributes</a>, and their advantages also appear in the spec (yes, there’s a spec!):</p> <blockquote> <p>The <code>autocomplete</code> attribute offers a declarative mechanism by which websites can work with user agents to improve the latter’s ability to detect and fill sign-in forms by marking specific fields as “username” or “password”, and user agents implement a wide variety of detection heuristics to work with websites which haven’t taken the time to provide this detail in markup.</p> </blockquote> <p>(Source: <a href="https://w3c.github.io/webappsec-credential-management/">Credential Management spec</a>)</p> <h3>For usernames</h3> <p>For the username field, you can add <code>autocomplete="username"</code>. </p> <h3>For passwords</h3> <p>For new passwords, for example during account creation or in a password reset process, it’s <code>autocomplete="new-password"</code>. For current passwords, for example in a login form, it’s <code>autocomplete="current-password"</code>.</p> <h2>No funny stuff</h2> <p>Both <a href="https://support.1password.com/compatible-website-design/">1Password</a> and <a href="https://lastpass.com/support.php?cmd=showfaq&id=3385">LastPass</a> have various recommendations related to unexpected behaviour. Well-built login screens:</p> <ul> <li>try to stay away from dynamically adding and removing fields</li> <li>don’t regularly change names or IDs (or, worse, populate them dynamically) </li> <li>have the form on the page on first render from the server</li> <li>avoid <code>method=GET</code> and XHR requests for logging in (it can work, but it is harder)</li> <li>use the <code>placeholder</code> attribute <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#attr-placeholder">as it is intended</a></li> <li>steer clear from mimicking a password field with a regular field so that you can do things like showing the last character</li> </ul> <p>The message here is: keep it as simple as you can. This helps both users <em>and</em> password managers.</p> <h2>Multi-page login forms</h2> <p>Multi-page login forms can make sense, for example if there are different login options based on the type of user. With this kind of login pages, some password managers, including LastPass, may not play ball. I’ve found that LastPass will not work on first time visits, when your password field is <code>hidden</code> or in a <code>hidden</code> element (<a href="https://html.spec.whatwg.org/dev/input.html#hidden-state-(type=hidden)">more on the hidden attribute</a>). In others, including 1Password and the built-in managers of Chrome and Firefox, this problem does not exist.</p> <p>In my situation, ‘pages’ were just <code>div</code>s on the same page, with only one of them not <code>hidden</code>. That caused LastPass to not do its first time visits thing. I consider this a bug in LastPass, or overly enthusiastic heuristics at the very least. I found out that if I used something like <code>opacity: 0;</code> it did not fail. This would cause a weird user experience, as <code>opacity</code> only visually hides elements, leaving them available to access by keyboard or Assistive Technologies (AT). Sometimes, and in this case, accessibility is about making something <em>inaccessible</em> to all, at the same time (i.e. when temporary hiding certain screens in a flow).</p> <p>What I ended up going for is this: I used <code>data-hidden</code> instead of <code>hidden</code>, with CSS that only visually hides. In addition, I added the <code>inert</code> attribute (and its polyfill, as it has no browser support), to make sure the elements are not only invisible, they are also unavailable to use (until they should). Unavailable not only visually, but also for keyboard and AT users. It’s hacky, but it did circumvent LastPass’ bug.</p> <h2>Conclusion</h2> <p>Password managers are essential to secure internet usage, so making our login fields work with them is extremely important. This will mostly happen automatically if you follow best practices. The <code>autocomplete</code> attribute can make it easier for password managers to recognise your fields. Using <code>hidden</code> attributes can make password managers fail altogether. This can be hacked around, but I do not recommend doing so, unless absolutely necessary.</p> <p><em>Many thanks <a href="https://twitter.com/detonite">Job</a>, <a href="https://krijnhoetmer.nl/">Krijn</a>, <a href="https://mathiasbynens.be/">Mathias</a> and <a href="https://twitter.com/hmitsch">Henrik</a> for suggestions and feedback</em></p> <hr/> <p>Originally posted as <a href="https://hidde.blog/making-password-managers-play-ball-with-your-login-form/">Making password managers play ball with your login form</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Making password managers play ball with your login form">Reply via email</a></p> aria-expanded does not require a fallback 2018-01-22T00:00:00Z https://hidde.blog/aria-expanded-does-not-require-a-fallback/ <p>When building a control that toggles content in a web app, we can use <code>aria-expanded</code> to let the control know whether the content is shown or hidden. Expanded or not expanded. In assistive technologies (AT) that support this attribute, AT users can figure out whether the element was expanded. </p> <p>The other day, a website I worked on was audited for accessibility compliance. The auditor suggested we would add a fallback for <code>aria-expanded</code>, so that it would work for more users. After some discussion back and forth, we decided against this and went with no fallback.</p> <p>For those who don’t know the attribute, <code>aria-expanded</code> is an attribute you can put on a button that toggles content. When toggling the content, you update the attribute to be <code>true</code> of <code>false</code>. This lets browsers, accessibility APIs, platform APIs and ultimately your end users know that the thing is now open or closed. It is the mechanism that powers the <code>details</code> element in HTML, but you can also use it on your own controls, for example a hamburger menu or in a questions and answers sections.</p> <h2>Providing a fallback</h2> <p>For users of AT that does not support the <code>aria-expanded</code>, a fallback can be implemented. One way to do this is to simply add visually hidden text that conveys the control’s state:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>visually-hidden<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> (expanded)<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">></span></span></code></pre> <p>I would not recommend this. Yes, if we add this text like this to the control, it will get conveyed to users of AT. With it, potentially more users can use and understand the control. However, it might cause more problems than it solves.</p> <h2>No fallback</h2> <p>These are some reasons not to provide a fallback for <code>aria-expanded</code>. </p> <h3>A string that needs maintenance</h3> <p>There is now a string of text that needs to be maintained. It sits in your markup, it requires time to explain to new team members and you’ll have to decide whether you want it managed by a CMS.</p> <h3>Non-standard text</h3> <p>If you add this text yourself, you or your colleagues may end up picking different text across the site. Or text that is different from what users hear on other sites that have expandable elements in them. And if someone new starts on the team, they may not understand what this is and can’t look it up in a spec, as it is not standard.</p> <h3>No automagic localisation</h3> <p>Screenreaders that support <code>aria-expanded</code>, will read out the status of the control: when it is collapsed, it says ‘collapsed’, when it is expanded, it says ‘expanded’. This is if your screenreader speaks English. If it speaks Dutch, it adapts and will say ‘ingeklapt’ or ‘uitgeklapt’, respectively. It’s up to the screenreader and its settings what it says, but we can be sure it will be consistent and free of maintenance.</p> <h3>Redundant for most users</h3> <p>Users that use AT with <code>aria-expanded</code> support, will hear the status twice. Ok, this can be mitigated by using hidden text <em>instead</em> of the attribute, but then the other points still stand.</p> <h2>So what is AT support like?</h2> <p>The question this might leave you with: what is AT support for <code>aria-expanded</code> like? It is <a href="http://test-cases.tink.uk/aria-expanded/index.html">well supported across platforms</a>, and works in screenreaders like JAWS, NVDA, VoiceOver and Narrator. This means a fallback would leave most AT users to hear the status twice, to solve a problem for very few.</p> <p>So, in conclusion: it is now best to use <code>aria-expanded</code> without fallbacks.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/aria-expanded-does-not-require-a-fallback/">aria-expanded does not require a fallback</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20aria-expanded does not require a fallback">Reply via email</a></p> You don't always need alternative text 2018-02-06T00:00:00Z https://hidde.blog/you-dont-always-need-alternative-text/ <p>In a project I worked on recently, I noticed almost everything in the page had alternative text. Sometimes this can be redundant, for example if there is already text on the page that says what the thing is. Let’s look at some examples.</p> <h2>Why alternative text</h2> <p>A lot of the web is text. This is great. As a medium, that makes the web super parseable for external tools like search engines and assistive technologies (AT). It makes it even a better medium than the real world, where such parsing still requires a lot more effort. Until machine learning is ubiquitous, I guess, the fact that we have so much text on the web, makes the web the ultimate medium for accessible content.</p> <h2>When it is needed</h2> <p>Whenever we include non-text elements on a page, it is a good practice to add alternative text. For example, when adding an image, whether it is a photo or something with three words of text in it, we can use the <code>alt</code> attribute to convey what’s on the image to anyone who can’t see it. We’ve all seen this:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>img</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>delirium.jpg<span class="token punctuation">"</span></span> <span class="token attr-name">alt</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>A pink elephant<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span></code></pre> <p>Or when adding a video, it is useful to add subtitles, for users who cannot hear the people talking in the video:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>video</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>instruction-video.mp4<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>track</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>instruction-video.vtt<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>video</span><span class="token punctuation">></span></span></code></pre> <h2>When it is not needed</h2> <p>Sometimes, alternative text is redundant. Look at these examples:</p> <h3>Speaker photos on a conference website</h3> <p>A page is divided in sections, with sections for each speaker. The heading in the section is the name of the speaker. There is also a portrait of the speaker. The photo does not require alternative text here, as it would be the same as the section heading, and that would be redundant. Note that the <code>alt</code> attribute is required, so in this case I would recommend an empty alt attribute: <code>alt=""</code>. </p> <p>I only learned when I was involved with Fronteers Conference, which follows this pattern on <a href="https://fronteers.nl/congres/2013/speakers">its speaker pages</a> (thanks <a href="https://krijnhoetmer.nl/">Krijn</a>).</p> <h3>Labelled icons</h3> <p>Here’s a close button:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>button<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>img</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>close.svg<span class="token punctuation">"</span></span> <span class="token attr-name">alt</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Close<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span></code></pre> <p>In this case, there is only an icon, it exists on its own. An alternative text would be useful here, especially since it is used as an interactive element (like <code>&lt;a&gt;</code> or <code>&lt;button&gt;</code> ). If a button is just an icon, it does not have text that can function as the element’s ‘name’. So when, for example, a screenreader announces ‘button’, it doesn’t announce what the button is (as it doesn’t know). Adding a text like ‘Close’ helps with that, so that the screenreader can announce ‘button - close’</p> <p>But when an icon has a word next to it, for example ‘Log out’, the icon itself is decorative and does not need an alternative text:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>button<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>img</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>close.svg<span class="token punctuation">"</span></span> <span class="token attr-name">alt</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> Close <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span></code></pre> <p>In this case we can leave the <code>alt</code> attribute empty, as otherwise a screenreader would announce ‘button - close close’.</p> <h3>When captions describe photos</h3> <p>Sometimes, photos come with visible captions that describe them. In these cases, it is not necessary to add text into the <code>alt</code> of the photo, as the alternative text is already out there, the description has fulfilled the need.</p> <h2>Conclusion</h2> <p>Alternative text is a great opportunity to make the non-text parts of the web accessible. However, look out for redundancy, and only add it when it conveys something that isn’t already there.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/you-dont-always-need-alternative-text/">You don't always need alternative text</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20You don't always need alternative text">Reply via email</a></p> Donuts and Fronteers 2018-04-09T00:00:00Z https://hidde.blog/donuts-and-fronteers/ <p>At the Open Innovation team at Mozilla, I learned about <a href="https://donut.ai/">Donutbot</a>. It is a Slack bot that randomly matches people from the team to each other, so that they can then go on and enjoy donut together. They are usually just metaphorical donuts, you could totally go for bubble tea or lunch. It doesn’t even have to be together, in person. You could use video conferencing software. But if you do meet IRL, selfie-sharing is appreciated.</p> <p>Random donuts are a fun way to meet people you don’t directly work with. Or people you, for whatever reason, never talked to. It is also like a water cooler for remote workers. I really like the idea, so I suggested it to Fronteers, the Dutch professional association for front-end developers. It has a large-ish Slack community of mostly Netherlands-based front-end developers.</p> <p>The way Donutbot works is as follows: it lives in a specific channel, which everyone in a Slack community is invited to join. Every two weeks, it matches everyone in the group with a random other person. To do this, it will start a group conversation with itself and the two people. That’s it. They can then sort out a date and time to physically or digitally meet. After two weeks, it will ask if you have had a chance to meet.</p> <p>As of this week, Donutbot exists on Fronteers Slack. To be part of it, <a href="https://fronteers-slack.herokuapp.com/">join</a> the <code>#meetandgreet</code> channel, and who knows who you’ll meet next.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/donuts-and-fronteers/">Donuts and Fronteers</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Donuts and Fronteers">Reply via email</a></p> A Dutch version of the Inclusive Design Principles 2018-04-16T00:00:00Z https://hidde.blog/a-dutch-version-of-the-inclusive-design-principles/ <p>I love the Inclusive Design Principles and often refer to them in discussions about accessibility. I also like language, so I thought why not translate them into <a href="https://inclusivedesignprinciples.org/nl/">Dutch</a>?</p> <p>The Inclusive Design Principles are written by the good people of The Paciello Group. They give guidance on how to make your websites and apps <strong>work for more people</strong> and <strong>make user-centered choices</strong>. The document urges makers of websites to think about context, consistency, choice and control, and emphasises that our products should add value, offer the same to all users and make primary content and tasks the first thing on a page. </p> <p>If you would like to read or share them in Dutch, you now can, as <a href="https://inclusivedesignprinciples.org/nl/">Principes voor Inclusive Design</a> is now live.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/a-dutch-version-of-the-inclusive-design-principles/">A Dutch version of the Inclusive Design Principles</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20A Dutch version of the Inclusive Design Principles">Reply via email</a></p> For everyone 2018-04-20T00:00:00Z https://hidde.blog/for-everyone/ <p>At accessibility talks, I love to show a photo of Sir Tim Berners-Lee and the words he made appear on enormous screens during the 2012 Olympics opening ceremony in London: ‘This is for everyone’. </p> <p><img src="https://hidde.blog/_images/display-in-stadium-showing-this-is-for-everyone.jpeg" alt="Display in stadium showing this is for everyone" /> <em>Copyright: Martin Rickett/PA Wire, from <a href="https://www.theguardian.com/sport/london-2012-olympics-blog/2012/jul/27/london-2012-olympics-opening-ceremony-live">The Guardian</a> </em> </p> <p>With ‘this’, he meant the web, I assume. I like to ponder what the other bit means, ‘for everyone’. It’s probably a number of different things:</p> <ul> <li>Everyone can have a website. As in, you can register a domain, get hosting and put your site on. All at low cost and sometimes free. You do not need permission and are free to put whatever content on: your corporate mission statement or your love for the Vengaboys. Anything.</li> <li>Everyone can go to websites, there’s no entry fee or barrier to the web —although there is to some sites and in some countries— the web is open to access by default.</li> <li>Everyone can access the web, it is built to work for lots of different users, including those with visual, auditory or motor impairments, those with slow connections, those with new and those with old machines. </li> </ul> <p>I think ‘this is for everyone’ refers for a large part to the universal accessibility of the platform. It is what makes the web awesome.</p> <h2>A different ‘for everyone’</h2> <p>During a meetup that took place at Uber Amsterdam’s offices this week, I learned about that company’s mission statement. Before I continue, it is very kind of them to host meetups, they are a great way for the web community to meet each other. I admire the hospitality that makes this possible. </p> <p>Anyway, the statement:</p> <blockquote> <p>Uber’s mission is to bring transportation — for everyone, everywhere.</p> </blockquote> <p>I’m sorry, but it struck the wrong chord with me. <em>Their</em> everyone (and indeed their everywhere) means something else. Admittedly, this may come across as extreme cynicism, but let’s try and think about what it means for them. What Uber mean by making transport <em>available to everyone</em>, is that they want everyone’s transport transactions to run through <em>their</em> systems. So that they can get their financial cut. </p> <p>This is, of course, a perfectly fine strategy and it is how economies work. It isn’t inherently <em>wrong</em> for companies to try and increase market share and profit, but it is definitely a different ‘for everyone’. It’s the same language with a different meaning. As the web-style ‘for everyone’ wouldn’t <a href="https://www.nytimes.com/2017/03/03/technology/uber-greyball-program-evade-authorities.html">break sensible laws that protect vulnerable people</a>, it wouldn’t <a href="https://mashable.com/2014/12/14/uber-sydney-surge-pricing/#n6BnbWBPJ5qt">monetise people in distress</a>, it would not <a href="http://valleywag.gawker.com/ubers-dirty-trick-campaign-against-nyc-competition-cam-1508280668">order fake rides to beat competitors</a>, it would not <a href="https://www.theverge.com/2018/3/20/17144502/uber-lawsuit-service-dog-discrimination-disability">deny users with guide dogs</a> and it would not use its data to <a href="https://www.theguardian.com/technology/2016/dec/13/uber-employees-spying-ex-partners-politicians-beyonce">spy on ex-girlfriends</a>, <a href="http://money.cnn.com/2014/11/25/technology/uber-prostitutes/index.html">track one night stands</a> and… well, the list goes on. </p> <p>This is for themselves, not for everyone. Uber wouldn’t do those things if its for everyone was really about people and not about profits. They make Uber’s ‘for everyone’ sound hollow. And I don’t like that, because the web’s ‘for everyone’ is not hollow, it is built into how the platform technically works, in web standards, in all of that.</p> <h2>Conclusion</h2> <p>It appears ‘for everyone’ can have different meanings and I think it is important to see the difference between them, so that we are not fooled by for-profit companies that present themselves as charities. The web itself is a place where people are put first, and a place where power is not exercised on people, it is given <em>to</em> people. </p> <p>Surely, it is great that so many companies are now using that platform for commercial purposes. Arguably that has helped with the platform’s popularity. It’s been pretty good for many of the world’ s economies too. But I can’t help but think about what the web could look like if we would make more things that really solve problems for everyone… let’s ask this: ‘what is the problem and who are we solving it for?’</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/for-everyone/">For everyone</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20For everyone">Reply via email</a></p> More accessible markup with display: contents 2018-04-21T00:00:00Z https://hidde.blog/more-accessible-markup-with-display-contents/ <p>CSS Grid Layout lets you turn an element into a grid, and place the element’s <em>direct children</em> onto it. Given that, it might be tempting to use flatter markup, but less meaning is usually less accessibility. With <code>display: contents</code>, we can place <em>grand children</em> on a grid, which lets us have accessible markup <em>and</em> beautiful layout. Let’s dive into the details! </p> <p>Below, I will explain in more detail what I mean by children and grand children, and then show how we can use <code>display: contents</code> to improve this. <em>Note: this caused an accessibility bug in all major browser engines, which has been addressed partially in all major engines since May 2022, with <a href="https://adrianroselli.com/2022/07/its-mid-2022-and-browsers-mostly-safari-still-break-accessibility-via-display-properties.html">open issues</a>, see below for details</em></p> <h2>Grid works on direct children</h2> <p>In Grid Layout, when a grid is defined on a given element, only direct children of that element become grid items and are layed out on it. To refresh for those not familiar with the syntax, let’s look at an example and write a recipe. With this HTML:</p> <img src="https://hidde.blog/_images/example-layout-1.png" alt="Example layout 1" /> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>container<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h1</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>item<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Penne with tomato sauce<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h1</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>item<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>This simple recipe has few ingredients but tastes delicious.<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>item ingredients<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span><span class="token punctuation">></span></span>You'll need<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>ul</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">></span></span>canned tomatoes<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">></span></span>onions<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">></span></span>garlic<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>ul</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span></code></pre> <p>we can have this CSS:</p> <pre class="language-css"><code class="language-css"><span class="token selector">.container</span> <span class="token punctuation">{</span> <span class="token property">display</span><span class="token punctuation">:</span> grid<span class="token punctuation">;</span> <span class="token comment">/* element is now a grid container */</span> <span class="token property">grid-template-columns</span><span class="token punctuation">:</span> <span class="token function">repeat</span><span class="token punctuation">(</span> 4<span class="token punctuation">,</span> 1fr <span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">/* grid now has 4 columns */</span> <span class="token selector">.item:nth-child(1)</span> <span class="token punctuation">{</span> <span class="token property">grid-columns</span><span class="token punctuation">:</span> 1 / 2<span class="token punctuation">;</span> <span class="token comment">/* Place item between grid line 1 and 2 */</span> <span class="token punctuation">}</span> <span class="token selector">.item:nth-child(2)</span> <span class="token punctuation">{</span> <span class="token property">grid-columns</span><span class="token punctuation">:</span> 2 / 4<span class="token punctuation">;</span> <span class="token comment">/* Place item between grid line 2 and 4 */</span> <span class="token punctuation">}</span> <span class="token selector">.item:nth-child(3)</span> <span class="token punctuation">{</span> <span class="token property">grid-columns</span><span class="token punctuation">:</span> 4 / 5<span class="token punctuation">;</span> <span class="token comment">/* Place item between line 4 and 5 */</span> <span class="token punctuation">}</span></code></pre> <p>I’ve used <code>.container</code> and <code>.item</code> as classnames, because that’s core to Grid Layout: there’s grid containers and grid items. Obviously, use any naming convention your projects require. </p> <p>The reason we can position these items on the grid, is that they are direct children of the grid container. But look at what happens if we’d like to add a list of sponsors, like this:</p> <img src="https://hidde.blog/_images/example-layout-2.png" alt="Example layout 2" /> <p>We could add the list to our markup:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>container<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h1</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>item<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Penne with tomato sauce<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h1</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>item<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>This simple recipe has few ingredients but tastes delicious.<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>item ingredients<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span><span class="token punctuation">></span></span>You'll need<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>ul</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">></span></span>canned tomatoes<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">></span></span>onions<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">></span></span>garlic<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>ul</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>ul</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>item sponsors<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">></span></span>Supermarket 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">></span></span>Supermarket 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>ul</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span></code></pre> <p>But we won’t be able to position each sponsor onto the grid. This is because only the <code>&lt;ul&gt;</code> is a direct child of the container element and therefore a grid item. The <code>&lt;li&gt;</code>s are not: because they are not direct children of our grid container, they don’t get to participate in its grid game. But what if we really want to align the sponsors onto the grid?</p> <h2>Flatter markup</h2> <p>One obvious method of making the sponsors participate is to remove the <code>&lt;ul&gt;</code> and use a <code>&lt;div&gt;</code> for each sponsor. But what we would then do, it ‘flatten’ our markup. That’s throwing away the baby with the bathwater.</p> <p>The benefit of using the <code>&lt;ul&gt;</code> (unordered list) element are plenty:</p> <ul> <li>it will stay a list outside the context of our page, for example in Safari Reader mode, it will show as a list </li> <li>when printed with stylesheet turned off, it will show as a list</li> <li>for people who use screenreaders, it is a list (screenreaders can announce things like ‘list, 3 items’).</li> </ul> <p>If we would make our markup flatter, we lose those benefits.</p> <h2><code>display: contents</code> to the rescue</h2> <p>With <code>display: contents</code>, we can have our markup <em>and</em> our grid placement. This property makes the element so that <em>it no longer seems to exist</em>. It does not generate a box, so backgrounds, borders and other box-related properties will no longer work on it. Grid placement properties will also no longer work. But all of these things will work for the element’s children. <a href="https://drafts.csswg.org/css-display/#valdef-display-contents">The spec</a> says the element behaves ‘as if it had been replaced […] by its contents’. If that sounds weird, I can recommend <a href="https://bitsofco.de/how-display-contents-works/">Ire Aderinokun’s detailed explainer</a>.</p> <img src="https://hidde.blog/_images/without-display-contents-on-ul-it-is-a-grid-item-with-display-contents-its-children-are-grid-items-4.png" alt="Without display contents on ul it is a grid item, with display contents its children are grid items" /> <p>Effectively, for our purposes here, using <code>display: contents</code> on an element does this: the element stops participating in the grid, and its contents start participating in it. It lets us specify our sponsors onto the grid, instead of the list they are contained in.</p> <p>There’s some interesting <a href="https://drafts.csswg.org/css-display/#unbox-html">edge cases listed in the spec</a>, for if the property is used on elements like <code>img</code> and <code>video</code>. </p> <h2>Accessibility concerns with current browser implementations of <code>display: contents</code></h2> <p>For people who use assistive technologies (AT), browsers expose accessibility properties, including the <code>role</code> of elements on the page. This is so that their AT knows what’s what on the page. Many elements come with a built-in <code>role</code>, for example lists have a <code>role</code> of <code>list</code>. </p> <p>This is where it goes wrong in current browsers that support <code>display: contents</code>. They do not interpret <code>display: contents</code> as a lay-out thing only, they also derive meaning from it. This is <a href="https://twitter.com/fantasai/status/979027939885948928">problematic</a> and a bug according to <a href="https://drafts.csswg.org/css-display/#the-display-properties">the spec’s comment on display affecting layout</a>:</p> <blockquote> <p>The display property has no effect on an element’s semantics: these are defined by the document language and are not affected by CSS. Aside from the none value, which also affects the aural/speech output and interactivity of an element and its descendants, the display property <strong>only affects visual layout</strong>: its purpose is to allow designers freedom to change the layout behavior of an element without affecting the underlying document semantics. </p> </blockquote> <p>(emphasis mine)</p> <p>Looking at our sponsor list example, it means that the item is no longer seen as a list, but as something else (<a href="https://codepen.io/hidde/pen/gzbMeL">test case in CodePen</a>). </p> <p>I’ve added my test results per browser below. In each of them, our <code>&lt;ul&gt;</code> gets the correct <code>role</code> without <code>display: contents</code>, but once the property is set, it loses its role.</p> <h3>Firefox 61</h3> <p>The list gets a <code>role</code> of <code>text leaf</code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1455357">Firefox bug</a>). <em>Update: this is now fixed; it will ship in Firefox 62 in August 2018</em></p> <h3>Chrome 66</h3> <p>The list shows as ‘accessibility node not exposed, element not rendered’ (<a href="https://bugs.chromium.org/p/chromium/issues/detail?id=835455">Chromium bug</a>). <em>Update: this is now fixed; it has shipped in Chome 89 in March 2021</em></p> <h3>Safari</h3> <p>The list shows as ‘no accessibility information’ (<a href="https://bugreport.apple.com/web/?problemID=39630240">Safari bug</a>, <a href="https://bugs.webkit.org/show_bug.cgi?id=185679">Webkit bug #185679</a>, <a href="https://bugs.webkit.org/show_bug.cgi?id=237834">Webkit bug #237834 that they did more work in</a>) </p> <p><em>Update 13 June 2022: this was reported fixed in <a href="https://webkit.org/blog/12621/release-notes-for-safari-technology-preview-144/">Safari TP 144</a> / <a href="https://developer.apple.com/documentation/safari-release-notes/safari-16-release-notes">Safari 16</a></em><br /> <em>Update 9 July 2022: Adrian Roselli reports <a href="https://adrianroselli.com/2022/07/its-mid-2022-and-browsers-mostly-safari-still-break-accessibility-via-display-properties.html">work is still needed in Safari</a></em></p> <p>Related to this issue is that <code>display</code> properties in CSS have impact on table semantics, as <a href="http://adrianroselli.com/2018/02/tables-css-display-properties-and-aria.html">Adrian Roselli explains</a>; see also <a href="https://developer.paciellogroup.com/blog/2018/03/short-note-on-what-css-display-properties-do-to-table-semantics/">Steve Faulkner’s explanation of where the responsibilities lie</a>.</p> <h2>Conclusion</h2> <p>With <code>display: contents</code>, you can place grand children of a grid container on the grid. This allows for more semantic mark-up, which is great for accessibility. The more meaningful your mark-up, the more detail an assistive technology can provide to its users. However, there is one caveat: none of the browsers that currently support <code>display: contents</code> expose elements that have the property to the accessibility tree with their original role.</p> <p>I believe the accessible roles should not disappear when setting <code>display: contents</code>, as that defeats a lot of the purpose of <code>display: contents</code>. I have filed bugs with Firefox, Chromium and Safari for this. I really hope we will be able to use <code>display: contents</code> while keeping the accessible roles of elements intact, so that we can have great layouts and great accessibility. To be continued, I hope!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/more-accessible-markup-with-display-contents/">More accessible markup with display: contents</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20More accessible markup with display: contents">Reply via email</a></p> Vague, but exciting… 2018-06-04T00:00:00Z https://hidde.blog/vague-but-exciting/ <p>Last week I saw Sir Tim Berners-Lee, inventor of the web and receiver of the Turing Prize, give the ACM Turing Lecture. He spoke about redecentralising the web. </p> <p>In less than an hour, Tim Berners-Lee talked us through the history of the web, its current state and what we need to do to have a healthy future for the web. Redecentralisation, he phrased this. The web was invented as a decentralised thing, but that model is currently under threat. Large portions of the web have become walled gardens from within which it is hard to exchange with others: data is kept within its own garden.</p> <h2>A universal and decentralised web</h2> <p>The decentralised web, Berners-Lee explained, started at CERN, a research institution that brings together lots of different people, from different universities, with different preferences for both natural and programming languages and, of course, lots of documentation that was stored on computers.</p> <p>Berners-Lee worked at CERN as a software engineer and he had this idea for making documents easier to access by having unique identifiers for them. When talking about this idea at the coffee machine, a colleague said he should write it down. He did and when his boss read <a href="http://info.cern.ch/Proposal.html">the proposal</a>, he wrote the now so famous words ‘Vague, but exciting’ on the memo. When he later had some time in between projects, what an impactful coincidence, he started to develop this idea further. </p> <p><img src="https://hidde.blog/_images/berners-lee-in-front-of-slide-with-uri-vs-udi-vs-url-1.jpg" alt="Berners Lee in front of slide with URI vs UDI vs URL" /> <em>URI vs UDI vs URL</em> </p> <p>A key component of the initial idea was that everything on the planet should be named so that it has something to be accessed by universally — or uniformly, there was plenty of debate around the distinction, he explained. </p> <p>The universality of the web, Berners-Lee said, is that it works independent of:</p> <ul> <li>hardware and software, including browsers</li> <li>the type of network access (e.g. mobile or cable)</li> <li>whether you want the data to be publicly or privately available</li> <li>the polish of the content: it works equally well for polished publications and scribbled ideas (or Vengaboys fansites)</li> <li>language and culture</li> <li>disability</li> <li>whether the data is to be consumed by people, machines or a combination of both</li> </ul> <p>A web that has the above independencies is one worth fighting for, Berners-Lee explained. The W3C famously does great work in this, but less well known is that Berners-Lee found another organisation: <a href="https://webfoundation.org/about/">the World Wide Web Foundation</a>. It wants to make the web a better place for more people. He argued that if people spend 98% of their time on the web, they might as well spend 2% defending it.</p> <h2>We might be going in the wrong direction</h2> <p>Berners-Lee first showed a virtuous circle: if all goes well the web lets people publish, which inspires conversation and more publications. This is the utopian scenario and we’ve seen a lot of this actually happen. The web community itself it s a great example of this, we teach each other stuff and good blogs inspire other people to start blogging, this very blog is an example of that effect. </p> <p><img src="https://hidde.blog/_images/tim-berners-lee-in-front-of-slide-showing-virtuous-circle.jpg" alt="Tim Berners Lee in front of slide showing virtuous circle" /> <em>The ideal web is a virtuous circle</em></p> <p>However, if we’re not careful, Berners-Lee warned, there can also be a vicious circle, a dystopian scenario. This happens when algorithms cause people to meet more people like themselves, narrows down their circle and alienates them from people who are different. Or when websites are used to harvest people’s personal data that are then used for political gain. Or when falsehoods are presented as facts. These seem pretty much like the things that Mozilla identify as issues concerning <a href="https://www.mozilla.org/en-US/internet-health/">internet health</a>.</p> <h2>Towards more decentral web</h2> <p>There’s all sorts of things we can do to make better things for the web, and perhaps, consequently, make the web better. Berners-Lee urged us to build things that facilitate open dialogue and discussion, not flame wars. Human rights should be at the center of such things, and it would probably only work if it was not a centralised solution: we might need new (social) networks altogether in order to get what we need. <a href="https://solid.mit.edu/">Solid</a> is an initiative led by Tim Berners-Lee aimed at building social websites that are not centralised and let people have control of your own profile and data.</p> <p>It was an inspiring morning and great to see Berners-Lee speak in person (for what was my second time). The principles that the web was built on are strong and the lecture was a great reminder of how we can make better things on the web. We should make good things!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/vague-but-exciting/">Vague, but exciting…</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Vague, but exciting…">Reply via email</a></p> How I learned to stop worrying and love CSPs 2018-06-26T00:00:00Z https://hidde.blog/how-i-learned-to-stop-worrying-and-love-csps/ <p>To gain precise control over what styles, scripts and other assets do on your site, you can serve pages with a Content Security-Policy. What does that mean for the front-end, and for those of us building user interfaces in browsers? Well, it can be tricky to set up, but there are useful benefits. </p> <h2>Why CSPs?</h2> <p>CSPs basically work like a whitelist of asset domains that the browser will accept for your site. This is great, as browsers have no notion of benevolent or malicious assets. Only website owners do. By telling browsers where the good stuff is located, website owners can rest assured users of modern browsers won’t get bad assets executed. They are one out of many <a href="https://securityheaders.com/">security headers</a>.</p> <p>CSPs have been around for ages (see for example the <a href="https://blog.twitter.com/engineering/en_us/a/2011/improving-browser-security-with-csp.html">Twitter blog in 2011</a>), but <a href="https://pokeinthe.io/2016/04/25/state-of-csp-alexa-top-one-million-2016-04/">usage numbers seem to be quite low</a>. It seems to me they have recently gained more traction though, as more people get interested into website safety and content integrity. See also <a href="https://hacks.mozilla.org/2016/02/implementing-content-security-policy/">how Mozilla Add-Ons did it</a>.</p> <h2>How they work</h2> <p>Technically, a <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP">CSP</a> is a string that contains key-value pairs, served as a header with the response (or via a <code>meta</code> element in the page). They describe for each type of content how it can be used within your page. To be more precise: where it can be loaded from. Definitions for each type of asset are separated with semicolons, the definitions themselves have spaces in between.</p> <p>Here’s an example: </p> <pre class="language-markup"><code class="language-markup">script-src https://hidde-cdn.com; style-src https://hidde-cdn.com</code></pre> <p>This will only allow scripts or styles if they are served from <code>https://hidde-cdn.com</code>.</p> <p>There are also a number of keywords. </p> <ul> <li><code>self</code> will allow assets from the same domain that the page is served from</li> <li><code>unsafe-inline</code> will allow inline assets</li> </ul> <p>See for example, this policy:</p> <pre class="language-markup"><code class="language-markup">script-src 'self' https://hidde-cdn.com; style-src 'unsafe-inline' https://hidde-cdn.com</code></pre> <p>This allows scripts only from the current domain or from <code>https://hidde-cdn.com</code>, and allows styles inline or when served from <code>https://hidde-cdn.com</code>. </p> <p>There are also directives: <code>font-src</code> for fonts, <code>img-src</code> for images,<code>connect-src</code> for fetching/requests and <code>default-src</code> if you want to set a default. Best <em>set default-src to none</em>, so that you already have a policy for any asset types you don’t or forget to define.</p> <p>The <code>unsafe-inline</code> directive is interesting: it has the word ‘unsafe’ in it, because <a href="https://developers.google.com/web/fundamentals/security/csp/#inline_code_is_considered_harmful">inline assets are considered harmful</a>. I should clarify: inline assets aren’t harmful because they are inline <em>as such</em>, but it is the case that whenever malicious scripts or stylesheets are injected, they are likely to be inline. Blocking their execution altogether mitigates their risk. If that feels like too much, it is also possible to allow <em>some</em> inline scripts: identify one script with a <a href="https://en.wikipedia.org/wiki/Cryptographic_nonce">nonce</a> (a number used once) and whitelist that nonce.</p> <p>In summary, a CSP lets you whitelist locations to load assets from. Although these whitelists themselves are simple when you grasp the concept, their consequences can be unexpected and, for front-end devs, rather inconvenient.</p> <h2>Some side-effects</h2> <p>When I recently implemented a CSP in a project I was working on, I found a couple of surprises that were inconvenient, some of them related to disallowing inline assets. Note that those specific issues will be go away if your setup has a different, less stringent CSP locally.</p> <h3>Adding styles via Developer Tools</h3> <p>Sometimes when I’m working on some CSS, I’ll inject CSS via the Dev Tools, so that I can see what the effect of my changes are without actually making them just yet. If your CSP disallows inline styles, you are out of luck as this feature will stop working. </p> <h3>Browsersync</h3> <p>If your local development environment uses script to reload the browser when you’ve changed a file, this likely uses inline scripts that will be blocked when your policy forbids inline scripts. </p> <h3>Analytics</h3> <p>If you’re using external analytics scripts, don’t forget to add the domains that they load from, if they are different from your own domain. This is the case for Google’s Analytics and Tag Manager products, for example. </p> <h3>Polyfills that inject CSS</h3> <p>The <code>inert</code> polyfill injects some CSS into the page in order to prevent user selection on inert elements. Injected CSS counts as inline CSS (obvs), so that will not work.</p> <h3>Inline styles in SVGs</h3> <p>Double-check that SVGs that you are including in your page do not contain <code>style</code> attributes, as some browsers can deem those to be a <a href="https://pokeinthe.io/2016/04/09/black-icons-with-svg-and-csp/">violation of <code>unsafe-inline</code></a>. </p> <h2>The good and the bad</h2> <h3>What I love about CSPs</h3> <p>The great thing about CSPs is that, if implemented well, you know exactly where to expect attacks. Without a CSP, the ‘attack vector’ is unknown and likely big or of infinite size, with a CSP you know where it can come from. </p> <p>If you work in a large organisation where the marketing team can insert scripts via Tag Manager(-like) solutions, which is quite common these days, CSPs are also a useful treshold. Scripts that are useful for gaining marketing insights could at the same time be risky from a security standpoint (not to mention privacy).</p> <p>There are some design choices that make CSPs a joy to work with, for example the built-in <code>report-uri</code> directive, that lets you specify a URL to report CSP violations to, which can be used to track violations using a service like <a href="https://sentry.io/welcome/">Sentry</a>. </p> <h3>What I slightly dislike</h3> <p><em>If</em> your site is served over SSL and you sanitise all the things (in other words, you avoid <a href="https://www.xkcd.com/327/">Little Bobby Table scenarios</a>), your CSP does not actually make it <em>more</em> secure. Note that this is a huge if. If you’re healthy, a health insurance isn’t going to make you more healthy, but it is extremely sensible to have one in place anyway. This is kind of the point of CSPs, they provide extra cover for if things like SSL and XSS protection aren’t (correctly) in place. Mistakes can be easy to make in the security space. So I’ve learned to love this: CSPs don’t harm if you can work around the side-effects.</p> <p>Something else I don’t really like is the usability of error reports for CSP violations in browser Dev Tools. They will make clear that there is an error, but aren’t too helpful in pointing towards the right direction. Browsers could be clearer about which exact bit of your policy is stopping an asset from working.</p> <h2>TL;DR</h2> <p>CSPs can nullify what XSS attackers can do once they’ve managed to attack. This is great, although implementing it can make some things harder on the front-end. But that’s ok, it is our job after all. For help with implementing a CSP for your site, check out Mozilla’s <a href="https://addons.mozilla.org/en-US/firefox/addon/laboratory-by-mozilla/">Laboratory Add-On</a> and Google’s <a href="https://developers.google.com/web/fundamentals/security/csp/">Web Fundamentals page on CSP</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/how-i-learned-to-stop-worrying-and-love-csps/">How I learned to stop worrying and love CSPs</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20How I learned to stop worrying and love CSPs">Reply via email</a></p> What kind of ethics do front-end developers need? 2018-07-05T00:00:00Z https://hidde.blog/what-kind-of-ethics-do-front-end-developers-need/ <p>Now that the technology sector of the world is rapidly transforming all of the world’s things into digital things, many have called for <em>more ethics in our field</em>. That is in many instances quite a vague goal, so let’s apply it to one part of digital: front-end development. How can we be more ethical as front-end developers, what kinds of things can we do? I thought I’d try and make a list.</p> <p>I don’t know what is good for us. I mean, I have ideas about that, but this post is not about those ideas, it is about what kinds of things front-end developers can think about if they want to apply ethics to our field.</p> <h2>What and why</h2> <p>In <a href="https://noti.st/hdv/7VKLDJ/trolleys-veils-and-prisoners-the-case-for-accessibility-from-philosophical-ethics">my talk for Inclusive Design 24</a>, I said that ethics is about <em>how we want our world shaped</em>. But ethics has many definitions, another one is that it answers the question ‘what should I do?’ In that question, note the word ‘should’. It’s about what you’re obliged to do. It also implies taking a moral stance and choosing between different paths. It is about coming up with reasons based on what is considered the right thing, based on a set of rules. An example of such a rule is ‘only act according to rules that you would want to apply to everyone’ (said <a href="htts://plato.stanford.edu/entries/kant-moral/">Kant</a>). And there is <a href="https://en.wikipedia.org/wiki/Golden_Rule">The Golden Rule</a>: treat others as you would want to be treated.</p> <p>The ethics described above is roughly what the literature would refer to as duty-based ethics, it is based on the idea of a moral obligation. There is also consequence-based ethics. Consequentialists look at the outcome of their decisions and actions. They consider how decisions or actions impact the world, for example whether they <a href="http://www.iep.utm.edu/util-a-r/">increase or decrease the total amount of happiness in the world</a>. It doesn’t matter how you get to an increase of total happiness, it matters that you do.</p> <p>When trying to apply ethics to technology, it should be fine to be pragmatic and combine both approaches. Do things because they are right and do (or leave) things because of their consequences.</p> <p>The reason that ethics can make an important contribution to the web is its focus on why and how we do things rather than just what we are doing. That focus has the unique chance to make our choices more human, because arguably without ethics we could just leave our decision making to machines. <a href="https://twitter.com/laurakalbag/status/1012381100369481730">It takes a human to make ethical decisions</a>, said the awesome Laura Kalbag. Thinking ethically about decisions also makes them more human. It works both ways. </p> <p>Tim Berners-Lee already talked about how ethics is important for the web at the first WWW conference in 1994. He describes this in his book <em>Weaving the web</em> (2000, 86):</p> <blockquote> <p>I finished by pointing out that, like scientists, people in the Web development community had to be ethically and morally aware of what they were doing</p> </blockquote> <p><img src="https://hidde.blog/_images/book-weaving-the-web-by-tim-berners-lee-with-mark-fischetti.jpg" alt="Book Weaving the web by Tim Berners Lee with Mark Fischetti" /> <em>This, about the origins of the Web, is recommended reading, by the way. Don’t judge it by its cover design…</em> </p> <p>Ethics is important for everyone who makes things for the web: people working on design, product and management. But also for front-end developers. We drive a lot of how modern web products are built and uniquely know of <em>weird details</em> and <em>consequences</em> of products decisions. If ethics is about consequences, we are part of it. So let’s worry about what decisions are made. Rather than just using our expertise to build products, we can think about decisions and <em>then</em> build products. Because it is also our duty and we can help increase (or not decrease) total happiness in the world.</p> <h2>Ok, so do I just <code>npm install ethics</code>?</h2> <p>Admittedly, I’m stretching it a bit, but I would like to show what ethics is not. I should stress that ethics can’t be just <em>added</em> to something that exists, it has to be in the decision process before. Automating ethics won’t work either, trying to do it would also sort of miss the point of ethics. Package managers like <code>npm</code> can install most things that a web project could possibly depend on, but it should be clear by now that ethics is not one of them. Computers can automatically foresee consequences sometimes, they can use statistical analysis see how big your JS bundle will be. Or, more real-world, use facial recognition to see that someone is cheating on their partner. But the point is, ethics is the assessment that can start after metrics like these. It requires humans. </p> <p>There are plenty of situations in our jobs where we can apply ethical thinking to what we do. Let’s look at some real-world examples.</p> <h2>Front-end developer impact</h2> <h3>Ensure accessibility</h3> <p>The web is <a href="https://hiddedevries.nl/en/blog/2018-04-20-for-everyone">accessible by default</a>, but as a developer it’s easy to break that in the flow of getting features shipped. I sometimes do this myself, and I specialise in accessibility. There are ways to improve though, for example by focusing (part of) your personal development on learning about making accessible products. By being aware of how to meet the <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1">Web Content Accessibility Guidelines</a> and generally accessibility good practices, you can directly contribute to letting more people enjoy the web through code.</p> <h3>Analytics with Do Not Track</h3> <p>You’re asked to implement trackers in a site. You are aware that technically, this will allow some megacorporation to spy on people. You are also aware that modern browsers support <a href="https://www.eff.org/issues/do-not-track">Do Not Track</a>. It will likely be your choice to honour your user’s Do Not Track settings, and otherwise your duty to convince the people in the company who prefer more metrics over more valuing user preferences. Or maybe you research a way to completely anonomise the data. This combines duty and consequences. </p> <h3>Impact on society at large</h3> <p>This is a more general example, applying to what you work on and where you choose to work. There’s a degree of ‘but not everyone is so privileged that they have choice’ to this, but I still believe we can all choose to some degree. When working as a front-end developer, it is likely that what you work on will somehow shape the world, sometimes even disrupt it. Should you build the front-end for a product that ‘disrupts’ an industry, but also introduces more inequality and makes the lives of other people harder?</p> <h3>Code of conducts in open source</h3> <p>If you released some of your code as an open source project and it attracted a bit of a community around it, considering community values would make a huge difference. Things like how you want people to feel empowered to make suggestions, feel included in the community, participate and show empathy to each other. A Code of Conduct (for example, a <code>CODE_OF_CONDUCT.MD</code>) could help make these values explicit, and heck, you could even <a href="https://www.contributor-covenant.org/">npm install</a> one (just note that this only adds value if you also have a plan for getting incidents reported and responding to them).</p> <h3>Diversity in hiring</h3> <p>As a front-end developer you may sometimes be involved in hiring new team members. This is also a great opportunity to influence how the world is shaped: be aware of possible biases in order to give good recommendations to HR.</p> <h3>Recognising dark patterns</h3> <p>If you don’t like to be tricked into buying services you don’t actually need or want, then your users likely feel the same. Learn to recognise <a href="https://darkpatterns.org/">dark patterns</a> and start the discussion if you’re asked to implement one.</p> <h3>Keeping users secure</h3> <p>By being aware of <a href="https://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project">common security risks</a> we can ensure our users are safer online. Most of the responsibilities fall within front-end (and back-end) development scope. The Golden Rule applies here: if you surf the web as a consumer, you would also like the developer who has built the site to have done so securely.</p> <p>These are all things where an ethical attitude and contemplating <em>why</em> and <em>how</em> we do things can be helpful in creating a better web. They’re not all easy things, some of them are hard to get right. But if we’re going to play a role in making all the things digital things, let’s do it responsibly. </p> <h2>Conclusion</h2> <p>As front-end devs, we can apply ethics to our work by having an ethical mindset when doing our work. Practically we could do this by applying the Golden Rule and thinking about consequences of our code for users and our colleagues, for example by ensuring accessibility, security and a safe and welcoming working environment.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/what-kind-of-ethics-do-front-end-developers-need/">What kind of ethics do front-end developers need?</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20What kind of ethics do front-end developers need?">Reply via email</a></p> Accessible page titles in a Single Page App 2018-07-19T00:00:00Z https://hidde.blog/accessible-page-titles-in-a-single-page-app/ <p>According to <a href="https://www.w3.org/WAI/WCAG21/quickref/#page-titled">WCAG 2.4.2</a> pages should have titles. How to go about this in a single page world?</p> <h2>What are titles for?</h2> <p>Pages have titles so that people can recognise where they are. They are like a plaquette on a meeting room door, signposts that mark the platform in a train station or the signage for a supermarket aisle. They help people figure out where they are. </p> <p>Additionally, page titles also signify uniquely what’s on a URL. This is helpful for search engines, they display the title. Or for social media platforms, they display it when you share a link. People using screenreaders hear the title, it lets them figure out what a page is when they land on it.</p> <h2>Titling pages, the traditional way</h2> <p>In a site with multiple pages, you can put different content in the <code>&lt;title&gt;</code> element for each different page. This is trivial if you build each page separately, it is a little more work when the value comes out of a CMS, but still fairly straightforward.</p> <h2>Titling pages in Single Page Apps</h2> <p>In a Single Page App (SPA), the user never leaves the page. There is no new page with a new title. Instead, you’ll have to update this manually by changing the value or <code>document.title</code> , which is where the page title is in the DOM.</p> <p>Changing pages in SPAs is often done with routers like <code>react-router</code> and <code>vue-router</code> . I was surprised to see that, by default, those two only update content and the URL, not the document title.</p> <p>You can update the page title manually, though. In React, you can <a href="https://github.com/ReactTraining/react-router/issues/49">do it in the <code>componentDidMount()</code> </a> of a route, and there is a <a href="https://github.com/gaearon/react-document-title">react-document-title</a> package that does it for you. If you want to update more meta info than just the title, there is <a href="https://github.com/nfl/react-helmet">React Helmet</a>.</p> <p>In Vue, I had luck doing it in <code>beforeEach</code> of the router:</p> <pre class="language-javascript"><code class="language-javascript">router<span class="token punctuation">.</span><span class="token function">beforeEach</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">to<span class="token punctuation">,</span> from<span class="token punctuation">,</span> next</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span> document<span class="token punctuation">.</span>title <span class="token operator">=</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>to<span class="token punctuation">.</span>name<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string"> - Your site</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">;</span> <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> <p>But if you’d like to abstract this further and update the page’s title along with other things in the head of your document, there is <a href="https://github.com/miaolz123/vue-helmet">Vue Helmet</a> or <a href="https://github.com/declandewet/vue-meta">Vue Meta</a>.</p> <p><em>(Update 2 June 2020)</em> In Svelte, you can set page titles using the special <code>&lt;svelte:head&gt;</code> element in the components that you use as a route, like so:</p> <pre class="language-markup"><code class="language-markup"><span class="token comment">&lt;!-- MyPage.svelte --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token namespace">svelte:</span>head</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>title</span><span class="token punctuation">></span></span>Page Title goes here<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>title</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span><span class="token namespace">svelte:</span>head</span><span class="token punctuation">></span></span></code></pre> <h2>Announcing titles</h2> <p>In screenreaders, when a user goes to a new page, it will read out the title of that page. In a Single Page App world, you can update the title with <code>document.title</code> , but, sadly, that change does not trigger a screenreader announcement. It is helpful to do this manually, for example by putting content into a live region (the <a href="https://github.com/Heydon/on-demand-live-region">on demand live region</a> abstracts this).</p> <p>There are different strategies as to <em>what</em> to read out on a route. In an SPA, you could choose to set focus to the top of the document when you do a route, this would make it feel like a multi page application. Users would have to use skip links to get back to the content, just like in multi page applications. But maybe you only update one section, and your strategy is to <em>move focus to the new content</em>. In this case, you could ensure the title of whatever is new is read out, rather than the updated page title. For example, if you replace the <code>main</code> by something new and then focus the new content, convey to assistive technologies what the title of the newly focused content is, for example by having its first heading announced.</p> <p>Does this mean the <code>title</code> is irrelevant in SPAs? Not really, it is still useful to have an up to date <code>title</code> , for example for people switch between tabs or when you turn on Server Side Rendering.</p> <h2>TL;DR</h2> <p>Giving pages unique titles aids accessibility and is compulsory if you are after WCAG 2 AA compliance. If you build a single page app, update the title manually, but also look at having something useful announced when new content is inserted. It could make more sense for this to be a section title than the document’s title, depending on what you’re building.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/accessible-page-titles-in-a-single-page-app/">Accessible page titles in a Single Page App</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Accessible page titles in a Single Page App">Reply via email</a></p> An AI reading list 2018-08-07T00:00:00Z https://hidde.blog/an-ai-reading-list/ <p>Having been long interested in artificial intelligence, it was one of my focus areas in university, I looked for theoretical background beyond the hype. If it is also summer where you are, you may have some extra reading time, too. So, I present you: an AI reading list.</p> <p>This list is mostly about the philosophy of AI: what intelligence means, how it can be represented, what the ethical implications are of teaching machines, those kinds of questions. Expect to read about psychology, mathematics, linguistics, philosophy and computer science. It’s all of those things together that the field is made up of.</p> <p>A common theme in these books is that AI application aren’t <em>that</em> intelligent yet or anywhere near ready to replace human intelligence. Phew. I discovered this myself looking for recent books on philosophy and AI. Online bookstore search engines (or category pages) were not that helpful for finding what I was looking for. Look in the ‘philosophy’ department and a book by Plato is listed first. Who reads Plato just by themselves? Book review pages in newspapers, blogs and humans in book stores helped more. Yes, humans!</p> <h2>The New Dark Age</h2> <p>In The Guardian’s review of this book they said enjoyment of it depends on whether you are a glass half full or half empty kind of person. Very much true, I think. <a href="https://www.versobooks.com/books/2698-new-dark-age">The New Dark Age</a> describes a lot of dark consequences of what Bridle calls ‘computational thinking’, the idea of throwing tech at every problem. This thinking seems prominent in Silicon Valley and it is dangerous, Bridle explains, because our problems are less about what we know (data) and much more about what we do and think. This book is not just about AI, it is also a lot about the impact of technology on society. We should think twice if we want to outsource decision making to systems, Bridle warns. Buy from <a href="https://www.versobooks.com/books/2698-new-dark-age">the publisher</a> to get a free e-book with your hardback.</p> <h2>Plato and the Nerd</h2> <p>Is AI ‘our biggest existential threat’, as Elon Musk once claimed? Edward Ashford Lee, writer of <a href="https://mitpress.mit.edu/books/plato-and-nerd">Plato and the Nerd</a> doesn’t think so. What is more likely to happen and what we should want to happen, he explains in this book, is that humans and machines complement each other. We are creative, they can crunch lots of data at mesmerising speeds. We may not be more than just neurons (Lee isn’t a dualist), but it is unlikely we’ll ever be able to reconstruct human brains and minds in machines. If we’re making abstractions, like Plato did with his theory of Ideas, we should be careful not to confuse <em>the map</em> with <em>the territory</em>. This book brilliantly explains machines from semiconductors to programming languages to mathematical possibilities. It gets very technical and mathy at points. Lee shows how engineers are creative rather than technical: the most technical layers are abstracted away from them. He also talks about the relationship between tech and society: ‘I do not see how a true humanist today can understand society without understanding technology’, he says and I could not agree more.</p> <h2>From Bacteria to Bach: The Evolution of Mind</h2> <p><a href="https://www.penguin.co.uk/books/253900/from-bacteria-to-bach-and-back/">From Bacteria to Bach</a> by philosopher Daniel Dennett is about evolution, what it means to (not) understand something (explained with the interesting notion of ‘competence without comprehension’) and how that changes our view on artificial intelligence, language, culture, consciousness and much more. The book is full of anecdotes and side steps, which for me at some point started to prevent Dennett from clearly getting his point across, it was a bit overwhelming. But then again, the book is full of interesting analysis of where the fields of philosophy, psychology and computer science have overlap. See also <a href="https://www.theguardian.com/books/2017/feb/02/from-bacteria-to-bach-and-back-by-daniel-c-dennett-review">The Guardian’s review</a>, who said this about the book: </p> <blockquote> <p>This is an infuriating book – too long and self-referential – but underlying it all is an interesting argument</p> </blockquote> <h2>Common sense, the Turing test and the quest for real AI</h2> <p>In 2018 many of us think of adaptive machine learning (AML) if we think about AI. In <a href="https://mitpress.mit.edu/books/common-sense-turing-test-and-quest-real-ai">Common sense, the Turing test and the quest for real AI</a>, Hector J. Levesque takes us back to what it all started with: good old-fashioned artificial intelligence (GOFAI). It goes into detail about what can’t really be learned by machines: common sense. He explains <a href="https://en.wikipedia.org/wiki/Winograd_Schema_Challenge">Winograd Schemas</a>, which is his modern equivalent of the Turing test: they can be used to figure out if a machine is ‘making it or faking it’. I liked how concise and lucid this book is.</p> <h2>Turing’s Vision</h2> <p><a href="https://mitpress.mit.edu/books/turings-vision">Turing’s Vision</a>, which I <a href="https://hiddedevries.nl/en/blog/2017-04-21-book-tip-turings-vision">raved about before</a>, is about one of Alan Turing’s most interesting papers, in which he tries to prove the mathematician Hilbert wrong. That paper shines new light on something called the ‘decision problem’ (‘whether we can write algorithms that can decide if certain mathematical statements are true or false’). This book is fairly technical, I had to skip parts because I had not enough intelligence. Your mileage may vary.</p> <p>That’s all for now, happy reading! I’d love to hear what others are reading in comments or e-mail.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/an-ai-reading-list/">An AI reading list</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20An AI reading list">Reply via email</a></p> Let's serve everyone good-looking content 2018-08-11T00:00:00Z https://hidde.blog/lets-serve-everyone-good-looking-content/ <p>In <a href="https://twitter.com/bdc/status/1027318066932211714">Benjamin’s poll</a>, the second most voted reason to avoid Grid Layout was supporting Internet Explorer users. I think it all depends on <em>how</em> we want to support users. Of any browser. Warning: opinions ahead.</p> <h2>What lack of Grid Layout means</h2> <p>Let’s look at what a browser that does not support Grid Layout actually means. </p> <h3>What it is not</h3> <p>To be very clear, let’s all agree this is not the case:</p> <ul> <li><strong>Browsers that support Grid Layout</strong>: users see a great layout</li> <li><strong>Browsers that don’t support Grid Layout</strong>: users see a blank page</li> </ul> <p>That would be bad. Luckily, it is not that bad. CSS comes with a cascade, which includes the mechanism that the values of style rules are always set to something. Rules have a default value, which is usually what browsers will apply for you. It can be overridden by a website’s stylesheet, which in turn can also be overridden by user stylesheets. Because of the design of CSS, properties always compute to <em>some</em> value.</p> <h3>What it is</h3> <p>When turning an element on the page into a grid, we apply <code>display: grid</code> to it. At that point, it becomes a <em>grid container</em> and we can apply grid properties to it (and its children). If we set <code>display: grid</code> in an unsupported browser, the element will simply not become a grid container, and it will not get any of the grid properties you set applied. The <code>display</code> property will be whatever it was, usually <code>inline</code> or <code>block</code>, different elements have different defaults.</p> <p>A little sideline: <a href="https://www.w3.org/TR/css-grid/#grid-containers">per spec</a>, if you use floats (or clear), they will be ignored on children of grid containers. This is great for fallbacks.</p> <p>Without Grid Layout, you still get your content, typography, imagery, colours, shadows, all of that. It will likely be displayed in a linear fashion, so it will be more or less like most mobile views. That is a perfectly ok starting point and it is good-looking content that we can serve to everyone.</p> <h2>Serving users good-looking content</h2> <p>I think our goal, rather than supporting specific browsers or specific CSS properties, should always be this: to serve users good-looking content and usable interfaces that are on-brand. I think good-looking and usable do not depend on how griddy your layout is. On-brand might, though. Some brand design guidelines come with specific grids that content needs to be layed out in. But aren’t we already used to stretching such guidelines, building responsive interfaces that work across viewports? Shouldn’t we let go, because we <a href="https://alistapart.com/article/dao">cannot control a user’s browser</a>?</p> <p>If for some small proportion of our users, we let go of the specific grid we created with grid layout, that will not hurt them. Likely not without <em>any</em> fallback, but definitely not with a simple fallback based on <code>float</code>s, <code>inline-block</code> or maybe <code>flex</code> and/or <a href="https://www.smashingmagazine.com/2017/11/css-grid-supporting-browsers-without-grid/">feature queries</a>. But keep it simple. As <a href="https://adactio.com/journal/14131">Jeremy Keith wrote</a>:</p> <blockquote> <p>You could jump through hoops to try to get your grid layout working in IE11, […] but at that point, the amount of effort you’re putting in negates the time-saving benefits of using CSS grid in the first place.</p> </blockquote> <p>I don’t think we owe it to any users to make it all exactly the same. Therefore we can get away with <em>keeping fallbacks very simple</em>. My hypothesis: users don’t mind, they’ve come for the content.</p> <p>If users don’t mind, that leaves us with team members, bosses and clients. In my ideal world we should convince each other, and with that I mean visual designers, product owners, brand people, developers, that it is ok for our lay-out <em>not to look the same everywhere</em>. Because serving good-looking content everywhere is more important than same grids everywhere. We already do this across devices of different sizes. For responsive design, we’ve already accepted this inevitability. This whole thing is a communication issue, more than a technical issue.</p> <h2>Save costs and sanity</h2> <p>If we succeed in the communication part, we can spend less time on fallbacks, now and in the future (I’m not saying <em>no</em> time, we want good-looking content). An example: that mixin we created to automatically fallback <code>grid</code> to <code>flex</code> to <code>inline-block</code> might look like a great piece of engineering now, it may later become a piece of hard to comprehend code. Solving the communication issue instead of the technical one, will save time in initial development costs and help prevent technical debt.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/lets-serve-everyone-good-looking-content/">Let's serve everyone good-looking content</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Let's serve everyone good-looking content">Reply via email</a></p> Heading structures are tables of contents 2018-09-01T00:00:00Z https://hidde.blog/heading-structures-are-tables-of-contents/ <p>The heading structure of a web page is like its table of contents. It gives people who can’t see your page a way to navigate it without reading everything. </p> <p>To be clear, by ‘heading structure’ in this post, I mean the heading elements in your HTML: <code>&lt;h1&gt;</code> to <code>&lt;h6&gt;</code> . These elements can be strongly intertwined with what they look like, but for our purposes it is <em>the markup that matters</em>.</p> <p>The best analogy I’ve been able to come up with for heading structures, is the feature in Microsoft Word that lets users generate a table of contents automatically. It is used a lot by all kinds of people, in all kinds of environments (in long corporate documents, but also in academia). If you’ve set document headings correctly, it lists all sections and subsections. It even remembers, and updates, which page they are on.</p> <p><img src="https://hidde.blog/_images/screenshot-of-pages-application-with-table-of-content-settings-open.png" alt="Screenshot of Pages application with table of content settings open" /> <em>Example of the automagic table of contents feature in Pages. It even lets you select which heading levels to include!</em> </p> <p>All websites have this too, as a similar feature is built into most screenreaders. In VoiceOver, for example, users can press a button to see a list of all headings and use this to navigate a page. In fact, this is a common way for screenreader users to get around your page without reading everything.</p> <p><img src="https://hidde.blog/_images/wikipedia-page-about-assistive-technologies-with-voiceover-rotor-headings-open.png" alt="Wikipedia page about assistive technologies with voiceover rotor headings open" /> <em>The headings feature in action on Wikipedia. Note that Wikipedia also lists the headings explicitly, with section numbering.</em> </p> <h2>Only use headings to identify sections</h2> <p>To let users get the best navigate-by-headings experience, only use heading elements for content that actually identifies a section. Ask ‘would this be useful in my table of contents?’, and if the answer is no, best choose a different HTML element. This way, only table of contents material makes it into your heading structure. </p> <p>For this reason, by the way, I recommend to avoid having headings be part of user generated content (as in: content added not by content specialist, but by users of your site). If you offer Markdown for comments, for example, headings in those comments could mess with the usability of your heading structure.</p> <p>If you choose something to be a header, make sure it describes the section underneath it. This can be hard to get right, you might have great puns in your headings, or maybe they were written by a SEO expert. </p> <h2>Visually hidden headings</h2> <p>Not all sections have headings, often the visual design makes it clear that something is a distinct piece of content. That’s great, but it doesn’t have to stop a section from <em>also</em> showing up in your table of contents. Hidden headings to the rescue!</p> <p>A hidden heading is one that is ‘visually hidden’, this is content that is not visual on screen, but it exists in your markup and screenreaders can use it:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>visually-hidden<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Contact information<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">></span></span> <span class="token comment">&lt;!-- some content that looks visually a lot like contact information, with icons and a receptionist stock photo that makes it all very obvious--></span></code></pre> <p>(More about <a href="https://snook.ca/archives/html_and_css/hiding-content-for-accessibility">CSS to visually hide</a>)</p> <p>The heading goes into your virtual table of contents, but it is not visible on screen.</p> <p>Note that visible headings are much preferred to hidden headings. There are two problems in particular with hidden headings: </p> <ul> <li>Like with other hidden content, it can easily be forgotten about by your future self or the next team member. Hidden content that is not up to date with the visible content is unhelpful, so it is a bit of a risk.</li> <li>Serving slightly different content may cause confusing conversations, for example if an AT user and a sighted user discuss a page and only one of them knows that there is a heading.</li> </ul> <h2>‘Don’t skip heading levels’</h2> <p>Although <a href="https://commonlook.com/heading-levels-navigation-or-decoration/">WCAG 2 does not explicitly forbid skipping heading levels</a>, and this is controversial, I would say it is best not to skip heading levels.</p> <p>If a contract has clause <strong>2.4.2</strong>, it would be weird for there not to be a <strong>2.4</strong> — the former is a subclause of the latter. It would be weird for the subclause to exist without the main clause. </p> <p>The most common reason why people skip headings is for styling purposes: they want the style that comes with a certain heading and that happens to be the wrong level for structural purposes. There are two strategies to avoid this:</p> <ul> <li>have agreement across the team about how heading levels work</li> <li>use <code>.h1</code>, <code>.h2</code>, <code>.h3</code> classes, so that you can have correct heading levels, but style them however you like</li> </ul> <p>The former is what I prefer, on many levels, but if it is a choice between weird CSS and happy users, that’s an easy one to make.</p> <h2>Automatically correct headings</h2> <p>The <a href="https://html.spec.whatwg.org/dev/sections.html#outline">outline algorithm</a> mentioned in HTML specifications is a clever idea in theory. It would let you use any headings you’d like within a section of content; the browser would take care of assigning the correct levels. Browsers would determine these levels by looking at ‘sectioning elements’. A sectioning element would open a new section, browsers would assume sections in sections to be subsections, and headings within them lower level headings.</p> <p>There is no browser implementing the outline algorithm in a way that the above works. One could theoretically have automated heading levels with <a href="https://medium.com/@Heydon/managing-heading-levels-in-design-systems-18be9a746fa3">clever React components</a>. I like that idea, although I would hesitate adding it into my codebases. That leaves us with manually choosing plain old headings level, from 1 to 6. </p> <h2>Conclusion</h2> <p>Heading structures give screenreader users and others a table of contents for our sites. By being conscious of that, we can make better choices about heading levels and their contents.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/heading-structures-are-tables-of-contents/">Heading structures are tables of contents</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Heading structures are tables of contents">Reply via email</a></p> Overlapping skills in front-end development 2018-09-09T00:00:00Z https://hidde.blog/overlapping-skills-in-front-end-development/ <p>Last week <a href="https://twitter.com/mxstbr/status/1038416725182697472">a poll about CSS</a> did the rounds with a question about the cascade. It got me thinking about CSS and overlapping skills in front-end development. </p> <h2>Is the cascade more complex than other concepts?</h2> <p>The question was, given two class selectors applied to two elements which had the order of classes as their only difference, what they would look like. Many respondents got it wrong. CSS nerds replied that the question was fairly basic, JS nerds replied <a href="https://twitter.com/loose_chainsaw/status/1038378757432598528">CSS is shit</a>. Ok, that was likely a troll. There were also sentiments like ‘you don’t get web development if you don’t understand the cascade’ or ‘you don’t get web development if you <em>do</em> like doing CSS’. Oh oh, social media… why am I on it?</p> <p>Before continuing, I do want to defend CSS. It is a pretty smart and <a href="http://www.wiumlie.no/2006/phd/">well-considered language</a>. It is <a href="https://hiddedevries.nl/en/blog/2017-07-03-did-css-get-more-complicated-since-the-late-nineties">not a programming language by design</a>. Concepts like the cascade are complex, but they <em>aid</em> the simplicity of the language, which was an important design principle. </p> <p>Admittedly, it takes time to grasp such concepts before you can take full advantage of them. But isn’t that the case for most concepts in web development? Component lifecycle hooks, accessibility trees, dockerisation, OIDC, Lambda functions, writing mode agnostic (logical) properties, Content-Security Policies, DNS entries, <code>git rebase</code>… they all make complex-to-understand things available in simple-to-use ways. About many of these, I was frustated at first, but happy and excited ever after. </p> <p>CSS may (seem to) miss some of the determinism, scoping and typing that many programmming languages offer, but I believe it is precisely the lack of those sorts of things that makes it extremely accessible to learn and use. It is by design that you <a href="https://twitter.com/jeresig/status/1038422481965658114">can’t know what you HTML will look like</a>. And we’re able to use JavaScript to add such features ourselves, if our codebase or team is of a size that requires them.</p> <h2>Overlapping skills</h2> <p>As people who make websites, we all specialise in different things. They often overlap. Some of us are markup nerds, server side rendering nerds, svg nerds, sysadmin nerds, security nerds, network nerds, Grid Layout nerds, webfonts nerds… most are a combination of many of these things. Some of us aren’t even nerds. It’s all good. In my view, it is unlikely any person overlaps with <em>all the things</em>, although there are people who get dangerously close. </p> <p>If I learned anything from reading the comments, besides ‘don’t read the comments’, it is this: I need to remind myself that we can all learn so much from each other, because skills overlap. That requires not a ‘X is shit’ attitude, but a ‘how does X work?’ one.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/overlapping-skills-in-front-end-development/">Overlapping skills in front-end development</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Overlapping skills in front-end development">Reply via email</a></p> #HackOnMDN 2018-09-25T00:00:00Z https://hidde.blog/hackonmdn/ <p>This weekend I joined a bunch of web developers, tech writers, web standards lovegods and other friendly folks in London, to work on accessibility documentation for MDN, Mozilla’s platform for learning about web development.</p> <p>I had a brilliant time, meeting familiar faces from social media IRL and catching up with others. Not only did I learn lots about nails and stools (thanks <a href="https://front-end.social/@ninjanails">Seren</a> and <a href="https://front-end.social/@estelle">Estelle</a>), it was also great to be amongst like-minded people to overhear deeply technical accessibility discussions between people who already wrote about accessibility when I wasn’t even born yet.</p> <p><img src="https://hidde.blog/_images/people-standing-around-table-one-man-in-front-with-laptop-on-lap.jpg" alt="People standing around table one man in front with laptop on lap" /> <em>Photo: <a href="https://twitter.com/brucel/status/1044657823945248770">Bruce Lawson</a>, with a hipster filter added, as we were in Shoreditch</em></p> <p>On the first day we got to know each other and picked projects to work on. While others looked at adding screenreader compatibility data and documenting WAI-ARIA better, I teamed up with Seren, <a href="https://twitter.com/evaferreira92">Eva</a> and <a href="https://https//mastodon.social/@gwitch">Glenda</a> to improve and add accessibility information on MDN pages that were about non-accessibility topics. </p> <p>What I liked about that particular project, is that it exposes accessibility knowledge to people who are not necessarily looking for it. If you want to know how <code>order</code> works in CSS, you get some information about how it affects screenreader users for free. I’m optimistic. I believe most developers will do the right thing for their users. As long as they have the information on what the right thing looks like in code, design, strategy, testing, et cetera.</p> <p>After lunch a lot of us gave lightning talks! <a href="https://twitter.com/MichielBijl/status/1043841101139005444">Eva talked</a> about the problems of automatically translating content and making technical videos available with captions, and Michiel did a great TED-style talk on when to use ARIA. It was just <a href="https://twitter.com/stephaniehobson/status/1043843383431778304">one slide</a>.</p> <p>Although MDN is a <em>developer</em> network, there are pages for many others. So on the second day I worked on revamping the page <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Accessibility/Accessibility_information_for_UI_designers">Accessibility information for UI/UX designers</a>. It was fairly outdated, so it felt sensible to replace it with more hands-on advice. </p> <p>On the last day I continued work on that page and did a PR to improve icon accessibility. I also gave a short lightning talk entitled “Making password managers play ball with your login form”, which is also <a href="https://hiddedevries.nl/en/blog/2018-01-13-making-password-managers-play-ball-with-your-login-form">a blog post on this site</a>.</p> <p><img src="https://hidde.blog/_images/people-sitting-at-tables-with-laptop-one-girl-smiling-into-camera.jpg" alt="People sitting at tables with laptop, one girl smiling into camera" /> <em>Photo: <a href="https://twitter.com/brucel/status/1044657823945248770">Bruce Lawson</a></em></p> <p>Others in the room did great work on getting screen reader compatibility data onto MDN, adding ARIA reference pages, cleaning up docs, modernising Spanish content, <a href="https://twitter.com/aardrian/status/1043533561209544705">updating the WCAG reference with 2.1 content</a> and <a href="https://twitter.com/aardrian/status/1044233677293735936">improving MDN’s tooltips</a>. There were also very informative lightning talks about focus styles, <a href="http://adrianroselli.com/2018/02/tables-css-display-properties-and-aria.html">display properties and semantics</a>, WCAG 2.1 and beyond (<a href="https://www.w3.org/WAI/GL/task-forces/silver/">Silver</a>) and <a href="https://github.com/ericwbailey/a11y-syntax-highlighting">accessible syntax highlighting</a>.</p> <p>It’s been a great three days. I’ve thoroughly enjoyed both doing contributions to MDN, as well as meeting and learning from like-minded people. And I’m proud we got so much done!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/hackonmdn/">#HackOnMDN</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20#HackOnMDN">Reply via email</a></p> Review: New Frontiers in Web Design 2018-09-26T00:00:00Z https://hidde.blog/review-new-frontiers-in-web-design/ <p>Last week I had the chance to read <a href="https://www.smashingmagazine.com/2018/09/smashing-book-6-release/#about-the-book">New Frontiers in Web Design</a>, the latest in the series of Smashing Books. It just came out and is full of interesting knowledge for people who work on the web in 2018. From CSS custom properties to advanced service workers to bringing personality back to the web.</p> <h2>What’s it about?</h2> <p>Let’s dive right into it. The book consists of 10 chapters, all about different subjects. </p> <h3>Design systems</h3> <p>No elephants in the room were avoided in this chapter about design systems. I loved reading what <em>Laura Elizabeth</em> said about the idea some have of design systems: that they are somehow quite trivial. Creating, promoting and maintaining design systems isn’t simple, and Laura brilliantly shows this. The list of questions to answer for management is very useful.</p> <h3>Accessibility in SPAs</h3> <p><em>Marcy Sutton</em> writes about the accessibility of Single Page Applications. She shows common pitfalls and how to avoid them. Marcy also goes into managing focus, focusless announcements and when to use which. Later in the chapter she explains how to do automated tests and what they can test for.</p> <h3>Grid Layout in production</h3> <p>In this chapter, <em>Rachel Andrew</em> talks about Grid Layout in the real world. She explains most if not all of the cool things Grids let you do, and explains what one can do about fallbacks using Grid Layout’s built-in scenarios (‘new layout knows about old layout’).</p> <h3>Custom Properties in CSS</h3> <p><em>Mike Riethmuller</em> contributed a chapter about Custom Properties. I learned various things, like that the <code>var()</code> function takes a fallback value, and that you could use <code>calc()</code> to give unitless custom property values a unit. His examples of writing way fewer CSS rules, by updating values, not which property is being used, are an invitation to go and use this stuff now.</p> <h3>Service Workers</h3> <p><em>Lyza D. Gardner</em>’s chapter about Advanced Service Workers is great: it is advanced, but explains basic concepts, too. That made it easier to follow along. It reminds of how hard caching can be, and contains some nifty tricks, like giving your Service Worker an ID, that you can use when cleaning out old caches. The chapter also does a great job explaining push notifications and background sync.</p> <h3>Loading resources</h3> <p>‘Loading resources on the web is hard’, concludes <em>Yoav Weiss</em> in his chapter about loading our websites faster. He talks about how websites load and discusses a wide variety of strategies to optimise loading. Both old school classics and fancy new features. One interesting reminder early in this chapter is that HTML is progressive, which makes it load faster than anything as browsers can start processing it when only part of it was downloaded.</p> <h3>Designing conversations</h3> <p><em>Adrian Zumbrunnen</em> explains what’s important when designing a bot to talk to, and behaving human-like is one of those things, he says. It made me think about how human customer service often offers a robot-like experience, in that their agents strictly stick to their scripts. If we design conversations with bots to be more human, will all conversations end up being very similar?</p> <h3>Chatbots and virtual assistents</h3> <p>Continuing from designing conversations, the next chapter is about engineering them. <em>Greg Nudelman</em> talks about creating plugins for voice assistants as well as standalone bots. As an engineer, I found it a fascinating insight in how this stuff works. As a citizen slash consumer, I would dislike any services that replace their friendly and smart humans with statistical analysis. That may be just me.</p> <h3>Cross reality</h3> <p>Cross reality is the umbrella term for virtual, augmented and mixed reality. In this chapter <em>Ada Rose Cannon</em> explains how to create scenes in browsers, using web standards and some libraries that abstract them. She also goes into improving rendering performance and there’s a useful list of things she wished she had known when she began.</p> <h3>Making it more personal</h3> <p>The last chapter in the book is written by Mr Smashing himself. <em>Vitaly Friedman</em> tells us all about how to put more personality into our work. Earlier this year, I saw him talk about the same at ICONS in Amsterdam. Vitaly encourages us all to create more interesting things. The theme resonates a lot with me. Yes, we need more things that are visually interesting and different. We also need more things that have well considered UI patterns, that ‘exceed expectations’, as Vitaly writes.</p> <h2>My thoughts</h2> <p>Reading this book feels a bit like going to a good conference. There is lots of variety, plenty to learn and you get away with stuff to try out on your project when you get back to work. </p> <p>There is also lots of variety within each chapter. I felt some chapters covered too much, they could have been more concise. The upside is that you get a lot of content for your money, so there’s that.</p> <p>One other thing that could be improved is the way references work: footnotes contain just (shortened) URLs, which obfuscates their original address. It may be just me, but I like seeing the name of the author and the name of the post/page being cited, to connect dots quicker.</p> <p>If a majority of the covered subjects piques your interest, don’t hesitate to buy Smashing Book #6. There will be plenty of new things to learn. Regarding the physical book: I have not seen it yet, but going by the tweets, the hardcover edition is beautiful, so that is one to consider.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/review-new-frontiers-in-web-design/">Review: New Frontiers in Web Design</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Review: New Frontiers in Web Design">Reply via email</a></p> Accessibility wars and the state of talking to machines 2018-09-29T00:00:00Z https://hidde.blog/accessibility-wars-and-the-state-of-talking-to-machines/ <p>This week I attended Accessibility London. It took place at Sainsbury’s headquarters, who were kind enough to host the event.</p> <h2>The Accessibility Peace Model</h2> <p><strong>Glenda Sims</strong> talked about what she and Wilco Fiers like to call <a href="https://www.deque.com/blog/the-web-accessibility-interpretation-problem/">the accessibility interpretation problem</a>: people disagree about how (much) accessibility should be implemented and tested. There are normative guidelines (WCAG), but experts have different views on what complying to the norm means. Glenda explained that this is ok, ‘there are multiple valid ways to use WCAG’. </p> <p><img src="https://hidde.blog/_images/bbc4345c-4050-4753-9243-d91180668a30.jpeg" alt="Glenda Sims in front of slide saying: reasons for interpretation differences: complexity of wcag2, volume of wcag 2 interpretation, technology agnostic language, motivation for testing" /> <em>Glenda Sims on why interpretations differ</em> </p> <p>She explained a scale of interpretation styles:</p> <ul> <li>bare minimum (only where WCAG says ‘this is normative’)</li> <li>optimised (beyond strictly normative, also tries to act in spirit of the whole document and look at the Understanding and Techniques pages)</li> <li>idealised (tries to look beyond what’s currently possible and maximises accessibility). </li> </ul> <p>Different people at your team or your client’s teams will be on different places of that scale. Knowing this is the case can help think about expectations. I found this a super refreshing talk, it resonated a lot with my experiences. <a href="https://www.deque.com/blog/the-web-accessibility-interpretation-problem/">The full whitepaper</a> can be found on Deque’s website. </p> <h2>The history and future of speech</h2> <p><strong>Léonie Watson</strong> walked us through the history and future of people talking to computers (<a href="http://decks.tink.uk/2018/london-a11y/#54">Léonie’s slides</a>). From synthetic voices that existed way over 90 years ago to modern computer voices that can sing reasonable covers of our favourite pop songs. There are various W3C standards related to speech, Léonie explained, like <a href="https://www.w3.org/TR/voicexml21/">Voice XML</a> and the <a href="https://www.w3.org/TR/speech-synthesis/">Speech Synthesis Markup Language</a>, and there is a <a href="https://www.w3.org/TR/css3-speech/">CSS speech spec</a> (‘why should I have to listen to everything in the same voice?’, Lèonie asked. A great point.) As far as I know, nobody works on CSS Speech anymore, sadly.</p> <p>Léonie also explained how we can design for voice with the <a href="https://inclusivedesignprinciples.org/">Inclusive Design Principles</a> in mind, with useful do’s and don’ts. At the end, she left us with questions about embedding privacy, security, identity and trust in voice assistants.</p> <p>This was an excellent event with great speakers, I was so glad I was able to attend.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/accessibility-wars-and-the-state-of-talking-to-machines/">Accessibility wars and the state of talking to machines</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Accessibility wars and the state of talking to machines">Reply via email</a></p> Grids in cards 2018-11-04T00:00:00Z https://hidde.blog/grids-in-cards/ <p>Paddings in cards are great, but how about using <em>grids</em> in cards? Using columns and rows for whitespace can give great flexibility, and lets us have optional padding: we can turn it off when we want to.</p> <p><em>Note: this is an exploratory post, not something I necessarily recommend to apply to all the things.</em></p> <h2>A card with padding everywhere</h2> <p>Most card-type components will have a padding set across all dimensions, so that the content does not stick to any of the sides of the box:</p> <pre class="language-css"><code class="language-css"><span class="token selector">.card</span> <span class="token punctuation">{</span> <span class="token property">padding</span><span class="token punctuation">:</span> 1em<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p><img src="https://hidde.blog/_images/card-with-text-about-geladas.png" alt="Card with text about Geladas" /> <em>An example card with 1em of padding around. Source: <a href="https://en.wikipedia.org/wiki/Gelada">Wikipedia - Gelada</a></em> </p> <p>This is a very effective way of doing things, especially with <code>box-sizing</code> set to <code>border-box</code>. But what if you wanted to have something like this: </p> <img src="https://hidde.blog/_images/card-with-text-left-and-list-of-meta-info-right-right-secton-has-background-extending-all-around.png" alt="Card with text left and list of meta info right, right secton has background extending all around" /> <p>On the left hand side, the padding works, but on the right hand side, we want the background of the content to stretch to the sides of the box, which will not work if it had a padding. Let’s see if CSS Grid Layout can help!</p> <h2>A card with some padding turned off</h2> <p>So here’s CSS for a card that looks the same, it has <code>1em</code> of whitespace all around, but this time it is built with Grid.</p> <pre class="language-css"><code class="language-css"><span class="token selector">.card</span> <span class="token punctuation">{</span> <span class="token property">display</span><span class="token punctuation">:</span> grid<span class="token punctuation">;</span> <span class="token property">grid-template-columns</span><span class="token punctuation">:</span> 1em auto auto 1em<span class="token punctuation">;</span> <span class="token property">grid-template-rows</span><span class="token punctuation">:</span> 1em auto 1em<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p><img src="https://hidde.blog/_images/card-with-grid-overlayed-showing-whitespace-all-around-content.png" alt="Card with grid overlayed, showing whitespace all around content" /> <em>Grid tracks for padding!</em> </p> <p>(<a href="https://codepen.io/hidde/pen/xQxNjP">Example on CodePen</a>, recommended to view with Firefox Grid Inspector)</p> <p>We create a grid and make the first and last column, as well as the first and last row, exactly <code>1em</code>. In this example, there is two <code>auto</code> grid track in between, there could be more if you wanted. </p> <p>When we used padding, that was all we had to do to make the content stay inside the padded area. With grid, we have created an ‘optional padding’ situation so we will have to explicitly place the content inside the padded area.</p> <p>If we want a piece of content to be in the padded area: </p> <pre class="language-css"><code class="language-css"><span class="token selector">.card__content</span> <span class="token punctuation">{</span> <span class="token property">grid-column</span><span class="token punctuation">:</span> 2 / 3<span class="token punctuation">;</span> <span class="token property">grid-row</span><span class="token punctuation">:</span> 2 / 3<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>If we want the content to have a background that extends to the boundaries of the box, we position it to take up the first to the last row, and position it to take up space until the last column:</p> <pre class="language-css"><code class="language-css"><span class="token selector">.card__meta</span> <span class="token punctuation">{</span> <span class="token property">grid-row</span><span class="token punctuation">:</span> 1 / 5<span class="token punctuation">;</span> <span class="token property">grid-column</span><span class="token punctuation">:</span> 4 / 6<span class="token punctuation">;</span> <span class="token property">padding</span><span class="token punctuation">:</span> 1.5em<span class="token punctuation">;</span> <span class="token property">background-color</span><span class="token punctuation">:</span> #eee<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>You could, of course, style <code>.card__meta</code> with negative margins, but I feel that method is less intuitive. I’m curious to hear how people think about using Grid instead.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/grids-in-cards/">Grids in cards</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Grids in cards">Reply via email</a></p> My first MozFest 2018-11-04T00:00:00Z https://hidde.blog/my-first-mozfest/ <p>This weekend I attended my first Mozilla Festival in North Greenwich, London. It was great. In this post I’ll share some takeaways from my favourite sessions.</p> <p>Ever since I started working for Mozilla, I learned more about their communities. They have wide interests, ranging from Rust to machine learning to WebVR. Sometimes related to Firefox, but often not. People from these and other communities come together at MozFest, to talk, learn and think about what Mozilla calls <a href="https://www.mozilla.org/en-US/internet-health/">internet health</a>. Internet Health is an umbrella term for various issues related to what’s happening to the web. They include (de)centralisation of power, online harassment, privacy, security and how people understand the web works (e.g. distinguish sponsored content from journalism). There’s also an <a href="https://internethealthreport.org/">Internet Health Report</a>. </p> <p>Mozilla Festival 2018 was 9 floors of internet health goodness, each with its own theme. The spaces had lots of meeting spaces that hosted small-scale workshops and talks. </p> <p><img src="https://hidde.blog/_images/crowd-at-mozfest-fox-at-the-front.jpg" alt="Crowd at MozFest, fox at the front" /> <em>There was also a photo opportunity with a fox</em></p> <h2>Targeted advertising and human rights</h2> <p>“Targeted advertising is used as a delivery mechanism for propaganda”, said <a href="https://nathaliemarechal.net/">Nathalie Maréchal</a>. She is a researcher at Ranking Digital Rights, a non-profit that tries to find out how much some of the world’s largest corporations respect their user’s privacy online. It did not take long for me, to realise how this is indeed a human rights issue. We can ask questions about enabling companies to know all about us in order to sell us products. It gets worse, though, when political parties use the same mechanisms in order to win elections. Or when the algorithms automate discrimination or create dangerous bubbles. </p> <h2>Design for renaming</h2> <p>This session was about the problems trans people face when there is a mismatch between their official identity documents and what they self identify as. It was heartbreaking to hear some real-world experiences of trans people. After an introduction, we broke out in groups to define the problem space and then worked on finding solutions. We found we can do a lot if we avoid using a birth name as someone’s unique identifier in a system. In general, we should stop assuming names are fixed. This is easier said than done, because a lot of the systems banks an governments use are very old and not so flexible.</p> <h2>Fooling AI</h2> <p>I also attended a session about a special sticker that <a href="https://www.youtube.com/watch?v=i1sp4X57TL4">fooled a machine learning algorithm</a>, presented by Anant Jain. When fed a picture of a banana, the algorithm correctly classified it as such. When said special sticker was applied to the banana, the algorithm confidently classified it as… wait for it… a toaster. That’s a funny example, but the idea that machine learning systems can be fooled is not. There are lots of situations where this could lead to dangerous situations, like a self-driving car’s ML that fails to recognise a human crossing the street.</p> <h2>AI’s collateral damage</h2> <p>In the <a href="https://www.youtube.com/watch?v=503Yup0wpIk">AI’s collateral damage panel (video)</a>, four very smart people shared their thoughts around potential consequences of artificial intelligence on our society. They talked about the danger of algorithms and our lack of understanding how they work. Guillaume Chaslot, who worked on YouTube’s machine learning algorithms, admitted he did not fully understand how they worked. And then there was the question of what to optimise algorithms for. If tech companies optimise for engagement, which they often do as it is good for ad-selling, this drives the content in a certain direction. Algorithms optimised for engagement are likely to recommend content that outrages people, fueling polarisation online. A third aspect the panelists discussed was legislation. Is it likely our governments are equipped to legislate AI, looking at how <a href="https://edition.cnn.com/2018/04/10/politics/mark-zuckerberg-senate-hearing-tech-illiteracy-analysis/index.html">Mark Zuckerberg’s Senate hearing</a> painfully exposed the senators’ tech illiteracy? </p> <p>The content of MozFest was often pretty dark, but, surprisingly, people were pretty positive. They were looking for ways to bend the bad things into positive results. I had a great time and learned plenty of new things. I was even able to do a round of <em>guerilla</em> user testing a new product I am working on at the moment. </p> <p>It was super cool to be among people that care about an open, inclusive and decentral web. Yup, I realise that makes me sound like my thoughts were re-programmed with Mozilla marketing speak. But being there, hearing about these issues and seeing people from all sorts of organisations care, it was brilliant. Would attend again!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/my-first-mozfest/">My first MozFest</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20My first MozFest">Reply via email</a></p> Up to speed with web performance 2018-11-10T00:00:00Z https://hidde.blog/up-to-speed-with-web-performance/ <p>On Thursday and Friday I learned all sorts of things about making sites faster at the <a href="https://perfnow.nl/">performance.now() conference</a> in Amsterdam. I frantically took notes at each talk, so here’s my summary of the event.</p> <p>Performance has always been one of my main interests in web development: if you want a good user experience, speed is essential. The performance.now() conference was two days, with eight talks on each day. Some had lots of theory, others were case studies. The balance between different types of content was excellent. I thoroughly enjoyed learning more about resource hints, HTTP/2, rendering performance of UI and fonts, the web itself and how performance works in large organisations. </p> <p>See also: <a href="https://www.youtube.com/playlist?list=PLjnstNlepBvMnKuNFvWeQWzlRp8Cbiw0X">the conference videos on YouTube</a>.</p> <p><img src="https://hidde.blog/_images/yoav-weiss-slide-says-http2-to-the-rescue.jpg" alt="Yoav Weiss, slide says HTTP2 to the rescue" /> <em>HTTP/2 was a recurring theme</em> </p> <h2>Day 1</h2> <h3>Steve Souders - Making JavaScript fast</h3> <p>The conference kicked off with the grand… eh godfather of web performance: Steve Souders. He talked about the issues that stand in the way of everything (the ‘long poles in the tent’), based on data from the HTTPArchive. The longest pole: JavaScript fatigue. Scripts are not just bad news for performance because of download time, but also because parsing them costs CPU time on our user’s devices. Steve recommended reducing it (check code coverage, budget 3rd parties), and for what is left: load it async (or better: defer), use <code>&lt;link rel=preload as=script&gt;</code> (or better: as a header) and double-check your assets are actually compressed.</p> <h3>Harry Roberts - Third-party scripts</h3> <p>Harry Roberts discussed third party scripts in four stages: understanding what the problem is, auditing for it, talking to internal teams and vendors and reducing the problem where possible (<a href="https://speakerdeck.com/csswizardry/its-my-third-party-and-ill-cry-if-i-want-to">Harry’s slides</a>). Third party scripts can affect user’s security, they can slow things down (or even be a single point of failure). For auditing, Harry mentioned <a href="http://requestmap.webperf.tools/">Request Map</a>, a tool that takes a Web Performance Test as input and creates a map. With the data in hand, he explained, you can go talk to the vendor or the scripts (note: they might lie). Or you can go to the department responsible for the scripts and have a polite meeting with them (‘ask questions, don’t demand immediate removal’). This sparked some discussion at the drinks afterwards: polite is probably good, but shouldn’t developers really be quite strong about reducing tracking? To mitigate third party performance issues, Harry recommended self-hosting, <code>async</code> loading where possible and <code>preconnect</code> to ‘warm up’ the connections to origins that are most important and that you’ll need frequently.</p> <h3>Anna Migas - Debugging UI perf issues</h3> <p>Anna Migas showed us how to impove what she calls ‘perceived <em>load</em> performance’ (<a href="https://www.slideshare.net/AnnaMigas1/performancenow-fast-but-not-furious">Anna’s slides</a>). If we want smooth interactions, we have to do our calculation work between frames. This is because we should ensure our users get not only 60fps, but possibly also 120fps, it’s a thing on iPad Pro and Razer devices. She exposed step by step how a browser builds a frame and shared great tricks for avoiding jank (offload tasks outside the main thread) and diagnosing its cause in Dev Tools (Performance, Rendering and Layering tabs). She also explained issues with certain interaction patterns, like animations (janky if wrong properties or too many), parallax scrolling (‘paint storms’), fixed elements (lots of repainting) and lazy loading images (content jumps). A great trick for improving performance of fixed or sticky elements: try to get browsers to load them in their own layer (can be forced by using <code>will-change</code> or <code>transform: translate3D(0,0,0)</code>). She did warn here: be mindful that more layers consume more memory, use them wisely.</p> <h3>Adrian Holovaty – Geeking out with performance tweaks</h3> <p>Adrian created <a href="https://www.soundslice.com/">Soundslice</a>, which is a cleverly built web interface for sheet music. Because it displays sheet music, it displays complex combinations of notes. Hard to get performant, one might think. Soundslice works with a <code>canvas</code> that can (has to) do redraw very often. It has clever things like that it will highlight the currently played note. You can get kind of stuff super performant with very careful coding, Adrian showed. You do just the things required, not too often, etc. Being the co-creator of a famous library himself, Django for Python, he surprised some by saying he recommends not to use frameworks, as they are often full of things your app doesn’t need. Specifically this is true for front-end frameworks, as <em>their</em> redundant code gets shipped to and parsed by users. Food for thought, I heard many say in the break after. So, no big library, but a small set of 8 utility functions in vanilla JavaScript. Adrian also showed how <code>requestAnimationFrame</code> helped to not redraw too often. Google Dev Tools and Google’s Closure Compiler helped him ship better code. Other cool tricks: one global <code>tmpList</code> that gets reused every time a function requires a temporary array, singleton functions where possible to allow for a cache of fractions to avoid memory overuse, caches for expensive calculations and <a href="https://en.wikipedia.org/wiki/Bitfield">bitfields</a> to use less bytes for saving meta information of notes (one byte per boolean instead of the default 8). Mind. Blown.</p> <p><img src="https://hidde.blog/_images/adrian-in-front-of-slide-with-sheet-music-with-one-section-marked.jpg" alt="Adrian in front of slide with sheet music with one section marked" /> <em>Adrian shows sheet music</em> </p> <h3>Zach Leatherman - Fonts</h3> <p>Those who had hoped to walk out of Zach Leatherman’s talk with the one, ultimate, bullet-proof solution to loading fonts fast, were out of luck (<a href="https://noti.st/zachleat/KNaZEg/the-five-whys-of-web-font-loading-performance">Zach’s slides</a>). There is just too much to think about. Most solutions will be a trade-off in some way. But there’s lots to tweak. Zach walked us through <a href="https://performance-sometime.netlify.com/">improving font loading in a default WordPress theme</a>. He showed lots of tools that can help us deal with what he called the biggest enemies of font loading: <em>invisible text</em> (because font not yet loaded) and <em>moving text</em> (because of fallback font getting replaced by the real thing). Reflowing content is annoying, so Zach proposed a new performance metric: ‘web font reflow count’. Good web font implementations try and keep this number low, while no web font implementations have it at zero. Waiting endlessly for final versions of all fonts is also not ideal. Reflow could also be avoided if fallback fonts look a lot like the webfonts, or if bold webfonts are fallbacked by synthetically bolded regular weights (which, Zach showed, Safari can do). He also talked about how to use <code>preconnect</code> (in some cases), self hosting, <code>font-display</code> (can have sensible results without JS), the Font Loading API (full control over what and when) and subsetting, with clear and helpful examples. I loved it and will review this site’s web font choices.</p> <h3>Natasha Rooney - Protocols</h3> <p>As someone who is just an ordinary front-end developer, I always find people who understand all about networking a bit intimidating. So was Natasha Rooney, even though she said ‘protocols are easy’. She works on protocols and networking standards at the W3C and IETF. In one of her first slides, Natasha showed the absolute boundaries of network speeds on a map. They are dictated by physics, ‘you can’t beat the speed of light’. To optimise that part of the web stack, the advice is to serve content from servers physically closer to your users (think CDNs). With awesome supermarket metaphors, she explained pipelining. She then went into the details of SPDY, Google’s protocol that later was the basis for HTTP/2, and QUIC, again a Google invention. QUIC may help solve head of line blocking issues by reducing latency. It could end up becoming standardised as HTTP/3. Both SPDY and QUIC run on existing protocols (TCP and UDP respectively), because middle boxes often disallow other protocols.</p> <h3>Andrew Betts – Fun with headers</h3> <p>When Andrew Betts worked in the Technical Architecture Group (TAG), he had to review proposals for new HTTP Headers, amongst, presumably, lots of other tasks. For this talk, he looked into the HTTPArchive to show us some headers. Those we should want and those we should not want. The ones to keep were <em>restrictive</em> headers like <code>Content-Security-Policy</code>, <code>Strict-Transport-Security</code> and <code>Referrer-Policy</code> (all for security) and <em>permissive</em> ones like <code>Access-Control</code> and client hints (full overview in <a href="https://twitter.com/koenkivits/status/1060559225745784832">Koen Kivit’s tweet</a>). Andrew also looked a bit at the future. Particularly <code>Feature-Policy</code> looked pretty interesting and the idea of setting some of these headers in a JSON file served from a well-known endpoint. </p> <h3>Tammy Everts - What’s the best UX metric?</h3> <p>Tammy Everts shared with us what she thinks works best as a performance metric focused on user experience (<a href="https://www.slideshare.net/tammyeverts/how-i-learned-to-stop-worrying-and-love-ux-metrics">Tammy’s slides</a>). She started by sharing some history of performance metrics and what their problems are, then went into current metrics that aid UX. More modern metrics often start with ‘First’ (First Paint, First Interactive, etc), and SpeedCurve introduced metrics for important things on the page (like ‘largest background image rendered’). Tammy also said you can define your own custom metrics. Some companies do, like some social media (‘Time to First Tweet’). Collecting measurements is one thing, but what to do with them? Tammy talked a bit about per page performance budgets, based on some of the metrics she showed before. </p> <h2>Day 2</h2> <h3>Tim Kadlec - The long tail of performance</h3> <p>Tim Kadlec’s talk opened day two and it was about ‘the long tail’. That isn’t always the same people: it could be you on a flight, you who forgot to charge or you visiting a rural area. In other words: the real world. Tim showed how he worked with the MDN team to reduce loading times. A large part of page size was fonts. Choosing a system font instead of Mozilla’s brand sans-serif and subsetting their slab serif helped heaps. Talking more generally, Tim explained he had, in years and years of audits, never seen a case where the site couldn’t have improved making the core user tasks faster. There’s always assets, old code or other stuff that could be removed. And we can choose to do that, Tim explained, we can be proactive and provide a resilient and solid experience. Truly inspiring opening words. Practically, he recommended us to test on older devices and slower connections.</p> <p><img src="https://hidde.blog/_images/tim-kadlec-in-front-of-slide-with-steve-souders-saying-javascript-is-the-main-culprit-for-slow-web-pages.jpg" alt="Tim Kadlec in front of slide with Steve Souders saying JavaScript is the main culprit for slow web pages" /> <em>Speakers quoting speakers: Tim Kadlec refers back to what Steve Souders said the day before</em> </p> <h3>Yoav Weiss - Resource Loading</h3> <p>Yoav Weiss talked about what makes resource loading slow, how we can solve it today and how it will be better in the future. The problems: establishing a connection has many roundtrips, servers take time to process requests, starts are slower than necessary, browsers sometimes have idle time while figuring out which resources to load, when they’re loading they go in turns and then we sometimes load more than necessary (bloat). HTTP/2 helps with a lot, not everything. In the future, we’ll be able to use the wait time by using HTTP/2 Push, we should unshard domains (as it is an antipattern in HTTP/2) and take advantage of <code>preload</code> and <code>preconnect</code> headers (<em>responsibly</em>; adding it to everything messes with prioritisation and make things worse) and we can turn on <a href="https://github.com/google/bbr">BBR</a> (See also: <a href="https://blog.cloudflare.com/http-2-prioritization-with-nginx/">Optimizing HTTP/2 prioritization with BBR</a>, via Tammy Everts).</p> <h3>Kornel Lesiński - Optimising images</h3> <p>Did you know JPEG images don’t contain pixels? Kornel Lesiński explained they have layers of abstract patterns instead. Together they form the image. Some parts contain details and others don’t, and by moving all non-detail data to the beginning of the file, you get this effect of low res slowly becoming hi-res, they load ‘progressively’. Progressive JPEGs have one issue: if you have multiple, they load one by one. In other words, as a group they’re not progressive. This can be mitigated by configuring nginx to send just the first 15%, then wait so that the network can do other things, then send the rest of the file. The doesn’t work on CDNs, they’ll serve static from cache, <em>unless</em> you <a href="https://twitter.com/tsbnunes/status/1060850833561186304">use Edge Workers</a>. Kornel also showed different future image compression techniques, the best of which just exist in browsers as video codecs. The trick to that? Load hero images in a <code>&lt;video&gt;</code> and you’re good to go, Kornel explained. Clever. And probably not for production.</p> <h3>Katie Sylor-Miller - Performance archeology</h3> <p>Katie Sylor-Miller (<a href="https://www.slideshare.net/KatrinaSylorMiller/raiders-of-the-fast-start-frontend-performance-archaeology-performancenow-conference">Katie’s slides</a>) had this fantastic approach of marrying archeology (her background) with web performance, and with… <em>Indiana Jones</em>. The talk was, at the same time, a case study of Katie’s work at Etsy. The team’s hypothesis was that listing page performance improvements would lead to more conversion, so they surveyed, found the culprits and acted on them. It involved manual JS removals at first, but that was later replaced by a very nifty looking (in-house) solution called ‘Vimes’. It automatically <a href="https://twitter.com/jorgelbgm/status/1060861242288553984">finds which parts of the JS are never or rarely used</a>. To avoid having to do this, Katie recommended to ‘architect for deletion’. Interesting findings from the research were that before/after difference got much larger on slower connection speed and that, yes, performance definitely affected conversion.</p> <h3>Jason Grigsby - Progressive Web Apps challenges</h3> <p>It’s been a couple of years since the idea of Progressive Web Apps was introduced. Jason Grigsby talked about some challenges in 2018 PWA land (<a href="https://www.slideshare.net/grigs/progressive-web-app-challenges">Jason’s slides</a>). One such challenges is the definition, it would make sense to have different definitions for developers (like <a href="https://adactio.com/journal/13098">Jeremy’s</a>) and marketeers (<a href="https://infrequently.org/2015/06/progressive-apps-escaping-tabs-without-losing-our-soul/">Alex and Francis’ original definition</a>, or Google’s, that has gone through a couple of iterations). If anything, the <a href="https://fberriman.com/2017/06/26/naming-progressive-web-apps/">acronym is not for developers</a>. There’s plenty of FUD around Progressive Web Apps, Jason explained, and they can do more than we think. Geolocation, Web Payments, an app shell architecture and offline support can all be part of a good PWA experience. Hidden challenges include appearing to use more storage than expected (security measures in browsers dealing with <a href="https://cloudfour.com/thinks/when-7-kb-equals-7-mb/">opaque responses</a>) and designing for the intricacies of a seamless offline experience.</p> <h3>Scott Jehl - Move fast and don’t break things</h3> <p>While most speakers talked about how to make existing sites faster, Scott Jehl recommended us all to not make them slow in the first place. His technique of choice for this: progressive enhancement. It as effective many years ago and it is effective still, Scott explained. For performance, but also for accessibiliy and SEO. He discussed various techniques that fit well within this mindset: HTTP/2 Server Push (Filament already use it in PROD), inlining CSS (or the most critical subset of it if there’s a lot), the <code>lazyload</code> attribute that is in experimental Chrome (<a href="https://github.com/whatwg/html/pull/3752">PR for lazyload against the HTML specification</a>) and <a href="https://www.cloudflare.com/products/cloudflare-workers/">Service Workers on the CDN level</a> so that you can A/B test without bothering users (if you do it on the client, consider this new metric: <a href="https://twitter.com/_munter_/status/1060900971700805637">second meaningful content</a>). Great conclusion: <em>it is easier to make a fast website than to keep a website fast</em>. </p> <h3>Michelle Vu - Performance at Pinterest</h3> <p>Michelle Vu runs the performance team at Pinterest. Her fantastic talk gave us insight in how they got and keep their site fast. The results were very positive: 30% faster got them 10% more sign-ups. Michelle explained that what worked for them is to pick a key metric, which in Pinterest’s case was a custom metric. She said it is helpful to tie performance metrics into business metrics. When measuring, it is helpful to look both at synthetic data (test runs) <em>and</em> RUM data (real users). Michelle showed they each serve a need: synthetic results are consistent and you can run the tests before deploying (e.g. upon code merge) and RUM data shows impact on real users. Michelle also showed a bit of their performance tooling: <a href="https://twitter.com/_munter_/status/1060916306235539456">regressions are measured</a> and there’s performance regression <em>pager duty</em>. So cool! The most important lesson I learned from this talk is that education is very important. Pinterest do this in their pattern library and document things like the experiments (how they were ran, results, etc) and the details of optimisations. Besides documentation, communication and in-person training was just as important to educate others. </p> <h3>Paul Irish - Closing keynote</h3> <p>Closing of the last day of the conference was Paul Irish. He talked about the state of metrics, specifically two kinds: visual metrics and interactivity metrics. Visual metrics are things like <a href="https://docs.google.com/document/d/1BR94tJdZLsin5poeet0XoTW60M0SjvOJQttKT-JK8HI/edit">First Meaningful Paint</a>, Visual Completion, Layout Stability (a.k.a. ‘layout jank’) and something Paul called Last Painted Hero, a measurement for the last paint of most important content (see also: <a href="https://speedcurve.com/blog/rendering-metrics/">Rendering Metrics by Steve Souders</a>). Interactivity metrics are things like <a href="https://docs.google.com/document/d/12UHgAW2r7nWo3R6FBerpYuz9EVOdG1OpPm8YmY4yD0c/edit">First CPU Idle</a> and <a href="https://docs.google.com/document/d/1Tnobrn4I8ObzreIztfah_BYnDkbx3_ZfJV5gj2nrYnY/edit">First Input Delay</a>. Paul also showed how to measure these metrics with real users using a <a href="https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/PerformanceObserver">PerformanceObserver</a>. The flow he recommends for this is to write code, test it synthetically (‘in the lab’), ship it, then validate it with real users (‘RUM’).</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/up-to-speed-with-web-performance/">Up to speed with web performance</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Up to speed with web performance">Reply via email</a></p> Calm tech, platform abuse and reality 2018-11-28T00:00:00Z https://hidde.blog/calm-tech-platform-abuse-and-reality/ <p>This week I attended the Digital Design Ethics conference in Amsterdam. I learned about calm technology, how platforms are abused, what our options are and how to try and prevent abuse earlier. My write-up of the day.</p> <h2>Calm technology</h2> <p>Amber Case started off. She explored the kind of technology she wants to see more of: <em>calm technology</em>. In this age, she explained, attention is more scarce than technology. So we ought to be critical of how we want our tech to interrupt us. Does it really need to talk? Often quieter signals are just as effective. Our industry replicates voice assistants we saw in films, instead of informing solutions by social norms and human needs. Humanity is important in general, Amber explained. For instance, if we make smart machines, let’s consider how to include human intelligence to contribute to that smartness. She mentioned an algorithm that helps find cancer cures, and complements raw data with input from PhD students, instead of figuring out everything alone. Or if we make a smart fridge that refuses to operate if the wrong human stands in front of it, let’s consider they may require food for their diabetic brother. Let’s take reality into account, said Amber. </p> <p>Slightly shorter version of Amber’s talk: <a href="https://www.youtube.com/watch?v=D5neEzKMClA">Calm Technology on YouTube</a></p> <p><img src="https://hidde.blog/_images/amber-case-in-front-of-slide-with-kitchen-appliances-that-all-have-speech-bubbles-and-make-noise.jpg" alt="Amber Case in front of slide with kitchen appliances that all have speech bubbles and make noise" /> <em>Amber Case on the dystopian kitchen of the future</em> </p> <h2>Indifferent platform executives</h2> <p>The theme of reality continued in talk two. I’m not sure if I’ve ever seen a web conference speaker so furious on stage. Mike Monteiro talked about Mark Zuckerberg of Facebook and Jack Dorsey and Biz Stone of Twitter. The thing is: people use their platforms to spread fake news and declare nuclear war (the US president did). In response to the latter, Twitter did not kick the president off their platform and <a href="https://medium.com/@biz/newsworthy-and-of-public-interest-1f2b83314f89">hid behind corporate speak</a>. Mike finds this problematic, because there is insincerity in pretending to fairly apply rules, if instead, you bend them to keep profitable accounts online. It doesn’t take much cynicism to conclude these decisions are about money. Monteiro backed this up with an <a href="https://www.bloomberg.com/news/articles/2017-08-17/what-is-trump-worth-to-twitter-one-analyst-estimates-2-billion">analyst’s valuation</a> of what removing Trump from Twitter would cost the company: 2 billion dollars, or a fifth of its value. </p> <p><img src="https://hidde.blog/_images/mike-in-front-of-slide-that-says-saying-no-is-a-design-skill-asking-why-is-a-design-skill-rolling-your-eytes-is-not-a-design-skill.jpg" alt="Mike in front of slide that says Saying NO is a design skill, asking why is a design skill, rolling your eytes is not a design skill" /> <em>We should not look away. Photo: Peter van Grieken</em></p> <p>It isn’t just the executives, Mike explained: everyone who works at a company like Twitter should ask themselves why they are still there. Paying a mortgage, he said, is not enough. He warned us: if you work as a designer or developer at a company that has terrible effects on the world, be mindful of not “slowly moving your ethical goalposts”. I cannot help but think there’s quite some space between moving ethical goalposts and completely quitting your job. Mike mentioned the Google walkout: they try to move stuff from the inside.</p> <p>If you’d like to watch Mike’s talk, see <a href="https://vimeo.com/268704084">How to Build an Atomic Bomb - Mike Monteiro - btconfDUS2018</a>. Warning: contains a lot of swearing and Holocaust references.</p> <h2>Design as applied ethics</h2> <p>According to Cennydd Bowles, we should regard design as <em>applied ethics</em>. In his recent book <a href="https://www.future-ethics.com/">Future Ethics</a>, he explains that in detail (go read, it is great). At his Amsterdam talk, he gave a fantastic overview of his book’s themes. Cennydd talked about <em>when</em> ethics comes into play: always. When you invent a thing, it’s extremely likely it can be used for bad things. So, worrying about avoiding bad consequences should be intrinsic to our design processes. </p> <p>Cennydd’s talk had good advice for mitigating the issue that Mike mentioned earlier: if you create a platforms that is abused, how should you respond? Cennydd went into concrete actions that help take abuse into account in the design stage.</p> <p>One of the actions Cennydd mentioned: add people who would potentially suffer from your product to the list of stakeholders. Another one: the <em>persona non grata</em>: design for the persona of someone with bad intentions as a strategy to make your product less bad. And he talked about Steve Krug’s well known ‘don’t make me think’: if we want to give users agency, Cennydd explained, sometimes the opposite, <em>making them think</em>, is preferred. For example, if you give people privacy settings, a ‘consent to all the things’ button requires less thinking, but a more fine-grained control yields more privacy and shows you view people as people.</p> <h2>The veil of ignorance</h2> <p>Both Mike and Cennydd mentioned the <em>veil of ignorance</em>, a thought experiment by the political philosopher John Rawls. I used this concept in a talk I gave a couple of weeks ago (<a href="https://talks.hiddedevries.nl/4goikG/trolleys-veils-and-prisoners-the-case-for-accessibility-from-philosophical-ethics#stLAXe9">Trolleys, veils and prisoners</a>), please allow me to quickly reiterate that here. The idea is: imagine a group of people that you ask to come up with all the rules that govern our world. But there’s one trick: you strip them away from their position in society. Whether they were Uber’s CEO or an Uber driver, from a rich or a poor family, haves or have-nots… they are now none of those things. They wear a ‘veil of ignorance’. They are in what Rawls called the ‘original position’. After they made up the rules, they’re randomly distributed into positions in society. If they are put in the ‘original position’, the theory goes, these people will distribute rules fairly. This is simply because they don’t know how they’ll get them applied to themselves. It’s a powerful concept, and I believe something that applies brilliantly to tech. In quite practical terms, it means if you build or design something, would you want to be the person using that product? </p> <p>If I had to summarise the event in four words, they would be ‘take reality into account’. Amber Case said we should do so in the opening talk. Mike Monteiro said we should not let ourselves get away with ignoring reality. Cennydd Bowles offered some great tips for getting bringing reality into our design process. Hearing these three useful perspectives on bringing ethical thinking to our design processes, I had great day at the Digital Design Ethics conference.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/calm-tech-platform-abuse-and-reality/">Calm tech, platform abuse and reality</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Calm tech, platform abuse and reality">Reply via email</a></p> Scroll an element into the center of the viewport 2018-12-10T00:00:00Z https://hidde.blog/scroll-an-element-into-the-center-of-the-viewport/ <p>Say your page displays a list of names and you want a certain person to be highlighted and scrolled into view. There’s a browser API for that: <code>Element.scrollIntoView()</code>, which scrolls an element into view. </p> <p><code>Element.scrollIntoView()</code> can take two types of elements: a boolean or an object. The object argument gives developers more control over how elements ‘in view’ are aligned, but has slightly less browser support. Let’s look at what we can do with both.</p> <h2>The boolean argument</h2> <p>Say, you have a couple of people in a list:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>ul</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>alice<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Alice Cruz<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>daniel<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Daniel Ho<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">></span></span> … <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>julie<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Julie Howard<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">></span></span> … <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>ul</span><span class="token punctuation">></span></span></code></pre> <p>(<a href="https://codepen.io/hidde/pen/dQEaoO">Example on Codepen</a>)</p> <p>If you want Julie to be scrolled into view, find the relevant element, then call <code>scrollIntoView()</code>:</p> <pre class="language-javascript"><code class="language-javascript"><span class="token keyword">const</span> julie <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span><span class="token string">'julie'</span><span class="token punctuation">)</span><span class="token punctuation">;</span> julie<span class="token punctuation">.</span><span class="token function">scrollIntoView</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> <p>This scrolls the element into view. With a boolean argument, you can have some control over alignment. If you pass <code>true</code> (default), the browser will scroll so that the element is at the top of your viewport or other scrollable element. With <code>false</code>, it scrolls so the element is at the bottom of the viewport:</p> <pre class="language-javascript"><code class="language-javascript">julie<span class="token punctuation">.</span><span class="token function">scrollIntoView</span><span class="token punctuation">(</span><span class="token boolean">true</span><span class="token punctuation">)</span> <span class="token comment">// align top</span> julie<span class="token punctuation">.</span><span class="token function">scrollIntoView</span><span class="token punctuation">(</span><span class="token boolean">false</span><span class="token punctuation">)</span> <span class="token comment">// align bottom</span></code></pre> <p>Note that the underlying terminology is not ‘top’ or ‘bottom‘, I’ll get into that in the next section.</p> <p>For most use cases, this boolean argument may be all you need. It lets you choose if you want the element to align top or bottom. </p> <p>This isn’t always ideal, sometimes you may have a sticky header, so scrollling an element to the top of the document would not actually get it into view. If something like that is the case in your project, the object argument comes in handy. It gives more control over alignment and allows for smooth scroll.</p> <h2>The object argument</h2> <p>In the latest version, you can also pass <code>Element.scrollIntoView()</code> an object, which lets you set two things:</p> <ul> <li>should it scroll smoothly or jump instantly?</li> <li>how should the element align along the block and inline axes?</li> </ul> <pre class="language-javascript"><code class="language-javascript">julie<span class="token punctuation">.</span><span class="token function">scrollIntoView</span><span class="token punctuation">(</span><span class="token punctuation">{</span> <span class="token literal-property property">behavior</span><span class="token operator">:</span> <span class="token string">"smooth"</span> <span class="token operator">|</span> <span class="token string">"auto"</span><span class="token punctuation">;</span> <span class="token literal-property property">block</span><span class="token operator">:</span> <span class="token string">"start"</span> <span class="token operator">|</span> <span class="token string">"center"</span> <span class="token operator">|</span> <span class="token string">"end"</span> <span class="token operator">|</span> <span class="token string">"nearest"</span><span class="token punctuation">;</span> <span class="token literal-property property">inline</span><span class="token operator">:</span> <span class="token string">"start"</span> <span class="token operator">|</span> <span class="token string">"center"</span> <span class="token operator">|</span> <span class="token string">"end"</span> <span class="token operator">|</span> <span class="token string">"nearest"</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> <h3>Smooth scroll</h3> <p>With the <code>behavior</code> parameter, you can set whether scrolling should be instant, so the page just jumps to the element, or smoothly, over a number of seconds (to be <a href="https://drafts.csswg.org/cssom-view/#valdef-scroll-behavior-smooth">decided by the browser</a>). </p> <p>Unsurprisingly, the <code>"smooth"</code> value triggers smooth scroll. The <code>"auto"</code> value triggers instant scroll, as long as the element’s computed value for the <code>scroll-behavior</code> in CSS <a href="https://drafts.csswg.org/cssom-view/#scrolling">is not <code>"smooth"</code></a>.</p> <h3>Alignment</h3> <p>Where I’ve been saying ‘top’ and ‘bottom’, I should have said ‘start‘ or ‘end’. They are the logical properties that you might recognise from other recent CSS specs like Grid Layout and flexbox. </p> <p>As a quick reminder, the inline direction is the direction in which your text runs: it is the direction in which the words of this article are added. The block direction is the opposite of that, it is where block level elements are stacked, or where paragraphs of this text are added.</p> <p>In a page with a vertical scrollbar, on the block axis, <code>start</code> means top, <code>end</code> means bottom. That’s the case on this page, for instance. But if your page uses vertical <a href="https://www.w3.org/TR/css-writing-modes-4/">writing mode</a>, you’d scroll horizontally, like in <a href="https://www.chenhuijing.com/zh-type/">Hui-Jing Chen’s example of Chinese typography</a>; in those cases, <code>start</code> means right, <code>end</code> means left on the block axis.</p> <h2>Fallbacks can be tricky</h2> <p>All browsers that understand <code>element.scrollIntoView()</code> accept the boolean argument. But only some accept the object argument. The good thing is, browsers will fallback for you. The default for the boolean argument is <code>true</code>, which sets the equivalent to <code>block: start</code>. If you use the object argument to use <code>block: center</code> or <code>block: end</code>, browsers that don’t do the object argument, will regard the argument to be <code>true</code> (because objects are <a href="https://developer.mozilla.org/en-US/docs/Glossary/Truthy">truthy</a>). So you’ll end up with <code>block: start</code> in those browsers. That’s often great, except when it is the opposite of what you’re fallbacking for. </p> <p>If your interface requires precisely control over scroll alignment, fallbacks can be tricky. As an alternative you can also roll your own alignment with <code>element.scrollTo()</code>, as <a href="https://codepen.io/janhoogeveen/pen/GwaeJP">Jan Hoogeveen pointed out</a> (thanks Jan!). If you end up going for that, I would recommend using coordinates as an argument, as the object argument does not work in some recent browsers, including Edge. See also <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo">window.scrollTo</a> on MDN.</p> <h2>In the works: scroll snap</h2> <p>If you find <code>scrollIntoView</code> interesting, you may be interested in Scroll Snap, too. This is new CSS, currently being worked on, which lets you define things like a padding for the scroll container. Rachel Andrew has written a guide on the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Scroll_Snap/Basic_concepts">basic concepts of Scroll Snap</a> on MDN. Some of the properties are already available in some browsers.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/scroll-an-element-into-the-center-of-the-viewport/">Scroll an element into the center of the viewport</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Scroll an element into the center of the viewport">Reply via email</a></p> Making single color SVG icons work in dark mode 2018-12-24T00:00:00Z https://hidde.blog/making-single-color-svg-icons-work-in-dark-mode/ <p>In a project I work on, we had a couple of buttons that consisted of <em>just</em> icons (with visually hidden help text). The QA engineer I worked with, found some of those did not show up in dark mode, which rendered the buttons unusable for users of that mode. Using inline SVGs with <code>currentColor</code> fixed the issue.</p> <h2>What’s dark mode?</h2> <p>Dark mode (similar-ish to <em>high contrast</em> mode) is a setting on platforms, browsers or devices that inverts a user’s colour scheme: from dark elements on a light background to light elements on a dark background. </p> <p>This setting improves the experience for all sorts of users. For instance, people who work in the evening, those spend a lot of time behind their screens and users with low vision. It also saves energy on some types of screens.</p> <p>Dark mode is available on <a href="https://www.macworld.com/article/3283342/os-x/article.html">the latest macOS</a> and <a href="https://www.cnet.com/how-to/how-to-enable-dark-mode-in-windows-10/">Windows 10</a>, but also in the form of a browser plugin (<a href="https://addons.mozilla.org/en-US/firefox/addon/dark-background-light-text/">Dark Background and Light Text</a> add-on for Firefox, <a href="https://darknightmode.com/">Dark Night Mode</a> Chrome extension). In this post I’ll refer to Dark Modes as one thing that generally works the same across different implementations. In reality, there can be inconsistencies, of course. They can be tricky to test remotely, as testing platforms like Browserstack don’t support dark modes for security reasons.</p> <p>Some dark modes will flip colors on existing websites, turning your white colours black. In our project, we try to make our interface work with that kind of dark mode, as some of our users use these settings and it lets them have a much better experience. This is a relatively cheap accessibility win.</p> <h2>Inline SVGs to the rescue</h2> <p>Let’s assume our site has a light background with black icons. One way to include an SVG icon is to use an <code>&lt;img&gt;</code> tag pointing to the SVG. Here’s an example of a chevron icon:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>img</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>chevron-right.svg<span class="token punctuation">"</span></span> <span class="token attr-name">alt</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token punctuation">"</span></span> <span class="token attr-name">aria-hidden</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span> <span class="token attr-name">role</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>presentation<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span></code></pre> <p>(<a href="https://codepen.io/hidde/pen/BvpQOZ">examples on CodePen</a>)</p> <p>In Windows High Contrast, <a href="https://addons.mozilla.org/en-US/firefox/addon/dark-background-light-text/">Dark Background and Light Text</a> and <a href="https://darknightmode.com/">Dark Night Mode</a>, the icon simply did not show. I believe the reason is that Dark Modes generally parse style sheets only, they ignore the contents of markup (including SVG files). In those cases, they will not replace black with white.</p> <p>If we could only set the color for these SVGs in our stylesheets! Well, <code>currentColor</code> allows for that, and, it turns out, that actually works with Dark Modes:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>svg</span> <span class="token attr-name">xmlns</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>http://www.w3.org/2000/svg<span class="token punctuation">"</span></span> <span class="token attr-name">width</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>24<span class="token punctuation">"</span></span> <span class="token attr-name">height</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>24<span class="token punctuation">"</span></span> <span class="token attr-name">viewBox</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>0 0 24 24<span class="token punctuation">"</span></span> <span class="token attr-name">fill</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>none<span class="token punctuation">"</span></span> <span class="token attr-name">stroke</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>currentColor<span class="token punctuation">"</span></span> <span class="token attr-name">stroke-width</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>2<span class="token punctuation">"</span></span> <span class="token attr-name">stroke-linecap</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>round<span class="token punctuation">"</span></span> <span class="token attr-name">stroke-linejoin</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>round<span class="token punctuation">"</span></span> <span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>polyline</span> <span class="token attr-name">points</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>9 18 15 12 9 6<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>svg</span><span class="token punctuation">></span></span></code></pre> <p>For those new to <code>currentColor</code>: it resolves to whatever the CSS <code>color</code> is (as set or inherited) of the element the <code>svg</code> is used in. So if a tool updates all <code>color</code>s in the page, the SVGs automagically change colour too. It is also popular because it works great with states like hovers: for icons with text, icon colours will change whenever you change the text colour. </p> <h2>Declaring supported color schemes</h2> <p>After I posted this, Amelia Bellamy-Royds <a href="https://twitter.com/AmeliasBrain/status/1077425163199688704">helpfully pointed me</a> at a <a href="https://github.com/w3c/csswg-drafts/issues/3299">proposal for declaring color schemes preference</a>. It is proposed to be a property you can set at root level (<code>supported-color-schemes: light || dark</code>) or as a meta tag, so that browsers can be in the know before they start parsing CSS. The property basically lets you tell a browser that your CSS supports dark modes and will not break in them. Safari has <a href="https://developer.apple.com/safari/technology-preview/release-notes/#r70">experimental support</a> for the property in Technology Preview 71.</p> <p>The <code>supported-color-schemes</code> property is meant to be used in conjunction with the <code>prefers-color-scheme</code> media query.</p> <h2>Conclusion</h2> <p>So, if you use <code>currentColor</code> for the only (or primary) colour in your SVG icons, they will work better in dark modes. I’ve not done much more research than this, but hope it helps others who try to make their icons work in dark mode. Feedback more than welcome!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/making-single-color-svg-icons-work-in-dark-mode/">Making single color SVG icons work in dark mode</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Making single color SVG icons work in dark mode">Reply via email</a></p> 2018 in review 2018-12-26T00:00:00Z https://hidde.blog/2018-in-review/ <p>The year is about to end, so here is another year in review post! </p> <p>Some might think it is odd to summarise one’s own year, but I think it is fun to share some facts and thoughts. I love reading these kinds of posts from others (hi <a href="https://zellwk.com/blog/review-2018/">Zell</a>, <a href="https://andy-bell.design/wrote/2018-a-year-in-review/">Andy</a>, <a href="https://cheeaun.com/blog/2018/12/2018-in-review/">Chee-Aun</a>, <a href="https://nienkedekker.com/blog/2018-a-post-mortem">Nienke</a>, <a href="http://www.heydonworks.com/article/quick-2018-review">Heydon</a>). So here we go. Like last year, I’ve divided stuff into highlights and things I learned. To be clear, that doesn’t mean I had a year consisting of 100% highlights and learnings. That would be weird. Of course there was also stuff that went wrong, wasn’t amazing or was personal. I just think they’re for elsewhere (in person over drinks).</p> <h2>Highlights</h2> <h3>Projects</h3> <p>In 2018, I spent most of my time in Mozilla’s Open Innovation team, that I’ve been part of for over a year now (as a contractor). I feel very lucky to get to work with so many smart people. I’m specifically working on the IAM project. For those unfamiliar with the acronym: IAM is short for identity and access management, it is about how people prove who they are (for instance, with email or a third party) and get access to stuff with as little friction as possible. That is particularly challenging when people have multiple identities, which most do. As part of the IAM effort, it’s been super exciting to build most of the front-end for a project codenamed “DinoPark”, which is currently in closed beta. I’m excited to continue this work in 2019 and share more when we can. </p> <p>In Q4, I also spent a day a week working at the City of The Hague, specifically helping with improving accessibility and profesionalising front-end development of their digital services. It’s been great to see improvements shipped both in the application’s code as well as the content management system product. Looking forward to what we’ll do next year.</p> <p>Other short engagements included: </p> <ul> <li>teaming up with <a href="https://askatticus.n/">Jeroen</a> and <a href="https://frozenrockets.nl/">Peter</a>, I helped NOS, the Dutch broadcaster, with an accessibility audit, user tests with visually impaired users and an in-house presentation on technical accessibility</li> <li>I ran a one day workshop on accessibility guidelines at <a href="https://www.zilverenkruis.nl/">Zilveren Kruis</a></li> <li>with <a href="https://frozenrockets.nl/">Peter</a>, I worked on JavaScript to power a chat-like interface for the Dutch government</li> </ul> <h3>Volunteering</h3> <p>I did not do a lot of volunteering this year, but I did <a href="https://hiddedevries.nl/en/blog/2018-04-16-a-dutch-version-of-the-inclusive-design-principles">translate the Inclusive Design Principles into Dutch</a> and worked on <a href="https://hiddedevries.nl/en/blog/2018-09-25-hackonmdn">improving MDN documentation on accessibility</a>.</p> <h3>Cities</h3> <p>This year, I traveled to Munich, Bristol, Munich (twice), Taipei, San Francisco, Mountain View, Paris, Como, London (twice), Berlin (twice), and Düsseldorf. I’m not so proud of this carbon footprint, and experimented with European train travel, which took a bit more time, but was pretty ok for productivity.</p> <p><img src="https://hidde.blog/_images/panorama-with-on-left-hills-bros-letters-on-top-of-building-and-on-right-a-huge-bridge.jpg" alt="Panorama with on left hills bros letters on top of building and on right a huge bridge" /> <em>My terrible attempt at taking a panorama picture from the rooftop of the Mozilla offices in San Francisco</em> </p> <h3>Conferences and events</h3> <p>This year, I attended these events:</p> <ul> <li><a href="https://beyondtellerrand.com/events/munich-2018/speakers">Beyond Tellerand Munich</a></li> <li><a href="https://fronteers.nl/congres/2018">Fronteers Conference</a></li> <li><a href="https://mozillafestival.org/">Mozilla Festival</a> (UK)</li> <li><a href="http://perfnow.nl/">performance.now()</a></li> <li><a href="https://did.amsterdam/">Design Ethics Conference</a></li> </ul> <p><img src="https://hidde.blog/_images/laptop-back-with-lots-of-stickers.png" alt="Laptop back with lots of stickers" /> <em>Proof that I attended events: new stickers!</em> </p> <p>I spoke multiple times, too: </p> <ul> <li>about <a href="https://talks.hiddedevries.nl/Gc3PA1/how-to-make-password-managers-play-ball-with-your-login-form">password managers</a> at MozTW community meetup (Taiwan) and #HackOnMDN (UK)</li> <li>about <a href="https://talks.hiddedevries.nl/41MnIW/the-web-is-ready-for-great-graphic-design">graphic design and the web</a> at Front-end United and CSS Day</li> <li>about <a href="https://talks.hiddedevries.nl/ui2L5o/six-ways-to-make-your-site-more-accessible">accessibility essentials</a> at Refresh Conference</li> <li>about <a href="https://talks.hiddedevries.nl/4goikG/trolleys-veils-and-prisoners-the-case-for-accessibility-from-philosophical-ethics">philosophical ethics</a> at Accessibility Club Conference (Germany)</li> </ul> <p>I did my CSS Layout workshop three more times (for Fronteers and at Front-end United) and ran a new accessible components workshop (for Frozen Rockets).</p> <p>Organisers, thanks so much for having me, a newbie speaker. The first time conference speaking was stressful, time-consuming and very scary, but also satisfying. I got great feedback, both praise (yay!) and things I can improve on (thanks, you know who you are). </p> <p>I’d love to speak more in 2019, please do <a href="https://hidde.blog/en/contact/">get in touch</a> if you want to have me present at your event or give a workshop.</p> <h3>Writing</h3> <p>I published 26 posts on this blog, not including this one. Like I said in last year’s review: I very much <em>recommend writing to fellow people who work on the web</em>, it can be helpful in many ways. It is also great to be able to do this on a domain you own, on pages you designed and built. If anyone needs mentoring around this, get in touch, I would love to help!</p> <p>Some of the most read posts:</p> <ul> <li><a href="https://hiddedevries.nl/en/blog/2018-04-21-more-accessible-markup-with-display-contents">More accessible markup with display:contents</a> on a bug in <code>display: contents</code> implementation in major browswers that undoes accessibility benefits the property could have brought otherwise (since fixed in Firefox stable and being fixed in Chromium)</li> <li><a href="https://hiddedevries.nl/en/blog/2018-07-05-what-kind-of-ethics-do-front-end-developers-need">What kind of ethics do front-end developers need?</a> - in which I tried to make the idea of ‘more ethics’ practical for front-end developers</li> <li><a href="https://hiddedevries.nl/en/blog/2018-08-11-lets-serve-everyone-good-looking-content">Let’s serve everyone good looking content</a> on, wow, really, in 2018, that websites don’t need to look the same in 2018. I find this is still a thing at my clients and those of devs I talked to.</li> <li><a href="https://hiddedevries.nl/en/blog/2018-01-13-making-password-managers-play-ball-with-your-login-form">How to make password managers play ball with your login form</a> sharing what I learned about password manager compatibility </li> </ul> <h3>Reading</h3> <p>It felt a bit weird to have the Goodreads app keep me in check reading-wise, but it did the job. I managed to read more than the goal I set: 46 books. Some that readers of this blog might find interesting:</p> <img src="https://hidde.blog/_images/book-covers-of-brotopia-klont-common-sense-and-killing-commendatore.png" alt="Book covers of brotopia, klont, common sense and killing commendatore" /> <ul> <li><a href="http://brotopiabook.com/">Brotopia</a>, about the ‘bros’ that founded some of the biggest Sillicon Valley corporations and the culture they created. I must admit some doubts towards the word ‘bro’ , but wow, the book taught me a lot about how I don’t want to be and where I don’t want to work.</li> <li><a href="https://webwinkel.uitgeverijprometheus.nl/book/maxim-februari">Klont</a> – if you read Dutch, get it! This novel brilliantly captures the phenomenon ‘datafication’ and how it endangers some of the basic concepts of free societies, as well as, unrelated, the phenomenon of ‘experts’ traveling the world to give talks</li> <li><a href="https://mitpress.mit.edu/books/common-sense-turing-test-and-quest-real-ai">Common sense, the Turing test and the quest for real AI</a> – sometimes fairly technical and academic, but I loved the hype-free thinking about artifical intelligence and what to expect from it</li> <li><a href="https://www.penguinrandomhouse.com/books/561550/killing-commendatore-by-haruki-murakami/9780525520047/">Killing Commendatore</a> – if you’re into Murakami or want to start reading his work, this is great. It is a lot of pages, in two parts, but worthwile. I read the Dutch translation, it is available in many other languages, too.</li> </ul> <p>For all the ‘big data’ and AI expertise that Amazon, which owns Goodreads, has, the app is still very bad at recommending new books. For me, it doesn’t go beyond what the most generic airport bookshops stock. The real human beings I follow on the platform brought much more reading inspiration.</p> <h2>Things I learned</h2> <p>Some random things I learned:</p> <ul> <li>I finally got my hands dirty in declarative client-side component frameworks. My framework of choice was Vue.JS. I learned concepts like routers, props down / events up, reactivity and lifecycle hooks, found they mostly just made sense and enjoyed working in this paradigm. I also found that within these concepts, I mostly wrote just JavaScript, good markup and sensible CSS. For instance, X is now ran inside a lifecycle hook, but X itself is just a method in JavaScript. Y is exposed as a component template, but Y itself is just plain old good <code>table</code>.</li> <li>I learned in multiple projects this year how hard it can be to explain the concept of focus. It exists as a thing in the browser (the <code>document.activeElement</code>), but also as a thing in people’s thinking, not necessarily the same way. And then I’m not even talking about <em>indicating</em> focus yet. In my talk in Groningen I spent a number of slides trying to get it crystal clear. I like <a href="https://twitter.com/nvreez/status/1055745735952658432">Laura Carvajals “You wouldn’t steal their cursor”</a> and tried a streetlights metaphor (they are not pretty, but if they’re not there, you can’t see where you’re going at night)</li> <li>I worked with <a href="https://www.w3.org/WAI/standards-guidelines/wcag/new-in-21/">WCAG 2.1</a> in real projects (testing for the newly added success criteria and talking about them in slides)</li> <li>I added CSPs to some sites (see also <a href="https://hiddedevries.nl/en/blog/2018-06-26-how-i-learned-to-stop-worrying-and-love-csps">How I learned to stop worrying and love CSPs</a>)</li> <li>I did more background reading to better understand the world we’re developing front-ends for (super meta), inspired by various colleagues, conference speakers and friends</li> <li>It’s totally workable to use <a href="https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly">Firefox Nightly</a> as a main development browser, I had expected the occasional crash, because it is an early release channel, but had none. It is not as unstable as it advertises as. Also: tabs and sessions get recovered after updating (I knew this, but had not taken the risk before).</li> </ul> <p>What I want to get better at next year:</p> <ul> <li>writing and presenting</li> <li>I want to try and build something with <a href="https://www.rust-lang.org/">Rust</a></li> <li>get more people excited about having a personal website with a blog</li> <li>take more time off</li> </ul> <p>With that, I wish all readers a fantastic 2019! If anyone has written year in review posts, I’d love to hear about them in the comments/webmentions, and read what you have done.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/2018-in-review/">2018 in review</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%202018 in review">Reply via email</a></p> Return of the blog roll 2019-01-02T00:00:00Z https://hidde.blog/return-of-the-blog-roll/ <p>Personal blogs are making a comeback among web folks. I like this. I have even gone so far as to add a blog roll to this site, so that you can see which blogs I like to read (fwiw).</p> <h2>Personal blogs FTW</h2> <p>When I started getting interested in the web, about 15 years ago, blogs were how I learned new stuff. It was not just learning either, it was reading what interesting people were up to. This is something I heavily used RSS for: the data format that allows easy subscribing to content (or ‘syndication’). In an RSS reader, for whoever is unfamiliar with it, I was able to follow all the feeds I subscribed to in one place.</p> <p>In the last 5-10 years, Twitter took over a lot of that. I stopped using an RSS reader at some point. If I discovered blog posts, it was because the authors tweeted about them, via round-ups like <a href="https://vasilis.nl/dailynerd/index.html">The Daily Nerd</a> (it was great and is dearly missed) or via newsletters like Rachel Andrew’s <a href="http://csslayout.news/">CSS Layout News</a>, David A. Kennedy’s <a href="https://a11yweekly.com/">A11y Weekly</a> and Zoran Jambor’s <a href="https://css-weekly.com/">CSS Weekly</a>.</p> <p>Twitter has become a little less attractive recently. They made changes so that third-party apps like Tweetbot are <a href="https://www.theverge.com/2018/5/16/17362138/twitter-api-third-party-apps-changes-explained">mostly broken</a>. The platform’s leadership <a href="https://www.buzzfeednews.com/article/charliewarzel/a-honeypot-for-assholes-inside-twitters-10-year-failure-to-s#.koZDDl6yOb">fails to deal with the abuse that happens to its users</a>. They keep experimenting with orders that are not historic order… all this made me realise I should go back to consuming blogs directly. I have been gone back to reading blogs through an RSS reader for a couple of months now (I use <a href="https://feedbin.com/">Feedbin</a>).</p> <p>There seems to be a revival of RSS, Jonathan Snook <a href="https://twitter.com/snookca/status/1080500648842534912">noted this week</a>:</p> <blockquote> <p>I like that RSS seems to be making a very small comeback. I find it easier to keep track of and means I don’t have to be on constant lookout on Twitter for updates.</p> </blockquote> <p>Sara Soueidan <a href="https://twitter.com/SaraSoueidan/status/1081050443441147904">said reading RSS gives less noise</a>: </p> <blockquote> <p>My RSS reader is like a private, quiet, comfy reading room, compared to Twitter which is more like a crowded, noisy coffee shop. </p> </blockquote> <p>RSS is a great means to take back control over the web we love from platforms like Twitter. Ben Ubois, founder of Feedbin, a service to read RSS, explicitly says so in his latest blog post, <a href="https://feedbin.com/blog/2018/09/11/private-by-default/">Private by default</a>: </p> <blockquote> <p>I want Feedbin to be the opposite of Big Social. I think people should have the right not to be tracked on the Internet and Feedbin can help facilitate that.</p> </blockquote> <p>This is music to my ears.</p> <p>Earlier this year, NetNewsWire, the 16 year old RSS reader for Mac, was returned to Brent Simmons, its original inventor. He plans to release a new reader, open source, and <a href="http://inessential.com/2018/08/31/netnewswire_comes_home">make it the very best</a>.</p> <p>Šime Vidas of Web Platform News recently <a href="https://webplatform.news/issues/2018-10-31">published his list of over 600 RSS feeds</a>, worth a scroll through.</p> <p>So yes, more people are getting interested in using RSS again. And in <a href="https://personalsit.es/">personal sites</a>. </p> <h2>This site now has a blog roll</h2> <p>For those who aren’t using it: this site has two RSS feeds: <a href="https://hidde.blog/rss/full">full articles</a> and <a href="https://hidde.blog/rss/summaries">summaries</a>. You can read them in whichever reader you like, or open the posts in the browser from your RSS reader. Then you’ll see my fonts of choice.</p> <p>And, as of this week, this site has a <a href="https://hidde.blog/en/blog#blog-roll">blog roll</a>. Blog rolls are lists of (personal) blogs, usually displayed in a sidebar of a website. They have disappeared from a lot of blogs in the past years (I do like <a href="https://adactio.com/">Jeremy Keith’s bedroll</a>), but I completely agreed with <a href="https://marcus.io/">Marcus Herrmann</a>, when he <a href="https://twitter.com/_marcusherrmann/status/1076133774121975809">suggested they should make a comeback</a>. I love blog rolls to discover more people to follow, sometimes outside my own bubble. </p> <p>On this blog, the blog roll has sites of people whose stuff I like to read. The people that inspire my writing here. The blogs I can recommend. For what it’s worth. I hope more people will follow Marcus’ example.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/return-of-the-blog-roll/">Return of the blog roll</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Return of the blog roll">Reply via email</a></p> On the importance of testing with content blockers 2019-01-07T00:00:00Z https://hidde.blog/on-the-importance-of-testing-with-content-blockers/ <p>I recommend everyone to browse with content blockers turned on. The goal: protection against tracking. Safari and Firefox have good tracking protection features. With more people using these features, we should test our sites with content blockers turned on. </p> <h2>Content blocking</h2> <p>In the <a href="https://en.wikipedia.org/wiki/Surveillance_capitalism">age of surveillance capitalism</a>, some browsers have started getting more aggressive in how they block ad trackers to protect the privacy of their users.</p> <p>Firefox has had <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Privacy/Tracking_Protection">Tracking Protection since version 42</a>. It works with a blacklist of domains. When something is blocked, it will show up in the Dev Tools Console (“The resource at X was blocked, because tracking protection is enabled”). </p> <p>Safari not only can block trackers for you, it also allows third parties to <a href="https://developer.apple.com/documentation/safariservices/creating_a_content_blocker">define blocking behaviour</a>. Third party blockers can match patterns in URLs and detect things like the domain a script is loaded on (same as site vs not same as site, the latter means third party). When a tracker is identified, developers can choose what to do: block it altogether, just block cookies or hide elements from the page. Users can install one or multiple content trackers. There is a “load without content blockers” feature (long press reload on iOS), but note users may be unaware of it. I know I was until very recently.</p> <h2>What can break</h2> <p>Four examples I encountered in the last few months:</p> <ul> <li>I wanted to purchase clothing on Zara’s website, to pick up in a store. On the part of the form where I had to select which store, nothing showed. I could also not go to the next step. <code>TypeError: X is null</code> was thrown in the browser Console. A Facebook tracking script was blocked by my content blocker, presumably the reason for the script to fail. </li> <li>I wanted to find opening times at my local supermarket. Search did not yield results until I turned off content blockers.</li> <li>I wanted to open a hamburger menu. It did not open. (This one is very common, actually)</li> <li>A link did not work at all.</li> </ul> <p><img src="https://hidde.blog/_images/screenshot-of-zara-checkout-with-typeerrors-in-dev-tools-console.jpeg" alt="Screenshot of Zara checkout with TypeErrors in dev tools console" /> <em>On this page, I could not select a store or press continue, because Facebook’s tracking script did not load</em></p> <p>To understand the last example better, see Stephanie Hobson’s <a href="https://hacks.mozilla.org/2016/01/google-analytics-privacy-and-event-tracking/">Google Analytics, Privacy, and Event Tracking</a>, which shows how Google Analytics recommended tracking code breaks links for people who block the tracker. </p> <p>We should <strong>not need to track to take people’s money</strong>. Or to let them find opening times, open a hamburger menu or follow a link. Metrics can be useful, but they are <a href="https://press.princeton.edu/titles/11218.html">rarely questioned</a>. </p> <h2>A working website: some strategies</h2> <p>I understand companies want behavioral data in order to improve their sites. But if it puts a stop to taking people’s actual money, doesn’t that defeat the purpose of why you have a website as a company? Is figuring out how many people open your hamburger menu more important than having the feature work at all?</p> <h3>Use no scripts</h3> <p>This one is easy in theory. It is hard in the reality of modern web development, because people will laugh at the suggestion. If your site does not rely on JavaScript to build features like to take people’s money, search for opening times, show a navigation on mobile or go to other pages, these features can potentially <em>just</em> work. </p> <h3>Progressive enhancement</h3> <p>If you manage to develop in a way that does not assume JavaScript (or CSS), you’re likely doing progressive enhancement of some sort. It means that when you build new features, you start with the very basic building blocks, like headings and lists. Simple HTML that describes the feature in a way the most basic browsers understand. You then turn it into something fancy, using web technology a modern as you like. For example, <a href="https://andy-bell.design/wrote/the-power-of-progressive-enhancement/">use Web Components to make it tabs</a>, as Andy Bell described. If the fancy thing breaks, the basic building block likely still works.</p> <p>Not only should progressive enhancement help make your site more robust and resilient, if your whole team can think this way, it can help setting priorities sensibly. See also <a href="https://resilientwebdesign.com/">Resilient Web Design</a>, Jeremy Keith’s free book on building resilient web sites and <a href="https://www.sonniesedge.co.uk/talks/dear-developer">Dear developer</a>, a talk by Charlie Owen. </p> <h2>Conclusion</h2> <p>To build good websites, I think we should prioritise working websites above gathering potentially useful data (if doing that at all). As developers, we should keep in mind trackers could get blocked and, consequently, never rely on their availability.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/on-the-importance-of-testing-with-content-blockers/">On the importance of testing with content blockers</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20On the importance of testing with content blockers">Reply via email</a></p> Linking to translations 2019-01-18T00:00:00Z https://hidde.blog/linking-to-translations/ <p>The other day I worked on some front-end code that takes users to a version of the website in a different language. Two attributes can make such links more accessible: <code>lang</code> and <code>hreflang</code>. What’s the difference?</p> <h2>Strings in another language</h2> <p>The <code>lang</code> attribute can expose what language a page is in, when it is added to the root tag. For example, a page in English, will likely have this as its root element:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>html</span> <span class="token attr-name">lang</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>en<span class="token punctuation">"</span></span><span class="token punctuation">></span></span></code></pre> <p>You can also use <code>lang</code> on any tag in a document, to signify a section, paragraph or word is in a different language. This is useful when you link to a translation. If the link text has a different language than the rest of the document, you can expose that.</p> <p>A link with link text in Chinese, as spoken in Taiwan, one of my favourite countries:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>/zh-TW<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> 中文 <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span></code></pre> <p>The same link, now with the language exposed:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>/zh-TW<span class="token punctuation">"</span></span> <span class="token attr-name">lang</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zh-TW<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> 中文 <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span></code></pre> <p>That’s all. Note: this only means that <strong>the word within this tag is in a different language</strong>. It says nothing about the page we’re linking to.</p> <p>Words marked up in an HTML element with a <code>lang</code> attribute, will get read out with a voice in that language in Safari with VoiceOver and some versions of other screenreaders, depending on settings and voice availability</p> <h2>Links to pages in another language</h2> <p>If the page you’re linking to is in a different language, you can use <code>hreflang</code> to signify that (<a href="https://html.spec.whatwg.org/dev/links.html#attr-hyperlink-hreflang">hreflang in the spec</a>).</p> <p>For example:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>/zh-TW<span class="token punctuation">"</span></span> <span class="token attr-name">hreflang</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zh-tw<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> Chinese <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span></code></pre> <p>If you link to a page in a different language and the text you use is also in a different language, both attributes can be used at the same time.</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>/zh-TW<span class="token punctuation">"</span></span> <span class="token attr-name">hreflang</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zh-tw<span class="token punctuation">"</span></span> <span class="token attr-name">lang</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zh-TW<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> 中文 <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span></code></pre> <p>To be very honest, I don’t know of an actual system using it for detection. Implementing the attribute doesn’t hurt though, if more of us do it, tools can more reliably take advantage of that. The <code>hreflang</code> attribute is also <a href="https://yoast.com/hreflang-ultimate-guide/">used by people who want to increase their search engine rankings</a>, in a per page setting exposed via a <code>link</code> element or as a header.</p> <h2>Language tags: BCP 47</h2> <p>The format of languages used in <code>lang</code> and <code>hreflang</code> is specified in something called <a href="https://tools.ietf.org/html/bcp47">BCP47</a>.</p> <p>They consist of one or more subtags, separated by a hyphen (-). The first one is the primary language, for example <code>en</code> for English and <code>zh</code> for Chinese (<em>zhōngwén</em> means Chinese writing). Most are two characters, some are more.</p> <p>There is a <a href="http://www.loc.gov/standards/iso639-2/php/code_list.php">list of language tags</a> on the Library of Congress website.</p> <h2>Summary</h2> <p>So, to sum up: </p> <ul> <li><code>lang</code> on any HTML element describes what language is used in that element</li> <li><code>hreflang</code> on a link (<code>&lt;a&gt;</code>) describes the language of the page you’re linking to</li> <li>both <code>lang</code> and <code>hreflang</code> are in the format described in <a href="https://tools.ietf.org/html/bcp47">BCP47</a></li> </ul> <p>Happy internationalising!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/linking-to-translations/">Linking to translations</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Linking to translations">Reply via email</a></p> Console logging the focused element as it changes 2019-01-30T00:00:00Z https://hidde.blog/console-logging-the-focused-element-as-it-changes/ <p>When you build a Single Page Application, chances are that you manage some of the <code>focus</code> through script. For debugging, it can be super useful to log the currently focused element to the Dev Tools Console.</p> <h2>Logging the focused element</h2> <p>The focused element is known in the DOM as <code>document.activeElement</code>, so you can just <code>console.log()</code> that if you want to know what the currently focused element is.</p> <h2>Logging it as it changes</h2> <p>Thanks to <a href="https://twitter.com/GirlsCodeMK">Eva</a>, I recently learned a way to log the active element as it changes:</p> <pre class="language-javascript"><code class="language-javascript">document<span class="token punctuation">.</span><span class="token function">addEventListener</span><span class="token punctuation">(</span><span class="token string">'focusin'</span><span class="token punctuation">,</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">'focused: '</span><span class="token punctuation">,</span> document<span class="token punctuation">.</span>activeElement<span class="token punctuation">)</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token boolean">true</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> <p>The <code>focusin</code> event is like <code>focus</code>, but it bubbles, so when any element within <code>document</code> receives focus, <code>focusin</code> bubbles all the way up to <code>document</code>.</p> <p>When I posted this on Twitter, Christian Schaefer <a href="https://twitter.com/derSchepp/status/1089929182203858945">helpfully pointed out</a> that, although <code>focus</code> does not bubble, it can be intercepted when the <code>capturing</code> flag (<code>addEventListener</code>’s third argument) is set to <code>true</code>. Phil Walton then <a href="https://twitter.com/philwalton/status/1089957070185451521">added</a> that <code>focus</code> fires also for non-interactive elements and when the <code>window</code> receives focus. Even better!</p> <p>So this is what you could use to log the active element when it changes:</p> <pre class="language-javascript"><code class="language-javascript">document<span class="token punctuation">.</span><span class="token function">addEventListener</span><span class="token punctuation">(</span><span class="token string">'focus'</span><span class="token punctuation">,</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">'focused: '</span><span class="token punctuation">,</span> document<span class="token punctuation">.</span>activeElement<span class="token punctuation">)</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token boolean">true</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> <p>Also relevant: PPK’s <a href="https://www.quirksmode.org/blog/archives/2008/04/delegating_the.html">Delegating the focus and blur events</a>, over 10 years old, in which he explains that lack of bubbling in <code>focus</code> makes sense, because we would not want it to bubble to <code>window</code>, as the `window’ having focus means that the user has focused the entire browser window.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/console-logging-the-focused-element-as-it-changes/">Console logging the focused element as it changes</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Console logging the focused element as it changes">Reply via email</a></p> Three ways to build Crouwel's Hiroshima poster in CSS 2019-01-31T00:00:00Z https://hidde.blog/three-ways-to-build-crouwels-hiroshima-poster-in-css/ <p>Recreating old posters, I figured there are at least two approaches to deciding how many grid tracks your component or page needs: one can make it visually perfect, the other is more flexible if content is bound to change.</p> <p>In the past 1.5 year or so I spread my excitement for flexbox and Grid Layout through workshops. An assignment I used in each one, is to recreate Wim Crouwel’s iconic “Hiroshima” poster using CSS. Poster recreation in CSS is an idea, of course, popularised by Jen Simmons and her awesome <a href="https://labs.jensimmons.com/">Experimental Layout Lab</a>. She has lots of poster experiments on that site, check it out if you have not.</p> <p>I like having a poster recreation exercise in the workshop, as it lets people learn CSS properties, without worry over maintainability or other concerns that come in mind when doing real-world CSS coding. It also lets the participants build graphic designs that are wildly different from most websites, think outside of the box (oh wait, <a href="https://vimeo.com/289479045">CSS is ALL boxes</a>, as Hui Jing Chen explains in her Box Alignment talk).</p> <p><img src="https://hidde.blog/_images/photos-of-posters-and-logos-on-museum-walls-and-original-hiroshima-poster-on-the-right.png" alt="Photos of posters and logos on museum walls and original hiroshima poster on the right" /> <em>Photos from the exhibition about Crouwel’s work at the Design Museum in London (2010), photos by <a href="https://www.flickr.com/photos/benterrett/5800444715/in/photostream/">Ben Terrett</a>. On the right: the original Hiroshima poster.</em> </p> <p>One poster I like to use is Wim Crouwel’s “Hiroshima” poster. Crouwel is one of The Netherlands’ most influential graphic designers. As co-founder and designer at the influential agency Total Design, he worked on large corporate house styles. He is best known though, for the posters he designed for Dutch museums, including the Stedelijk Museum in Amsterdam. The “Hiroshima” poster was made for an exhibition in the Van Abbe Museum in Eindhoven, The Netherlands. It’s not a complicated poster, sporting the name of the exhibition, a subtitle, location and the opening times.</p> <p>The letters used for the word “Hiroshima” were manually designed by Crouwel. They have inspired various typefaces, including “Shima” by <a href="https://www.behance.net/navasca">Nate Navasca</a>, which closely resembles it, and <a href="http://ultratypes.bigcartel.com/product/ut-morph">UT Morph</a> by Oscar Cobo.</p> <h2>Column choices</h2> <p>If you look closely, you’ll find that the opening times and exhibition duration align with the stem of the second letter ‘h’. The subtitle aligns with the letter ‘o’. Presumably, this is on purpose. </p> <h3>A column for each stem</h3> <p>One way to design the columns for this poster, is to define a column for each of the stem: 17 in total. The minimal space between the letters can be the grid’s <code>column-gap</code>. This leaves us closest to what we presume the poster maker intended.</p> <p>We then need to decide one or more columns to each letter: one for the ‘i’ and three for the ‘m’, for instance.</p> <h3>A column for each letter</h3> <p>Another approach is to create a column for each letter, and let the columns be of <code>auto</code> width. They will then grow with the letters contained in them. </p> <h3>The content-based choice</h3> <p>We could also base our track choices on the four bits of content (title, subtitle, opening times, exhibition duration). This is a more functional approach, and less precise. The bits of content will likely not fully align with the letters of the word “Hiroshima”. </p> <h2>Ok, show me the code!</h2> <p>I’ve built examples with all three approaches: 4, 9 and 17 columns.</p> <p><img src="https://hidde.blog/_images/left-poster-with-simple-grid-overlayed-right-poster-with-complex-grid-overlayed.png" alt="Left poster with simple grid overlayed, right poster with complex grid overlayed" /> <em>The two extremes: 4 columns and 17 columns, visualised using Firefox’s built-in Grid Inspector.</em> </p> <h3>4 columns</h3> <p>The <a href="https://codepen.io/hidde/pen/jdymBd">4 column</a> has least markup and classnames related to the function of the element in the whole. With just those four columns, it does the bare minimum. Dates and opening times don’t align with the letters they’re supposed to align with. But had someone decided to change the exhibition’s name, little harm would be done.</p> <p>I approximated the size of the columns by making them all 1 part of the available space:</p> <pre class="language-css"><code class="language-css"><span class="token property">grid-template-columns</span><span class="token punctuation">:</span> <span class="token function">repeat</span><span class="token punctuation">(</span> 4<span class="token punctuation">,</span> 1fr <span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> <h3>9 columns</h3> <p>My <a href="https://codepen.io/hidde/pen/MLJxEb">9 column version</a>, has each letter wrapped in a span. Only direct children of grid containers get to play in the grid game, but with <code>display: contents</code> on the <code>&lt;h1&gt;</code> , it gets skipped and its children become grid items. <em>Warning</em>: do not use <code>display: contents</code> in production just yet, as the heading will <a href="https://hiddedevries.nl/en/blog/2018-04-21-more-accessible-markup-with-display-contents">lose its accessible role</a> in most browsers.</p> <p>In this one, the columns are of <code>auto</code> size, so that they grow with their content:</p> <pre class="language-css"><code class="language-css"><span class="token property">grid-template-columns</span><span class="token punctuation">:</span> <span class="token function">repeat</span><span class="token punctuation">(</span> 9<span class="token punctuation">,</span> auto <span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> <p>Note that this works because the letters are the largest things in their respective tracks. If we had put anything larger in the same column, for instance in another row, that larger thing would have made the whole column larger.</p> <p>Because of <code>display: contents</code>, the <code>span</code>s within the <code>h1</code> became grid items. With no explicit placement, they get <a href="https://www.w3.org/TR/css-grid-1/#common-uses-auto-placement">auto-placed</a> in a column of their own, allowing for alignment of content with the actual letters. With that in place, I then told all <code>span</code>s to go to the correct row:</p> <pre class="language-css"><code class="language-css"><span class="token selector">h1 span</span> <span class="token punctuation">{</span> <span class="token property">grid-row</span><span class="token punctuation">:</span> 3<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <h3>17 columns</h3> <p>In the <a href="https://codepen.io/hidde/pen/ZwLKKz">17 column version</a>, I’ve wrapped each letter in a span with a classname. I did not need to space each letter individually, but I did have to address differences in how many columns a letter should <code>span</code>: the letters ‘i’ require one column, the letter ‘m’ requires three and all the others require 2. I did unique classnames for each letter, with the two h’s and i’s sharing one between them:</p> <pre class="language-css"><code class="language-css"><span class="token selector">.hiroshima-r, .hiroshima-o, .hiroshima-s, .hiroshima-h, .hiroshima-a</span> <span class="token punctuation">{</span> <span class="token property">grid-column</span><span class="token punctuation">:</span> span 2<span class="token punctuation">;</span> <span class="token property">grid-row</span><span class="token punctuation">:</span> 3<span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token selector">.hiroshima-m</span> <span class="token punctuation">{</span> <span class="token property">grid-column</span><span class="token punctuation">:</span> span 3<span class="token punctuation">;</span> <span class="token property">grid-row</span><span class="token punctuation">:</span> 3<span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token selector">.hiroshima-i</span> <span class="token punctuation">{</span> <span class="token property">grid-column</span><span class="token punctuation">:</span> span 1<span class="token punctuation">;</span> <span class="token property">grid-row</span><span class="token punctuation">:</span> 3<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>Another, more abstract approach could be to have a <code>span-1</code>, <code>span-2</code> and <code>span-3</code> classname.</p> <h2>What’s better?</h2> <p>Thanks for reading this far in a post that is just about grid columns. Basically, my point is about two approaches: <strong>visual perfection</strong> versus <strong>functional pragmatism</strong>. I’ve seen both in real world CSS. Either can be effective. Neither of the two is <em>better</em>, everyone can grid however they like. </p> <p>I would say visual perfection makes more sense in a promotional type of website, where the site was designed just for one purpose, maybe to communicate a one off event. A conference that you already know the name of. That sort of thing. </p> <p>The functional approach is ideal when working with a CMS, where content can change, or there are multiple instances of the same design work. It’s more resilient to change.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/three-ways-to-build-crouwels-hiroshima-poster-in-css/">Three ways to build Crouwel's Hiroshima poster in CSS</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Three ways to build Crouwel's Hiroshima poster in CSS">Reply via email</a></p> Content-based grid tracks and embracing flexibility 2019-02-23T00:00:00Z https://hidde.blog/content-based-grid-tracks-and-embracing-flexibility/ <p>Something I love about CSS is that it lets us define visual design for unknown content. This is kind of magic. We can even size things based on content, with <code>min-content</code>, <code>max-content</code> and <code>auto</code>. This post is about how that works in CSS Grid Layout, and what usage in real projects would mean.</p> <p>In Grid Layout, there are many ways to size a column or row (I’ll refer to them as ‘track’ from here). You can be absolute and define tracks in pixels, or even centimeters, which is pretty useful if you’re doing print work. You can use relative units too, for example relative to the root element’s font size (<code>rem</code>), viewport (<code>vw</code>, <code>vh</code>, <code>vmin</code>, <code>vmax</code>), the width of a 0 (<code>ch</code>)… any <a href="https://www.w3.org/TR/css3-values/#lengths">CSS length size</a>, really. Of course, all of these sizing methods can be mixed in grid definitions. For example, you could make one column flexible, the other absolute and yet another one content-based. In fact, that’s often a sensible thing to do. </p> <h2>Why size at all?</h2> <p>In Grid Layout, you don’t <em>have</em> to size anything. If you don’t define (some) track sizes, their size will be <code>auto</code>, based on the content they need to fit. You could still say which tracks you want with the <code>grid-area</code> syntax, but leave sizing up to the browser. Or you could refrain from defining areas at all, in which case the browser will create tracks for each of your grid items, then size them.</p> <p>The obvious reason to define some, most or all of your track sizes anyway, is because you have intentions about your lay-out. You <em>want</em> your content area to have a maximum length for better readability, or you <em>want</em> your ad bar to be certain size for business reasons.</p> <p>Another reason to give some sizes, is that it saves the browser from parsing your content in order to figure out track sizing by itself, the <a href="https://www.w3.org/TR/css-grid-1/#min-size-auto">spec notes</a>:</p> <blockquote> <p>when content-based sizing is used on an item with large amounts of content, the layout engine must traverse all of this content before finding its minimum size, whereas if the author sets an explicit minimum, this is not necessary</p> </blockquote> <p>This is not an issue with small amounts of content, the spec concurs that that’s trivial, but it is a potential concern if you have lots of grid items or content.</p> <h2>Content versus context</h2> <p>The go-to CSS spec on sizing is <a href="https://www.w3.org/TR/css-sizing-3/">CSS Intrinsic & Extrinsic Sizing Module Level 3</a>. It deals with two ways to size: based on <em>context</em> and based on <em>content</em>. </p> <p>Context-based or <strong>extrinsic sizing</strong> of an element is sizing based on the container it is in. This is often its parent, or it could be the viewport. The extrinsic size of a block element is the size of that container, minus padding and border. If you set an element to, say, <code>width: 50%</code>, it is said to be extrinsically sized to be half of the container.</p> <p>Content-based or <strong>intrinsic sizing</strong>, on the other hand, is sizing based on the element’s content, so it is independent from its context. </p> <p>Before I continue: one place we already have widespread content-based sizing on the web is in tables. They size based on how much content is in the cells. If you place two tables on the same page, they’ll likely differ in size (like the <a href="https://fronteers.nl/congres/2013/schedule">schedule for day 1 and day 2 on the Fronteers website</a> differ). This happens automagically, unless you start setting explicit sizes.</p> <h2>min-content, max-content and auto</h2> <p>So how do <code>min-content</code>, <code>max-content</code> and <code>auto</code> work? Let’s take the following line of text (from Charles Darwin’s <em>On the origin of species</em>, 24): </p> <blockquote> <p>Some facts in regard to the colouring of pigeons well deserve consideration.</p> </blockquote> <p>If it is displayed in a browser using CSS, it will sit in a box. The minimum width of that box in order to fit this content, is the size that fully fits <em>the longest word</em>, so without ‘overflowing’. In this sentence that would be ‘consideration‘. To size this box to that word, CSS lets you use the <code>min-content</code> keyword. If you set <code>width: min-content</code> onto the element that has this text, it will be sized something like this:</p> <pre><code>Some facts in regard to the colouring of pigeons well deserve consideration. </code></pre> <p>Note that if your box contains more than just words, more things influence <code>min-content</code>, for example largest image or fixed size box.</p> <p>The maximum width of that box is the width of this entire sentence. Think of the width it would require if <code>white-space: nowrap</code> was applied. To size the box to the maximum that is required for the content, CSS has the <code>max-content</code> keyword.</p> <p>Keep in mind that <code>min-content</code> and <code>max-content</code> are all about sizing in the <em>inline</em> direction, the one in which words flow, as opposed to the block direction, in which blocks, like paragraphs, flow. </p> <p>In CSS, we can use the <code>min-content</code> and <code>max-content</code> keywords as sizes for elements that contain content. In Grid Layout specifically, we can use the keywords to size tracks. Say you’re using <code>min-content</code> to size a column, it will be calculated based on the minimum required for content throughout all the rows in that column.</p> <p>And then there’s <code>auto</code>. This keyword can mean different things throughout CSS (for a more in-depth look, see fantasai’s <a href="https://vimeo.com/134597090">Defining auto</a> at CSS Day 2015). For example, in block level elements an <code>auto</code> width takes up the full available width, while in inline level elements, it takes up just the space needed for the content. In grid tracks, it behaves similar-ish to inline elements, it will take up the space of the content. One exception is that if there is a grid item inside the track that has a size, that size can make the whole track grow.</p> <h2>Embrace the web’s flexibility</h2> <p>As I said above, I really like content-based sizing, so it bugs me that I don’t see it used a lot in real-world projects. <a href="http://dowebsitesneedtolookexactlythesameineverybrowser.com/">Websites don’t need to look the same in all browsers</a>, right? That theory is convincing, at least in the circles of front-end developers and designers, but clients often expect more sameness across browsers than we’d like. Even within teams, this is common. </p> <p>Going from websites that look the same <em>in all browsers</em>, what about looking the same <em>with all content</em>? Content-based sizing units are potentially very useful, but will they make sense on production websites? I see two potential hurdles: it could still be hard to <strong>incorporate them in our design processes</strong>, and they could create purposeful inconsistencies that <strong>some may see as mistakes</strong>.</p> <h3>Design process</h3> <p>One of the hardest problems in designing for the web is that the designer has to deal with <em>unknowns</em>. Websites have CMSes, so content can change. It’s likely unknown. Users come with all sorts of devices and screens, so canvas size is mostly unknown, too. </p> <p>CSS does a fantastic job at giving us tools to solve that exact problem. If you want a certain amount of characters in a column, you don’t need to know what the characters are in order to get what you want. Just write what the rule is, and the browser worries about how to apply it to actual content. But even if this is solved in CSS, that doesn’t mean it is solved in the tools we design websites in. I have met with designers who write CSS and design in the browser, but design in software like Sketch is also very common. </p> <p>If we want to use content-based sizing in designs and use design tools that are not the browser, whoever writes the CSS should demonstrate what the web can do. The CSS person can show how flexibly built websites can work better in different languages, on different devices and for different people. Designers and developers can team up, make demos. Browsers can help too, they are improving design tools to expose what’s happening. Tools like the <a href="https://hacks.mozilla.org/2019/01/designing-the-flexbox-inspector/">new flexbox inspector in Firefox Dev Tools</a> can bring design and code closer together.</p> <h3>Is intentional inconsistency ok?</h3> <p>What does it mean if subsequent pages end up having slightly (or wildly) different grids? This may create a confusing or “broken” user experience. I think inconsistencies can be very powerful, because they lead to an ideal space distribution. The track that needs most space, gets most space (in an <code>auto</code> scenario). This is ideal for content, but does it yield the ideal for visual design and user experience? I don’t know, maybe?</p> <p>Content-based sizing could be most effective in components that exist once on a page, so that there are no inconsistencies. Or in pages that are quite unique, like temporary landing pages and one off sites for conferences, exhibitions and the like.</p> <h2>Wrapping up</h2> <p>With the <code>min-content</code>, <code>max-content</code> and <code>auto</code> keywords, we can size grid tracks based on their content. I think this is very cool. If we manage to embrace as much of the web’s flexibility as we can, we can get the most out of these tools, and let CSS help us with designing for the unknown.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/content-based-grid-tracks-and-embracing-flexibility/">Content-based grid tracks and embracing flexibility</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Content-based grid tracks and embracing flexibility">Reply via email</a></p> Component frameworks and web standards 2019-02-28T00:00:00Z https://hidde.blog/component-frameworks-and-web-standards/ <p>At last year’s Fronteers Conference, I had numerous conversations about the merits of using client-side frameworks for virtual DOMs, declarative templating and routing, versus a classic, vanilla approach to building websites. I had always been a vanilla-fan, but built a recent project in a framework, liked that too, and, well… I think they aren’t the polar opposites that they used to be in my head!</p> <p>This post has three parts: in the first, I look at what I like about “the web standards stance” or a “vanilla approach”. In the second, I share what I liked when I used a JavaScript component framework. In the last part, I look at whether these two approaches are actually different: maybe I assumed a false dichotomy?</p> <h2>The web standards stance</h2> <p>As I see it, Fronteers Conference has traditionally been very web standards focused. We had no talks about Sass until years after it came about. We did hear about new CSS specs years before they were in browsers. Standards over abstractions. Progressive enhancement and accessibility have been recurring themes from the very first event. I’m not saying any of these things are superior over others, just that learning about them influenced me and many other regulars in our thinking about the web. </p> <p>Personally, I have until recently managed to avoid JavaScript frameworks in projects. Did I miss out? Maybe. I did my front-end work in teams with a rather traditional stack. Often, they used Node to turn abstractions of HTML, CSS and JavaScript into browser-ready code. But the browser would not be sent much JavaScript and there would be no virtual DOMs.</p> <p>It’s <strong>applying what’s in web standards directly</strong>, without a framework that wraps them. I’ll call this the ‘vanilla’ approach. It is basically a very minimal one, with <strong>no or few dependencies</strong>. Hand-written solutions for just the problems at hand. Some call it ‘not invented here syndrome’, which has a negative connotation, but there are also downsides to whatever the opposite of ‘not invented here’ is (<a href="https://jakearchibald.com/2018/when-packages-go-bad/">packages can go bad</a>, and what about <a href="https://blog.shunliang.io/frontend/2018/12/25/the-ant-design-xmas-egg-that-went-wrong.html">christmas effects in production</a>?). </p> <p>I believe going vanilla is a totally valid approach to making sites. Large companies do it. Like GitHub, they even <a href="https://github.com/search?q=topic%3Aweb-components+org%3Agithub">open sourced their components</a>, but also <a href="https://gomakethings.com/companies-that-use-vanilla-js/">Netflix, Marks and Spencers and others</a>. Going vanilla is controversial, too, I found. When Sara Soueidan <a href="https://twitter.com/sarasoueidan/status/1098960689455075330?s=21">tweeted</a>:</p> <blockquote> <p>It’s really depressing that most useful tools these day are made for React projects and/or require React knowlegde to set up and use. This locks out many of us who are not using React for everything & who still prefer the vanilla route for their projects.</p> </blockquote> <p>she got various people tell her she should learn React, some very unfriendly. But vanilla is a fine choice too, and more cross compatible, as her point proves: a vanilla component or library could work across multiple ecosystems or outside any ecosystem. A vanilla approach assumes the web itself as its ecosystem or platform.</p> <p>It’s not just easier cross compatibility though. I have seen in real world projects, including some for very large organisations, that these traditional, vanilla stacks let us have fast, accessible and maintainable sites. By default. </p> <ul> <li>Fast, because (JavaScript) code you don’t ship to the user, is code they don’t have to download and their browsers don’t have to parse. See also <a href="https://www.youtube.com/watch?v=RwSlubTBnew">the performance.now() keynote of Steve Souders</a>, “grandfather of web performance”, and Alex Russel’s piece on ‘ambush by JS’: <a href="https://infrequently.org/2017/10/can-you-afford-it-real-world-web-performance-budgets/">Can you afford it?</a></li> <li>Accessible, because the web is accessible by default. Because web standards are standards, they have the biggest chance of being the thing that makers of assistive technologies adopt to base their tech on. Using a <code>select</code> rather than a library that customises one and makes it inaccessible in the process (happens), increases the chance of the component to work for more people</li> <li>Maintainable, or I should say, maintainable for potentially a longer time, because if you depend on less things, there is less chance your project stops working because of a third factor. </li> </ul> <p>I’m not saying you can’t have these things if you use frameworks. As I said, from real world projects, I learned that traditional, minimal dependency stacks have these benefits. I should note here, you can also get these benefits if you use a framework: giving users more speed and accessibility <a href="https://twitter.com/dan_abramov/status/1089627579664007168">is also the goal of some frameworks</a>, and there are lots of people in the framework world that are very effective at improving such aspects through framework code. </p> <p>(Yup, I find accessibility and speed, i.e. aspects that users experience, the most important criteria for judging my tools)</p> <p>Having said all this, I tried a framework and I loved it! Probably not a surprise, as almost the whole world seems hooked to frameworks.</p> <h2>I tried a framework</h2> <p>In the last few months I built my very first framework-based front-end, in Vue.js. I complemented it with a router, a store and a GraphQL library, in order to have, respectively, multiple (virtual) pages, globally shared data and a smart way to load new data in my templates. </p> <p>Those of you who work with front-end frameworks will likely nod along to the above description. Others may feel confuses and/or start laughing. Multiple pages, global scope and loading data can be done in web-default stacks with vanilla code. In way fewer lines. Multiple pages by literally creating pages and links between them, global scope by putting stuff in the window object (scoped to your app if you like), loading data with plain old XHR or <code>fetch()</code>. Why let users download lots of kilobytes of framework code, if the web already has the functionality?</p> <p>Well, let’s start with things I learned to love. If you have worked with front-end frameworks, you probably want to skip ahead.</p> <h3>Routers</h3> <p>Routers are pretty useful abstractions of which types of pages exists and what data they can have. It took me a lot of uneasy feelings to replace the plain old <code>&lt;a&gt;</code>’s in my site with instances of Vue Router’s <code>&lt;router-link&gt;</code> component.</p> <p>For those unfamiliar with what this means: in an <code>&lt;a&gt;</code> you use the <code>href</code> attribute to say where the link goes. A <code>&lt;router-link&gt;</code> points to a predefined named <code>route</code>, and accepts in its <code>to</code> attribute objects for settings that you invent, as well as query parameters.</p> <p>So if you’d write an <code>&lt;a&gt;</code> to go to a page with parameters:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>/search?query=css&amp;category=tutorials<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> CSS <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span></code></pre> <p>you can instead define it as a <code>&lt;router-link&gt;</code> , a special component that comes with the Vue Router library:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>router-link</span> <span class="token attr-name">:to</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>{ name: 'SearchResult', query: { query: 'css', category: 'tutorials' } }<span class="token punctuation">"</span></span><span class="token punctuation">/></span></span>CSS<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>router-link</span><span class="token punctuation">></span></span></code></pre> <p>(note this is a difference in the template only, the DOM and accessibility trees will only ever see something like the first)</p> <p>Either is pretty readable. The router link is more abstract, if you don’t construct the URL yourself, you may make less mistakes and it may be easier for others what’s happening. This is not a client-side framework advantage, of course, you can find similar concepts on the server side, like in <a href="http://flask.pocoo.org/docs/0.12/api/#flask.Flask.route">Flask routing</a>. Routing is as old as the web itself.</p> <p>The major advantage isn’t readability, it is that the client-side router ties in with <em>the state your website is in</em>. Because it has a fuller picture, it can make useful decisions like to only reload parts of the page. If you link to the same type of page, it may just update the difference in content. This does come with some focus and scroll management challenges, but that’s for another post.</p> <h3>Real components</h3> <p>Ask five people on a web team what a component is, and you may end up with wildly different definitions. Even in our world where most web teams made <em>components</em> central to their way of working, <strong>we struggle to mean the same by the word</strong>.</p> <p>As a front-end developer, I’ve long thought of components as a blob of markup, with optional corresponding style and/or script, all living in the same folder. They would have a shared classname on the root element, which would be unique to instances of that component. Just by being in the same folder, they’d be a component for anyone working with the code. They exist because the team agrees not to clash names.</p> <p>In declarative JS frameworks like Vue and React, components are defined <em>as components</em>. You define each component in the syntax the framework provides. This is arguably more rigid and meaningful than the ‘being in a same folder’ form of defining components I described above. In the case of Vue’s ‘single file components’, the JS knows of a component its name and possible properties (and their types). For associated scripts, it knows the component’s methods, life cycle hooks (a fancy word for: scripts to execute before or after component markup exists in DOM) and event handlers. For styling, it also knows the component’s associated CSS. </p> <h3>Reactivity</h3> <p>All template languages offer some form of variables:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h1</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h1</span><span class="token punctuation">></span></span></code></pre> <p>The text inside the <code>h1</code> becomes whatever <code>header</code> resolves to. When there is <em>reactivity</em>, variables aren’t resolved once, but will update when they need to. For example, if a component is <code>expanded</code>, the value of <code>expanded</code> can update from <code>true</code> to <code>false</code>, at a programmatically determined time. Following whatever logic your component has for expanding. In online banking, the value for <code>totalBalance</code> could be reactive and change on some event that is triggered by money coming into the bank account. The credit card logo URL could be reactive and change from <code>mastercard.svg</code> to <code>visa.svg</code> based on what credit card number is being typed in. That sort of thing.</p> <h3>Easy to get started</h3> <p>Both Vue and React have a command line tool that creates a project, with lots of stuff built in (<code>create-react-app</code> and <code>create-vue-app</code>). This scared me at first, as I was afraid it would by default put stuff into bundles I would send to my users. It turns out a lot of what <code>create-*-app</code> setups offer is build and testing tools. My least favourite part of making websites is configuring tooling, a ‘just works’ default is good enough for my needs.</p> <p>Also, wow, there is some very good documentation for these frameworks, that explain just enough to get started, but also let you dive much deeper if you want or need to. It’s all very welcoming and nice.</p> <p>Thankfully, I also had great colleagues at work and peers at Fronteers Slack that I could direct questions to, have code reviewed by, et cetera. If you want to get started with a framework, I do recommend joining a Slack group for the framework or your area.</p> <h2>What I liked less</h2> <h3>Backwards compatibility</h3> <p>Web standards are extremely backwards compatible. Very rarely do HTML tags get deprecated (hi <code>&lt;blink&gt;</code> !), almost never do DOM methods or ECMAScript features get taken out. This makes sites built with vanilla code future proof. You will likely have to do security updates to old sites, but it is unlikely you’ll have to write your HTML, because someone decided <code>fieldset</code>s are no longer supported.</p> <p>If you’re using a framework, the features you rely on are more likely to disappear. When Vue just came out, one would loop through an object like this:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>ul</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>tags<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span> <span class="token attr-name">v-repeat</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>tags<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>ul</span><span class="token punctuation">></span></span></code></pre> <p>(example <a href="https://011.vuejs.org/guide/list.html">from Vue 0.11</a>)</p> <p>Then <code>v-for</code> was introduced. My point is, <strong>this sometimes happens</strong>. Frameworks come up with better paradigms (see also Hooks and Suspense in React). When your site wants to update to a new version, your team needs to rewrite and know what to rewrite. All of Twitter is like “I’ve rewritten this project X to use Hooks”, but this is not trivial, even less so if it is the complicated codebase of your large corporate client. </p> <p>There are lots of organisations out there using Angular 1 in projects, and I see them struggle to find developers willing to do the work. They’ve since moved on to newer frameworks. The orgs are stuck with outdated paradigms that are incompatible with the now. For freelance front-end developers in The Netherlands, recruitment calls for a certain bank that went all-in on Angular may sound familiar?</p> <p>I feel this is a real difference between ‘just’ using web standards and buying into a framework. There is also legacy vanilla code, of course. But if that is, as I described in the introduction, very minimal, few dependency code, maintaining it is consequently less involved.</p> <h3>Different origins</h3> <p>I love the origin story of the web, and the idea that it was further developed at an <a href="https://www.w3.org/">independent consortium</a> and groups like <a href="https://whatwg.org/">WHATWG</a>. The origins of the big component frameworks are big corporations like Google (Angular) and Facebook (React). Corporations that are more <em>for profit</em> than <em>for humans</em>. Even-though the projects themselves are open source and have volunteer communities full of great humans.</p> <h2>A false dichotomy?</h2> <p>As I described above, there are lots of things to like about using modern JavaScript frameworks to build websites, and a couple of things to moan about. But let’s look now at how that approach differs from ‘just’ using web standards and vanilla code. Let’s look at how it differs from the approach of which I said it gives us good things like accessibility and performance by default. If there is a difference, because maybe frameworks versus web standards is a false dichotomy?</p> <h3>De-facto standards</h3> <p>Various frameworks from the past have inspired web standards. jQuery’s selector engine <a href="https://github.com/jquery/sizzle">Sizzle</a> inspired <code>querySelector</code>/<code>querySelectorAll</code>. The modern component frameworks seem to diverge towards standard ways of working, both in syntax patterns and in broader concepts, like routing and reactivity. They are not in specs, but they could inspire new web standards. As far as I’m aware, nobody is standardising concepts like reactivity, but there for example this proposal for <a href="https://github.com/w3c/ServiceWorker/issues/1373">declarative routing in Service Workers</a>, and among the new proposals in ECMAScript there are many ideas inspired by how people write framework code, like <a href="https://github.com/tc39/proposal-optional-chaining">optional chaining</a>. Still, <a href="https://twitter.com/slightlylate/status/1100955863622152192">epic standard battles to make features happen are epic</a>.</p> <h3>Framework-browser collaboration</h3> <p>Framework engineers and browser makers collaborate, <a href="https://twitter.com/acdlite/status/1089273195281080335">said React engineer Andrew Clark</a>: </p> <blockquote> <p>Our team has a regular weekly meeting with Chrome engineers. Sometimes we meet more than once! We’re collaborating on display locking, main thread scheduling, resource prioritization, and more. Great relationship, much credit to @stubbornella and @shubhie</p> </blockquote> <p><a href="https://twitter.com/stubbornella/status/1089274636569763840">Chrome PM Nicole Sullivan confirmed</a> this:</p> <blockquote> <p>My favorite part of my job is collaboration with frameworks. The web platform engineers are beyond excited about the tight feedback loops we’ve developed and are developing. We even added getting framework feedback to our intent to implement process.</p> </blockquote> <p>I don’t really know of such a direct collaboration between framework authors and the Firefox browser. Or other browsers. Such collaborations are quite different from web standards efforts, but I guess they can lead to improved performance and accessibility for large amounts of users. Less “open” improvements, but improvements.</p> <h3>Lots of vanilla code in frameworks components</h3> <p>If I’m comparing vanilla to frameworks, I should also say that within the framework wrapper, I’ve always ended up using vanilla knowledge. Not only is it still important to know which HTML elements there are and what they mean, because framework-based sites yield accessibility trees just like regular sites do. It’s essential to have a deep understanding of all things JavaScript (for instance, everything on <a href="https://learnvanillajs.com/roadmap/">Chris Fernandi’s JS roadmap</a>, because the component frameworks offer just that: a framework to get started. Within that, it’s your choice if you want to solve your problems with your own custom solutions, or use libraries, plug-ins, etc Or, of course, and this is common, do either when it makes sense. </p> <h3>Progressive enhancement</h3> <p>Progressive enhancement and client-side frameworks do seem to be hard to marry, because by default they do their work in the browser. There are plenty of ways to make servers do the initial render, but if we are honest this is not trivial. Regardless of where we render, we can and likely should apply a progressive enhancement way of thinking to a framework-based project. To stretch what progressive enhancement means very far: make no assumptions. Not about your user’s devices, not about their permissions, not about their content blockers, not about any other of their choices.</p> <p>For example: </p> <ul> <li>if you ultimately want to plot on a map the cars nearest to a user’s location, you could display a list of car locations initially. When users have location abilities, their browser’s support exposing those through the location API and they have granted your site permissions, then try and do the plotting.</li> <li>in a project I worked on, we generated <a href="https://en.wikipedia.org/wiki/Identicon">identicons</a> on the client. The process involved the Web Crypto API, to convert strings into hashed strings. In browsers that don’t support Web Crypto, we fell back to a hardcoded hashed string. Browsers that got the full thing showed avatars based on people’s username, so they were unique for each user, browsers all showed non-unique avatars based on the string ‘user’.</li> <li>you want to lay out a component of your site using CSS Grid Layout. To the 10-20% of browsers that don’t support this spec, you serve a simple fallback, so that all the content is usable, readable and looks not broken. </li> </ul> <h2>Conclusion</h2> <p>I love vanilla code, and things that are invented here. Thoughtful developers that solve a problem at hand. I’ve sometimes felt worried that working with front-end frameworks like React or Vue would be at odds with that mental model. I feel I was probably wrong there, there is a lot of grey between vanilla and frameworks, and people do all sorts of cool things on either side to get to solutions that are <em>accessible</em> and <em>performant</em>. This is great. I am glad I tried a framework and found its features were extremely helpful in creating a consistent interface for my users. My hope is though, that I won’t forget about vanilla. It’s perfectly valid to build a website with no or few dependencies.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/component-frameworks-and-web-standards/">Component frameworks and web standards</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Component frameworks and web standards">Reply via email</a></p> Book review: The age of surveillance capitalism 2019-03-06T00:00:00Z https://hidde.blog/book-review-the-age-of-surveillance-capitalism/ <p>This week I read <a href="http://www.shoshanazuboff.com/new/the-age-of-surveillance-capitalism-comments-and-reviews/">The age of surveillance capitalism</a> by Shoshana Zuboff, an enlightening book about how big tech companies are watching what we do, and what their end game might be. I thought I had heard all of this, but, of course, I couldn’t be more wrong. </p> <h2>Beyond “You are the product”</h2> <p>You’ve likely heard people say ‘if a product is free to use, you are not the customer, you <em>are the product</em>’. It’s a bit of a cliché now, that Zuboff completely reframes in <em>The Age of Surveillance Capitalism</em>. We aren’t exactly the product… we, or the data that describes our behaviour, to be more precise, are the raw material of a whole new iteration of capitalism.</p> <p><img src="https://hidde.blog/_images/the-book-photographed-on-a-table.jpg" alt="The book photographed on a table" /> <em>The book is huge, but only just over 500 pages, the rest is footnotes</em> </p> <p>The Age of Surveillance Capitalism explains this new iteration in the context of early capitalism (Ford’s, and even the age of gilds). Zuboff explains how the founders of Google, and later Facebook and others too, set the scene: how they found use for data that previously looked useless, their secrecy about exposing the size of their data collection and their lobby against rules. Yup, they prefer to make their own rules. And will insist that their way is the only way, which the world just needs to accept: Zuboff coins this ‘inevitabilism’. </p> <p>This attitude of setting their own scene is a recurring theme throughout the book. For instance, when Facebook does behavioral research, they don’t follow “The Common Rule“, Zuboff explains, that academic experimenters apply to themselves to avoid power abuse. This abuse in a corporate setting could be much worse than that in an academic one, as there is more conflict of interest in play (in the corporate setting there is a need to earn profits for shareholders).</p> <h2>A new iteration of capitalism</h2> <p>So what’s this new iteration of capitalism? Zuboff explains that in this new paradigm, data is the <em>raw source</em> or ‘commodity’, extraction of it the <em>production process</em> (a supply route that the big tech companies work hard to protect) and predicting people’s behaviour is <em>the product</em>. </p> <p>The production process (‘extracting’ data from people) has expanded massively over the past years, as tech corporations found new ways to get behavioural data (‘behavioural surplus’, as Zuboff calls it). They offer more and more services, sometimes increasing their speed by purchasing other companies (Facebook bought WhatsApp and Oculus, Google bought YouTube). And it isn’t just online either. Tech companies discovered there is lots of data to be gathered in the real world, through physical things with internet connections. Google Maps cars that ‘accidentally’ take WiFi hotspot data. Hotel rooms that come with Alexa built-in. And sometimes they give rewards in exchange, like an insurance company that offers a lower rate in return for replacing a monitoring device in your car.</p> <p>There is this notion in the book that we accept too much without foreseeing the full picture. At some point Zuboff describes the nature of contracts online: legally they likely cover all they need to do, but might it be unreasonable to assume that anyone ever reads them? What if they refer to other contracts? The large scale data extraction operetion, that Zuboff later calls Big Other, may be a case of the <em>horseless car syndrome</em>, she suggests. When the first car was invented, we were used to horses and carriages, and thus that was how we tried to name and understand this new phenomenon: as a horseless carriage. </p> <h2>The dystopia of a data-driven society</h2> <p>The latest big thing isn’t just studying behavior, it is influencing behavior, too. Experimenters at Facebook found they could hugely influence people in whether they would go vote or not by using techniques from behavioral psychology. With these techniques, humans become merely tools. Zuboff introduces the notion of instrumentarialism, which she compares do and notes is quite different from totalitarianism. They both overwhelm society and do some sort of social domination, but for different reasons, the market vs the political realm.</p> <p>Zuboff shows how the world in which surveillance capitalism plays the role it plays in ours, is somewhat dystopian. She compares it to Orwell’s and Skinner’s. One of the aspects that makes it dismal is that <em>humanity</em> gets reduced away. The tech leaders are utopians and believe in a “data-driven society”, Zuboff says. They insist that that is ’practical and feasible but also a moral imperative in which the benefits to the collective outweigh all other considerations’ (438). People like Pentland don’t believe in individuals with opinions and attitudes to live… if we see others do something, we’ll copy, we are easily conditioned.</p> <h2>Is this a conspiracy theory?</h2> <p>I have to ask, as last week a group of Dutch actors accused of hyperbolic complot theories held up the book in a talkshow as their bible. It contains some strong claims and assumptions about people’s intentions, but overall Zuboff’s book is very thorough. Her claims and statements are consistently supported by extensive footnotes.</p> <p>A lot of the practices she asks questions about, actually happen. Tech leaders don’t deny them, and sometimes even boast about them, Zuboff shows. This is in the realm of private companies. What if the instruments of these private companies get used by authoritarian governments? Zuboff talks about how private companies helped American intelligence agencies with all sorts of technology. China’s Sesame Credit systems rates people’s character and gives or denies them perks, including things like purchasing rail tickets and using dating apps. The numbers are staggering. Again, these are not conspiracies, they actually happen.</p> <p>It is also important that this argument isn’t against capitalism, it is against systems that break basic principles of democracy and human autonomy. </p> <h2>Conclusion</h2> <p><em>The age of surveillance capitalism</em> is a great read, be sure to get a copy if you want to understand what <em>surveillance capitalism</em> is and could become. It does a great job at demonstrating what she presumes are the dynamics behind the internet economy. It’s convincing, and thought-provoking. It has gotten me worries, but also strangely positive about which world I want to fight for. It’s not an easy or quick read, as it is an academic book and sentences tend to get long and detailed. Alternatively, you can hear <a href="https://youtu.be/2s4Y-uZG5zk?t=670">Shoshana Zuboff talk about surveillance capitalism at The Intercept</a> or <a href="https://irlpodcast.org/season4/episode5/">her interview with Mozilla’s IRL podcast</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/book-review-the-age-of-surveillance-capitalism/">Book review: The age of surveillance capitalism</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Book review: The age of surveillance capitalism">Reply via email</a></p> Content and colour at #idea11y in Rotterdam 2019-03-22T00:00:00Z https://hidde.blog/content-and-colour-at-idea11y-in-rotterdam/ <p>Last night I joined the ‘inclusive design and accessibility’ meetup (<em>idea11y</em>) at Level Level in Rotterdam, to learn more about optimising content and colors.</p> <p>When I talk about accessibility, I often approach the subject from a front-end code perspective, and I make a point of disclaimering: this is only <em>one of the many aspects to ensure the accessibility of a website</em>. Content and colours are two other very important aspects that are essential to get right, so it was great to hear <a href="https://twitter.com/iamhiwelo">Damien Senger</a> and <a href="https://twitter.com/erikkroes">Erik Kroes</a> talk us through those subjects.</p> <h2>Content</h2> <p><strong>Damien Senger</strong>, designer and accessibility advocate at Castor EDC, talked about cognitive impairments: ‘they are interesting, because they are often invisible’ (<a href="https://noti.st/hiwelo/0Jj6nm/readability-accessibility-by-design">Damien’s slides</a>). This is a great point, it also implies that these aspects are harder to catch in automated tests. Lighthouse can’t warn about them like it can about ill-formatted ARIA. Cognitive impairments we can optimise for include dyslexia, autistic spectrum disorder and ADHD. Users with such impairments benefit from less content, better organised content and more readable text. </p> <p>Damien explained we read not by word but by ‘saccade’, jumping between parts. He also showed how shapes are important, and lack thereof bad for readibility, for instance all caps or justified text. These four C’s help, Damien said: <em>continuity</em> (repeat same information for reassurance), <em>conspicuity</em> (make it obvious), <em>consistency</em> (use same wording for same things) and <em>clarity</em> (ensure copy is understable).</p> <p>Damien gave lots of tips for designing, on four levels:</p> <ul> <li>micro typography: too much contrast can make letters dance for dyslexics, so dark grey is preferred to black; breaking highlighting is bad at people use that to see where they are</li> <li>macro typography: think about heading hierarchy and group related things</li> <li>layout: ensure consistency of layout and always offer multiple ways to find content</li> <li>global: avoid distracting users with things like autoplaying videos; reduce content</li> </ul> <h2>Colour</h2> <p><strong>Erik Kroes</strong>, accessibility specialist at ING, talked about colour, specifically what colour contrast means and how to create a for-screen colour palette for your brand that can be used with black and white accessibly. </p> <p>Most people will know that colour contrast is important and use tools like Lea Verou’s awesome <a href="https://contrast-ratio.com/">Contrast Ratio</a>. For AA-level conformance, WCAG 2.1 <a href="https://www.w3.org/TR/WCAG/#contrast-minimum">prescribes contrast ratios of 3:1 (large text) and 4.5:1 (all text)</a>. These tools simply tell us whether our colours are within the range. Erik wanted to know more than just the numbers and had great feature requests (‘why do none of these tools show contrast with black and white at the same time?’).</p> <p>Most of the talk was about creating colour schemes that lead to sufficient contrast ratios. Erik showed how HSL doesn’t really help when working out a contrastful scheme… to really get into finding colours with enough contrast, we need to look at <a href="https://en.m.wikipedia.org/wiki/Rec._709">ITU-R Recommendation BT.709</a>, a standard from the 90s that describes colors for television screens that takes the human eye’s workings into account (‘useful luminence’, Erik called it). I had no idea, that this is what WCAG colour contrasts ultimately are based on. The reason this 30 year old standard is still somewhat suitable, is that screens still use sRGB and human eyes are still the same. </p> <p>Erik explained that in WCAG 2.1, ratios range between 1:1 (zero contrast) and 21:1 (black on white). What I never realised, and am still unsure if I fully get how, is that when a colour has a ratio of 3:1 on a white background, it has a 7:1 ratio on a black background, because <a href="https://twitter.com/petervangrieken/status/1108818335184179200">21 divided by 7 equals 3</a>. The maximum of 21 makes that the set of accessible colour combinations is limited. </p> <p>To help with finding colour schemes that work well with black and white texts, Erik recommended the <a href="http://contrast-grid.eightshapes.com/">Contrast Grid</a> tool. He also works on <a href="https://github.com/erikkroes/color-tool">his own tool</a> to meet his contrastful color needs, this looks very exciting (and is Web Components based).</p> <p><img src="https://hidde.blog/_images/screenshot-of-eriks-color-tool-with-at-the-top-four-swatches-and-slides-that-allow-selecting-rgb-and-hsl-colors.png" alt="Screenshot of Eriks color tool with at the top four swatches and slides that allow selecting rgb and hsl colors" /> <em>Erik’s tool</em></p> <h2>Wrapping up</h2> <p>This was a great evening, thanks to <a href="https://twitter.com/detonite">Job</a>. Rumour has it that there will be another one next month, so I am looking forward to that!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/content-and-colour-at-idea11y-in-rotterdam/">Content and colour at #idea11y in Rotterdam</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Content and colour at #idea11y in Rotterdam">Reply via email</a></p> Naming things to improve accessibility 2019-04-18T00:00:00Z https://hidde.blog/naming-things-to-improve-accessibility/ <p>One thing you can do to improve the accessibility of your work is to always ensure <strong>things have accessible names</strong>. Unique and useful names, ideally, so that they can be used for navigation. In this post I’ll explain how browsers decide on the names for links, form fields, tables and form groups.</p> <p><em>This post is based on part of my talk <a href="https://talks.hiddedevries.nl/lMxtx5/six-ways-to-make-your-site-more-accessible">6 ways to make your site more accessible</a>, that I gave at WordCamp Rotterdam last week.</em></p> <h2>Accessibility Tree</h2> <p>When a user accesses your site, the server will send markup to the browser. This gets turned into trees. We’re probably all familiar with the DOM tree, a live representation of your markup, with all nodes turned into objects that we can read properties of and perform all sorts of functions on. </p> <p>What many people don’t know, is that there is a second structure that the browser can generate: the accessibility tree. It is based off the DOM tree, and contains all meta information relation related to accessibility: roles, names and properties. Another way to say it: the accessibility tree is how your page gets exposed to assistive technologies. </p> <h3>Assistive Technology</h3> <p>Assistive Technology (AT) is an umbrella term for all sorts of tools that people use to improve how they access things. For computers and the web, they include:</p> <ul> <li>alternate pointing devices, like a mouse that attaches to a user’s head</li> <li>screen magnifiers, they enlarge the screen</li> <li>braille bars, they turn what’s on the screen into braille</li> <li>screenreaders, they read out what’s on the screen to the user</li> </ul> <img src="https://hidde.blog/_images/alternate-pointing-devices-braille-bars-screen-magnifiers-and-screenreaders.jpg" alt="Alternate pointing devices, braille bars, screen magnifiers and screenreaders" /> <p>All of these tools, to work efficiently, need to know what’s happening on the screen. To find out, they access Platform APIs, built into every major platform, including Windows, Mac and Linux. The APIs can expose everything in the OS, so they know about things like the Start Bar, Dock or the browser’s back button. One thing they don’t know about, is the websites you access. They can’t possibly have the semantic structure of every website built into their APIs, so they rely on an intermediary — this is where the Accessibility Tree comes in. It exposes your website’s structure. As I said, it is based on the DOM, which is based on our mark-up.</p> <p><img src="https://hidde.blog/_images/your-markup-becomes-a-dom-tree-which-the-accessibility-is-based-on-which-is-then-sent-to-platform-apis-and-ultimately-ends-up-at-assistive-technologies.jpg" alt="Your markup becomes a DOM tree which the accessibility is based on which is then sent to platform APIs and ultimately ends up at assistive technologies" /> <em>A handy flow chart</em> </p> <p>The accessibility tree exposes roles (is this a header, a footer, a button, a navigation?), names (I’ll get into those in a bit), properties (is the hamburger menu open or closed, is the checkbox checked or not, et cetera) and a number of other things.</p> <p>If you want to see what this looks like on a site of your choosing, have a look at the <a href="https://developer.mozilla.org/en-US/docs/Tools/Accessibility_inspector">Accessibility Panel</a> in Firefox Developer Tools, or check out the accessibility info boxes in Chrome, Safari Tech Preview or Edge developer tools.</p> <h3>Accesssible name computation</h3> <p>Names are one of the things the accessibility tree exposes for its objects. What a thing’s name is, gets derived from markup. There are many aspects that can influence this. If you want to know this in detail, check out the <a href="https://www.w3.org/TR/accname-1.1/">Accessible Name and Description Computation Specification</a>.</p> <h2>Unique names help distinguish</h2> <p>Before going more into how to expose names, let’s look at which names we want. What the names are is crucial for whether they are accessible or not. </p> <p>What if your family has four cats, and each of them is named ”Alice”? This would be incredibly impractical, as it would make communication difficult. “Has Alice been fed yet?”, you might wonder. “Is Alice outside?”, you might ask your partner. Ambiguity is impractical. Yet, this is what we do when our homepage has four news items, with each “Read more” as its link text. </p> <p><img src="https://hidde.blog/_images/four-very-cute-cats.jpg" alt="Four very cute cats" /> <em>Imagine all of your cats were named Alice (photo: <a href="https://www.flickr.com/photos/stratman2/38071877924/in/photolist-TjUbqm-bCqjgF-26hd9k-Hvi5Bs-2drvqnV-ejciXf-qjDedZ-26hebk-pnrkw9-211hjUm-hZNytZ-4nbnuB-opMVzy-othkih-poX3E8-22HqHia-p8tHw3-dQ3x9k-26UQoWu-9XQAyj-2aherRX-9YYrSe-8pXr3Z-q6CjdK-i76VB">stratman2 on Flickr</a>)</em></p> <p>This is very common, sadly. In the <a href="https://webaim.org/projects/million/">WebAIM Million</a> project, in which WebAIM looked at over a million sites and ran automated accessibility checks, they found:</p> <blockquote> <p>24.4% of pages had links with ambiguous link text, such as ‘click here’, ‘more’, ‘continue’, etc.</p> </blockquote> <p>Reusing “Read more” as the link text for each news item makes our code and content management simpler, but it provides bad usability for screenreader users. When they use the link shortcut to browse through links on the page, they will have no idea where each links leads them. In the example above, when you ask an AT to read out all links, it will read “Link Read more, Link Read more, Link Read more, Link Read more”.</p> <h2>Naming things</h2> <p>So, unique and descriptive names are useful to AT users. Let’s look at which HTML can help us provide names. As I said before, the heuristics for determining names are in <a href="https://www.w3.org/TR/accname-1.1/">a spec</a>, but with just HTML providing names for most things is trivial. The following section is mostly useful for people whose HTML is rusty.</p> <h3>Links</h3> <p>The contents of an <code>&lt;a&gt;</code> element will usually become the accessible name.</p> <p>So in:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>/win-a-prize<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> Win a prize<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span></code></pre> <p>the accessible name would compute as “Win a prize”. </p> <p>If there’s just an image, its alt text can also get used: </p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>/win-a-prize<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>img</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>prize.png<span class="token punctuation">"</span></span> <span class="token attr-name">alt</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Win a prize<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span></code></pre> <p>And, to be clear, if there’s nothing provided, the name would be <code>null</code> or empty string, so some people would be unable to win any prize. </p> <h3>Form fields</h3> <p>Form fields get labelled using the <code>&lt;label&gt;</code> element. In their aforementioned research, WebAIM also found:</p> <blockquote> <p>59% of form inputs were not properly labeled. </p> </blockquote> <p>Let’s look at what a labelling mistake could look like:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">></span></span>Email<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span> <span class="token comment">&lt;!-- don't do this--></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>email<span class="token punctuation">"</span></span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>email<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span></code></pre> <p>In this example, the word “Email” appears right before the input, so a portion of your users might be able to visually associate that they belong together. But they aren’t <em>associated</em>, so the input has no name— it will compute as <code>null</code> or <code>''</code> in the accessibility tree.</p> <p>Associating can be done by wrapping the input in a <code>&lt;label&gt;</code> element, or by using a <code>for</code> attribute that matches the input’s <code>id</code> attribute:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>label</span> <span class="token attr-name">for</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>email<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Email<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>label</span><span class="token punctuation">></span></span> <span class="token comment">&lt;!-- do this--></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>email<span class="token punctuation">"</span></span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>email<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span></code></pre> <h3>Tables</h3> <p>To give a table a name, you can use its <code>&lt;caption&gt;</code> element. This is used as the first element in a <code>&lt;table&gt;</code>.</p> <h3>Groups in a form</h3> <p>Within forms, you sometimes want to group a set of form inputs, for example a collection of radiobuttons or checkboxes that answer the same question. HTML has <code>&lt;fieldset&gt;</code> for grouping form elements. To name this group as a whole, use the <code>&lt;legend&gt;</code> element:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>fieldset</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>legend</span><span class="token punctuation">></span></span>Don't you love HTML?<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>legend</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>radio<span class="token punctuation">"</span></span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>yesno<span class="token punctuation">"</span></span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>yes<span class="token punctuation">"</span></span><span class="token punctuation">/></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>label</span> <span class="token attr-name">for</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>yes<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Yes<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>label</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>radio<span class="token punctuation">"</span></span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>yesno<span class="token punctuation">"</span></span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>no<span class="token punctuation">"</span></span><span class="token punctuation">/></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>label</span> <span class="token attr-name">for</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>no<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>No<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>label</span><span class="token punctuation">></span></span></code></pre> <p>If you were to inspect this fieldset in the accessibility tree, you will notice that the group is now known as “Don’t you love HTML?”.</p> <h2>What about ARIA?</h2> <p>Those familiar with the <a href="https://www.w3.org/TR/accname-1.1/">Accessible Name and Description Computation spec</a> might wonder at this point: doesn’t ARIA also let us give elements accessible names? It totally does, for instance through the <code>aria-label</code> / <code>aria-labelledby</code> attributes. When added to an element, they overwrite the accessible name (if there was one). </p> <p>Good reasons to prefer standard HTML tags over ARIA include:</p> <ul> <li>better browser support (a lot of browsers support most ARIA, but all support all HTML, generally speaking)</li> <li>more likely to be understood by current or future team members that don’t have all the ARIA skills</li> <li>less likely to be forgotten about when doing things like internationalisation (in your own code, or by external tools like Google Translate, see Heydon Pickering’s post <a href="http://www.heydonworks.com/article/aria-label-is-a-xenophobe">aria-label is a xenophobe</a>)</li> </ul> <p>Sometimes ARIA <em>can</em> come in handy, for example if an element doesn’t play along well with your CSS (like if you want a Grid Layout in a <code>fieldset</code>), or if your (client’s) CMS is very inflexible.</p> <h2>It’s the markup that matters</h2> <p>In modern browsers, our markup becomes an accessibility tree that ultimately informs what our interface looks like to assistive technologies. It doesn’t matter as much whether you’ve written this markup:</p> <ul> <li>in a <code>.html</code> file</li> <li>in Twig, Handlebars or Nunjucks</li> <li>as the <code>&lt;template&gt;</code> in a Vue Single File Component</li> <li>exported in the JSX of your React component</li> <li>outputted by a weird legacy CMS</li> </ul> <p>It is <em>which</em> markup that determines if your site is pleasurable to experience for AT users. In short: it’s the markup that matters</p> <p>There’s good chance your site already uses all of the above HTML elements that name things. They have existed for many years. But I hope this post explains why it is worth the effort to always ensure the code your site serves to users, includes useful names for assistive technologies. Markup-wise it is trivial to assign names to all things on our site, the real challenge is probably two fold. It’s about <strong>content</strong> (do we come up with useful and distinguishable names), and about <strong>tech</strong> (can we ensure the right markup gets into our user’s DOMs).</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/naming-things-to-improve-accessibility/">Naming things to improve accessibility</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Naming things to improve accessibility">Reply via email</a></p> Baking accessibility into components: how frameworks help 2019-05-24T00:00:00Z https://hidde.blog/baking-accessibility-into-components-how-frameworks-help/ <p>Complex components like date pickers, custom selects and modals can be tricky to get right. They can be tricky to make accessible. They need good internals, like sound semantics, keyboard usability and focus management. All well tested, preferably with a diverse set of real users. Once that is done, once a complex component is built to a high standard, frameworks or Web Components could help make that component very reusable.</p> <p>Well, what’s new, you might think? Isn’t reusability of components the whole point of UI frameworks and Web Components? Yes, probably. But that is often pointed out as an advantage that increases <em>developer convenience</em>. I’ve heard that phrased as ‘if the developer has convenience, the user will, too’. Meanwhile, component framework-powered websites have a somewhat negative connotation among accessibility experts. This post tries to explore how component frameworks help. How they, too, can make the web a much better place for users, especially in terms of accessibility and usability. (Disclaimer: conclusions in this post may be trivial to declarative framework developers)</p> <h2>When I had to build a custom select</h2> <p>The longer a project goes on, the bigger the chance that someone will want a custom select to be built. I usually try and resist, because these are very hard to get right. Native selects have a lot of thought put into them. They work across platforms in a way that matches each platform (see native select behavior on Android, iOS). But sometimes there are good reasons. Really.</p> <p>What I’m talking about, just to be clear, is not just a custom trigger (those are <a href="https://github.com/filamentgroup/select">relatively easy</a>), but also custom options within them. Everything custom!</p> <p>The use case that initially triggered this piece of work, was a Mozilla project that had a component where someone could set <em>field level privacy settings</em>. There was a number of fields, like ‘First Name’ and ‘Last Name’, each with their own privacy setting. It was designed to have just the icon in collapsed state, and icons plus labels in the expanded state. An interface with all options spelled out for each field, would likely cause mental overhead. This is not a setting people set often, but we want it to be there, easy to find, because it is important to have control over your data privacy. With that in mind, it would make sense to show just an icon in the collapsed state.</p> <h2>No ARIA this time</h2> <p><a href="https://www.w3.org/WAI/standards-guidelines/aria/">ARIA</a> is a fantastic initiative that essentially lets developers <em>polyfill</em> semantics. It involves adding attributes to an HTML element, in order to set accessibility-related meta information like the names, descriptions, roles and states of that element. It is specifically aimed at <em>rich internet applications</em>. Something to remember about it is that, while the ARIA suite <em>adds new semantics</em> to use in HTML, it is not a successor to the existing set of HTML elements. Those elements are still there and often very appropriate to use. The first rule of ARIA is <a href="https://www.w3.org/TR/using-aria/#rule1">not to use it</a>.</p> <p>Yep, it’s usually fine and appropriate to use existing semantic HTML elements.</p> <p>The problem with the existing HTML element that is <code>select</code>, is this: browsers provide no way to customise what the options look like. But a select is not so different from a group of radiobuttons, right? Either let users pick one out of many. (I’m leaving the <code>multiple</code> attribute out of this, but let me just say they could map to checkboxes). </p> <p>One big advantage of radiobuttons is that they are easy to customise, because you can visually hide them and then do whatever you like with their associated <code>label</code> element. </p> <p>This is the basic version of a custom option:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>radio<span class="token punctuation">"</span></span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>option-1<span class="token punctuation">"</span></span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>option-set<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>label</span> <span class="token attr-name">for</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>option-1<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Rotterdam<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>label</span><span class="token punctuation">></span></span></code></pre> <p>With this, you can apply a visually hidden technique to the input, use the <code><label< code=""> for styling, and rely on the <code>name</code> to associate multiple options to be one thing. You could wrap the group of options in a <code>fieldset</code> and give that a maximum height. And probably a sensible (max?) width. Also, you’ll want to ensure it opens where there is space (and not outside the viewport). </label<></code></p> <p>Then, if your list of options is all done, there is one piece left: the thing that toggles the options. For this, I would suggest a <code>button</code>:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>button<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> Choose city <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span></code></pre> <p>If you want, you could use some ARIA to convey that this button controls your fieldset. This can be done with <code>aria-controls</code>, with an ID as its value (use the ID of the element you expand):</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>button<span class="token punctuation">"</span></span> <span class="token attr-name">aria-controls</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>custom-select<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> Choose city <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span></code></pre> <p>In <a href="https://tink.uk/using-the-aria-controls-attribute/">Using the aria-controls attribute</a>, Léonie Watson explains that although support is inconsistent, creating a “controls” relationship in the DOM can make a component more robust, while not getting in the way of users:</p> <blockquote> <p>The presence of aria-controls won’t damage the User Experience (UX) for people using UA that don’t support it, but it will enormously improve the UX for those people whose browser/screen reader combinations do.</p> </blockquote> <p>Another thing you can do to the button is set the expanded state, with <code>aria-expanded</code>. This takes a boolean:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>button<span class="token punctuation">"</span></span> <span class="token attr-name">aria-controls</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>custom-select<span class="token punctuation">"</span></span> <span class="token attr-name">aria-expanded</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>false<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> Choose city <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span></code></pre> <p>The <code>aria-expanded</code> needs to reflect the actual expanded state, so when the custom select is open, set it to <code>true</code>, if not, set it to <code>false</code>.</p> <p>So… say, you’ve done all this work, and you start using these custom selects across your website. One risk of reusing through copy/paste is that the code ends up in many places, and only in some of the places, all the markup is used as intended. This could be detrimental to the user experience. Maybe we could actually benefit from an abstraction here.</p> <h2>When component abstractions aid accessibility</h2> <p>If we do the above and make it available as a declarative component, perhaps React, Vue or an actual vanilla Web Component, one benefit is <em>state</em>. As we’ve seen in the above example, there are some things that rely on state, like the setting of <code>aria-expanded</code>. Declarative component frameworks make such settings trivial (once you’re up and speed with using the framework, that is, we’ll get into that later).</p> <p>A second big advantage, is that it becomes <em>one whole</em> at the point of usage. Let’s say it is called <code>custom-select</code>. </p> <p>Whenever we want to use <code>custom-select</code>, we do (pseudo code):</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>custom-select</span> <span class="token attr-name">options</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>options<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span></code></pre> <p>In which <code>options</code> is some JavaScript object of options.</p> <p>We declare it, we say what the options are, and in the DOM, it becomes a custom select with those options. This “becoming a custom select” might worry front-end folks, but it is not some sort of magic. We have described exactly what this means, how it should be done. With which semantics, keyboard behavior, focus styles and usability. These things are very important metrics for quality, they require careful consideration. The advantage of using some sort of component abstraction is that only one person or one team has to do this thinking. Others then ‘just’ use it, without worrying about the internals. </p> <p>In my case, I’ve gone for a button that toggles a fieldset, but if there is a better way, <code>custom-select</code> can become whatever that better way is in the future. We need to come up with excellent internals, even be ready to improve them after a user test or accessibility. But all in all, I find this separation between internals and actual usage helpful.</p> <p>A good example of a similar separation of concerns, from existing HTML, is the <code>&lt;video&gt;</code> element. It has a couple of internals that developers don’t need to worry about at the point of usage. We just need to tell it where our video and subtitles live. It then deals with internals for us: play buttons, closed captions, even multiple video formats… all the good stuff.</p> <p>I’m more and more convinced that containment of ‘the good stuff’ can make the web better for users.</p> <h2>Increased complexity</h2> <p>There is a disadvantage to this nice containment of components using a framework: it’s complex. I mean, the tooling required to ship code is, because it requires advanced knowledge of JavaScript. That potentially <a href="https://rachelandrew.co.uk/archives/2019/01/30/html-css-and-our-vanishing-industry-entry-points/">scares people away</a>. Complexity could <a href="https://adactio.com/journal/15050">reinforce privilege</a> and moving all of a component into JavaScipt can <a href="http://www.heydonworks.com/article/reluctant-gatekeeping-the-problem-with-full-stack">turn full-stack developers into gatekeepers</a>. Heydon Pickering describes there is a problem with full stack:</p> <blockquote> <p>if you put someone in charge of all [the full stack], it’s highly likely they are going to be much weaker in some areas than others</p> </blockquote> <p>In his post, Heydon identifies that what I call a component’s “internals” above are often built poorly. For two reasons: because improving internals now requires knowledge of complex frameworks and because the people specialising in them get undervalued. People who are good at writing front-end code that improves accessibility, but not at advanced JavaScript, might give up, at which point the web could lose out on accessible functionality. That’s sad.</p> <p>I really like working on the detailed stuff that affects users: useful keyboard navigation, sensible focus management, good semantics. But I appreciate not every developer does. I have started to think this may be a helpful separation: some people work on good internals and user experience, others on code that just uses those components and deals with data and caching and solid architecture. Both are valid things, both need love. Maybe we can use the <a href="https://css-tricks.com/the-great-divide/">divide</a> for good?</p> <h2>Conclusion</h2> <p>Modern websites commonly contain complex interaction patterns that aren’t default on the web. We may dislike that or prefer simplicity, but that’s a different (and also interesting) discussion. If we are going to code these complex interactions, it makes sense to contain the result in a component. Let’s assume we’ve worked hard on very accessible and usable ‘internals’, ran user tests and are confident that they are good. Then re-usability is a great thing, because the people who reuse, don’t need to worry about the internals. Like they wouldn’t worry about the internals of a <code>video</code> element when they use that. This is how I think frameworks can help make the web more accessible to users. And, ultimately, pave the way for more user convenience.</p> <p><em>Update 31/1</em>: In this post, I regard framework components and Web Components as one group for lack of a better word, but as Šime Vidas notes in the comments: if we make accessible components <em>it makes more sense to do it in framework-agnostic Web Components than in a framework</em>. To add to that, it might not only be tool-agnostic, but also more future proof.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/baking-accessibility-into-components-how-frameworks-help/">Baking accessibility into components: how frameworks help</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Baking accessibility into components: how frameworks help">Reply via email</a></p> Hello W3C! 2019-05-27T00:00:00Z https://hidde.blog/hello-w3c/ <p>In June, I will start working at the W3C as a Web Front-end Accessibility Specialist in the <a href="http://w3.org/wai">WAI</a> team. This also means I’m leaving Mozilla and the City of The Hague, where I currently contract. Goodbye is never easy, but I’m very excited for this next challenge.</p> <p>With 1¾ years, my freelance contract at Mozilla is my longest since I started contracting. Being a contractor is never forever, but I’m still sad to leave. I learn a lot and feel I am able to contribute a lot, too. I like this balance. It is great to work with Mozilla’s Open Innovation team, and specifically the IAM Project. I feel at home. It is difficult, too, at times, as our team is distributed across the globe in an ever-changing organisation (some of that is fun, too). </p> <p>The majority of my time in the last year was spent on a project codenamed DinoPark, where people can browse other people’s profiles and edit their own. This is currently in Staff-only beta. Technically it is a <a href="https://github.com/mozilla-iam/dino-park-front-end">Vue-based front-end which talks to back-ends using GraphQL</a>. It is even more exciting from a human perspective. It fits <a href="https://www.mozilla.org/en-US/about/manifesto/">Mozilla’s Manifesto</a> in many ways, for example in privacy (how it lets users control who can see their data), security (designed with security at the core) and accessibility (we tackled accessibility challenges early in the process). I like and very much align with the Mozilla stance in the web, which is well captured in the manifesto… this makes me want to continue my relationship with Mozilla as a contributor. I’m still figuring out where that could be (there’s <em>some</em> ideas).</p> <p>I will also leave the City of The Hague, where I rewrote the existing front-end code into a component-based system, exposed as a pattern library. I also worked on the accessibility throughout this system and the web pages it powers. Working for the government is something I had wanted for a long time, because governments have lots of IT problems, and solving them right can provide incredible value to people’s lives. </p> <p>I will certainly miss working with both of these teams.</p> <p>But really, the <a href="https://webaim.org/projects/million/">web is not accessible enough</a>, and I feel like I’ve developed a passion for helping people get it right. At work, but also through <a href="https://talks.hiddedevries.nl/">talks</a> and <a href="https://frozenrockets.academy/">workshops</a>. I’m delighted that I’ll get to spend more time on accessibility work. </p> <p>In the last 10 years, I was often the “accessibility person” on the team. In my role at W3C, I am excited to become a person who is part of an “accessibility team”. I’ll be a Web Front-end Accessibility Specialist, working on <a href="https://www.w3.org/WAI/about/projects/wai-guide/">WAI-Guide</a>, that’s mostly what I know and can share right now. I’m equally nervous and excited for what awaits me.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/hello-w3c/">Hello W3C!</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Hello W3C!">Reply via email</a></p> Indicating focus to improve accessibility 2019-06-06T00:00:00Z https://hidde.blog/indicating-focus-to-improve-accessibility/ <p>It’s a common, but fairly easy-to-fix accessibility issue: lack of indicating focus. In this post I will explain what we mean by focus and show you how focus outlines make your site easier to use.</p> <h2>What is focus?</h2> <p><em>Focus indicators</em> make the difference between day and night for people who rely on them. Let’s first look at what they are, and which people find them useful.</p> <p>Focus is something that happens between the interactive elements on a page. That’s the first thing you should know. (See the <a href="https://allyjs.io/data-tables/focusable.html">focusable elements compatibility table</a> for a more detailed and nuanced definition.) <a href="https://html.spec.whatwg.org/multipage/dom.html#interactive-content-2">Interactive elements</a> are elements like links, buttons and form fields: things that users can interact with.</p> <img src="https://hidde.blog/_images/focus-outline-moving-between-links.gif" alt="Focus outline moving between links" /> <p>On a page, at any given time, there is one element that has focus. If you’ve just loaded a page, it is probably the document, but once you start to click or tab, it will be one of the aforementioned interactive elements. The currently focused element can be found with <code>document.activeElement</code>.</p> <p>By default, browsers convey which element currently has focus by drawing an outline around that element. The defaults vary between browsers and platform. With CSS, you can override these defaults, which we’ll get to in a bit.</p> <h3>Who benefits</h3> <p>Focus outlines help users figure out where they are on a page. They show which form field is currently filled in, or which button is about to be pressed. People who use a mouse, might use their cursor for this, but not everyone uses a mouse. For instance, there are many keyboard users: a person with a baby on one arm, people with chronic diseases that prevent the use of a mouse, and of course… developers and other power users. .</p> <p>Beyond keyboards, there are other tools and input devices that rely on clearly indicated focus, like <a href="https://axesslab.com/switches/">switches</a>. Focus indication also helps people who have limited attention spans or issues with short term memory, for example if they are filling out a lengthy form.</p> <p>If the idea of indicating the current element in a website seems weird, consider TV interfaces. Most people use them with a remote control or game controller, and therefore rely on the interface to convey what’s currently selected.</p> <h3>Never remove them</h3> <p>Not everyone likes how focus outlines look, some find them ugly. But then that’s the case with street lights, too. They are unlikely to win design awards, but if you have to walk home in the dark, you are glad they help you see where you are.</p> <p>Removing focus styles, as some websites do, is as detrimental for keyboard users as removing the mouse cursor would be for mouse users.</p> <p>Nobody would override the browser’s default cursor, effectively removing the cursor altogether:</p> <pre class="language-css"><code class="language-css"><span class="token selector">body</span> <span class="token punctuation">{</span> <span class="token property">cursor</span><span class="token punctuation">:</span> none<span class="token punctuation">;</span> <span class="token comment">/* you wouldn't do this */</span> <span class="token punctuation">}</span></code></pre> <p>So we shouldn’t do this either, which removes the browser’s default outline:</p> <pre class="language-css"><code class="language-css"><span class="token selector">:focus</span> <span class="token punctuation">{</span> <span class="token property">outline</span><span class="token punctuation">:</span> none<span class="token punctuation">;</span> <span class="token comment">/* so, please don't do this */</span> <span class="token punctuation">}</span></code></pre> <p>Or, as Laura Carvajal <a href="https://vimeo.com/309897241">put it at Fronteers 2018</a>:</p> <img src="https://hidde.blog/_images/slide-you-wouldnt-steal-their-cursor-in-font-of-you-wouldnt-steal-their-car.jpg" alt="Slide You wouldnt steal their cursor in font of You wouldnt steal their car" /> <p>Even if you provide an alternative with something like <code>box-shadow</code>, best set <code>outline</code> to <code>solid transparent</code>, because <code>box-shadow</code> does not play well with high contrast modes.</p> <h2>Good focus indicators</h2> <p>One way to indicate focus is to rely on browser defaults. It works, but I would recommend designing your own focus outlines. This gives you maximum control over how easy they are to see, and lets you integrate them with brand colours or the style of your site. Usually, thicker outlines (from 2px onwards) are better, as they are simply easier to see.</p> <p>The <code>:focus</code> pseudo class takes CSS rules like any other selector, so you could style it however you like. In some cases a background color or underline could indicate that something is active.</p> <h3>Examples</h3> <p>Below are focus outlines as seen on Schiphol.nl and the City of The Hague websites. They make it easy to distinguish in a list of links which one is currently active.</p> <img src="https://hidde.blog/_images/on-left-list-of-links-with-one-that-has-purple-outline-on-right-list-of-links-with-one-yellow-background-and-dark-thin-border.png" alt="On left list of links with one that has purple outline, on right, list of links with one yellow background and dark thin border" /> <h3>Transitions</h3> <p>Focus outlines do not have to be boring. The <code>outline</code> property can be <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transition">transitioned</a> with CSS, so why not add a subtle animation? Make it pop!</p> <h3>Contrast</h3> <p>In <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1">WCAG 2.1</a>, focus indicators are bound to the same contrast rules as other parts of the content, as per <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1&showtechniques=324%2C331#non-text-contrast">1.4.11: Non-text contrast</a>. This means a contrast of 3:1 between the outlines and their background is required.</p> <p>On websites that have both light and dark parts, it is quite common to have a dark and a light focus style. For example, if your focus outline is blue for parts with a white background (for instance, the main content area), you could make it white for parts with a black background (for instance, the footer).</p> <h2>Special cases</h2> <h3>Focusing non-interactive elements</h3> <p>As mentioned earlier, focus works on interactive elements. In special cases, it makes sense to focus a non-interactive element, like a <code>&lt;div&gt;</code> , if that element is a piece of expanded content or a modal overlay that was just opened.</p> <p>Any element can be added to focus order with the <code>tabindex</code> attribute in HTML. Best use it with <code>0</code> or <code>-1</code>:</p> <ul> <li><code>tabindex="0"</code>: element can be focused with keyboard and through JavaScript</li> <li><code>tabindex="-1"</code>: element can be focused through JavaScript, but cannot be tabbed to</li> </ul> <p>A <code>tabindex</code> with a number larger than 0 is best avoided, as this sets a preference of where the element goes in the tab order. If you set it for one element, you will have to set and maintain (!) a <code>tabindex</code> value on all interactive elements on the page. See also: <a href="https://www.scottohara.me/blog/2019/05/25/tabindex.html">It rarely pays to be positive</a> by Scott O’Hara.</p> <h3>Only for keyboard users</h3> <p>If you are a developer and the design team is unwilling to apply bold focus styles, you could propose to show them to users who need them, for instance only to keyboard users.</p> <p>There are two caveats to this notion of “users who need them”:</p> <ul> <li>Not all people who rely on focus styles use a keyboard. We mentioned <a href="https://axesslab.com/switches/">switches</a> earlier, but that’s only one use case. As a general rule, keep in mind that you can’t predict all the ways your visitors choose to browse the web.</li> <li>Making focus styles keyboard-only takes away an affordance for mouse users too, as focus also indicates that something is interactive.</li> </ul> <p>For these reasons, we should be careful making decisions about when and how to show focus styles. Luckily, there is a CSS property invented to help us out here: <a href="https://www.w3.org/TR/selectors-4/#the-focus-visible-pseudo">focus-visible</a>. According to the spec, it lets us:</p> <blockquote> <p>provide clearly identifiable focus styles which are visible when a user is likely to need to understand where focus is, and not visible in other cases</p> </blockquote> <p>In other words: it aims to let you indicate focus only for people that need it. It is preferable to avoid such heuristics and convey focus rings to everybody, but if you have to, focus-visible is ideal. Especially if the alternative is nothing at all.</p> <h2>Focus styles as keyboard accessibility</h2> <p>A focused element that isn’t highlighted has a big impact on usability for keyboard users. You could make keyboard checks part of your development workflow to ensure that you don’t forget focus indicators. For instance, you could include “Can be used with a keyboard” in your definition of done. This is a <a href="https://www.w3.org/WAI/test-evaluate/preliminary/#interaction">check</a> that most people in the team should be able to do before a new feature goes live. As we’ve seen above, focus styles don’t just benefit keyboard users, but keyboard operability is a good way to test them.</p> <p>When testing, you might find that not all browsers and platforms let you tab through interactive elements by default. Here are some of the most common settings across platforms and browsers:</p> <ul> <li>macOS: under System Preferences > Keyboard > Shortcuts set ‘Full keyboard access’ to ‘All controls’</li> <li>Safari, macOS: in <code>Safari > Preferences</code>, under ‘Advanced’, check ‘Press Tab to highlight each item on a webpage’</li> <li>Chrome: in chrome://settings, under ‘Web content’, check ‘Pressing Tab on a webpage highlights links, as well as form fields’</li> </ul> <h2>Summing up</h2> <p>Hopefully this post inspires you to try out your (client’s) site with just a keyboard. Maybe it is a pleasure to use already. If not, perhaps this post convinces you or your team to address the problem and design some on-brand focus indicators. Together we make the web more friendly to users of keyboards, sticks and switches. Together we make the web work for everyone.</p> <p>Focus outlines are one of many ways to design for accessibility. For more tips on design with accessibility in mind, see <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Accessibility/Accessibility_information_for_UI_designers">Accessibility Information for UI designers</a> on MDN and <a href="https://www.w3.org/WAI/tips/designing/">Tips for designing with accessibility</a> at the W3C.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/indicating-focus-to-improve-accessibility/">Indicating focus to improve accessibility</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Indicating focus to improve accessibility">Reply via email</a></p> CSS Day 2019: some things I learned 2019-06-18T00:00:00Z https://hidde.blog/css-day-2019-some-things-i-learned/ <p>Last week I joined over 400 web nerds at CSS Day 2019, which took place once again in the lovely Compagnietheater in Amsterdam. These are some of the things I learned.</p> <p><img src="https://hidde.blog/_images/left-to-right-badge-that-says-hidde-de-vries-man-that-makes-smoothies-surrounded-by-smoothies-three-speakers-in-front-of-their-respective-slides.png" alt="Left to right badge that says hidde de vries man that makes smoothies surrounded by smoothies three speakers in front of their respective slides" /> <em>The badges were beautiful and there were smoothies (<code>scroll-behavior: smoothie</code>)! Speakers from left to right: Natalya Shelburne, Rachel Andrew, Tab Atkins, Heydon Pickering. Photos on the right by <a href="https://www.joycegoverde.com/">Joyce Goverde</a>, the event’s awesome photographer</em> </p> <p>When I attended the first installment of the conference, I had not expected that there would be more. I mean, there’s only so much you can say about CSS. Of course I was wrong and more happened… every year. Last week was the 7th (!). The 2019 edition was not, as tweets may have suggested, a day for bashing JavaScript or the people who write it. Apart from the occasional tongue in cheek comment on people’s motivations to pick React (<em><a href="https://www.youtube.com/watch?v=TgWyyoofKIA">React?</a></em>), this conference was full of interesting tidbits on what CSS can do now, how it is being developed (in specs and in browsers) and how we can, as CSS developers, be effective team members, able to sell CSS as the serious language that it is. With all due respect for our colleagues who write JavaScript (I and many others do both, too).</p> <p>Note, I missed the first talk (the good thing about a conference nearby is: can do some daughter time in the morning). Luckily <a href="https://www.youtube.com/watch?v=tqYWDGzhZKM">Rachel Andrew’s video</a> and <a href="https://noti.st/rachelandrew/VqOEAa/refactoring-the-way-we-talk-about-css">Rachel’s slides</a> are already online, I just watched the video and it is very, very good. One great point she makes in it is that we should stop talking about CSS as if it is a hack, because if we do we reinforce the idea that CSS is weird, quirky and a series of hacks. She said this in the context of using <code>auto</code> margins for alignment, which she said is simply using CSS <em>as it is specced</em>, not a hack.</p> <h2>What CSS can do now</h2> <p>Something you might not think about daily: when should lines break? <a href="https://twitter,com/frivoal">Florian Rivoal</a> showed how whitespace between words works on the web, and what some of the challenges are in deciding when to break a line to the next (<a href="https://florian.rivoal.net/talks/line-breaking/#cover">Florian’s slides</a>, <a href="https://www.youtube.com/watch?v=hXP0M7Um1dI">Florian’s video</a>). This is specifically interesting within tables, as a cell that contains a long line of content increases the whole table’s size, unless the line breaks. The same happens in Grid Layout cells, by the way. Breaking is defined in <a href="http://www.unicode.org/reports/tr14/">Unicode, annex 14</a>, you can automate with auto hyphens (always set a <code>lang</code> and star <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=652964">the Chromium bug</a> to express interest in support) or manually influence with <code>&lt;wbr&gt;</code> or a <a href="https://en.wikipedia.org/wiki/Soft_hyphen">soft hyphen character</a>.</p> <p>Steve Schoger showed tips and tricks to make websites look better (<a href="https://www.youtube.com/watch?v=7Z9rrryIOC4">Steve’s video</a>). No actual CSS was shown, but it was interesting to see how small visual changes can make a big difference. Think about how to choose the right colors, create visual hierarchy and design good tables. A great tip regarding tables was: they don’t <em>have</em> to represent your database structure: often you can show less columns by combining or omitting some information, and make the core information easier to find. It was good to see that in many of his tips, Steve also took accessibility into account.</p> <p>Heydon Pickering introduced how smart CSS can let flexbox layouts resize between linear one column things and multiple columns, without that weird in between state where the last item takes double space and therefore looks more important, and, importantly, with no media queries (<a href="https://www.youtube.com/watch?v=RUyNJaoJH_k">Heydon’s video</a>). They depend on window width, which is not helpful in a world where components can exist in all sorts of containers. His solution is aptly (?) named the <a href="http://www.heydonworks.com/article/the-flexbox-holy-albatross">holy albatross</a>, and in his talk he revealed a project called <a href="https://every-layout.dev/">Every Layout</a> where that technique and others will be made available as custom elements, built together with Andy Bell.</p> <h2>How it is being developed</h2> <p>Line boxes have existed for ages in CSS, Elika J. Etemad a.k.a. fantasai explained, they ensure content does not overlap (<a href="https://www.youtube.com/watch?v=OtlGo48iTOk">fantasai’s video</a>). But, non-overlapping content could mean a less ideal vertical rhythm, and this annoys typographers working with CSS. The definition of ‘fits within linebox’ may need to be redefined, Elika explained, there may be a switch between this old and new model for how lines are sized. What if you have a graphic or heading on a page that is not as tall as exactly X amount of lines? That would interrupt the vertical rhythm. To deal with that, CSS might get a <code>block-step-size</code> property that could insert extra space above and/or below that graphic, to fill the gap between the space the graphic needs and the space the vertical rhythm offers. You would even be able to choose whether to add it as margin or padding (with <code>block-step-insert</code>), and where to align it (<code>block-step-align: auto | center | start | end</code>). This is all defined in <a href="https://www.w3.org/TR/css-rhythm-1/">CSS Rhythmic Sizing</a>, currently open for feedback. Elika also went into linebox trimming with <code>leading-trim-over</code>/<code>leading-trim-under</code>, which gives better control over leading in the top and bottom of a text, to allow for alignment without magic numbers (see <a href="https://github.com/w3c/csswg-drafts/issues/3240">#3240</a>). Interestingly, for this to work, it’s not just CSS, but also font foundries, who need to add the required metrics. Font metrics are also important for baselines (in future CSS you can set a dominant baseline with <code>dominant-baseline</code> (TIL there are <em>multiple</em> baselines)) and drop caps. For all of these things, languages beyond English (including CJK: Chinese-Japanese-Korean), are very much taken into account by spec writers, because the web is for everyone.</p> <p>Manuel Rego Casasnovas showed how CSS is developed as features inside browsers: what the steps are to follow, what kind of actual C++ code goes where in the code base and how features go from existing behind flags to stable browser features that will forever exist because backwards compatibility (<a href="https://www.youtube.com/watch?v=C1JcKq3NzWU">Manuel’s video</a>). One of the many interesting things I learned in this talk is that it takes hours to compile a browser.</p> <p><img src="https://hidde.blog/_images/slide-that-has-squares-forming-the-word-css-with-code-grid-skip-areas-and-syntax-with-numbers-and-slashes.png" alt="Slide that has squares forming the word css with code grid skip areas and syntax with numbers and slashes" /> <em> If we had <code>grid-skip-areas</code>, we could choose to autoplace grid items in all areas, except some. Then we could create the word CSS out of a grid.</em> </p> <h2>Being a CSS developer</h2> <p>It is unlikely for a question to attract as many trolls online as: ‘is CSS a programming language?’ Lara Schenck decided to do the research and shared her results with us in a talk that was excellent in so many ways (<a href="http://stuff.notlaura.com/downloads/cssday2019.pdf">Lara’s slides</a>, <a href="https://www.youtube.com/watch?v=dtddBM8s7xY">Lara’s video</a>). CSS fits right into one of the programming paradigms, domain-specific declarative programming languages, Lara explained. There are lots of criteria sceptics could come up with, like that programming languages should be Turing complete, suitable to write algorithms in and ‘have consequences’. She addressed these brilliantly in a sort of Socratic dialogue. Yes, you can replicate <a href="https://en.wikipedia.org/wiki/Rule_110">rule 110</a> in CSS with <code>:checked</code> and <code>:not()</code>, ok and a user and HTML, you can (and probably should) write CSS algorithms that are groups of declarations to produce a specific output, and yes, CSS has consequences, that can be addressed with programming methodologies. A great serious note she ended with is that a consequence of labeling CSS as “not programming” is that it renders companies unable to hire people who are <em>good at CSS</em>. People see it as not a skill worthy, and this is a problem, because without good CSS developers, companies lose out on well-built front-ends. To add a data point: I see this phenomenon almost everywhere I work (sadly).</p> <p><img src="https://hidde.blog/_images/slide-with-turing-machine-from-laras-imagination-has-ticker-tape-with-ones-and-zeros-running-through-a-machine.png" alt="Slide with turing machine from lara's imagination has ticker tape with ones and zeros running through a machine" /> <em>Lara’s Turing machine</em> </p> <p>Natalya Shelburne talked about the mindset of people who write CSS and how it combines different mental models (<a href="https://www.youtube.com/watch?v=y-tpXXDoFhM">Natalya’s talk</a>). She talked how CSS developers can bridge the gap between designers and the actual application’s you’re working on. One tool that helps is design systems: it can bridge domains, enforce shared vocabularies. Another cool thing she showed was a special ribbon like menu that she deploys just on staging. It has tools to help designers understand grids and, amazingly, the boxes that exist in the CSS reality, as compared to the boxes that are in the designer’s software. What an awesome way to collaborate! Natalya also discussed technological barriers: by moving a lot of our code into React components that are written in a way that’s mostly optimised for reading the JavaScript that exists around it, highers the bar for pure CSS people to contribute. She suggested having a pure HTML/CSS version to allow designers to contribute. Rather than thinking about or sticking to certain technologies, we should think about how to <em>enable people</em>, Natalya said. She celebrated that there are lots of people in the web community doing great work in this space.</p> <h2>Wrapping up</h2> <p>It was really good to see some new CSS that is coming up (seriously. watch <a href="https://www.youtube.com/watch?v=OtlGo48iTOk">fantasai’s video</a>) and learn about how to use existing CSS. Another recurring theme throughout the day was: as a community of CSS people, we should demand this language we love to be taken much more seriously. If not for our own sanity and valuation, then for the companies we are writing CSS code for. I urge you to watch <a href="https://www.youtube.com/watch?v=dtddBM8s7xY">Lara’s video</a> and <a href="https://www.youtube.com/watch?v=y-tpXXDoFhM">Natalya’s talk</a>. </p> <p>One call to action that a couple of speakers mentioned in talks and in the hallways: please have a say in how CSS develops, all discussions <a href="https://github.com/w3c/csswg-drafts">happen on GitHub</a>, everyone should feel free to comment. Blogging about things you’d like to see or use is also encouraged.</p> <p>The CSS Day organisers have once again set the bar very high for the next edition, let’s hope there will be another one in 2020!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/css-day-2019-some-things-i-learned/">CSS Day 2019: some things I learned</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20CSS Day 2019: some things I learned">Reply via email</a></p> How accessibility trees inform assistive tech 2019-06-27T00:00:00Z https://hidde.blog/how-accessibility-trees-inform-assistive-tech/ <p>The web is accessible by default. It was designed with features to make accessibility possible, and these have been part of the platform pretty much from the beginning. In recent times, inspectable accessibility trees have made it easier to see how things work in practice. In this post we’ll look at how “good” client-side code (HTML, CSS and JavaScript) improves the experience of users of assistive technologies, and how we can use accessibility trees to help verify our work on the user experience.</p> <h2>People browse differently</h2> <p>Assistive Technology (AT) is the umbrella term for tools that help people operate a computer in the way that suits them. <a href="https://en.wikipedia.org/wiki/Refreshable_braille_display">Braille displays</a>, for instance, let blind users understand what’s on their screen by conveying that information in braille format in real time. <a href="https://www.apple.com/accessibility/mac/vision/">VoiceOver</a>, a utility for Mac and iOS, converts text into speech, so that people can listen to an interface. <a href="https://www.nuance.com/dragon.html">Dragon NaturallySpeaking</a> is a tool that lets people operate an interface by talking into a microphone.</p> <p><img src="https://hidde.blog/_images/hand-on-braille-purple-display.jpg" alt="Hand on braille purple display" /> <em>A refreshable Braille display (Photo: <a href="https://commons.wikimedia.org/wiki/User:Sebastien.delorme">Sebastien.delorme</a>)</em></p> <p>The idea that people can use the web in the way that works best for them is a fundamental design principle of the platform. When the web was invented to <a href="http://info.cern.ch/Proposal.html">let scientists exchange documents</a>, those scientists already had a wide variety of systems. Now, in 2019, systems vary even more. We use browsers on everything from watches to phones, tablets to TVs. There is a perennial need for web pages that are resilient and allow for user choice. These values of resilience and flexibility have always been core to our work.</p> <p>AT draws on these fundamentals. Most assistive technologies need to know what happens on a user’s screen. They all must understand the user interface, so that they can convey it to the user in a way that makes sense. Many years ago, assistive technologies relied on OCR (optical character recognition) techniques to figure what was on the screen. Later they consumed markup directly from the browser. On modern operating systems the software is more advanced: accessibility APIs that are built into the platform provide guidance.</p> <h2>How front-end code helps</h2> <p>Platform-specific Accessibility APIs are <a href="https://www.w3.org/TR/2017/REC-core-aam-1.1-20171214/#comparing-accessibility-apis">slightly different depending on the platform</a>. Generally, they know about the things that are platform-specific: the Start Menu in Windows, the Dock on the Mac, the Favorites menu in Firefox… even the address bar in Firefox. But when we use the address bar to access a website, the screen displays information that it probably has never displayed before, let alone for AT users. How can Accessibility APIs tell AT about information on websites? Well, this is where the right client-side HTML, CSS and JavaScript can help.</p> <p>Whether we write plain HTML, JSX or Jinja, when someone accesses our site, the browser ultimately receives markup as the start for any interface. It turns that markup into an internal representation, called the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction">DOM tree</a>. The DOM tree contains objects for everything we had in our markup. In some cases, browsers also create an accessibility tree, based on the DOM tree, as a tool to better understand the needs and experiences of assistive technology users. The accessibility tree informs platform-specific Accessibility APIs, which then inform Assistive Technologies. So ultimately, our client-side code impacts the experience of assistive technology users.</p> <img src="https://hidde.blog/_images/your-markup-becomes-a-dom-tree-which-the-accessibility-is-based-on-which-is-then-sent-to-platform-apis-and-ultimately-ends-up-at-assistive-technologies.jpg" alt="Your markup becomes a DOM tree which the accessibility is based on which is then sent to platform APIs and ultimately ends up at assistive technologies" /> <h3>HTML</h3> <p>With HTML, we can be specific about what things are in the page. We can define what’s what, or, in technical terms, provide semantics. For example, we can define something as a:</p> <ul> <li>checkbox or a radio button</li> <li>table of structured data</li> <li>list, ordered or unordered, or a list of definitions</li> <li>navigation or a footer area</li> </ul> <h3>CSS</h3> <p>Stylesheets can also impact the accessibility tree: layout and visibility of elements are sometimes taken into account. Elements that are set to <code>display: none</code> or <code>visibility: hidden</code> are taken out of the accessibility tree completely. Setting display to <code>table</code>/<code>table-cell</code> can also impact semantics, as Adrian Roselli explains in <a href="http://adrianroselli.com/2018/02/tables-css-display-properties-and-aria.html">Tables, CSS display properties and ARIA</a>.</p> <p>If your site dynamically changes generated content in CSS (<code>::before</code> and <code>::after</code>), this can also appear or disappear in accessibility trees.</p> <p>And then, there are properties that can make visual layout differ from DOM order, for example <code>order</code> in grid and flex items, and <code>auto-flow: dense</code> in Grid Layout. When visual order is different from DOM order, it is likely also going to be different from accessibility tree order. This may confuse AT users. The <a href="https://www.w3.org/TR/css-flexbox-1/#order-accessibility">Flexbox spec</a> is quite clear: the CSS order property is “for visual, not logical reordering”.</p> <h3>JavaScript</h3> <p>JavaScript lets us change the state of our components. This is often relevant for accessibility, for instance, we can determine:</p> <ul> <li>Is the menu expanded or collapsed?</li> <li>Was the checkbox checked or not?</li> <li>Is the email address field valid or invalid?</li> </ul> <p>Note that accessibility tree implementations can vary, creating discrepancies between browsers. For instance, missing values are computed to <code>null</code> in some browsers, <code>''</code> (empty string) in others. Differing implementations are one of many reasons <a href="https://wicg.github.io/aom/accessibility-tree">plans to develop a standard</a> are in the works.</p> <h2>What’s in an accessibility tree?</h2> <p>Accessibility trees contain accessibility-related meta information for most of our HTML elements. The elements involved determine what that means, so we’ll look at some examples.</p> <p>Generally, there are four things in an accessibility tree object:</p> <ul> <li><strong>name</strong>: how can we refer to this thing? For instance, a link with the text ‘Read more’ will have ‘Read more’ as its name (more on how names are computed in the <a href="https://www.w3.org/TR/accname-1.1/">Accessible Name and Description Computation spec</a>)</li> <li><strong>description</strong>: how do we describe this element, if we want to add anything to the name? The description of a table could explain what kind of info that table offers.</li> <li><strong>role</strong>: what kind of thing is it? For example, is it a button, a nav bar or a list of items?</li> <li>state: if any, does it have state? Think checked/unchecked for checkboxes, or collapsed/expanded for the <code>&lt;summary&gt;</code> element</li> </ul> <p>Additionally, the accessibility tree often contains information on what can be done with an element: a link can be <em>followed</em>, a text input can be <em>typed into</em>, that kind of thing.</p> <h3>Inspecting the accessibility tree in Firefox</h3> <p>All major browsers provide ways to inspect the accessibility tree, so that we can figure out what an element’s name has computed to, or what role it has, according to the browser. For some context on how this works in Firefox, see <a href="https://marcozehe.wordpress.com/2018/04/11/introducing-the-accessibility-inspector-in-the-firefox-developer-tools/">Introducing the Accessibility Inspector in the Firefox Developer Tools</a> by Marco Zehe.</p> <p>Here’s how it works in Firefox:</p> <ul> <li>In Settings, under Default Developer Tools, ensure that the checkbox “Accessibility” is checked</li> <li>You should now see the Accessibility tab</li> <li>In the Accessibility tab, you’ll find the accessibility tree with all its objects</li> </ul> <h3>Other browsers</h3> <p>In Chrome, the Accessibility Tree information lives together with the DOM inspector and can be found under the ‘Accessibility’ tab. In Safari, it is in the Node tab in the panel next to the DOM tree, together with DOM properties.</p> <h2>An example</h2> <p>Let’s say we have a form where people can pick their favourite fruit:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>form</span> <span class="token attr-name">action</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>fieldset</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>legend</span><span class="token punctuation">></span></span>Pick a fruit <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>legend</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>label</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>radio<span class="token punctuation">"</span></span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>fruit<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> Apple<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>label</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>label</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>radio<span class="token punctuation">"</span></span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>fruit<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> Orange<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>label</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>label</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>radio<span class="token punctuation">"</span></span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>fruit<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> Banana<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>label</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>fieldset</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>form</span><span class="token punctuation">></span></span></code></pre> <p>In Firefox, this creates a number of objects, including:</p> <ul> <li>An object with a role of <strong>grouping,</strong> named <strong>Pick a fruit</strong></li> <li>Three objects with roles of <strong>label</strong>, named <strong>Apple</strong>, <strong>Orange</strong> and <strong>Banana</strong>, with action <strong>Click</strong>, and these states: <strong>selectable text</strong>, <strong>opaque</strong>, <strong>enabled</strong>, <strong>sensitive</strong></li> <li>An object with role of <strong>radiobutton</strong>, named <strong>Apple</strong>, with action of <strong>Select</strong> and these states: <strong>focusable</strong>, <strong>checkable</strong>, <strong>opaque</strong>, <strong>enabled</strong>, <strong>sensitive</strong></li> </ul> <p>And so on. When we select ‘Apple’, <strong>checked</strong> is added to its list of states.</p> <p>Note that each thing expressed in the markup gets reflected in a useful way. Because we added a <code>legend</code> to the group of radio buttons, it is exposed with a name of ‘Pick a fruit’. Because we used inputs with a type of radio, they are exposed as such and have relevant states.</p> <p>As mentioned earlier, we don’t just influence this through markup. CSS and JavaScript can also affect it.</p> <p>With the following CSS, we would effectively take the name out of the accessibility tree, leaving the <code>fieldset</code> unnamed:</p> <pre class="language-css"><code class="language-css"><span class="token selector">legend</span> <span class="token punctuation">{</span> <span class="token property">display</span><span class="token punctuation">:</span> none<span class="token punctuation">;</span> <span class="token comment">/* removes item from accessibility tree */</span> <span class="token punctuation">}</span></code></pre> <p>This is true in at least some browsers. When I tried it in Firefox, its heuristics still managed to compute the name to ‘Pick a fruit’, in Chrome and Safari it was left out completely. What this means, in terms of real humans: they would have no information as to what to do with Apple, Orange and Banana.</p> <p>As mentioned earlier, we can also influence the accessibility tree with JavaScript. Here is one example:</p> <pre class="language-javascript"><code class="language-javascript"><span class="token keyword">const</span> inputApple <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">querySelector</span><span class="token punctuation">(</span><span class="token string">'input[radio]'</span><span class="token punctuation">)</span><span class="token punctuation">;</span> inputApple<span class="token punctuation">.</span>checked <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span> <span class="token comment">// alters state of this input, also in accessibility tree</span></code></pre> <p>Anything you do to manipulate DOM elements, directly through DOM scripting or with your framework of choice, will update the accessibility tree.</p> <h2>Conclusion</h2> <p>To provide a great experience to users, assistive technologies present our web pages differently from how we may have intended them. Yet, what they present is based directly on the content and semantic structure that we provide. As designers and developers, we can ensure that assistive technologies understand our pages well writing good HTML, CSS and JavaScript. Inspectable accessibility trees help us verify directly in the browser if our names, roles and state make sense.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/how-accessibility-trees-inform-assistive-tech/">How accessibility trees inform assistive tech</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20How accessibility trees inform assistive tech">Reply via email</a></p> Click here to kill everybody: a review 2019-07-05T00:00:00Z https://hidde.blog/click-here-to-kill-everybody-a-review/ <p>This week I read <em>Click here to kill everybody</em>, a book that is at the same time worrying and encouraging. A security nightmare is waiting to happen, but there is still time to save the world. Yeah, the book is a tad dramatic, but generally a great read that I can recommend.</p> <p><img src="https://hidde.blog/_images/img4850.jpeg" alt="IMG 4850" /> <em>The book</em> </p> <p>More and more devices are connected to the internet, and it is not just traditional devices with browsers, like desktop computers, laptops, tablets and smartphones. It’s also <em>things</em> like washing machines and fridges. Even in mission critical things like thermostats, pacemakers and nucleair power plants. We, humans, are in the middle of this new world: we give input to and accept output from our devices. In his book <a href="https://www.schneier.com/books/click_here/" title=""><em>Click here to kill everybody</em></a>, security expert Bruce Schneier coins the phrase <em>Internet+</em> for this new reality (the internet, things and ourselves). He worries about Internet+, as it is grows rapidly and is a lot less secure than we should want it to be. With your car on the network, a hack could mean turning off its breaks while on the highway. With internet enabled medical devices in our body, a hack could mean turning you off. Yup, lots to worry! </p> <p>The book gives a good overview of security risks that we can find in internet connected devices and how villains could exploit them. Many of those devices have problems that we technically already know how to fix. Encryption exists, but companies produce baby monitors that don’t encrypt voice data, to name just one example. Some of this sounds oddly familiar to accessibility: WCAG is over 20 years old now, but it is <a href="https://webaim.org/projects/million/">not implemented as widely as one would hope</a>.</p> <p>There’s lots of reason for pessimism, Schneier explains, if you think about the incentives of companies and governments. Companies focus on maximising profits, and lack of security is often no threat to those profits. This is because usually customers face the consequences. <a href="https://hiddedevries.nl/en/blog/2019-03-06-book-review-the-age-of-surveillance-capitalism">Surveillance capitalism</a> also gets in the way, because you cannot trust companies to keep you secure if their business model is surveillance. In short, and the book goes into a lot more detail, we should not expect a lot from companies. Governments sometimes work against security: they try to keep security protocols weak and keep certain vulnerabilities secret, to make the work of intelligence agencies like NSA and FBI easier. Or they propose to ban encryption altogether (Cameron and May in the UK). Schneier questions whether such attempts are going to help: real criminals will find their way around, so it won’t stop them, but it will certainly make the world a lot less secure for ordinary consumers. Can we afford that?</p> <p>Still, Schneier looks at the government for solutions. Because they could actually do something about companies’ lack of security, by legally forcing companies into making their products more secure. Earlier in the book, Schneier talks about how useful it would be if security and detailed aspects of it become metrics by which products get compared. I could imagine that to be policy, too: force companies who make Internet of Things devices to disclose whether or not they have certain security features. Does this particular baby monitor encrypt data, and with which algorithm? Oh, this other one does not encrypt at all. It fits well in Schneier’s call for transparancy: more transparancy about data breaches and security implementation is essential for a more secure future, he says.</p> <p>One of the risks in governments getting policy about technology right, is that policy makers often lack technological understanding, Schneier explains. Last year’s Mark Zuckerberg hearings in the US Senate were probably a good example of that, although that was about privacy, not security. It was sad to watch many of the Senators ask the wrong questions, because they clearly did not get what they should have worried about. Many policy makers don’t seem to realise the risk of storing so much personal data on corporate servers, Schneier concludes. So he ends with a call to action. There is a huge need for people with an engineering background to be interested in policy, and get involved. Schneier also points at some experts who are already doing this, like <a href="https://en.wikipedia.org/wiki/Latanya_Sweeney">Latanya Sweeney</a> (“probably the best analyst in de-anonymysation”, now professor of government and technology) and professor <a href="https://en.wikipedia.org/wiki/Susan_Landau">Susan Landau</a> who testified before US Congress about ubiquitous encryption.</p> <p>I like the book. It is a bit sensational, has a click-baity title and focuses too much on the US and Europe, but it gives a really good overview of the stakes across companies, ethics and politics with regards to internet security. Its mostly about stakes, and not so much about practical security advice, which I’m sure you can find in one of Schneier’s other books. <em>Click here to kill everybody</em> ends positively: we can get this right, let’s take action now.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/click-here-to-kill-everybody-a-review/">Click here to kill everybody: a review</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Click here to kill everybody: a review">Reply via email</a></p> Meaning without markup: Accessibility Object Model 2019-07-22T00:00:00Z https://hidde.blog/aom/ <p>Meaningful markup is essential for accessibility, because it brings semantics. In short, it tells the browser what things are. Proposals for the Accessibility Object Model include a new way to convey semantics: without markup, directly in JavaScript. In this post, we will look at the proposals and their current status.</p> <h2>Beyond the scope of HTML</h2> <p>To get a more detailed overview of how the quality of our markup impacts end users, see my previous post <a href="https://hidde.blog/en/blog/2019-06-27-how-accessibility-trees-inform-assistive-tech">How accessibility trees inform assistive tech</a>. To summarise: our markup gets used to construct accessibility trees, which inform assistive technologies (AT) about what things are on our pages. With this information, AT can offer features like ‘browse by heading’ and advanced table navigation.</p> <p>There are plenty of semantic elements to choose from when we build a component. <a href="https://html.spec.whatwg.org/dev/semantics.html#semantics">The set of HTML elements</a> is enormous. Even if you build a new thing for which no semantic element exists, custom components that <a href="https://hidde.blog/en/blog/2017-10-19-web-components-as-compositions-of-native-elements">combine existing HTML elements</a> let you have at least some of your semantics for free. </p> <p>Sometimes the set of HTML elements really does not cut it. You’ve created an interface concept for which reasonably no semantic tag exists in HTML. This is where WAI-ARIA comes in: it lets you provide accessibility-relevant information to the browser using standardised attributes, including semantics, states and labels. </p> <p>Some examples of effective ARIA:</p> <ul> <li>with <code>aria-expanded="true|false"</code>, you can set the state of a button that expands/collapses content</li> <li>with <code>role="alert"</code> you can turn an element into a live region: when content is updated, the update is announced to AT users</li> </ul> <p>There is also ARIA that can turn elements into elements for which there are already existing HTML equivalents, such as buttons and links. This is not recommended, because apart from changing semantics, it also makes affordances like keyboard behavior the developer’s responsibility. For instance, instead of <code>&lt;span role=&quot;button&quot;&gt;</code>, it is much safer to use <code>&lt;button type=&quot;button&quot;&gt;</code> and get the keyboard behaviour for free. In 2019, styling native buttons is no longer a problem. Certainly not one that warrants accessibility bugs like reduced keyboard support.</p> <h2>How AOM will help</h2> <p>So, let’s say you are making something that passes the first rule of ARIA (paraphrased: “don’t use ARIA if it is not needed”). You could use markup for this: just add the appropriate attributes. Once the Accessibility Object Model is implemented, you could also apply ARIA without markup.</p> <p>The proposed <a href="https://github.com/WICG/aom/">Accessibility Object Model</a> (AOM) will be “a JavaScript API to allow developers to modify (and eventually explore) the accessibility tree for an HTML page”. In other words: it gives developers direct access to the accessibility tree. In a way, that’s a bit like what Service Workers do for the network and Houdini for style: give developers control over something that was previously done only by the browser. All in the name of an <a href="https://extensiblewebmanifesto.org/">extensible web</a>: control over these low-level features enables developers to experiment and create new things without waiting for the standards process. Perhaps, with AOM, people could define Web Components that don’t exist in HTML just yet. </p> <p>Having access to low-level features like these, gives developers power (yay!). But at the same time, they also give developers more direct responsibility, regarding aspects like security, performance and accessibility. It can be tricky and time-consuming to implement best practices and fulfill all those responsibilities. Admittedly, is it easier, and often sensible, to use browser defaults. Extending the web like this is probably most practical for teams that are able to invest the time.</p> <p>AOM is currently developed by people from across Mozilla, Google and Apple. They’ve defined four phases for the project. Let’s look at some of the plans and how they help.</p> <h3>No more ‘sprouting’</h3> <p>Interfaces with a lot of advanced controls can quickly become a sea of attributes, which <a href="https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-autonomous-drawbacks">the HTML spec calls “sprouting”</a>. Even a simple disabled button might require <code>role</code>, <code>aria-label</code> and <code>aria-disabled</code> attributes. That’s a lot of attributes, not just to add, but also to maintain (in markup). To solve this, AOM will let developers set accessibility attributes of an element directly in JavaScript.</p> <p>For example, to set <code>aria-expanded</code> on an element, you could do it on the element directly:</p> <pre class="language-javascript"><code class="language-javascript">el<span class="token punctuation">.</span>ariaExpanded <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span></code></pre> <p>Previously, we could only set this attribute to expanded by switching the value of the attribute in the markup. With AOM, the set of ARIA attributes will also exist as properties that DOM nodes can have, so called <a href="https://heycam.github.io/webidl/#idl-attributes">IDL</a> (Interface Definition Language) attributes. The IDL attributes are said to reflect attributes in the markup. In the above example, that means that upon setting <code>el.ariaExpanded</code> to true, an attribute (if it does not yet exist) is added to <code>el</code> and it is set to <code>true</code>.</p> <p>The mapping of ARIA attributes to IDL attributes is defined in the <a href="https://www.w3.org/TR/wai-aria-1.2/#idl-interface">ARIA 1.2 specification</a>.</p> <p>Note that in applications that have some form of virtual DOM, like those built with frameworks including React and Vue, best practices prescribe “don’t touch the DOM, let the framework deal with DOM changes”. In those applications, defining semantics in the markup or a template will probably still be the go-to approach.</p> <h3>Relationships without IDs</h3> <p>In HTML, the <code>id</code> attribute uniquely identifies an element. Form labels make use of this: we associate <code>label</code> attributes with their corresponding input by pointing the <code>label</code>’s <code>for</code> to the <code>input</code>’s <code>id</code>. In ARIA, there are a number of properties that need to point to an <code>id</code> (or multiple <code>id</code>s), like <code>aria-controls</code> (<em>this element controls that element</em>) and <code>aria-describedby</code> (<em>this element is described by this element/these elements</em>).</p> <p>With AOM, one can associate elements with other elements directly, by assigning them like this:</p> <pre class="language-javascript"><code class="language-javascript">formField<span class="token punctuation">.</span>ariaLabelledBy <span class="token operator">=</span> formLabel<span class="token punctuation">;</span></code></pre> <h3>Non-DOM nodes in the accessibility tree</h3> <p>In some very specific cases, a web application may contain content that does not exist as DOM nodes. For instance: drawing a train station’s map of available elevators on a <code>canvas</code>. Each elevator has a label, and also a informational popup that can be expanded. This information would currently be lost to assistive technologies. With AOM, you could define an accessibility tree containing all the labels and expanded states. These would then be conveyed to AT, so that users can understand them.</p> <h3>Good for testing</h3> <p>The AOM also aims to bring reading accessibility attributes. The intended use case: testing! With AOM, you would be able to access the names, roles and states of your HTML nodes directly in tests.</p> <p>Tests can already access an element’s ARIA information by reading out attributes today. With AOM, they would read out what something has actually computed to in the browser’s accessibility tree. This functionality has the potential to make tests better.</p> <h3>Accessibility Events</h3> <p>In JavaScript, we have a number of useful events that let us act on user input like clicks, keyboard presses and touch. In some cases, there is a discrepancy between such events and input from users of assistive technologies.</p> <p>In her talk <a href="https://www.youtube.com/watch?v=ZMZMMuXRFcE">Web Components and the AOM</a> at JSConf Asia 2019, Léonie Watson explained that actions like “swipe up” and “swipe down” mean different things to users of VoiceOver on iOS:</p> <blockquote> <p>When you have a screenreader running on a touch screen, the flick up and flick down gestures [developers] would probably use for adjusting the value of a slider, are already used for screenreader specific commands.</p> </blockquote> <p>Because screenreader users already use “swipe up” and “swipe down” gestures to trigger screenreader specific commands, it would be impossible for them to use the same gestures for something else in the app you’re developing. </p> <p>This is why AOM aims to bring events that are specific to assistive technologies, so that AT can design consistent ways to let the user perform certain actions. Apple calls these <a href="https://support.apple.com/en-us/HT209655">semantic events</a>.</p> <p>Some examples of accessibility events:</p> <ul> <li><code>increment</code> and <code>decrement</code> for going to the next item in a custom slider (like using up and down arrow keys)</li> <li><code>dismiss</code> for closing a modal overlay (like pressing <code>ESC</code> key)</li> </ul> <p>There is a large privacy concern associated with AT-specific events: malicious site owners could use them to detect if someone has a visual or mobility impairment.</p> <h2>Current status</h2> <p>The specifications for AOM are still in progress, and so are implementations. Various browsers have implemented (parts of) AOM). The part that seems to have most implementations is attribute reflection. This feature works for most attributes in Chrome and Edge (enable via <code>about:config</code>) and Safari (pick ‘Accessibility Object Model’ from Experimental Features setting in Developer menu). There is currently no AOM support not in Firefox. </p> <p>If you look at the <a href="https://w3c-test.org/wai-aria/idlharness.window.html">IDL tests</a> with AOM flags enabled, you can see how much your browser supports of the attribute reflection part of the specification.</p> <h2>Wrapping up</h2> <p>Simple solutions are often the easiest way to get your product to work for as many people as possible. For example, when for a date of birth field, you decide against a fancy, complex datepicker and rely on a clearly labelled <code>input[type=text]</code> instead. Standard, boring HTML goes a long way. Chances are it will work well for users and make your accessibility auditors happy. But if your product has custom controls that just don’t exist in HTML, you will want to convey the right accessibility properties to assistive technologies. </p> <p>AOM is an interesting new proposal in which accessibility information gets its own APIs beyond existing DOM methods like <code>setAttribute</code> and <code>getAttribute</code>. Those methods set and get out values that compute into properties of accessibility trees, but they don’t deal with those properties directly. It’s a subtle difference. With direct access to accessibility info, we could set accessibility properties without markup, we could create accessibility trees for things that don’t exist in the DOM (like for contents of <code>canvas</code> elements) and testing accessibility may improve.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/aom/">Meaning without markup: Accessibility Object Model</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Meaning without markup: Accessibility Object Model">Reply via email</a></p> Equality: a reading list 2019-08-23T00:00:00Z https://hidde.blog/equality-a-reading-list/ <p>The world isn’t as equal as it may seem to people who are white, heterosexual and able-bodied. This is a reading list about the inequality that they experience a lot less of. It has books about the everyday experiences of people who are underprivileged, what identity means, how racism and sexism manifest themselves and what we can do about that.</p> <p>A quick disclaimer: I’m not an expert in any of these subjects, just an interested reader. This selection is by no means exhaustive, but I hope it is helpful to others.</p> <p>Goldfish in bowls don’t know what water looks like, because they’re <em>in</em> water. That they cannot leave their bowl is a fact of their lives. The thing is… people sometimes have the same problem. When they look at society, they don’t always see all structures that exist within it. Structures like racism and sexism, for instance. </p> <p>The problem that is a common theme throughout all books in this list: people who aren’t affected by bad structures, often have a wildly unrealistic idea of what they mean and how common they are. Unlike goldfish though, those people have it relatively easy to peek outside of their bubble. Listening to or reading about what people with different perspectives experience is a good habit, and what I would encourage anyone with privilege to do. </p> <p>(If, reading this, you find yourself thinking “but I’m not privileged”, but you are white, male and/or heterosexual, you most likely <em>are</em>. Sorry.) </p> <p>When you’re better aware of inequality, you’re better equipped to speak up against it. <em>Why do I post this on my mostly tech blog?</em> Well, if a majority of tech workers is unaware of inequality <em>and</em> creates technology, we risk ending up with tech that reinforces inequality. That’s bad.</p> <img src="https://hidde.blog/_images/book-covers-how-to-be-right-why-im-no-longer-talking-to-white-peopel-about-race-white-fragiility-and-misogynation.png" alt="Book covers how to be right, why i'm no longer talking to white peopel about race, white fragiility and misogynation" /> <h2>Sexism is everywhere and always</h2> <p>Laura Bates started the <a href="https://everydaysexism.com/">Everyday Sexism</a> project, which collects experiences from women around the world. <em>Misogynation</em> is a collection of her essays about sexism, many of which draw from the experiences she collected as well as solid statistics. She answers a wide range of questions people may have about sexism, and provides excellent analysis of the phenomenon in the workplace, on our streets, at home, in healthcare, in politics and in education. I admire how she combines serious and humorous. Many feminists, Bates explains, get attacked for being ‘oversensitive’ and ‘too negative’, but this kind of response ’normalises and engrains the treatment of women as second class citizens, opening the door for everything else’. Yes. Providing an enormous range of examples, Bates shows that gender inequality is very real, often pretty ridiculous and that we should and can fight it successfully.</p> <p><em><a href="https://www.simonandschuster.co.uk/books/Misogynation/Laura-Bates/9781471169243">Misogynation</a></em> by Laura Bates (for some of the essays, see also: <a href="https://www.theguardian.com/lifeandstyle/series/laura-bates-on-everyday-sexism">Laura Bates on sexism in The Guardian</a>)</p> <h2>Racism is a system</h2> <p>Teaching workshops about racism in workplaces around the world, Robin DiAngelo noticed certain patterns in the attitudes of white people when confronted with racism and their part in it (everone has a part in it). They get defensive, angry and upset. She calls this white fragility: the phenomenon of white people unable to deal their racial stress. It’s painful to read about this, especially when compared to the actual problem: the experiences of people who are affected by racism itself. </p> <p>Racism is not a badly intended person being racist to another per se, it is the system, DiAngelo explains. It is our society in which wealth is not equally distributed between people from different races, and in which prejudice is concealed in euphemisms like “bad neighbourhood”. That system is shaped best for white people, therefore it you are white you benefit, whether you like (or want) it or not. DiAngelo explains it much better than I can, so I would really urge you to pick it up, and/or read <a href="https://alicebartlett.co.uk/blog/weaknotes-44-1">Alice Bartlett’s notes about White Fragility</a>, which inspired me to read it.</p> <p><em><a href="https://robindiangelo.com/publications/">White fragility: why it’s so hard for white people to talk about racism</a></em> by Robin DiAngelo</p> <h2>Blame the liars, not the lied to</h2> <p>James O’Brien is a radio presenter who talks to people phoning in from all across the UK. He found that a lot of his callers have been lead to believe falsehoods by cheap journalists that prioritise clicks and paper sales above truthseeking. His book <em>How to be right in a world gone wrong</em> is fundamentally about challenging their bogus arguments. This takes patience and confidence, neither of which O’Brien lacks in. If we don’t share them, we owe it to ourselves to challenge beliefs, myths and lies about subjects like LGBT rights, islam and Brexit. </p> <p><em>Blame the liars, not the lied to</em>, is the lesson in this book: O’Brien blames the media more than individuals who rely on them. If you can stand it that O’Brien is sometimes a bit full of himself —I think he does sufficient self-reflection, but that may be me being a non-native speaker of English— this is a very entertaining read. It may help in convincing less enlightened family, friends or acquaintances.</p> <p><em><a href="https://www.penguin.co.uk/authors/1083269/james-o-brien.html">How to be right in a world gone wrong</a></em>, by James O’Brien</p> <h2>A British perspective on race</h2> <p>In <em>Why I’m no longer talk to white people about race</em>, Reni Eddo-Lodge confronts us with a comprehensive account of the history of (British) racism and slavery, and describes heartbreaking accounts of racism in cities like Bristol. The reason that this is important, she explains, is that too many (white) people think there is no racism problem, which is largely because history of racism isn’t taught in most British schools and people don’t do enough self-study. If the title puts you off, definitely read it. The problem of talking to white people about race, Eddo-Lodge explains, is that they tend to not accept racism exist and make it about themselves instead. That wastes the time of people who want to fight racism, because they now need to spend it on arguments irrelevant to the actual issue. Eddo-Lodge kindly takes the time to articulate why there’s no such thing as reverse racism (true racism requires power) and what’s wrong with being colour blind (‘I don’t care which colour people are’ can easily be an attitude of denying racism, which only works if it doesn’t affect you, i.e. you have the privilege to be white). </p> <p>Like DiAngelo, Eddo-Lodge explains the fight against racism isn’t one against specific persons, i.e. nobody should feel personally threatened. It is about racism as a structure that has devastating consequences for people of colour, including lower grades, less benefit of the doubt, lower pay and less representation in the media. </p> <p><em><a href="https://www.bloomsbury.com/uk/why-im-no-longer-talking-to-white-people-about-race-9781408870570/">Why I’m no longer talking to white people about race</a></em> by Reni Eddo-Lodge (see also: <a href="http://renieddolodge.co.uk/why-im-no-longer-talking-to-white-people-about-race/">Eddo-Lodge’s original blog post</a>)</p> <h2>Racist search engines and algorithms</h2> <p>When <a href="https://time.com/5209144/google-search-engine-algorithm-bias-racism/">a friend told Safiya Umoja Noble</a> to do an online search for ‘black girls’, she was shocked to see what other suggested terms came up, and how that compared to searching for, say, ‘white girls’. It is excruciating. In her book <em>Algorithns of oppression</em>, Safiya Umoja Noble shows numerous shocking examples of how search engines contribute to more racism. She seems to put the blame on companies like Google for capitalising on racism, but with Ockham’s razor in mind I feel that could be unrelated, wouldn’t anyone who tries to index the web, also index the racism on it? But that’s not the point: when the first few pages of many search results in the largest search engine reinforce racial bias, a lot of people’s online information gets racially biased. Search engines could do something about this problem and have both the technical possibilities and moral obligation. Especially because the problem is likely to be much bigger when applied to other algorithms. Racial bias in systems that make decisions for the police for example, for instance, see also <a href="https://www.technologyreview.com/s/607955/inspecting-algorithms-for-bias/">Inspecting algorithms for bias</a> in MIT Technology Review and <a href="https://www.nytimes.com/2015/07/10/upshot/when-algorithms-discriminate.html">When algorithms discriminate</a> in The New York Times. The author’s point is solid, but I wasn’t a big fan of the argumentation or writing style.</p> <p><em><a href="http://algorithmsofoppression.com/">Algorithms of oppression: how search engines reinforce racism</a></em>, by Safiya Umoja Noble (see also: <a href="https://www.youtube.com/watch?v=UXuJ8yQf6dI">Safiya Umoja Noble’s TED talk</a>)</p> <img src="https://hidde.blog/_images/book-covers-making-of-a-man-algorithms-of-oppression-the-lies-that-bind.png" alt="Book covers making of a man, algorithms of oppression, the lies that bind" /> <h2>Making of a man</h2> <p>Trans people get asked odd questions, philosopher/writer Maxim Februari explains in <em>De maakbare man</em> (in Dutch, translations available), so he decided to write this short book to answer some of them. While he’s at it, he also critiques various legal and administrative burdens trans people face, and how our world is shaped by specific norms when it comes to sex and gender. Februari’s first person account is a great introduction to transsexuality. Interesting notes on the absolute inappropriateness of certain questions, the difference between sex and gender and what some of his environment’s responses were to Februari’s transition. </p> <p><em><a href="https://uitgeverijprometheus.nl/catalogus/de-maakbare-man-3.html">De maakbare man: notities over transseksualiteit</a></em> by Maxim Februari (Dutch, available in English as <a href="https://www.press.uchicago.edu/ucp/books/book/distributed/M/bo20174118.html">Making of a man</a>)</p> <h2>Are identities a lie?</h2> <p>People feel part of their identity, behave according to it and are treated in specific ways because of it. Yet, as the Ghanese-British philosopher Kwame Appiah shows in <em>The lies that bind</em>, reality is more complex than identities based on gender, class, creed (religion), colour, country and culture suggest. They bind people together, but they are also made up. In his very eloquent book, Appiah shows that none of these concepts refer really to one thing: there’s no such thing as having an English, gay or Muslim identity, because all three can vary wildly depending on time and place. He can know it, as someone who has many different identities. While many of the books in this list talk in terms of identity, this one provides excellent and thought-provoking analysis of what that means.</p> <p><em><a href="http://appiah.net/books/carousel/">The lies that bind</a></em> by Kwame Anthony Appiah (see also: <a href="https://www.bbc.co.uk/programmes/articles/2sM4D6LTTVlFZhbMpmfYmx6/kwame-anthony-appiah">Appiah’s Reed lectures about the same subject</a>, also available as a podcast)</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/equality-a-reading-list/">Equality: a reading list</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Equality: a reading list">Reply via email</a></p> Managing accessibility in open source CMSes: a write-up 2019-09-03T00:00:00Z https://hidde.blog/managing-accessibility-in-open-source-cmses-a-write-up/ <p>Last week, I attended a meetup that was about the accessibility of not just one CMS, but two: WordPress and Drupal. It brought together people from both communities to talk about their accessibility efforts. Because CMS accessibility can make a huge difference. It was kindly organised by Level Level, a WordPress consultancy in Rotterdam.</p> <p><em>Disclaimer: I work on authoring tool accessibility at the W3C/WAI, this write-up is in my personal capacity, views are, as always, my own.</em></p> <p>Short introductory talks were given by Rian Rietveld, former WordPress accessibility lead, and Mike Gifford, “godfather of Drupal accessibility”, who visited from Canada. They talked about how they moved their respective communities towards doing (a lot) more work on accessibility.</p> <p><img alt="How can we help each other? Hashtag DrupalWPa11y" src="https://hidde.blog/_images/slide-how-can-we-help-each-other-hashtag-drupalwpa11y-rian-and-mike.jpg" /> <em>Rian and Mike</em> </p> <h2>WordPress and catching up (Rian)</h2> <p>Rian explained that back in 2011 a lot of accessibility discussions in WordPress were still of the “why is it important” and “raising awareness” kind. Rian wanted it all to be more practical and focused on getting things done. The time seemed right, because more people got interested in the subject, partly because accessibility legislation was about to get stricter. Something else that helped was that the WordPress Slack community just started and turned out to be great for facilitating conversations. In 2016, WordPress announced:</p> <blockquote> <p>All new or updated code released into WordPress core and bundled themes must conform with the WCAG 2.0 guidelines at level AA. </p> </blockquote> <p>(see: <a href="https://make.wordpress.org/accessibility/2016/03/21/wordpress-goes-wcag/">WordPress goes WCAG</a>)</p> <p>Things got complicated around the release of Project Gutenberg, a new block based content editor. It was pushed by Automattic, the company of WordPress’ inventor Matt Mullenweg that also dedicates a lot of its developers to WordPress core, as it would strategically bring WordPress in line with other modernised forms of content editing. This type of content editing is hard to get right.</p> <p>For the accessibility team, Gutenberg was extremely tricky, Rian explained, because of the process: first features were developed, then designed, then accessibility checked. This order of things made that the accessibility team would always have to play catch up, in a fast moving project. The accessibility team warned about issues in the editor from the very start, but it was hard to catch up with the speed of development and convince people of the need for accessibility. Rian left the team when it became clear that Gutenberg would be included into WordPress without the accessibility issues addressed. </p> <p>An accessibility audit of the Gutenberg editor was then <a href="https://wpcampus.org/audit/">crowdsourced</a>, hundreds of issues were found and filed in GitHub. They are being addressed, but there are still many issues, and the catch up problem seems to have remained unsolved. <a href="https://twitter.com/boemedia">Monique</a>, who is in the core design team now, mentioned that she notices more designers and developers ask accessibility questions earlier on in the process, which is hopeful.</p> <p>Others mentioned the active accessibility community on WordPress Slack, that makes a difference by checking core code as well as plug-ins and themes. This is something WordPress has had for a while, but it is still “catching up” rather than “considered from the start”, which one would hope WordPress would do more, as it often ends up being cheaper and easier. The <a href="https://wpgovernance.com/">WordPress governance project</a>, that includes accessibility, may help with this, and improve how the efforts of the accessibility team are supported.</p> <h2>Drupal and ATAG (Mike)</h2> <p>Mike talked about how, in 2008/2009, he started looking into Drupal accessibility, because he had known people in the disability rights scene for years and wanted to apply what he knew to Drupal. He filed accessibility issues, and found it oddly addictive to tag them and get them in the issue queue.</p> <p>Mike explained that, some years ago, Drupal’s founder Dries Buytaert had identified a number of “gates” for Drupal quality control: </p> <blockquote> <p>Core changes must pass through a series of “gates” to ensure their quality is up to standards. Gates are essentially “checklists” that can be used to evaluate a patch’s readiness, by both developers and patch reviewers/core committers.</p> </blockquote> <p>(see: <a href="https://www.drupal.org/core/gates">Drupal core gates</a>)</p> <p>Accessibility is one of those gates, others include performance and usability. Needless to say, being one of the gates helped ensure accessibility throughout the ecosystem.</p> <p>Drupal publicly committed to being WCAG AA, see <a href="https://dri.es/drupal-commitment-to-accessibility">Drupal’s commitment to accessibility</a> on Dries Buytaert’s blog. Mike said accessibility work in Drupal was focused on not just the front-end, but also the back-end (just like in WordPress): they want to make Drupal itself accessible. The standard to follow for that kind of accessibility is <a href="https://www.w3.org/WAI/standards-guidelines/atag/glance/">ATAG</a>, which Mike put a lot of effort in promoting within the Drupal community. </p> <p>For those who are unfamiliar, ATAG has two parts: part A is about accessibility of the CMS so that content editors with disabilities can use it, part B is about improving the accessibility of output, so that web users with disabilities can use the resulting website. In Drupal 7, Mike said, they more or less met part A of ATAG, in Drupal 8, they tried to incorporate as much as possible of part B.</p> <p>A major driver for improving accessibility in Drupal, Mike explained, was the idea of scale: rather than do work to fix one website, they did work to fix a platform that is used on 3% of the web. Yes, this is awesome about making CMSes more accessible: you’re potentially improving a lot of sites at once. This also gives the team some leverage when, say, talking to a browser vendor about a specific bug, then you would normally have as the owner of just one site.</p> <h2>Challenges and solutions</h2> <p>After hearing Rian and Mike talk about their experiences in their respective community, we talked about various interesting subjects: </p> <ul> <li>is it possible to educate all developers in the world about basic accessibility, or should we ensure that’s built into libraries and CMSes? The latter could be super effective and help teach people where they are</li> <li>adding to the previous question, Mike said governments could take this up: as they use a lot of open source software and are paid with tax money, why not spend some of their resources on contributing accessibility improvements (as in: code) back to the open source projects they use?</li> <li>in procuring websites and CMSes, is it sufficient to ask for WCAG compliance? Mike suggests to ask more questions than that, see his <a href="https://github.com/mgifford/a11y-contracting">Accessibility Contracting Best Practices</a></li> <li>what’s the role of ATAG in this? Mike said we give content editors a lot of power, but not enough guidance. Implementing the B part of ATAG in CMSes can help here. It does seem harder to do than WCAG, he said, because the effects of (and investment in) ATAG improvements are much earlier in the process, they are about what it’s like for the content editor and how they are encouraged.</li> <li>Mallory, in the audience, mentioned the work that Greg Whitworth is doing on <a href="https://www.gwhitworth.com/blog/2019/07/form-controls-components/">standardising form controls</a>, people were excited for the potential of this project to make one common accessibility issue go away</li> <li>we talked briefly about <a href="https://www.nuance.com/dragon.html">Dragon Naturallyspeaking</a>, an assistive technology that is often forgotten about when testing the accessibility of user interfaces</li> </ul> <p>It was an interesting and constructive evening, with many experiences shared and plenty to think about. It’s clear that CMSes can play a huge role in making the web more accessible. One the one hand, for <strong>end users</strong> of the web: by encouraging and explaining content editors, implementing automated checks and high quality HTML output (this depends on many things, like templates used and also the very nature of WYSIWYG). On the other hand for <strong>content editors</strong>, by being usable for content editors with disabilities.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/managing-accessibility-in-open-source-cmses-a-write-up/">Managing accessibility in open source CMSes: a write-up</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Managing accessibility in open source CMSes: a write-up">Reply via email</a></p> Book review: Zed 2019-09-19T00:00:00Z https://hidde.blog/book-review-zed/ <p><a href="http://joannakavenna.com/zed/">Zed</a> by Joanna Kavenna is a dystopian satire, set in a future Great Britain, where a tech giant called Beetle runs most of society. Their ‘lifechain’ product is able to predict the future, which the justice department uses to prosecute people for future crimes (very Minority Report). They also deal in currency (BeetleBits), transport (Mercury cars), virtual assistents (Veeps) and VR (Real Virtuality). </p> <p>Beetle’s CEO, Guy Matthias, is one of those tech CEOs that Sillicon Valley seems to have way too many of. Before he addresses a conference in Davos, he orders his robot to read Thomas Mann’s <em>Magic mountain</em>, and distill a funny opening from it. When he needs a date for a dinner party, he checks out the expected success rate.</p> <p>Beetle takes pride in that they’ve created a reality where everything can be predicted and determined by smart algorithms… except it can’t, it sometimes fails. Of course it does. Those who insist we should <a href="https://theguardian.com/technology/2019/sep/17/tech-climate-change-luddites-data">compute every aspect of our lives</a> clearly fail to truly understand every aspect of our lives.</p> <p><em>Zed</em> is an excellent novel about what could go wrong if big technology corporations have too much power and not enough humanities majors in their leadership. It is very resemblant of the real world: Facebook who want to introduce a currency, Uber who try to reinvent transport… the list goes on.</p> <p>Someone on Goodreads called it ‘<a href="https://www.goodreads.com/review/show/2933014515">the fictional extension of Zuboff’s Surveillance Capitalism</a>’, which I think is apt. I would warmly recommend this to people who are interested in a critical look at the tech industry. See also the <a href="https://www.theguardian.com/books/2019/jul/28/zed-by-joanna-kavenna-review">review in The Observer</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/book-review-zed/">Book review: Zed</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Book review: Zed">Reply via email</a></p> Notes from the Internet Health Report 2019 2019-09-21T00:00:00Z https://hidde.blog/notes-from-the-internet-health-report-2019/ <p>This week I read (the <a href="https://internethealthreport.org/library-shelves-get-ready-the-internet-health-report-is-a-book/">print-version</a> of) the Internet Health Report 2019, published by the Mozilla Foundation about issues that potentially stand in the way of a web that ‘puts people first’. With the phrase ‘putting people first’, the report means ensuring aspects like safety, openness, inclusion and control. Some of these things improved in the past years, some less so than one would have hoped.</p> <p><img alt="Book internet heath report against backdrop of blue sky, river and trees" src="https://hidde.blog/_images/715d4bb5-819d-45e5-ad73-f6953b3b07e7.jpeg" /> <em>I read it by the waterside on my holiday</em></p> <p>The Internet Health Report is edited by <a href="https://mobile.twitter.com/solanasaurus">Solana Larsen</a> for Mozilla Foundation and puts together input from hundreds of readers and experts in an extremely readable format. Or multiple formats, really, as there is the website, the ebook and (new this year) a printed edition. The print version definitely helped me read the full thing. Everyone is invited to participate:</p> <blockquote> <p>this publication is neither a country-level index nor a doomsday clock. We invite you to join us in assessing what it means for the internet to be healthy, and to participate in setting an agenda for how we can work together to create an internet that truly puts people first</p> </blockquote> <p>(From the <a href="https://internethealthreport.org/2019/about/">README</a>)</p> <p>In <a href="https://internethealthreport.org/its-complicated-mozillas-2019-internet-health-report/">his update</a>, Mozilla Foundation’s Mark Surman calls out three things that improved: calls for privacy are becoming more mainstream, people start to speak up about and work on more responsible AI and a healthy discussion about big tech is taking place among more and more people. Some things also got worse, Surman writes: there is more internet censorship, biometrics are being abused and increased AI usage specifically affects minorities because of bias, despite efforts like ethics boards.</p> <p>This post has some of the things that piqued my interest, with links. For the full content, including all sources and links, get the <a href="https://www.transcript-verlag.de/978-3-8376-4946-8/internet-health-report-2019/">printed edition</a> or visit the <a href="https://internethealthreport.org/2019">Mozilla Internet Health Report 2019 website</a>, where you can read everything or just the things you’re interested in. There is also a <a href="https://d20x8vt12bnfa2.cloudfront.net/2019/2019InternetHealthReport_shortversion.pdf">PDF of the short version</a>.</p> <h2>Data: this year’s spotlight</h2> <p>In the spotlight section, the Internet Health Report features three articles that all have something to do with data.</p> <h3>AI</h3> <p>‘Use of AI is skyrocketing (for fun, as well as for governance, military and business) and not nearly enough attention is paid to the associated risks’, says the report. Governments start to use AI in military, for immigration decisions and for surveilling citizens, places one can imagine (racial) bias can cause serious harm. OpenAI decided not to release a trained data set as they worried about malicious uses of the technology. Some companies founded ethics boards to govern their AI usage, but they are often big companies with, inevitably, competing priorities. See also: <a href="https://internethealthreport.org/2019/lets-ask-more-of-ai/">Let’s ask more of AI</a></p> <h3>Cities</h3> <p>Data is useful for cities to base their policies on, and are somewhat envious of the ‘data monopoly’ big tech companies like Uber and AirBnB have. Some only give permission to do business on the condition of getting access to businesses’ data. See also: <a href="https://internethealthreport.org/2019/the-power-of-cities/">The power of cities</a></p> <h3>Ads</h3> <p>Paying for products with your personal data threatens freedom and human rights, because the algorithms that let companies do targeted advertising, can also be exploited by people with bad intentions. Some change is happening: Facebook, Twitter and Google all took some action against abuse after public pressure and new legislations. Lots of browsers now protect against tracking and/or block ads. Companies also start to realise targeting and knowing everything about everyone doesn’t necessarily make them more effective. See also: <a href="https://internethealthreport.org/2019/rethinking-digital-ads/">Rethinking digital ads</a></p> <h2>Safety</h2> <p>More and more awareness around privacy on the web is raised; by the campaigns of non profits like the EFF and Mozilla, but also by numerous data leaks that got into mainstream news and GDPR, the European data protection legislation that affects pretty much all businesses that are online. Tracking protection has become something browsers compete on (Firefox and Safari are ahead in this game), and even Facebook’s CEO announced that they now care about privacy.</p> <ul> <li>While anonymity online can be abused by criminals, it is also absolutely worth defending and an important tool for whistleblowers reporting on corruption, or for people whose government oppresses them. See also: <a href="https://internethealthreport.org/2019/in-defense-of-anonymity/">In defense of anonymity</a></li> <li>If you don’t want big tech to have your data, you just don’t give it, right? Well, Katarzyna Szymielewicz has a <a href="https://en.panoptykon.org/articles/three-layers-your-digital-profile">useful metaphor of three layers of data</a>: the first is data you share and control, the second is behavioral data and metadata that others collect (if you want to control this, you need expertise) and the third is what machines think about you (we have no control, because they are the result of companies combining data with algorithms we often can’t see). See also: <a href="https://internethealthreport.org/2019/show-me-my-data-and-ill-tell-you-who-i-am/">Show me my data and I’ll tell you who I am</a></li> </ul> <h2>Openness</h2> <p>The web has always been fundamentally open. Imagine starting a new website required a government issued permit, or that getting onto any website required a certain kind of education, nationality or payment… Worldwide, this openness is threatened, as there exist walled gardens, social media taxes and shutdowns.</p> <ul> <li>Governments who want to frustrate their citizens’ communications used to turn off the whole internet, but this was relatively easy to detect (for instance, by organisations protecting human rights), so they try out other tactics, like shutting down the internet in just one region or slow it down instead of turning it off. See also: <a href="https://internethealthreport.org/2019/internet-slowdowns-are-the-new-shutdowns/">Internet slowdowns are the new shutdowns</a></li> <li>Various African countries now have taxes on using social media and messaging apps (Uganda), VOIP (Zambia) and even blogging and vlogging (Tanzania). See also: <a href="https://internethealthreport.org/2019/taxing-social-media-in-africa/">Taxing social media in Africa</a></li> <li>Germany implemented a law against online hate speech and harrassment, which can force social media companies to take down certain content. Some call for web companies to be open about who reported content and how complaints are handled. See also: <a href="https://internethealthreport.org/2019/inside-germanys-crackdown-on-hate-speech/">Inside Germany’s crackdown on hate speech</a></li> <li>Wikidata, a project by the non-profit behind Wikipedia, offers lots of volunteer-created structured data. Technology firms who make voice assistants get a lot of value from this. Despite that, vast majority of donations is still from individuals, and only 4% from corporations. See also: <a href="https://internethealthreport.org/2019/wikidata-gives-wings-to-open-knowledge/">Wikidata gives wings to open knowledge</a></li> </ul> <h2>Inclusion</h2> <p>Is the internet a level playing field yet for people from all backgrounds? This question has multiple sides to it: it is about how online communities fight harrassment and abuse, and about the working conditions of people who make internet hardware.</p> <ul> <li>Women and women of colour in journalism are (still) much more likely to be harrassed online than men, various study showed. See more: <a href="https://internethealthreport.org/2019/women-journalists-feel-the-brunt-of-online-harassment/">Women journalists feel the brunt of online harassment</a></li> <li>Contributors to open source projects that power a lot of the world are often a homegeneous group. That’s bad as code is not neutral and i.e. biased towards the people who write it. Strictly enforced code of conducts are appreciated by underrepresented groups, have helped community members call out bad behaviour and are therefore a helpful instrument in trying to make open source communities more diverse. See also: <a href="https://internethealthreport.org/2019/codes-of-conduct-in-open-source-communities/">Codes of Conduct now guide open source communities</a></li> </ul> <h2>Web literacy</h2> <p>Do people understand the web well enough to make informed choices about things like sharing baby photos and recognising fake news? Do we understand it well enough to use it to people’s benefit, for example as a platform for activists to collaborate on?</p> <ul> <li>3101 people from 124 countries worked together analysing footage, interviews and expert analysis in a project called <a href="https://decoders.amnesty.org/projects/strike-tracker#decode-results">Decoded</a>, to show that the US-led coalition’s bombing of the Syrian city of Raqqa costed not 23 civilian deaths, but over 1500. See also: <a href="https://internethealthreport.org/2019/decoding-images-of-war-in-syria/">Decoding images of war in Syria</a></li> <li>User tracking and targeting employed for manipulation of public opinion with fake news threatens democracy. Cambridge Analytica was not only involved with influencing the British and US electorates, but also worked in many other countries, including Kenya, Brazil and Mexico. For this year’s European Election, Google, Twitter, Facebook and Mozilla pledged to do somethimg about this, signing the European Commission’s Code of Practice on Disinformation. See also: <a href="https://internethealthreport.org/2019/the-challenge-of-democracy-in-the-digital-era/">The challenge of democracy in the digital era</a></li> <li>Are we addicted to the internet? Research that showed Americans spend 6 hours a day on their devices and (other research) showing maintaining a user’s attention as a design principle seem to suggest so. That’s probably not time well spent. In the meantime Apple and Facebook introduced features to limit screen time. See also: <a href="https://internethealthreport.org/2019/breaking-free-of-the-addiction-machine/">Breaking free of the addiction machine</a></li> </ul> <h2>Control</h2> <p>Should the web be controlled by few or many? In other words, should power lie with a couple of companies that everything centers around, or do we want the web to be more decentralised? The Internet Health Report 2019 contains lots of good arguments for decentralisation.</p> <ul> <li>There’s the question of ‘who (literally) controls the internet’. The cables deep under the sea that make the web work used to be built by telecom cariers in the early 90s, but are now invested in by private companies like Google, Facebook, Amazon and Microsoft (who, in 2018, owned or leased over 50% of these cables between them). See also: <a href="https://internethealthreport.org/2019/the-new-investors-in-underwater-sea-cables/">The new investors in underwater sea cables</a></li> <li>For Uber, and many ‘unicorn’ companies like it, the structure of ‘everything (taxi rides, etc) goes through our company’, ie centralisation, is what gets their investors’ hope for returns up. Fine, that’s capitalism. But the model gets in the way of others providing alternatives or putting users in control. This is an issue when such companies have become utilities, says Nathan Schneider. These companies would probaby do things very differently if their users owned them, in which case they would only have to consider user interests. See also: <a href="https://internethealthreport.org/2019/what-if-facebook-were-owned-by-its-users/">What if Facebook were owned by its users?</a></li> <li>The largest five internet companies make money by selling user’s attention to advertisers (Google, Facebook and Baidu), selling devices (Microsoft and Apple), being a middle man (Amazon and Alibaba) and doing lots of things from payments to in-app purchases to ads (WeChat parent company Tencent). See also: <a href="https://internethealthreport.org/2019/how-the-biggest-internet-companies-make-money/">How do the biggest internet companies make money?</a></li> <li>Nextcloud is an effort to create an open source cloud, but unlike with traditional open source software it is not cheaper (free) compared to alternatives, it costs more (because you need to pay for hosting somewhere). See also: <a href="https://internethealthreport.org/2019/an-open-source-alternative-for-the-cloud/">An open source alternative for “the cloud”</a></li> </ul> <p>I learned a lot from reading the Internet Health Report 2019, from great new initiatives to serious problems that I wasn’t aware of. As a reader of this blog, I invite you to dive in yourself, too!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/notes-from-the-internet-health-report-2019/">Notes from the Internet Health Report 2019</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Notes from the Internet Health Report 2019">Reply via email</a></p> Breaking barriers with your CMS 2019-10-21T00:00:00Z https://hidde.blog/breaking-barriers-with-your-cms/ <p>A couple of weeks ago, I joined the Fronteers Jam Session to talk about something that I’ve been working on in the last couple of months: the ways in which CMSes can bring accessibility benefits. This is a written version of that talk.</p> <p>Note that these are just some examples of things that CMSes can do… truth is, I only had ten minutes. But still, I’m hoping more people will think of CMSes as accessibility accelerators, as there is lots of potential! </p> <h2>From one block of content to lots of content blocks</h2> <p>As an industry, we have gotten a lot better at designing content on the web since the early days. Away are the times of boring looking documents with little white space and ineffective typography. </p> <p><img alt="Lots of text on a white background" src="https://hidde.blog/_images/screenshot-2019-10-21-at-19.23.21.png" /> <em>We have gotten better at web design since this. </em> </p> <p>Part of why we got better, is that modern CSS has gotten some exciting new features in recent years. We now have things like variable fonts, HSL colours, blend modes and floats that are not rectangular. And of course, there’s this now widely supported new lay-out mode: Grid Layout. It lets us be intentional about white space. We can lay content out in ways that we truly did not have before.</p> <p>Something else that has changed is how we thing about what we are designing. Thanks to the work of people like Alla Kholmatova (<a href="https://designsystemsbook.com/">Design Systems</a>) and Brad Frost (<a href="http://atomicdesign.bradfrost.com/">Atomic Design</a>), we have, as an industry, started to think about our work in terms of components or patterns… distinct pieces of functionality, rather than full, all-encompassing pages.</p> <img alt="Book covers: on the left Design Systems, on the right Atomic Design" src="https://hidde.blog/_images/books2.png" /> <p>This leaves us with a new content management challenge. Previously, these long documents could be edited with one big block of WYSIWYG-text. Components require something different, you would probably create fields for every bit of data they contain. </p> <p>A teaser component might have fields for a title, sub title, call to action text and link destination, for instance. For front-end developers, that might mean you can have all this data as strings, and wrap it in whatever HTML makes most sense. This isn’t necessarily new or recent, many CMSes have had this option for years, and it is has become the standard in headless systems. But still, many large organisations don’t. </p> <p><img alt="edit teaser screen with three fields: title, subtitle, link text" src="https://hidde.blog/_images/teaser.png" /> <em>Example component-specific edit screen</em> </p> <p>There is also a different content management trend that addresses our new component-based world: visual editors. Or, as they’re sometimes referred to: “no code editors”. This might sound worrying to all front-end developers, because when you wrap markup around data, you can do all sorts of good for performance, code quality and accessibility. Having a system deal with all of that automatically is… scary? And what about accessibility specifically, what if this harms actual users?</p> <p>I could turn this question around… what if CMSes benefit actual users, by having accessibility built in?</p> <h2>The accessibility standard for CMSes</h2> <p>Accessibility standards consider CMSes as part of a larger group, that also includes other tools, like Learning Management Systems (LMS), wikis, social media, WYSWIYG editors, ”Save as HTML” functionality… basically everything that creates web content or facilitates the creation of HTML. These <em>tools that create web content</em> are also known as <em>authoring tools</em>. They can potentially improve a lot of accessibility at once.</p> <p>Among a number of <a href="https://www.w3.org/WAI/standards-guidelines/">standards and specifications</a>, the W3C has published three standards for web accessibility (“Accessibility Guidelines”): </p> <ul> <li><a href="https://www.w3.org/WAI/standards-guidelines/wcag/">WCAG</a> is for web content, adopted by governments worldwide</li> <li><a href="https://www.w3.org/WAI/standards-guidelines/uaag/">UAAG</a> is for browsers (“user agents”)</li> <li><a href="https://www.w3.org/WAI/standards-guidelines/atag/">ATAG</a> is for authoring tools, like CMSes</li> </ul> <p>So yes, there is a standard specifically about the accessibility of authoring tools, including CMSes and other things that produce HTML (see also: <a href="https://hidde.blog/content-creation-accessibility/"> ATAG: the standard for accessibility of content creation</a>). </p> <p>There are two things that ATAG requires from CMSes: they should be <strong>accessible themselves</strong> (i.e. work for people with disabilities), and they should <strong>encourage accessibility</strong> (i.e. produce and assist content editors with producing accessible output).</p> <h2>The editing experience</h2> <p>Creating an accessible editing experience means that people with disabilities have no barriers to create content: they can use the buttons, understand relevant context and access the interface with the input method that works for them. </p> <p>To give some examples, and yes, these also exist on websites that are not CMSes:</p> <dl> <dt>Accessible names</dt> <dd>A common accessibilitity issue is that the buttons in the interface are visually just icons. To make those work for users of assistive technologies, it is important that they have proper labels or accessible names. More about this in <a href="https://hiddedevries.nl/en/blog/2019-04-18-naming-things-to-improve-accessibility">Naming things to improve accessibility</a></dd> <dt>Keyboard accessibility</dt> <dd>Something else that is common in CMSes is that they require a mouse to be fully used. By ensuring keyboard accessibility, you can make the interface work for various groups of people. This includes indicating what has focus. See also: <a href="https://hiddedevries.nl/en/blog/2019-06-06-indicating-focus-to-improve-accessibility">Indicating focus to improve accessibility</a></dd> <dt>Zooming</dt> <dd>Some users will be using the CMS interface with their screen set to zoom in considerably, say 200 to 300 percent. This works well in the type of text documents I discussed at the start. On the web, text just reflows. It becomes more tricky in complex CMS interfaces, because there could be floating and sticky things that overlap with content when zoomed too much. See: <a href="https://webaim.org/resources/evalquickref/#scaling">Test content scaling</a></dd> </dl> <p>An interesting overview of what accessibility issues could look like in a real CMS is <a href="https://wpcampus.org/2019/05/gutenberg-audit-results/">the crowdsourced accessibility audit that was done for WordPress’ new Gutenberg editor</a>. As someone who is interested in the accessibility of content management systems, I am grateful that this was released publicly, this way everyone can learn.</p> <h2>The output</h2> <p>Apart from breaking barriers in the editing experience, we can also break barriers for users of the actual website. If we improve how HTML is produced by a CMS, we can potentially make a difference for all pages and sites produced by it.</p> <h3>Alt attributes</h3> <p>Most front-end developers will be aware images require alternative text in their <code>alt</code> attribute (or a <a href="https://www.w3.org/WAI/tutorials/images/decision-tree/">conscious decision to leave it blank</a>). Yet lots of websites lack it on some of their images. I don’t think this is because people aren’t aware of what the <code>alt</code> attribute is for. This could simply be a responsibility issue: the developer only built the template, the content editor only used the template, etc… Somewhere in between the attribute did not get shipped to the user.</p> <p>The CMS could be smart about this. It could: </p> <ul> <li>throw an error for missing alt attributes when an editor saves a page</li> <li>provide information on what makes a good alt text </li> <li>come with a checkbox that says “This needs no alternative, it is a decoration or already covered in other text”</li> <li>throw an error if someone tries to link an image that has no <code>alt</code> (because <code>alt</code> attributes can become link texts)</li> </ul> <h3>Spelling</h3> <p>If you’ve accidentally used “Swbmit” as a button text, that might not impact visual users so much, as they will probably see from the visual context what the word should be. For someone using a tool like <a href="https://en.wikipedia.org/wiki/Dragon_NaturallySpeaking">Dragon NaturallySpeaking</a>, which lets users tell their computer which buttons to click, the mismatch could be more problematic. For someone who uses a screenreader, it could also be annoying to have misspelled content, because if it is misspelled, it will get mispronounced , too.</p> <p>What if the CMS had a built-in spelling checker? That way, we could identify issues before they exist, and fix them before they get shipped to the user. </p> <h3>Colour contrast</h3> <p>When your site uses that design pattern where there is a text layed over a photo, it matters a lot what the photo is. Is it a dark-ish photo with light text on it, or are text and photo both light? The latter could lead to super low contrast, and with that, barriers for all sorts of users. This can affect people with various kinds of visual impairments, but also people who are outside in the sun, or those who have turned Brightness on their phone down to safe battery life.</p> <p>Colour contrast issues can be programmatically detected, so why not do it right in the CMS? After uploading a new header image, the CMS could do a quick contrast check and display an error if the page no longer meets the criteria. Again, we could identify issues before they exist, and fix before shipping.</p> <p>Whether it be with automated checks, carefully crafted content editing screens, extensive documentation of accessibility features… if we manage to bring some of our accessibility fixing to the CMS, we may be able to prevent barriers from shipping to users. </p> <h2>Conclusion</h2> <p>As front-end developers, we are all involved in the creation of web content. With this post, I hope to have given some examples of how CMSes can help create more accessible web content. Of course, it is just a couple of examples… but I think there are CMS-based solutions like this for a lot of different accessibility problems that we see on the web today. To be continued!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/breaking-barriers-with-your-cms/">Breaking barriers with your CMS</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Breaking barriers with your CMS">Reply via email</a></p> Tech vs society: a reading list 2019-12-03T00:00:00Z https://hidde.blog/tech-vs-society-a-reading-list/ <p>Within the bubble of technologists, the future looks bright and exciting. Outside of it, worried scholars and publicists have written a lot of books about the <em>dangers</em> of Big Tech, surveillance and the power of the market. This is a list of some interesting reads to better understand the impact of technology on society.</p> <p>This may sound depressing, and it is, to some extent. The world is doomed and it is technologists’ fault! But when we understand better how technology, the tech sector and “computational thinking” fit in the context of society, it will get easier to decide whether we should push back.</p> <p>As always, this reading list is what I happened to read on the subject, there are lots of other interesting publications out there.</p> <h2>How power dynamics changed</h2> <p>I already <a href="https://hiddedevries.nl/en/blog/2019-03-06-book-review-the-age-of-surveillance-capitalism">wrote about The Age of Surveillance Capitalism</a> before, but I wanted to re-include it here. This book really ought to be the first item on a list of books about how tech impacts society. It defines “surveillance capitalism” and shows its workings in great detail. As I said in my review, it is not a quick read, but absolutely recommended for anyone who works in tech. We’ve got to understand this if we want to make things right.</p> <p><em><a href="http://www.shoshanazuboff.com/new/the-age-of-surveillance-capitalism-comments-and-reviews/">The Age of Surveillance Capitalism</a></em> by Shoshana Zuboff</p> <img src="https://hidde.blog/_images/permanent-record-dont-be-evil-the-age-of-surveillance-capitalism.png" alt="Permanent Record, Dont be evil, The Age of Surveillance Capitalism" /> <h2>A critique of “disruptive” technologies</h2> <p>In his fantastic <em>Radical Technologies</em>, “to be played at maximum volume” as the last page says, Adam Greenfield explains and critically evaluates a wide range technologies that are supposedly the future, including internet of things, augmented reality, blockchain, 3D printing and machine learning. His angle is not “wow, exciting!”, but ”what is this, is it really as good as promised, and how will large-scale deployment impact society?”. I wish we would all adapt the same mindset when assessing new tech, because there are many reasons to oppose these “radical” technologies. Blockchain doesn’t scale, internet of things devices have major security and privacy implications and machine learning is, despite many practical applications, often not fully misunderstood (as people tend to forgot that data is not neutral, not objective and always a subset of reality). The book ends with a number of future scenarios, ranging from utopias to dystopias, which help ask the question: “what do we want a tech-driven society to look like?”</p> <p><em><a href="https://speedbird.wordpress.com/my-books/">Radical Technologies</a></em> by Adam Greenfield</p> <h2>Has Big Tech lost its soul?</h2> <p>Many of Silicon Valley’s big companies once started with idealistic mantras and values, like ‘Don’t be evil’ and ‘Information wants to be free’, but the tide has turned. The book shows how (excerpt from the cover):</p> <blockquote> <p>a world where “information wants to be free” became one in which we are the product being monetized, how the geeks tinkering with motherboards in their basements grew to be arrogant billionaires monopolizing the lion‘s share of the economy, and how the “democratized” internet we were promised can threaten the very fabric of our democracy. </p> </blockquote> <p>Foroohar brilliantly explains where it went wrong. Tech companies made their products extremely addictive with the help of behaviorist psychology. Secondly, they have become monopolies in ways we haven’t seen before by both creating the market and operating in it. Thirdly, they got heavily involved in government with far-reaching lobbying for tax cuts and deregulation and by lending their targeted advertising platforms (as well as their consultants (!) for advice) to political campaigns. All of this is enabled and strengthened by surveillance capitalism. </p> <p>Foroohar backs up her arguments with extensive research, and provides solutions, too. Is it depressing? Well, slightly, but it certainly left me with the feeling that having the picture painted so clearly will help address it. </p> <p><em><a href="https://www.ranaforoohar.com/books">Don’t Be Evil - The Case Against Big Tech</a></em> by Rana Foroohar</p> <h2>What government surveillance looks like</h2> <p>The extent of Big Tech’s collection of personal data may be extraordinary, but the government’s mass surveillance programs are as disturbing, as <a href="https://en.wikipedia.org/wiki/Global_surveillance_disclosures_%282013%E2%80%93present%29">Edward Snowden’s 2013 revelations</a> have shown in great detail. In <em>Permanent Record</em>, Snowden tells two histories: that of his own growing up and that of how the intelligence community (IC) got more and more powerful after 9/11. I found the personal stories interesting, the analysis thorough and the details thought-provoking. He makes useful semantic distinctions; for instance, he explains how metadata is more intimate than content data, because we create it unknowingly, rather than thoughtfully. The book is full of wordplay… a “permanent record” is what this book is of Snowden’s life, but also what the intelligence communmity keeps of every citizen. “Hacking” is what Snowden used to do as a kid to minimise time spent on homework, but also what would become part of his work and revelations.</p> <p><em><a href="https://us.macmillan.com/books/9781250237231">Permanent Record</a></em> by Edward Snowden</p> <h2>The impact of tech company culture on society</h2> <p><em>Super Pumped</em> is New York Times journalist Mike Isaac’s book about Uber. It gives detailed accounts of the company’s founder, culture and attitude. Three things that are are, it turns out, closely interrelated. The book’s odd name is literally one of Uber’s corporate “values”, and yes, I too was surprised to read that this company has those (given the plethora of scandals on so many different aspects of human dignity). There are the accounts of bad things that happened, but then there’s also how the company tried to cover those bad things by hiring prominent PR firms. I understand… every organisation above a certain size will have people who work to maintain and defend the company’s public image. Sure. But this book shows it clearly Uber doesn’t care, the company carries out an agenda that benefits few and hurts many, and has its bro-y culture leak into society in many bad ways. This has definitely put Uber on the top of my list of companies I would never want to work for.</p> <p><em><a href="https://www.mike-isaac.com/">Super Pumped</a></em> by Mike Isaac</p> <img src="https://hidde.blog/_images/super-pumped-hacker-hoaxer-whistlleblower-radical-technologies-3.png" alt="Super Pumped, Hacker Hoaxer Whistlleblower, Radical Technologies" /> <h2>Political activism through technology</h2> <p>When an anthropologist studies a hacker slash activist movement, it might just yield a super interesting book about online culture. <em>Hacker, Hoaxer, Whistleblower, Spy</em> by Gabriella Coleman is a investigative study of Anonymous, with a look into what they do, want and think, completed with IRC logs, which I think were a great way to provide a look into online culture. Sometimes she talks a little too much about herself, but I feel it kind of works in this context. This book gives some interesting insights into Anonymous, the “lulz” and the motivations between some of the group’s core members.</p> <p><em><a href="https://gabriellacoleman.org/category/academic-writing/">Hacker, Hoaxer, Whistleblower, Spy: The Many Faces of Anonymous</a></em> by Gabriella Coleman</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/tech-vs-society-a-reading-list/">Tech vs society: a reading list</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Tech vs society: a reading list">Reply via email</a></p> 2019 in review 2019-12-20T00:00:00Z https://hidde.blog/2019-in-review/ <p>Wow, the year only has 8 days left 😱! Time for a review, with some useless stats and links to things I worked on.</p> <p>Like <a href="https://hiddedevries.nl/en/blog/2018-12-26-2018-in-review">last year</a>, I’ve divided this into highlights and things I learned. </p> <h2>Highlights</h2> <h3>Projects</h3> <p>In the first half year of 2019, I continued my project at <a href="https://mozilla.org/">Mozilla</a>’s Open Innovation team, building their People directory, and worked in the <a href="https://denhaag.nl/">City of The Hague</a> on accessibility and the internal design system.</p> <p>In July I started a new project: at the W3C’s Web Accessibility Initiative (WAI), I am now working as part of the European Commission-funded <a href="https://www.w3.org/WAI/about/projects/wai-guide/">WAI-Guide</a> project. My work there is focused on improving the accessibility of/in tools that create web content, like CMSes. In short: we want more accessibility both for content editors (a good editing experience) and for end users (good output).</p> <p>Apart from my work at the W3C, I’ve been doing the occasional WCAG audit and accessibility/CSS workshop in my own capacity too.</p> <h3>Speaking</h3> <p>Last year I spoke at my first conference. This year I got the opportunity to do new (and some older) talks in various places, of which some were as part of my project at the W3C/WAI. </p> <p>In March, I did a talk called <a href="https://talks.hiddedevries.nl/jvlLvb/its-the-markup-that-matters">It’s the markup that matters</a> at <a href="https://www.voorhoede.nl/nl/">De Voorhoede</a>. It was part of their Future Proof Components event, and covered building accessible components, accessibility trees and the <a href="https://github.com/WICG/aom/blob/gh-pages/explainer.md">AOM</a>. </p> <p>At WordCamp Rotterdam and Inclusive Design Ghent, I shared <a href="https://talks.hiddedevries.nl/KhyueW/six-ways-to-make-your-site-more-accessible">6 ways to make your site more accessible</a>, based on my experience looking at common accessibility problems that front-end developers can do something about. </p> <p>In October, I presented a very short lightning talk at the <a href="https://webwewant.fyi/">Web We Want</a> session at View Source Conference, about how some accessibility problems could cease to exist if <a href="https://talks.hiddedevries.nl/k8mFtU/i-would-like-browsers-to-fix-accesssibility-problems-automatically">browsers would automatically fix them</a>. The problems: zoomability, readability, color contrast and focus indication (the first three are each solved in at least one browser, the fourth has not). This talk, shockingly, won both the jury and audience award. </p> <p>Also in October was a talk called <a href="https://talks.hiddedevries.nl/7p3S15/breaking-barriers-with-your-cms">Breaking barriers with your CMS</a> at the Fronteers Jam Session (on behalf of W3C/WAI). This presented some of my recent work at WAI: it explained <a href="https://www.w3.org/WAI/standards-guidelines/atag/glance/">ATAG</a> and the role of the CMS in accessibility efforts. </p> <p>At the Design in Government Conference in November, I talked about <a href="https://talks.hiddedevries.nl/UNRhD5/trolleys-veils-and-prisoners-the-case-for-accessibility-from-philosophical-ethics">the case for web accessibility from philosophical ethics</a>, again on behalf of W3C/WAI, and I did <a href="https://talks.hiddedevries.nl/iOG6m7/dutch-het-web-is-klaar-voor-geweldig-grafisch-ontwerp">an updated version of my graphic design on the web</a> talk in Dutch for Freshheads in Tilburg.</p> <p>Then in December, I joined dotCSS to talk about the history of CSS: <a href="https://talks.hiddedevries.nl/ai4MEp/on-the-origin-of-cascades">On the origin of cascades</a> put some of that in a Darwin-themed talk. The venue was enormous and intimidating, and there was transport strikes, but the event itself was excellent, with a great atmosphere and very well organised.</p> <p>I also did a number of in-house talks and workshops, about CSS Layout, ARIA and accessibility guidelines.</p> <h3>Reading</h3> <p>I read much more than last year (72 books so far), and have written more about books on this blog (see <a href="https://hiddedevries.nl/en/blog/2019-08-23-equality-a-reading-list">reading list about equality</a> and <a href="https://hiddedevries.nl/en/blog/2019-12-03-tech-vs-society-a-reading-list">reading list about tech and society</a>). Reading more books helped me read less social media, watch less video and generally relax more. Please become my friend on Goodreads (it’s not great, but if more people join we can all share recommendations)!</p> <p>Some notes:</p> <ul> <li>Audiobooks are great as you can read them in situations where holding a book doesn’t work (e.g. walking a dog, housework)</li> <li>To read more, finding the right books is half of the work (I mean, not literally… but it is important). I found more people to follow on Goodreads, keep a close eye on the literary supplements in the papers and love posts like <a href="https://thefox.is/writing/2019/books-in-review">2018: books in review</a> by Karolina Szczur. </li> <li><a href="https://bibliotheek.nl/">Dutch libraries</a> have ebooks and audiobooks that can be ‘borrowed’ via apps.</li> </ul> <h3>Writing</h3> <p>This year I wrote 24 posts (including this one), which means I have now over 100 posts in total on this blog.</p> <p>Some posts that people found interesting: </p> <ul> <li><a href="https://hiddedevries.nl/en/blog/2019-01-07-on-the-importance-of-testing-with-content-blockers">On the importance of testing with content blockers</a></li> <li><a href="https://hiddedevries.nl/en/blog/2019-02-28-component-frameworks-and-web-standards">Component frameworks and web standards</a> on my first experience using a front-end framework </li> <li><a href="https://hiddedevries.nl/en/blog/2019-04-18-naming-things-to-improve-accessibility">Naming things to improve accessibility</a> on the importance of accessible names in things like buttons, links and tables</li> <li><a href="https://hiddedevries.nl/en/blog/2019-05-24-baking-accessibility-into-components-how-frameworks-help">Baking accessibility into components: how frameworks help</a>: frameworks can get a bad name in the accessibility world, but I increasingly think when used by accessibility-aware developers, they can make things better, not worse</li> <li><a href="https://hiddedevries.nl/en/blog/2019-07-22-meaning-without-markup-accessibility-object-model">Meaning without markup: Accessibility Object Model</a>: a primer on the Accessibility Object Model, a technology that is still under development and potentially interesting for a variety of reasons</li> </ul> <p>I also contributed to the Mozilla Hacks blog, writing <a href="https://hacks.mozilla.org/2019/06/indicating-focus-to-improve-accessibility/">Indicating focus to improve accessibility</a> and <a href="https://hacks.mozilla.org/2019/06/how-accessibility-trees-inform-assistive-tech/">How accessibility trees inform assistive tech</a>. Thanks to Havi Hoffman for the opportunity! </p> <h3>Cities</h3> <p>This year I traveled to Antwerp, Berlin, Bristol, Essen, Ghent, Nice, Paris, Taipei and Vienna, using trains where possible, but I need to do better at that.</p> <h2>Things I learned</h2> <p>Here’s some random things that I learned about in the past year:</p> <ul> <li>Recently I started working on an app with Svelte, the front-end framework that doesn’t ship in its entirety to the user’s runtime, but tries to compile as much as possible to vanilla JavaScript. Small bundles, yay! </li> <li>As I started my project at the W3C, I learned a lot the standards process, the dynamics in Working Groups and the <a href="https://www.w3.org/2001/12/zakim-irc-bot.html">bots that help run teleconferences</a>.</li> <li>A large part of my work centered around authoring tools, or tools that create web content, and how they can help <a href="https://hiddedevries.nl/en/blog/2019-10-21-breaking-barriers-with-your-cms">bring more accessibility in the world</a>.</li> <li>I became increasingly aware of the role of <a href="https://hiddedevries.nl/perch/addons/apps/perch_blog/edit/?id=131">surveillance capitalism</a> in the world.</li> <li>I learned to love <a href="https://airtable.com/">AirTable</a> as a way to organise and plan the non-coding parts of my work, which are becoming a larger part of the whole</li> </ul> <p>In any case, I’d like to thank the readers of this blog for reading and sharing the posts I’ve published, it means the world to me. </p> <p>I wish you all a great 2020!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/2019-in-review/">2019 in review</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%202019 in review">Reply via email</a></p> Could browsers fix more accessibility problems automatically? 2020-02-04T00:00:00Z https://hidde.blog/could-browsers-fix-more-accessibility-problems-automatically/ <p>Last year, I was lucky to be selected to present at the <a href="https://webwewant.fyi/wants/10/">Web We Want</a> session at View Source in Amsterdam, to argue for something that’s bugged me (and others) for a while: browsers could be more proactive in fixing accessibility issues for end users.</p> <p>This post is part write-up of that <a href="https://talks.hiddedevries.nl/k8mFtU/i-would-like-browsers-to-fix-accesssibility-problems-automatically">5 minute talk</a>, part new additions.</p> <h2>Outreach only does so much</h2> <p>The accessibility community produces lots of information about making accessible websites. Especially for folks who want to get the basics right, detailed info is out there. Sources like <a href="https://www.w3.org/WAI/">WAI</a>, <a href="https://a11yproject.com/">The Accessibility Project</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility">MDN Accessibility</a> have information on what to do as designers, developers and content creators.</p> <p>This is great, but realistically, this guidance is only ever going to reach a subset of website owners. There are always going to be websites that do not include accessibility best practices, for all sorts of reasons. Whether it’s ill will or obliviousness, it impacts people’s ability to use the web effectively.</p> <p>It would be pretty useful if browsers could give users the power to override the web, so that they can browse it better. They would then be less at the mercy of willing or knowing developers.</p> <p>Note: I do not want to say browser features can remove the need for us to worry about improving accessibility. Usually, websites can make the best choices about accessibly offering their content. When it comes to responsibility for accessibility, it is the website’s, not the browser’s.</p> <h2>Can browsers fix issues when they find them?</h2> <p>Most web folks will be aware of <a href="https://www.w3.org/TR/WCAG21/">WCAG 2.1</a>, the internationally embraced web standard that defines what it means for a website to be “accessible”. The sources I mentioned earlier often refer to this document (or earlier versions of it). When we speak of an “accessibility problem”, there’s often a specific success criterion in WCAG that specifies it.</p> <p>WCAG conformance is largely tested manually, but luckily we can detect some accessibility problems automatically. An interesting project to mention in that regard, is <a href="https://act-rules.github.io/pages/about">ACT Rules</a>, a Community Group at the W3C. They are mostly people from accessibility testing software vendors, like aXe and SiteImprove, who work on rewriting WCAG as testing rules (paraphrase mine). While doing that, they help harmonise interpretation of the WCAG success criteria, in other words: find agreement about when some web page conforms and when it does not. Guideline interpretation is not trivial, see <a href="https://www.deque.com/blog/the-web-accessibility-interpretation-problem/">The Web Accessibility Interpretation Problem</a> by Glenda Sims and Wilco Fiers of Deque.</p> <p>Interpretation may not be trivial, there are issues that are pretty clear. There are some that we can get true positives for (note, this is a small subset of WCAG; useful, but small). So, if we can automatically <em>find</em> these issues, can we also automatically <em>fix</em> them? </p> <h2>What browsers could do today</h2> <p>There are some issues that browsers could fix automatically today. In my ideal world, when a website has one of those barriers, the user notices nothing, because the browser fixed it proactively. This is not a <a href="https://en.wikipedia.org/wiki/Get_Out_of_Jail_Free_card">Get out of jail free card</a> for developers, designers or content people, but more so one for end users, to improve their experience when they encounter inaccesibility.</p> <p>For lack of a better metaphor, I imagine each of these features to exist as a checkbox within the browser. I’ll gladly admit this is somewhat oversimplified and high level, it is really just to make the point. Browser makers will likely solve these problems most effectively. </p> <p>During my research, I found that some browsers already fix some of these issues. Yay, go browsers! </p> <h3>Force zoomability</h3> <p>Some users may depend on zoom functionality to read content. With the Apple-invented <code>viewport</code> meta-tag, web developers can disable zooming:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>viewport<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>user-scalable=no<span class="token punctuation">"</span></span><span class="token punctuation">></span></span></code></pre> <p>This may be useful in some edge cases, like in photo cropping or maps functionality. But often, it prevents what was a useful feature to some users. </p> <p>Browsers could fix this automatically, for example via some sort of preference that bypasses the developer’s preferences in favour of the user’s. </p> <p>This fix exists currently, as Apple does <a href="https://webkit.org/blog/7367/new-interaction-behaviors-in-ios-10/">ignore the <code>user-scalable</code> directive</a> in the latest versions of iOS (>10), and it seems some Android browsers do, too.</p> <h3>Force readability</h3> <p>Claiming that 95% of the web is text, Oliver Reichenstein once said: </p> <blockquote> <p>It is only logical to say that a web designer should get good training in the main discipline of shaping written information</p> </blockquote> <p>(from: <a href="https://ia.net/topics/the-web-is-all-about-typography-period">Web Design is 95% Typography</a>)</p> <p>Plenty of websites out there aren’t great at “shaping written information” at all. There may be differences in taste and all, but some design decisions objectively make content illegible to at least a portion of users. Common problems include: light grey text on a white background, typefaces with extremely thin letters as body text and way too many words per line.</p> <p>Browsers could fix such readability problems automatically, by forcing page content into a lay-out optimised for reading. Examples of browser features that do this: </p> <ul> <li>Safari has had a <a href="https://www.apple.com/safari#reader">Reader View</a> for a long time, it lets you select fonts and colours and is marketed as allowing for distraction-free reading</li> <li><a href="https://support.mozilla.org/en-US/kb/firefox-reader-view-clutter-free-web-pages">Firefox Reader View</a>, which will let you make some choices in typography, dark modes and can even speak the page content out loud so that users can listen instead of read</li> <li>Microsoft Edge has <a href="https://support.office.com/en-us/article/Use-Learning-Tools-in-the-Edge-browser-78a7a17d-52e1-47ee-b0ac-eff8539015e1">Immersive Reader View</a> (previously Reader View), which can, like Firefox, read aloud. It even has grammar tools, that will let you do things like highlight nouns.</li> </ul> <p><img alt="Screenshots" src="https://hidde.blog/_images/reader-modes.png" /> <em>Examples of reader mode: Safari, Firefox, Edge</em> </p> <h3>Enforce contrast</h3> <p>When there is too little colour contrast in our UIs, they are harder to use for people with low vision and as well as people with color deficiencies. With contrast checkers (like <a href="https://contrast-ratio.com/">Contrast Ratio</a>), designers can ensure their work meets WCAG criteria like <a href="https://www.w3.org/WAI/WCAG21/quickref/#contrast-minimum">Contrast Minimum</a> and <a href="https://www.w3.org/WAI/WCAG21/quickref/#non-text-contrast">Non-text Contrast</a>. Still, whenever new content gets added, there’s a risk new contrast problems emerge. That text on a photo on the homepage could turn from super readable to hardly readable in a whim. </p> <p>You might be getting the theme by now… browsers can deal with contrast problems automatically. Why not have a “enforce contrast” setting, that adds a black background to any white text, always?</p> <p>It turns out, some browsers are already working on this, too! I was unaware when I prepared my talk. The basic idea is to fix contrast for users that use Windows High Contrast Mode (HCM). So, rather than the individual setting I suggested, it ties in with a related and existing preference. Much better!</p> <p>The details:</p> <ul> <li>Microsoft Edge’s solution is a <a href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/master/Accessibility/HighContrast/explainer.md#ensuring-readability">readability backplate</a> that could be behind all text when High Contrast Mode is on. Melanie Richards also mentioned this in her talk <a href="https://www.youtube.com/watch?v=Z_QZhoBrWPc">Effectively Honoring Visual Preferences</a> at View Source 2019 (also goes into some great other colour-related accessibility features Microsoft are working on)</li> <li>Firefox is also adding a backplate, see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1539212">bug 153912</a>, which works in HCM and uses theme background color. Firefox used to completely disable background images in HCM, which ensured lots of contrast, but also in losing potentially important context.</li> </ul> <h3>Fix focus styles</h3> <p>For many different kinds of users, it is important to see which element they are interacting with. As I wrote in <a href="https://hacks.mozilla.org/2019/06/indicating-focus-to-improve-accessibility/">Indicating focus to improve accessibility</a>, focus indicators are an essential part of that.</p> <p>Some websites remove them, which makes navigation with keyboards and some other input methods nearly impossible. It is a bit like removing the mouse indicator. CSS allows for doing either, but that doesn’t mean we should.</p> <p>Browsers could fix this automatically! I would welcome a setting that forces a super clear focus indicator. Basically, it would activate a stylesheet like <code>:focus { outline: 10px solid black; }</code> (and probably a white outline for dark backgrounds), and boom, people who need focus indication no are no longer dependent on individual website’s willingness to provide it. </p> <p><img alt="screenshot left: unchecked checkbox force focus indication, screenshot left: checked checkbox force focus indication, large focus outline drawn" src="https://hidde.blog/_images/focusinidication.png" /> <em>A simplified example of what “force focus indication” could look like</em> </p> <p>I am not aware of any browsers that implement this, but believe it could be an effective way to mitigate a common problem.</p> <p><em>Update 26 April 2021</em>: From Chrome 86, there is a <a href="https://support.google.com/chrome/answer/10181515?hl=en">Quick Highlight</a> functionality that can be turned on in <code>settings://accessibility</code>. It will force focus outlines on any interactive element, even if the website didn’t provide any. The outline disappears after a few seconds.</p> <h3>Autoplay optional</h3> <p>There’s a number of potential accessibility problems with autoplaying content:</p> <ul> <li>autoplayed audio can get in the way for screenreader users trying to navigate (see <a href="https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-dis-audio.html">Understanding 1.4.2</a>)</li> <li>some autoplayed content can be in the way for people with attention deficit disorders (see <a href="https://www.w3.org/TR/UNDERSTANDING-WCAG20/time-limits-pause.html">Understanding 2.2.2</a>)</li> <li>certain autoplayed videos (notably with flashing content) could cause seizure (see <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/Seizure_disorders">Web accessibility for seizures and physical reactions</a> on MDN).</li> </ul> <p>Some websites fix this automatically now. Twitter <a href="https://www.theverge.com/2019/12/23/21035855/twitter-bans-apngs-trolls-seizures-epilepsy-foundation-attack">disabled animated PNGs after they had been used to attack users with epilepsy</a>.</p> <p>Browsers could fix such issues automatically, too… what if they had a setting that would never allow anything to autoplay? It turns out, Firefox has a flag for this. In <code>about:config</code>, you can set <code>image_animation_mode</code> to <code>none</code>, or <code>once</code> if you prefer (via <a href="https://sea.pcmag.com/browsers/16129/how-to-stop-gifs-from-auto-playing-in-your-browser">PCMag</a>). For Chromium, there are plugins.</p> <h3>Block navigation</h3> <p>When every page on a website starts with a bunch of navigation and header elements, it can be cumbersome to users of some assistive tech. If you use a system that reads out web pages sequentially, you don’t want to listen to the navigation menu for every page you go to. <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1&showtechniques=241#bypass-blocks">2.4.1 Bypass Blocks</a> exists for this reason, and many websites implement it with a “skip link” (e.g. “Skip to content”) that lets users jump to the content they need.</p> <p>Browsers can determine blocks of repeated content between pages, especially if they are marked up as labeled regions (see: <a href="https://www.w3.org/WAI/tutorials/page-structure/labels/">Labeling regions</a>). If a page has one <code>&lt;main&gt;</code> element, browsers could provide navigation to skip to that element.</p> <h2>Wrapping up</h2> <p>In an ideal world, websites ensure their own accessibility, so that they can do it in a way that works with their content and (sometimes) their brand. Website owners have the responsibility to make their stuff accessible, not browsers or other tools. </p> <p>Yet, when websites ship with accessibility problems, browsers could fix some. They could automatically “fix” zoomability, readability, colour contrast, focus indication, autoplay and block navigation. If they did, users need to rely less on what websites provide them.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/could-browsers-fix-more-accessibility-problems-automatically/">Could browsers fix more accessibility problems automatically?</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Could browsers fix more accessibility problems automatically?">Reply via email</a></p> More accessible defaults, please! 2020-03-01T00:00:00Z https://hidde.blog/more-accessible-defaults-please/ <p>Useful HTML elements like date inputs and <code>&lt;video&gt;</code> could make the web a much better place, if browser accessibility bugs in their implementations were prioritised.</p> <h2>On ‘the web is accessible by default’</h2> <p>I like to claim ‘the web is accessible by default’, a sentence that requires nuance (see below). Yes, the web <em>is</em> accessible by default in many ways. The fact that websites are made of text, structured text in most cases, allows for an amount of accessibility that print never had. We can enlarge it, copy paste it, feed it to translation software, have it read out by screenreaders… this is awesome, and very helpful.</p> <p>But the web has become more than text, in 2020 it is a lot more than that. Websites and web apps now have videos, complex forms and clickable areas that are usually more than a couple of words to form a link. I would love to tell my clients that they can just use HTML, the language that has accessibility built in. More often, the answer is ‘it depends’, when people ask for solutions.</p> <h2>The components of an accessible web</h2> <p>An accessible web has many components, which all somehow circle around <em>web content</em>. On an accessible web, everyone can create and view web content. That’s the basic premise (and the basic promise). To get there, we need not just accessible content. We also need tools that can create accessible content (like <a href="https://hiddedevries.nl/en/blog/2019-10-21-breaking-barriers-with-your-cms">CMSes</a>), web standards that allow for marking up accessible content (like HTML) and tools that can display content accessibly (like browsers). We need developers, authoring tools, web standards and browsers to all play along, if we want the web to be accessible. </p> <p>The browser part of the accessibility picture can have a huge impact. Last month, I wrote about the <a href="https://hidde.blog/en/blog/2020-02-04-could-browsers-fix-more-accessibility-problems-automatically">potential for browsers to automatically fix accessibility problems</a>, in other words mitigate issues caused by inaccessible content. But what about content that is accessible in principle. but breaks ‘because of browsers’? </p> <h2>What browsers could do</h2> <p>In <a href="https://daverupert.com/2020/02/html-the-inaccessible-parts/">HTML, the inaccessible parts</a>, Dave Rupert listed a bunch of HTML elements that have known accessibility problems in browsers, like date inputs and <code>&lt;video&gt;</code> . Developers use these elements because they trust the web to be accessible by default, their strategy is to stick close to the standards. That promise is somewhat broken for these specific elements.</p> <p>In Dave’s article, there is a link with more details for each problem (recommended reading!). It somewhat shocked me to see all these issues in one list, even though I had heard about the majority. Basically, if any of those HTML elements are used, a browser displays the content inaccessibly, despite that the standard defined a thing that <em>could be</em> accessible, and developers implemented a thing that <em>could be</em> accessible.</p> <p>It’s important for me to note at this point: browsers are complex beasts. Browser engineers are extraordinary people who work very hard to build all sorts of features that generally benefit the web. And, of course, we don’t just need an accessible web. We also need a secure web, a web with user privacy, a web with amazing graphic design capabilities (I love CSS Grid), a web that doesn’t lose market share to app ecosystems, a web that efficiently runs complex JavaScript applications, a web that’s fast, a web that can be a compilation target for Rust and C/C++, et cetera. </p> <p>I should also clarify that while browsers might be breaking things in these examples, there are also plenty of examples where <em>standards</em> are inconsistent despite heroic efforts, or <em>developers</em> build things that cause nightmares for web compatibility engineers (<a href="https://www.youtube.com/watch?v=q2kK_wd1xzY">keeping browsers compatible with the web is hard</a>, explained Mike Taylor at View Source 2016). </p> <p>So, with the caveats that browsers have many priorities, and that standards and developers can also cause trouble, let’s return to the issue of this post: inaccessible HTML elements in browsers. How can we mitigate these problems? Some of the issues can be addressed by web developers themselves with trivial code. If they have heard of the bug, not all developers will. For other issues, there are third party libraries, like <a href="https://ableplayer.github.io/ableplayer/">AblePlayer</a> for more accessible video. Again, it’s safe to say only a subset of developers is aware of the issues like <a href="https://scottvinkle.me/blogs/blog/how-accessible-is-the-html-video-player">those with <code>&lt;video&gt;</code> </a>.</p> <p>Browser makers are in a unique position to fix all of these particular issues for all, so that people with disabilities need to rely less on the willingness of individual developers to enjoy content. There are bugs filed against the relevant browsers, some of which have been open for over a decade, like the <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=494175">bug for keyboard accessibility for <code>&lt;video&gt;</code> in Firefox</a>.</p> <p>It would be so good if accessible rendering of HTML elements was prioritised more. </p> <p>Some developments are happening:</p> <ul> <li>There is some exciting work being done in Edge/Chromium to make the <a href="https://groups.google.com/a/chromium.org/forum/m/#!topic/blink-dev/kscJbfVjR5k">default rendering of form controls better</a></li> <li>For elements beyond what exists in HTML today, my hopes are on <a href="https://github.com/WICG/open-ui/tree/master/platform">OpenUI</a>, a project of the W3C’s Web Incubator Community Group. They aim to standardise form controls and components in which, among other things, “accessibility, focus and other foundational items work as expected”.</li> <li>Firefox has <a href="https://twitter.com/jcsteh/status/1234582153960116224">recently improved the accessibility of number input types</a></li> </ul> <h2>Wrapping up</h2> <p>Yes, there are lots of priorities beyond the rendering of HTML elements in browsers. Yet, I’d like to make the case for browsers to prioritise accessible implementations of HTML elements. If browsers implement <a href="https://daverupert.com/2020/02/html-the-inaccessible-parts/">these elements</a> with maximum default accessibility, they can make improve a lot of the web platform at once.</p> <p>As <a href="https://twitter.com/yatil/status/1233148827613499392?s=21">Eric Eggert said</a> on Twitter:</p> <blockquote> <p>We need a movement to fix the web platform to make those essential building blocks of the web accessible for all.</p> </blockquote> <p>I’d like to join this movement, please! But really, I hope for browsers to support this movement.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/more-accessible-defaults-please/">More accessible defaults, please!</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20More accessible defaults, please!">Reply via email</a></p> Minimum Viable Data Collection 2020-03-09T00:00:00Z https://hidde.blog/minimum-viable-data-collection/ <p>The gist of the EU’s <a href="https://en.wikipedia.org/wiki/General_Data_Protection_Regulation">General Data Protection Regulation</a> (GDPR) is simple: protect citizens from data-hungry corporations. It gives people control over how their personal data is collected, as it requires website-owners to stick to a set of rules when dealing with people’s data (I’m paraphrasing). In short: it gives <em>rights</em> to citizens and <em>duties</em> to (digital) businesses.</p> <p>Most websites in Europe have taken action to comply with parts of their duties, by implementing cookie consent banners. In the least bad scenario, the response of such website-owners was: let’s find out which cookies we set and which ones we allow others to set. Then ask users for permission and set cookies if permitted. So, basically, business as usual, but with a banner for explanation.</p> <p>Of course, cookies themselves are not the problem per se. It is the broader strategy, which hardly requires cookies. It is to try and get as much information from users as possible and combining everything you can find, to create detailed profiles of website visitors. This is enabled by and helps enable <a href="https://shoshanazuboff.com/book/about/">surveillance capitalism</a>, which threatens our societies and people in many ways.</p> <p>What if website-owners used the logical opposite of that strategy? What if our industry championed… <strong>Minimum Viable Data Collection</strong>? This strategy would collect the minimum information from users. Maybe it would actively destroy and anonymise any <a href="https://ec.europa.eu/info/law/law-topic/data-protection/reform/what-personal-data_en">personal data</a>. You would find out what kind of tracking you <em>do</em> or <em>enable</em> (via third-parties) and reduce it. Ideally to zero. This strategy respects citizen’s rights much better. </p> <p>Does this idealist blogger need more realism? Well, maybe. Let’s still explore this idea.</p> <h2>The current state of affairs</h2> <p>How do websites currently deal with their privacy-related obligations? Well, many ask permission to set cookies. Some use pointy formulations like ‘would you mind some cookies?’, completed with a picture of a cookie jar. Oatly, a company that makes vegan milk (yay!), is just of many going down this route:</p> <p><img src="https://hidde.blog/_images/screenshot-2020-03-09-at-12.27.52.png" alt="Screenshot 2020 03 09 at 12.27.52" /> <em>“Cookies go nicely with oat drinks. As it happens, the digital kind do too. So is it okay with you if we use cookies on this site?”</em> </p> <p>These are sometimes funny and original, but, also, they indicate these companies do not see online tracking as a serious problem. That’s understandable, it’s a complex problem, maybe we can’t expect marketeers to do their homework. But isn’t this too important to be turned into a joke?</p> <h2>Why do websites track?</h2> <p>The amount of cookie banners in the wild may lead us to conclude: websites really need tracking to function. Yet they don’t. So why <em>do</em> websites track?</p> <p>From the perspective of surveillance capitalist companies, the need for tracking is clear: their business is built upon it. Again, see Shoshana Zuboff’s <a href="https://shoshanazuboff.com/book/about/">The Age of Surveillance Capitalism</a>.</p> <p>What I’m interested in: why do website owners wilfully <em>welcome</em> bad trackers on their web properties? Surely, it would be easier to comply with data collection regulations by not collecting data at all? Minimum Viable Data Collection seems to be the most straightforward solution (<a href="https://en.wikipedia.org/wiki/Occam%27s_razor">Ockham’s razor</a>!). </p> <p>I think these are some of the common reasons why sites don’t focus on minimising data collection yet: </p> <dl> <dt>Unaware of the harm</dt> <dd>Some organisations may not have read up the consequences of using whatever part of their tools come with naughty trackers. This is not a valid excuse, but it may explain a majority of cases.</dd> <dt>User research</dt> <dd>Often, website owners want to track users to inform their design decisions. Through A/B tests (which <a href="http://drjasondavis.com/2013/09/12/eight-ways-youve-misconfigured-your-ab-test/">aren’t trivial to get right</a>, or other <a href="https://www.nngroup.com/articles/quantitative-user-research-methods/">quantitative UX research</a> on live websites.</dd> <dt>Social media</dt> <dd>A lot of websites embed content from third-parties, like videos from YouTube. Some also include buttons that allow social sharing, like <em>Tweet This</em> buttons. All of these come with tracking code more often than not. It’s <a href="https://ia.net/topics/sweep-the-sleaze-reactions">unclear if people actually use them (but it seems some do)</a>.</dd> <dt>Data collection for marketing</dt> <dd>Some websites, especially those in the business of sales (like hotel or flight booking sites), collect user data so that they can make better (automated) decisions on offers and pricing.</dd> </dl> <h2>Instead of maximising consent, minimise collection</h2> <p>The question all website owners should be asking, is: do we really, really need these trackers to exist on our pages? Can’t we do the things we want to do without trackers?</p> <p>I think in many cases we can: </p> <dl> <dt>Unaware of the harm</dt> <dd>More awereness is needed. As people who make websites and know how tracking works, we have to tell our clients and bosses.</dd> <dt>User research</dt> <dd>Maybe prioritise qualitative research? Or urge vendors of this software to design privacy-first?</dd> <dt>Social media</dt> <dd>Social sharing buttons could just be regular links (<code><a></a></code>) with information passed via parameters. Video embeds could be activated only when clicked.</dd> <dt>Data collection for marketing</dt> <dd>Maybe just don’t? If trust is good for business, <a href="https://www.darkpatterns.org/types-of-dark-pattern">dark patterns</a> are not.</dd> </dl> <h2>The no tracking movement</h2> <p>Excitingly, some websites choose to avoid or minimise tracking already.</p> <h3>The mission statement</h3> <p>Privacy and accessibility expert Laura Kalbag describes why she chose not to have trackers on her site:</p> <blockquote> <p>For me, “no tracking” is both a fact and a mission statement. I’m not a fan of tracking. (…) That means that you will not find any analytics, article limits or cookies on my site. You also won’t find any third-party scripts, content delivery networks or third-party fonts. I won’t let anyone else track you either.</p> </blockquote> <p>(From <a href="https://laurakalbag.com/i-dont-track-you/">I don’t track you</a>)</p> <p>Laura was inspired by designer and front-end engineer Karolina Szczur, whose <a href="https://thefox.is/">personal website</a> sports ‘No tracking’ in the footer. So cool, and very thoughtful.</p> <h3>Dutch public broadcasters go cookie-less</h3> <p>I was pleasantly surprised to see STER, the department that runs advertising for Dutch public broadcasters on tv, radio and internet, decided to <a href="https://www.ster.nl/nieuws/ster-start-nieuwe-jaar-volledig-cookieloos/">go cookieless for all of their web advertising in 2020</a>. Instead of profiling users, they profile their own content. STER classifies their content into 23 “contexts” (like “sport/fitness” and “cooking/food”). They then allow advertisers to choose in which context they want to promote their brand. Cool, they can be in the advertising business, offer contextual advertising spots, without the need for tracking all the things.</p> <h3>NRC: “our journalism is our product”</h3> <p>Dutch newspaper NRC also stopped using third party cookies, and takes a clear stance:</p> <blockquote> <p>Our journalism is our product. You are not. So we do not sell your data. Never. To nobody. We do not collect data for collection’s sake. We only save data with a tangible goal, like dealing with your subscription.</p> </blockquote> <p>From <a href="https://www.nrc.nl/privacy/">NRC privacy</a> (translation mine)</p> <p>I like the stance, but should note my tracker blocker still has to filter 5 known trackers out when I read the news (also goes for paying users).</p> <h3>New York Times: less targeting, more revenue</h3> <p>Last year, The New York Times swapped behavioural targeting for targeting based on location and context. This did not decrease their revenue. Jean-Christophe Demarta, Senior Vice President for global advertising at the paper: “We have not been impacted from a revenue standpoint, and, on the contrary, our digital advertising business continues to grow nicely.”</p> <p>Digiday editor Jessica Davies: </p> <blockquote> <p>The publisher’s reader-revenue business model means it <strong>fiercely guards its readers’ user experience</strong>. Rather than bombard readers with consent notices or risk a clunky consent user experience, it decided to drop behavioral advertising entirely.</p> </blockquote> <p>(Emphasis mine; both quotes from: <a href="https://digiday.com/media/gumgumtest-new-york-times-gdpr-cut-off-ad-exchanges-europe-ad-revenue/">After GDPR, The New York Times cut off ad exchanges in Europe - and kept growing ad revenue</a>)</p> <p>Again, my tracker blocker found 3 trackers when I visited <code>nytimes.com</code> this morning. </p> <p>For large scale websites, it seems minimising data collection is easier said than done. Currently, there may not be any large sites that are truly tracker-free (besides <a href="https://wikipedia.org/">Wikipedia</a>).</p> <h3>GitHub: “Pretty simple, really”</h3> <p>In 2020, code platform GitHub decided to get rid of their cookie banner,by getting rid of their cookies. CEO Nat Friedman writes:</p> <blockquote> <p>we have removed all non-essential cookies from GitHub, and visiting our website does not send any information to third-party analytics services. </p> </blockquote> <p>(from: <a href="https://github.blog/2020-12-17-no-cookie-for-you/">No cookie for you</a>)</p> <p>This fits well within their values, Friedman explains, “developers should not have to sacrifice their privacy to collaborate on GitHub.” I’d still love them to <a href="https://www.theverge.com/2019/10/9/20906213/github-ice-microsoft-software-email-contract-immigration-nonprofit-donation">stop working with ICE</a>.</p> <h2>Wrapping up</h2> <p>It is a concept for mostly inspirational purposes, but really… I think <em>minimum viable data collection</em> can be a great strategy for businesses who want to comply with the duties of privacy regulations. The advantages:</p> <ul> <li>you need to build less complex cookie consent mechanisms</li> <li>users stay on your site as they are less frustrated</li> <li>you can serve customers that use tracking protection (see below)</li> <li>your company gets hundreds of internet points</li> </ul> <p>To users who need to browse today’s web, I strongly recommend using a browser with strong tracking protection, like Firefox (has <a href="https://support.mozilla.org/en-US/kb/enhanced-tracking-protection-firefox-desktop">Enhanced Tracking Protection</a>) or Safari (has <a href="https://www.apple.com/safari#security">Intelligent Tracking Prevention</a>. For nerds who want to read more, check out the intelligent tracking posts on the WebKit blog, including <a href="https://webkit.org/blog/9661/preventing-tracking-prevention-tracking/">Preventing Tracking Prevention Tracking</a> or the <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Privacy/Tracking_Protection">Firefox Tracking Protection section on MDN</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/minimum-viable-data-collection/">Minimum Viable Data Collection</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Minimum Viable Data Collection">Reply via email</a></p> Uncanny Valley 2020-03-12T00:00:00Z https://hidde.blog/uncanny-valley/ <p>“It’s unfortunate that the world does not reward conciseness more. Making books shorter will effectively increase the rate at which we can learn.” This tweet from a start-up founder is quoted in Anna Wiener’s hilarious memoir <a href="https://www.mcdbooks.com/uncanny-valley/"><em>Uncanny Valley</em></a>, in which she tears apart the “dreary efficiency fetish” of the San Francisco tech scene, among other things. It touched me, because I love books and don’t want them <em>disrupted</em>.</p> <img class="image-right-small" src="https://hidde.blog/_images/book-cover-uncanny-valley-a-memoir.jpg" alt="Book cover uncanny valley a memoir" /> <p>At 25, Wiener left her life in Brooklyn, New York for San Francisco, to go work in the Valley. This book is her “memoir”. She was astounded by what she found: the constant gospel of work as the most important part of life, men who are overly confident about their own ideas, open bars, the 24 hour hustle, the dress code of company branded hoodies, God Mode, camping trips with no actual camping, childish company names, companies ran by people in their 20s, an office reception that is a replica of the Oval Office… the book is full of these on point details. Most of these phenomena were not new or shocking to me (as someone who works in tech), but I enjoyed Wiener’s liberal arts perspective on them. Her somewhat ironic tone works really well for this kind of thing, as it nicely cuts through the nonsense. I chuckled a lot. It’s not a 300 page rant, though, Wiener does not simply attack everything the Valley stands for (there are other books for that), it’s more subtle.</p> <p>It also isn’t just irony and fun. Wiener also takes the time to discuss serious problems in tech, including the feeling of “not belonging”, both as a women and as a non-engineer (she worked in support, and apparently that’s lower in the hierarchy). When, for work, she attended the <a href="https://en.wikipedia.org/wiki/Grace_Hopper_Celebration_of_Women_in_Computing">Grace Hopper Celebration of Women in Computing</a>, she describes she doesn’t feel like a women in computing, “more like a women around computers, a woman with a computer”. The “young founders” aspect, besides great to poke fun at, is also a serious problem, when tech companies hugely disrupt society. Their leaders may not have enough life experience to see the full picture, yet they feel they do, because venture capitalists put them on a pedestal.</p> <p><em>Uncanny Valley</em> doesn’t name names, it <a href="https://slate.com/culture/2020/01/uncanny-valley-brand-names-anna-wiener.html">offers descriptions</a> instead. A great style choice, because the descriptions say much more than the actual names would have. They add a little bit of context. The social network that everybody hated, the data analytics startup where everybody wears company-supplied “I am data driven” t-shirts, the venture capitalist who had said ‘software eats the world’, the open source code platform and the highly litigious Seatle-based conglomorate (that ends up buying that code platform). <em>Uncanny Valley</em> is not about the specific companies, but about the culture and the kinds of companies.</p> <p>The book has a special place for Silicon Valley thought leaders and what Wiener calls the “founder realism genre”: the blog posts they publish. Men, mostly men, give each other ‘anecdote-based instruction and bullet point advice’. You know the kind of Medium post. Not all men, not all Medium posts, but you get the idea. Founders who are convinced everything needs the type of efficiency they specialise in, while shielded from the consequences of their own transformations. Founders indifferent to some of the big problems of our time: inequality strengthened by <em>their</em> business models, hate speech amplified by <em>their</em> platforms and mass surveillance enabled by <em>their</em> data, In <a href="https://www.vox.com/culture/2020/2/3/21083764/uncanny-valley-anna-wiener-interview">an interview with Vox</a>, Wiener says:</p> <blockquote> <p>Silicon Valley is a culture focused on doing, not reflecting or thinking.</p> </blockquote> <p>Reflecting is essential, and the Valley could do more of it. Wiener reflects also about herself, her life and her career choices. Wiener seems to like and understand the people she meets, truly tries to figure out what motivates them and isn’t just ranting about them. For her, it seems to be a love/hate relationship, with quite a bit of both. That makes this book so strong. </p> <p>Recommended reading! If you want to learn more, see the <a href="https://www.youtube.com/watch?v=L7GDMNZYqJo">interview with Anna Wiener at the Strand Book Store</a>, listen to <a href="https://radiopublic.com/RecodeDecode/s1!60f66">Anna Wiener at Recode/Decode</a> or go to <a href="https://www.mcdbooks.com/uncanny-valley/">the book’s website</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/uncanny-valley/">Uncanny Valley</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Uncanny Valley">Reply via email</a></p> How deployment services make client-side routing work 2020-06-27T00:00:00Z https://hidde.blog/how-deployment-services-make-client-side-routing-work/ <p>Recently I deployed a Single Page Application (SPA) to <a href="https://vercel.com/">Vercel</a> (formerly <a href="https://zeit.com/">Zeit</a>). I was surprised to find that my client-side routes worked, even though my deployment only had a single <code>index.html</code> file and a JavaScript routing library. Here’s which ‘magic’ makes that possible, for if you ever end up needing the same.</p> <h2>How servers serve</h2> <p>In the most normal of circumstances, when we access a web page by its URL, it is requested from a server. This has worked since, I believe, the early nineties (URLs were more recently standardised in the <a href="https://url.spec.whatwg.org/">URL spec</a>). The browser deals with that for us, or we can do it in something like <a href="https://curl.haxx.se/">curl</a>:</p> <pre class="language-php"><code class="language-php">curl <span class="token constant">GET</span> https<span class="token punctuation">:</span><span class="token comment">//hiddedevries.nl/en/blog/</span></code></pre> <p>We tell the server “give me this page on this host”. To respond, the server will look on its file system (configs may vary). If it can find a file on the specified path, it responds with that file. Cool.</p> <p>Now, If you have a Single Page App that does not do any server side rendering, you’ll just have a single page. This is, for instance, what I deployed:</p> <pre class="language-css"><code class="language-css">public - index.html - build - bundle.js - bundle.css - images - // images</code></pre> <p>Let’s say I deployed it to <code>cats.gallery</code>. If someone requests that URL, the server looks for something to serve in the root of the web server (or virtual equivalent of that). It will find <code>index.html</code> and serve that. Status: <code>200 OK</code>.</p> <h2>Client side routes break by default</h2> <p>Our application is set up with client side routing, but, for reasons, we have no server side fallback (don’t @ me). It contains a <code>div</code> that will be filled with content based on what’s in the URL. This is decided by the JavaScript, which runs on the client, after our <code>index.html</code> was served.</p> <p>For instance, there is <code>cats.gallery/:cat-breed</code>, which displays photos of cats of a certain breed.</p> <p><img src="https://hidde.blog/_images/4160021588b0255002f9c.jpg" alt="Cat sitting in middle of road" /> <em>A British shorthair - photo by Martin Hedegaard on Flickr</em></p> <p>When we request <code>cats.gallery/british-shorthair</code>, as per above, the server will look for a folder named <code>british-shorthair</code>. We’ve not specified a file, the server will look for <code>index.html</code> there. No such luck, because we created no fallback, there’s just the single <code>index.html</code> in the root. If servers don’t find anything to serve, they’ll serve an error page with the <code>404</code> status code.</p> <p>It does matter how we’ve loaded the sub page about British shorthairs. Had we navigated to <code>cats.gallery</code> and clicked a link to the British shorthair page, that would have worked, because the client side router would have replaced the content on the same single page.</p> <h2>How do they make it work?</h2> <p>One way to fix the problem, is to use hash-based navigation and do something like <code>cats.gallery/#british-shorthair</code>. Technically, we’re still requesting that <code>index.html</code> in the root, the server will be able to serve it, and the router can figure out that it needs to serve cats of the British shorthair breed.</p> <p>But, we want our single page app to feel like a multi page app, and have “normal” URLs. Surprisingly, this still works on some services. The trick they need to do is to serve the <code>index.html</code> file that’s in our project’s root, but for any route. Want to see British shorthairs? Here’s <code>index.html</code>. Want to see Persian cats? Look, <code>index.html</code>. Returning to the home page? <code>index.html</code> for you, sir!</p> <h3>Vercel</h3> <p><a href="https://vercel.com/">Vercel</a> does this automagically, as described in the <a href="https://vercel.com/docs/configuration#routes/advanced/spa-fallback">SPA fallback</a> section of their documentation.</p> <p>This is the set up they suggest:</p> <pre class="language-php"><code class="language-php"><span class="token punctuation">{</span> <span class="token string double-quoted-string">"routes"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token string double-quoted-string">"handle"</span><span class="token punctuation">:</span> <span class="token string double-quoted-string">"filesystem"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> <span class="token string double-quoted-string">"src"</span><span class="token punctuation">:</span> <span class="token string double-quoted-string">"/.*"</span><span class="token punctuation">,</span> <span class="token string double-quoted-string">"dest"</span><span class="token punctuation">:</span> <span class="token string double-quoted-string">"/index.html"</span> <span class="token punctuation">}</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span></code></pre> <p>First handle the file system, in other words, look for the physical file if it exists. In any other case, serve <code>index.html</code>.</p> <h3>Netlify</h3> <p>On Netlify, this is the <a href="https://docs.netlify.com/routing/redirects/rewrites-proxies/#history-pushstate-and-single-page-apps">recommended rewrite rule</a>:</p> <pre class="language-css"><code class="language-css">/* /index.html 200</code></pre> <h3>GitHub Pages</h3> <p>Sadly, on GitHub Pages, we cannot configure this kind of rewriting. People have been requesting this since 2015, see <a href="https://github.com/isaacs/github/issues/408#issuecomment-632390593">issue 408</a> on an unofficial GitIHub repository.</p> <p>One solution that is offered by a friendly commenter: symlinks! GitHub Pages allows you to use a custom 404 page, by creating a <code>404.html</code> file in the root of your project. Whenever the GitHub Pages server cannot find your files and serves a 404, it will serve <code>404.html</code>.</p> <p>Commenter wf9a5m75 suggests a symlink:</p> <pre class="language-css"><code class="language-css">$> cd docs/ $> ln -s index.html 404.html</code></pre> <p>This will serve our <code>index.html</code> when files are not found. Caveat: it will do this with a <code>404</code> status code, which is going to be incorrect if we genuinely have content for the path. Boohoo. It could have all sorts of side effects, including for search engine optimisation, if that’s your thing.</p> <p>Another way to hack around it, is to have a <a href="https://www.smashingmagazine.com/2016/08/sghpa-single-page-app-hack-github-pages/">meta refresh tag</a>, as Daniel Buchner suggests over at Smashing Magazine.</p> <p>Let’s hope GitHub Pages will one day add functionality like that of Vercel and Netlify.</p> <h2>Wrapping up</h2> <p>Routing was easier when we used servers to decide what to serve. Moving routing logic to the client has some advantages, but comes with problems of its own. The best way to ‘do’ a single page app, is to have a server-side fallback. so that servers can just do the serving as they have always done. Generate static files, that servers can find. Don’t make it our user’s problem that we wanted to use a fancy client-side router. Now, should we not have a fallback for our client-side routes, redirect rules can help, like the one’s Vercel and Netlify recommend. On GitHub Pages, we can hack around it.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/how-deployment-services-make-client-side-routing-work/">How deployment services make client-side routing work</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20How deployment services make client-side routing work">Reply via email</a></p> 22281 2020-07-07T00:00:00Z https://hidde.blog/22281/ <p>In July 2019, my main browser of choice, Firefox Nightly, landed a new dashboard. It shows how much was blocked by the browser’s tracking protection feature. This can be found in <code>about:protections</code>. Let’s look at the stats after this first year.</p> <p>Tracking protection is essential on today’s web. It’s a feature that both Firefox (<a href="https://support.mozilla.org/en-US/kb/enhanced-tracking-protection-firefox-desktop">Enhanced Tracking Protection</a>) and Safari (<a href="https://webkit.org/blog/7675/intelligent-tracking-prevention/">Intelligent Tracking Protection</a>) have had for quite some time now. Most websites are still full of naughty scripts that pass on information to social media giants, track you across websites, exercise finger printing and even mine crypto currencies.</p> <p>I use the “Strict” mode in Nightly, which comes with a warning: ‘causes some sites to break’. I don’t recall ever seeing sites break at all, but your mileage may vary. Where it does happen, an exception can be made for a specific site. </p> <p>The dashboard in <code>about:protections</code> tells you what types of trackers were blocked over the past week, as well as a total since you started using the future. After just over a year, mine shows <strong>22281</strong> trackers since July 5, 2019. </p> <img alt="Enhanced Tracking Protection: Always On. Nightly automatically stops companies from secretly following you around the web. Nightly blocked 172 trackers over the past week. Graph split out by category and days of the week. 22,281 trackers blocked since July 5, 2019" src="https://hidde.blog/_images/screenshot-2020-07-07-at-14.44.06.png" /> <p>Like I’m excited <a href="https://hiddedevries.nl/en/blog/2020-02-04-could-browsers-fix-more-accessibility-problems-automatically">browsers can fix accessibility problems</a>, I’m grateful that they help address this problem when many websites don’t. It’s time for more <a href="https://hiddedevries.nl/en/blog/2020-03-09-minimum-viable-data-collection/">minimum viable data collection</a>. Happy birthday, tracking protection dashboard!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/22281/">22281</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%2022281">Reply via email</a></p> Reply via email 2020-07-14T00:00:00Z https://hidde.blog/reply-via-email/ <p>I noticed <a href="https://ethanmarcotte.com/wrote/replyin/">Ethan Marcotte</a> and <a href="https://www.robinrendle.com/notes/reply-links-in-rss-feeds">Robin Rendle</a> added “Reply via email” links to their RSS feeds. I decided to steal their idea for this blog.</p> <p>In the early days of the web, it was common to leave long-winded responses on each other’s blog posts. I didn’t blog back then. Now, (almost) all long form stuff that ends up in my comment queue is from content marketeers that show up just for the link juice.</p> <p>I do really like getting replies, positive, negative or neutral, so I’ve added a Reply via email link to make that easier. Hope it is useful to some!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/reply-via-email/">Reply via email</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Reply via email">Reply via email</a></p> Equality, a reading list (2) 2020-07-16T00:00:00Z https://hidde.blog/equality-a-reading-list-2/ <p>Last year, I published <a href="https://hiddedevries.nl/en/blog/2019-08-23-equality-a-reading-list">Equality, a reading list</a>. I’ve continued to read about equality, so here’s a second reading list, with even more recommended reads.</p> <p>As with the previous list, I am no expert. The books in this list helped improve <em>my</em> understanding of a number of different inequalities and how they intersect. I hope they can help you, too! </p> <p>Two notes: </p> <ol> <li>The word “equality” may have been poorly chosen on my part, and <em>equity</em> may be a better thing to strive for. Equality is the concept of treating everyone the same. Equity recognises not everyone has the same needs. It strives to treat people differently based on specific needs. Both want to promote fairness, so there’s that.</li> <li>A major misconception about racism is that it consists of tangible and objectively verifiable acts committed by <em>mean</em> people. Like a bar tender who refuses to serve [insert race] people. Pretty much all of the books in this list clarify that racism is often none of those things. They explain it as a system, demonstrated by ‘lived experiences’ of the people affected by it, often invisible to others. It commonly involves nice or well-intended people. Any given person may be more racist than they think. All of this makes the subject hard to talk about it for people, as all people have different experiences</li> </ol> <p>Without further ado, these are the recommendations, I hope there’s something in it for you.</p> <h2>“Not racist” is not enough</h2> <p>Ibram X. Kendi’s very popular “How to be an antiracist” is an extensive analysis of racism. It looks at history, culture, class, biology, ethnicity and more from an antiracist perspective. Antiracist, Kendi explains, is not the same as “not racist”. It’s not personal or about specific people either, it’s about working to dismantle a system. To be antiracist, says Kendi, is to act in ways that support antiracist policies (“policies that reduce racial inequity“). Almost every chapter starts with one or more definitions, often drawing clear distinctions. They help the reader identify what lacks in their thinking about the issues, and ensure a good understanding of the argument Kendi makes. To be antiracist, requires careful scrutiny of one’s own actions and ideas, something Kendi himself does, too. This is not something we can sit down and do one afternoon, the scrutiny should be an ongoing process. This book is the ideal guide to that process. Get the audiobook if you can, it’s great and author-narrated.</p> <p><em><a href="https://www.ibramxkendi.com/how-to-be-an-antiracist-1">How to be an antiracist</a></em> by Ibram X. Kendi. See also <a href="https://brenebrown.com/podcast/brene-with-ibram-x-kendi-on-how-to-be-an-antiracist/">Brené Brown with Ibram X. Kendi</a> (podcast)</p> <img src="https://hidde.blog/_images/books-2.png" alt="Books" /> <h2>Nice people</h2> <p>When you believe nice people cannot be racist, you don’t understand what racism is or how it operates, explains Austin Channing Brown in “I’m still here”. This belief in various shapes and forms, that are all harmful to the antiracist cause. There is what Channing Brown calls “relational defense’: “when people say they cannot possibly be racist, by appealing to the relationships of those who ‘know’ them”, or when they have black friends. Seems nice, but it puts the onus on the harmed. And there’s the concept of color blindness, which, again, seems nice, but it defeats the purpose if it is a blindness for racial injustice at the same time. Channing Brown’s perspective is that of a black Christian woman, and, like many of the other authors in this list, she shares generously from her own experiences and perspectives. Her treatment of the facade that diversity policy can be, is particularly well articulated. Again, I can recommend the author-narrated audiobook.</p> <p><em><a href="http://austinchanning.com/the-book">I’m still here</a></em> by Austin Channing Brown. See also, Brené Brown again… <a href="https://brenebrown.com/podcast/brene-with-austin-channing-brown-on-im-still-here-black-dignity-in-a-world-made-for-whiteness/">Brené Brown with Austin Channing Brown</a> (podcast)</p> <h2>Talking about racism</h2> <p>Talking about race can be uncomfortable, and can leave people with questions. “So you want to talk about race” very patiently and straightforwardly answers some of those. It treats important subjects like privilege (and what it means to “check your privilege”), microagressions, police brutality and cultural appropriation, and makes for a good entry-level book about anti-racism. This book is American, some themes might make less sense to people elsewhere (“on campus arrests” and lack of universal healthwcare come to mind). Like Kendi, Oluo is frank about her personal experiences, whether it is in examples of microagressions she experienced or tales of how she had to re-examine her own prejudice. I found this mixture of memoire and hand book very helpful.</p> <p><em><a href="https://www.hachettebookgroup.com/titles/ijeoma-oluo/so-you-want-to-talk-about-race/9781580056779/">So you want to talk about race</a></em> by Ijeoma Oluo</p> <h2>Bananas</h2> <p>Pete Wu is a Dutch journalist and “second generation” Chinese. His mom calls him “banana”, yellow outside, white inside. As he wrote his book “De bananengeneratie” (The banana generation, Dutch only), he found this was the case for other Chinese-Dutch, too. The book has interesting reflections on discrimination and cliches, and crystal clear analysis of what it means to be Chinese-Dutch in The Netherlands. I previously read Sun Li’s excellent <a href="https://www.amboanthos.nl/boek/de-zoetzure-smaak-van-dromen/">De zoetzure smaak van dromen</a>, which covers some of those subjects, from a slightly different angle. <em>De bananengeneratie</em> also explains how being Chinese-Dutch intersects with being gay, as Wu describes his experiences in online dating (the phrase “no asians” is apparently common in the online Dutch gay scene).</p> <p><em><a href="https://dasmag.nl/shop/pete-wu-de-bananengeneratie">De bananengeneratie</a></em> by Pete Wu</p> <h2>The myth of “trickle-down”</h2> <p>Some say it will lead to more equality if minorities make it to the top. This idea of “trickle down” is questionable, shows Dawn Foster in her short book “Lean out”. Sheryl Sandberg may have successfully made it to the top, but her “journey” cannot simply be copied by others. Making it to the top shouldn’t be an aspiration of feminism anyway, explain the authors of “Feminism for the 99%”, as sexism often intersects with other problems, like poverty, and there are bigger problems to solve at the bottom.</p> <p><em><a href="https://repeaterbooks.com/product/lean-out/">Lean out</a></em> by Dawn Foster and <em><a href="https://www.penguinrandomhouse.com/books/600151/feminism-for-the-99-by-cinzia-arruzza-tithi-bhattacharya-and-nancy-fraser/">Feminism for the 99%</a></em> by Cinzia Arruzza, Tithi Bhattacharya and Nancy Fraser</p> <h2>Winners take it all</h2> <p>Not to be confused with ABBA’s <em>The winner takes it all</em>. This is a good reminder that we should be extremely wary of people who say or pretend that they’ll save the world or make it more equal, especially if they’ve made large contributions to equality through their previous work. “Winners take all” makes fun of thought leaders and their conferences, explains what it means if philanthropists involve with politics and why “win win” without friction is a pipe dream.</p> <p><em><a href="https://www.penguinrandomhouse.com/books/539747/winners-take-all-by-anand-giridharadas/">Winners take all: the elite charade of changing the world</a></em> by Anand Giridharadas</p> <img src="https://hidde.blog/_images/books2-1.png" alt="Books2" /> <h2>Such a fun age and Little fires</h2> <p>Novels are a really good way to better understand racist dynamics, so I want to end this list with two of my favourite reads this year, “Such a fun age”, by Kiley Reid, beautifully shows how good intentions cannot prevent bad impact, by exploring racial inequality from two points of view, a rich white woman and a single black twenty-something. “Little fires everywhere”, by Celeste Ng, takes place in Shaker Heights, a suburb of Cleveland Ohio, where everything is planned, including careers, as if there is no privilege, and everyone is colour blind, as if there is no racial tensions. This is also a tale about motherhood, identity, and social status, the comedy is top notch and the characters are fantastic. This was also turned into a tv series on Hulu.</p> <p><em><a href="https://kileyreid.com/such-a-fun-age">Such a fun age</a></em> by Kiley Reid and <em><a href="https://www.celesteng.com/little-fires-everywhere/">Little fires everywhere</a></em> by Celeste Ng.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/equality-a-reading-list-2/">Equality, a reading list (2)</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Equality, a reading list (2)">Reply via email</a></p> When there is no content between headings 2020-09-05T00:00:00Z https://hidde.blog/when-there-is-no-content-between-headings/ <p>For accessibility purposes, you could think of <a href="https://hiddedevries.nl/en/blog/2018-09-01-heading-structures-are-tables-of-contents">headings as a table of contents</a>. But what if there are headings without contents?</p> <p>On a web page, a heading (<code>h1</code>, <code>h2</code>, <code>h3</code> etc) signposts ‘a section about X starts here’. Heading names are section names, in that sense. If, in a banana bread recipe, one heading says ‘Ingredients’, and the other says ‘Method’, expectations are set about what can be found where. Under the first heading, we’ll expect what goes into the banana bread, under the second we’ll expect some steps to follow.</p> <h2>The issue</h2> <p>Now, a problem I saw on a website recently: headings with no content. The issue wasn’t empty <code>hx</code> elements, it was that there was no content between these elements and the next. This can happen when the heading element was picked merely for its looks, rather than as a way to indicate that there is some content—and what kind of content.</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h1</span><span class="token punctuation">></span></span>Banana bread<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h1</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span><span class="token punctuation">></span></span>It's tasty<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">></span></span> <span class="token comment">&lt;!-- nothing --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span><span class="token punctuation">></span></span>It's healthy<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">></span></span> <span class="token comment">&lt;!-- nothing --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span><span class="token punctuation">></span></span>It can be anyway<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">></span></span></code></pre> <p>On a site with beautiful heading styles, this could look great, but structurally it is unhelpful, because when someone navigates to one of these <code>h2</code> ’s, they find nothing.</p> <p>It could also constitute a failure of WCAG <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1&showtechniques=324%2C331#info-and-relationships">1.3.1: Info and relationships</a>, because you’re basically claiming a structural relationship when there isn’t one. </p> <p>So, the two questions to ask for headings:</p> <ul> <li><strong>useful description</strong>: does this clearly say what kind of content I can find underneath? </li> <li><strong>content</strong>: is there any content available underneath?</li> </ul> <p>In the example above, only the <code>h1</code> meets the criterion of being something we would want to navigate to. The bits underneath are more of a list of unique selling points. Something like this would be better in this context:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h1</span><span class="token punctuation">></span></span>Banana bread<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h1</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>ul</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">></span></span>It's tasty<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">></span></span>It's healthy<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>ul</span><span class="token punctuation">></span></span></code></pre> <p>Note: the problem is not multiple headings as such, it’s multiple headings of the same level, that have no non heading content that they are a description for.</p> <h2>In summary</h2> <p>When you use a heading element, you set the expectation of content—always have content between headings of the same level.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/when-there-is-no-content-between-headings/">When there is no content between headings</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20When there is no content between headings">Reply via email</a></p> Why it's good for users that HTML, CSS and JS are separate languages 2020-11-25T00:00:00Z https://hidde.blog/why-its-good-for-users-that-html-css-and-js-are-separate-languages/ <p>This week, somebody <a href="https://github.com/w3c/csswg-drafts/issues/5743">proposed</a> to replace HTML, CSS and JavaScript with just one language, arguing “they heavily overlap each other”. They wrote the separation between structure, styles and interactivity is based on a “false premise“. I don’t think it is. In this post, we’ll look at why it is good for people that HTML, CSS and JS are separate languages.</p> <p>I’m not here to make fun of the proposal, anyone is welcome to suggest ideas for the web platform. I do want to give an overview of why the current state of things works satisfactorily. Because, as journalist <a href="https://www.linkedin.com/in/zeynep-tufekci-2958881a/">Zeynep Tefepkçi</a> said (<a href="https://adactio.com/articles/15975">source</a>): </p> <blockquote> <p>If you have something wonderful, if you do not defend it, you will lose it. </p> </blockquote> <p>On a sidenote: the separation between structure, style and interactivity goes all the way back to the web’s first <a href="https://www.w3.org/Proposal.html">proposal</a>. At the start, there was only structure. The platform was for scientists to exchange documents. After the initial idea, a bunch of smart minds worked years on making the platform to what it is and what it is used for today. This still goes on. Find out more about web history in <a href="https://talks.hiddedevries.nl/2gDDUr/slides">my talk On the origin of cascades</a> (<a href="https://www.youtube.com/watch?v=JjbeOvVFAdg">video</a>), or Jeremy Keith and Remy Sharpe’s awesome <a href="https://adactio.com/articles/15975">How we built the World Wide Web in 5 days</a>. </p> <h2>Some user needs</h2> <h3>Users need structure separated out</h3> <p>The interesting thing about the web is that you never know who you’re building stuff for exactly. Even if you keep statistics. There are so many different users consuming web content. They all have different devices, OSes, screen sizes, default languages, assistive technologies, user preferences… Because of this huge variety, having the structure of web pages (or apps) expressed in a language that is <em>just</em> for structure is essential. </p> <p>We need shared structure so that:</p> <ul> <li>screen reader users can navigate web pages by heading (see <a href="https://hiddedevries.nl/en/blog/2018-09-01-heading-structures-are-tables-of-contents">headings are tables of contents</a>). </li> <li>people with an attention disorder can turn on <a href="https://support.mozilla.org/en-US/kb/firefox-reader-view-clutter-free-web-pages">reader mode</a></li> <li>people with motor impairments can use autofill (see <a href="https://www.w3.org/WAI/WCAG21/Understanding/identify-input-purpose">Identify Input Purpose</a>)</li> <li>people who want to read a foreign language page in their mother tongue can stick a URL into <a href="https://support.google.com/translate/answer/2534559?co=GENIE.Platform%3DDesktop&hl=en">Google Translate</a></li> </ul> <p>All of these users rely on us writing HTML (headings, semantic structure, <code>autocomplete</code> attributes, <code>lang</code> attributes, respectively). Would we want to break the web for those users? Or, if we use the JSON abstraction suggested in the aforementioned proposal, and generate DOM from that, would it be worth breaking the way developers are currently used to making accessible experiences? This stuff is hard to teach as it is.</p> <p>Even if we would time travel back to the nineties and could invent the web from scratch, we’d still need to express semantics. Abstracting semantics to JSON may solve some problems and make some people’s life easier, but having seen some attempts to that, it usually removes the simplicity and flexibility that HTML offers.</p> <h3>Users need style separated out</h3> <p>Like it is important to have structure separated out, users also need us to have style as a separate thing. </p> <p>We need style separated out, so that: </p> <ul> <li>people with low vision can use high contrast mode; <a href="https://webaim.org/projects/lowvisionsurvey2/#contrastMode">a WebAIM survey</a> showed 51.4% do (see also Melanie Richard’excellent <a href="https://www.youtube.com/watch?v=Z_QZhoBrWPc">The Tailored Web: Effectively Honoring Visual Preferences</a>)</li> <li>people who only have a mobile device can access the same website, but on a smaller screen (responsive design worked, because CSS allowed HTML to be device-agnostic)</li> <li>people with dyslexia may want to override some styles use a dyslexia friendly typeface (see <a href="http://www.serendavies.me/dyslexic-fonts/2016/01/04/dyslexic_fonts.html">Dyslexic Fonts</a> by Seren Davies)</li> <li>people who (can) only use their keyboard can turn on browser plugins that force focus outlines</li> <li>users of social media may want to use a custom style sheet to turn off the Trending panel (it me 🙄)</li> </ul> <h3>Users need interactivity separated out</h3> <p>Some users might even want (or have) interactivity separated out, for instance if the IT department of their organisation turned the feature off company-wide. Some users have JavaScript turned off manually. These days, neither are common at all, but there are still good reasons to think about what your website is without JavaScript, because JavaScript loss can happen accidentally.</p> <p>We need interactivity separated out, because: </p> <ul> <li>some people use a browser with advanced tracking protection, like Safari or Firefox (see my post <a href="https://hiddedevries.nl/en/blog/2019-01-07-on-the-importance-of-testing-with-content-blockers">On the importance of testing with content blockers</a>)</li> <li>some people may be on low bandwidth </li> <li>some people may use an old device or operating system for valid reasons</li> <li>some people may be going to your site while you’ve just deployed a script that breaks in some browsers, but you’ve not found out during testing, because it is obscure</li> </ul> <p>As <a href="https://twitter.com/jaffathecake/status/207096228339658752">Jake Archibald said in 2012</a>: </p> <blockquote> <p>“We don’t have any non-JavaScript users” No, all your users are non-JS while they’re downloading your JS </p> </blockquote> <p>That’s right, all your users are non-JS while they’re downloading your JS. </p> <h2>Existing abstractions</h2> <p>None of this is to say it can’t be useful to abstract some parts of the web stack, for some teams. People abstract HTML, CSS and JavaScript all the time. People happily <a href="https://talks.hiddedevries.nl/2gDDUr/slides#slide50-desc">separate concerns differently</a>: not on a page level, but on a UI component level.</p> <p>On the markup end of things, there are solutions like Sanity’s <a href="https://github.com/portabletext/portabletext">Portable Text</a> that defines content in JSON, so that it can be reused across many different “channels”. This is a format for storing and transferring data, not for displaying it on a site. Because before you display it anywhere, you’d write a template to do that, in HTML. In a government project I worked on years ago, the team abstracted form fields to JSON before converting them to HTML. I currently work on a project where we use XSLT to specify some stuff before generating HTML.</p> <p>For CSS there are extensions like <a href="https://sass-lang.com/">Sass</a> and Less, utility-first approaches like <a href="https://tailwindcss.com/">Tailwind</a> and many methods to define CSS inside JavaScript component. From <a href="https://en.wikipedia.org/wiki/JavaScript_Style_Sheets">JSSS</a> (from 1997) to <a href="https://en.wikipedia.org/wiki/CSS-in-JS">CSS in JS</a> today, there is lots to choose. </p> <p>As for JavaScript: there are numerous abstractions that make some of the syntax of JavaScript easier (<a href="https://jquery.com/">jQuery</a>, in its time), that help developers write components with less boilerplate (like <a href="https://svelte.dev/">Svelte</a> and <a href="https://vuejs.org/">Vue</a>) and that help teams make less programmatically avoidable mistakes (<a href="https://www.typescriptlang.org/">TypeScript</a>).</p> <p>I don’t use any of these abstractions for this site, or most others I work on. Yet, many approaches are popular with teams building all sorts of websites. Choose any or no abstractions, whatever helps you serve the best HTML, CSS and JS to end users.</p> <p>We’re very lucky that all of these abstract things that are themselves simple (ish) building stones: HTML, CSS and (to a different extent) JavaScript. With abstractions, individual teams and organisations can separate their concerns differently as they please, without changing the building blocks that web users rely on.</p> <p>Could you benefit people in your abstractions? Maybe. The proposal mentions specific parameters for visual impairments and content that can trigger seizures. But it is better for users (including their privacy) to have such things in the main HTML and CSS, regardless of whether that was written by hand or outputted by some abstraction. </p> <h2>Conclusion</h2> <p>The separation between HTML, CSS and JavaScript as it currently is benefits web users. It does this in many ways that sometimes only become apparent after years (CSS was invented 25 years ago, when phones with browsers did not yet exist, but different <code>media</code> were already taken into account). It’s exciting to abstract parts of the web and remodel things for your own use case, but I can’t emphasise enough that the web is for people. Well written and well separated HTML and CSS is important to their experience of it.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/why-its-good-for-users-that-html-css-and-js-are-separate-languages/">Why it's good for users that HTML, CSS and JS are separate languages</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Why it's good for users that HTML, CSS and JS are separate languages">Reply via email</a></p> 2020 in review 2020-12-17T00:00:00Z https://hidde.blog/2020-in-review/ <p>It’s that time of the year again! In this post, I’ll share some highlights of my 2020, a year that I personally can’t wait to leave behind. Below, you’ll find what I’ve been up to and some things that I have learned.</p> <p>This year I have had some great things happen to me: I became a father for the second time and moved house. It has also been a struggle in many ways. But I’ll repeat my disclaimer from <a href="https://hiddedevries.nl/en/blog/2018-12-26-2018-in-review">2018</a>, in these public posts, for reasons, I chose to leave the “lowlights” out. Rest assured there were many, as I imagine was the case for you too.</p> <h2>Highlights</h2> <h3>Projects</h3> <p>It has been a good year for my freelance practice, also a stressful one, particularly in lockdown times.</p> <img src="https://hidde.blog/_images/wai-work.png" alt="Wai work" /> <p>I spent the vast majority of my time this year working with the Web Accessibility Initiative at the W3C. This year, I worked on various things: </p> <ul> <li>redesign of WCAG supporting documents, like Techniques and Understanding, to launch sometime next year, with improvements including syntax highlighting and clarified context</li> <li>talks about the importance of authoring tools, like <a href="https://www.youtube.com/watch?v=zlinL3SCjic">Your CMS is an accessibility assistant</a> for WordPress Accessibility Day</li> <li>launched the <a href="https://w3.org/WAI/atag/report-tool">ATAG Report tool</a>, which can be used to report on accessibility issues in authoring tools, like CMSes, e-learning systems and form generators</li> </ul> <p>In the time that was left, I did a bunch of accessibility audits and workshops in my own capacity. Some for my own clients, some for the clients of consultancies like <a href="https://firmground.nl/">Firm Ground</a> and <a href="https://elevenways.be/">Eleven Ways</a>. I also had a short advisory role on the <a href="https://coronamelder.nl/">CoronaMelder</a> website, helping with accessibility and code reviews.</p> <p>I gladly said yes to all of these things, and loved combining the standards-oriented work with the practical hands-on stuff. It’s truly been good to see people understand accessibility better.</p> <h3>Speaking</h3> <p>Almost all of my speaking this year was virtual. I had planned to represent W3C/WAI at the CSUN accessibility conference this year, but this ended up the first of many events cancelled. </p> <p>The only in-person talk of the year was a practice round for that CSUN talk: <a href="https://talks.hiddedevries.nl/kjfT9F/amplifying-your-accessibility-with-better-authoring-tools">Amplifying your accessibility with better authoring tools</a>. It was in Groningen, close to where I grew up and first worked, and I also got to see <a href="https://twitter.com/manuelame/">Maike</a> do her awesome talk about <a href="https://noti.st/maikeklip/8PwfGq/bring-back-empathy">empathy in government</a>.</p> <p>I also did some private talks, and these public talks, all online: </p> <ul> <li><a href="https://talks.hiddedevries.nl/hi8wiJ/amplifying-your-accessibility-with-better-authoring-tools">Amplifying your accessibility with better authoring tools</a> at <a href="https://afuturedate.herokuapp.com/">A Future Date</a></li> <li><a href="https://talks.hiddedevries.nl/2AxSl2/advancing-authoring-tool-accessibility">Advancing authoring tool accessibility</a> at an <a href="https://knowbility.org/programs/accessu/2020/">AccessU event</a> with an all-WAI line-up introducing all we’ve been working on</li> <li><a href="https://talks.hiddedevries.nl/2gDDUr/on-the-origin-of-cascades">On the origin of cascades by means of natural selectors</a>, a Darwin-themed look into the evolution of CSS, at <a href="https://www.meetup.com/CSS-Cafe/">CSS Café</a>, virtually in Boden, Germany </li> <li><a href="https://talks.hiddedevries.nl/Qz7boE/six-ways-to-make-your-site-more-accessible">6 ways to make your site more accessible</a> at Full Stack Utrecht</li> <li><a href="https://talks.hiddedevries.nl/wOPHj5/your-cms-is-an-accessibility-assistant">Your CMS is an accessibility assistant</a> at <a href="https://wpaccessibilityday.org/">WordPress Accessibility Day</a></li> <li><a href="https://talks.hiddedevries.nl/K4gTqg/on-auto-sizes-in-grid-layout">On auto sizes in Grid Layout</a>, about sizes in CSS. It was a dream come true to speak at <a href="https://singaporecss.github.io/">Singapore CSS</a>, an event organised by awesome humans.</li> <li><a href="https://talks.hiddedevries.nl/7NhArB/its-the-markup-that-matters">It’s the markup that matters</a> at <a href="https://hidde.blog/2020-in-review/vercel.com">Vercel</a>’s <a href="https://nextjs.org/2020/conf">Nextjs Conf</a>, packed with accessibility info, aimed at full stack developers.</li> </ul> <p>Generally, online talks felt harder than IRL ones, because of less audience interaction and more preparation time. There was also less meeting people and traveling. </p> <p>Less traveling was also an advantage: I could cook family dinner after delivering a talk, instead of being away for a few days. There was also one time where I attended my Q&A with a plaster, because I thought I could do some meal prep in a conference break. 🩹</p> <h3>Reading</h3> <p>I was able to read plenty and discovered a bunch of new authors that brought me joy and wisdom. I did one reading list post this year: <a href="https://hiddedevries.nl/en/blog/2020-07-16-equality-a-reading-list-2">Equality, a reading list (2)</a>.</p> <p>If you’re looking for recommendations, find me on Goodreads (email/DM for my handle), I read in Dutch and English. These are some highlights in fiction: </p> <ul> <li><a href="https://www.celesteng.com/">Celeste Ng</a>’s <a href="https://www.celesteng.com/little-fires-everywhere">Little fires everywhere</a>, and also her debut <a href="https://www.celesteng.com/everything-i-never-told-you">Everything I never told you</a></li> <li>Anna Wiener’s <a href="https://www.annawiener.com/uncanny-valley-1">Uncanny valley</a>, about a woman in publishing who moves to Silicon Valley and is rightly shocked by the men, the hustle, the offices, weird camping trips… (see also <a href="https://hiddedevries.nl/en/blog/2020-03-12-uncanny-valley">my review</a>)</li> <li><a href="https://twitter.com/NaoiseDolan">Naoise Dolan</a>’s Exciting Times, about millennials in Hong Kong</li> <li>Johan Harstad’s <a href="https://booksfromnorway.com/books/88-max-mischa-and-the-tet-offensive">Max, Mischa & Tetoffensiven</a>, about identity, living abroad, friendship, Norway, the US and much more, blew me away. Sorry if you don’t read German, Dutch or Norwegian, it wasn’t (yet) translated to English.</li> </ul> <p>These were my favourites in non-fiction: </p> <ul> <li>Jia Tolentino’s <a href="https://jia.blog/">Trick Mirror</a>, essays about the culture of the self</li> <li>Wendy Liu’s <a href="https://dellsystem.me/">Abolish Silicon Valley</a>, about what’s wrong with Silicon Valley’s ideology</li> <li><a href="https://en.wikipedia.org/wiki/Michael_Sandel">Michael Sandel</a>’s The Tyranny of Merit , about why meritocracy is a lie</li> <li>Ibram X Kendi’s <a href="https://www.ibramxkendi.com/how-to-be-an-antiracist-1">How to be an anti-racist</a> – paraphrasing Dutch journalist Pete Wu: it’s probably not right to think in strict boxes but the categories of “racist” and “anti-racist” seem like a very useful distinction to make. Ibram X Kendi’s work has been my favourite about anti-racism so far. He narrates the audiobook himself and it is super powerful.</li> </ul> <h3>Writing</h3> <p>I wrote a lot less. Partly, I’ll blame 2020. Partly, it may be due to more of my work involving writing. </p> <p>Some of the posts I did write: </p> <ul> <li><a href="https://hiddedevries.nl/en/blog/2020-02-04-could-browsers-fix-more-accessibility-problems-automatically">Could browsers fix more accessibility problems automatically</a> and <a href="https://hiddedevries.nl/en/blog/2020-03-01-more-accessible-defaults-please">More accessible defaults, please</a>– the web could be made more accessible from many sides: teams building website, website creation software, but also browsers. These posts go into what could be built into browsers.</li> <li><a href="https://hiddedevries.nl/en/blog/2020-06-27-how-deployment-services-make-client-side-routing-work">How deployment services make client-side routing work</a> about hosting SPAs with routers</li> <li><a href="https://hiddedevries.nl/en/blog/2020-03-09-minimum-viable-data-collection">Minimum Viable Data Collection</a>, where I argue that if we want to follow the spirit of GDPR, we should collect data minimally, rather than beg for permission to collect maximally. </li> </ul> <p>For the next year, I have some drafts floating around, that I hope to once finish and publish.</p> <h3>Cities</h3> <p>Last year, I had a “Cities” section. This section will be resumed next year.</p> <h2>Things I learned</h2> <p>I didn’t really do any side projects or volunteering this year. Some things I have learned this year:</p> <ul> <li>the basics of XSLT, which is used at W3C/WAI to generate the documents that support the WCAG standard</li> <li>I struggled a bit with <a href="https://git-scm.com/book/en/v2/Git-Tools-Submodules">git submodules</a>, and ended up learning a bit about them</li> <li>For obvious reasons, I worked on talk recording skills and found out it’s all about light, light and light. And that I pull weird faces and should move my head less.</li> <li>Audiobooks allow one to read while going for a walk or doing the dishes, which are some of the few tasks reading can nicely be combined with.</li> <li>Static site generators are perfect for creating WCAG conformance reports. Turning HTML into an accessible PDF is not trivial, and one almost certainly requires <a href="https://www.princexml.com/">PrinceXML</a> for it. It doesn’t support Grid Layout, but has lots of print-specific CSS that is fun to play with, should you be a CSS nerd.</li> </ul> <p>Dear readers, I hope 2021 treats you well. Hang in there.</p> <p>Should you want to read more personal review posts, check out those of <a href="https://css-irl.info/goodbye-2020/">Michelle</a>, <a href="https://matthiasott.com/notes/bye-2020">Matthias</a>, <a href="https://melanie-richards.com/blog/2020-review/">Melanie</a>, <a href="https://cheeaun.com/blog/2020/12/2020-in-review/">Chee Aun</a>, <a href="https://una.im/2020-in-review/">Una</a>, <a href="https://nienke.dev/posts/2020-a-post-mortem/">Nienke</a>, <a href="https://mxb.dev/blog/year-in-review-2020/">Max</a>, <a href="https://marcus.io/blog/my-2020">Marcus</a> and <a href="https://bradfrost.com/blog/post/2020/">Brad</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/2020-in-review/">2020 in review</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%202020 in review">Reply via email</a></p> How I turned my Goodreads data into a self-hosted website with Eleventy 2021-01-04T00:00:00Z https://hidde.blog/how-i-turned-my-goodreads-data-into-a-self-hosted-website-with-eleventy/ <p>In the last week of 2020, I decided to export my Goodreads data to display it <a href="https://books.hiddedevries.nl/">on my personal website</a>. This post is about what I did and how.</p> <img src="https://hidde.blog/_images/screenshot-1.png" alt="Screenshot" /> <h2>Why export?</h2> <p>First, I quite like Goodreads. It lets me see the reads of friends and acquaintances. It lets me share my own. This is all splendid, but it is still somebody else’s site. Somebody with very different life goals from my own, in fact. For more control on what I display and how, I decided to create a new section of this website dedicated to books, fed by an export of my Goodreads data.</p> <p>The two main reasons I use Goodreads are people and books. I want to connect with (internet) friends and be inspired by what they read. I also want to keep track of what I have read and plan to read, for instance when a person or article mentions an interesting book. When I’m reading a book review in the paper, I’l sometimes grab my phone and add the thing to the list. Goodreads has an easy to use catalog that usually lists what I searched.</p> <p>Some things to dislike about the platform are the gamification and the generic recommendations: it’s noise that I could do without (“you read something in philosophy, maybe you’ll like this book by Plato”). There are also lots of trackers, and it is powered by a faceless multi-billion dollar enterprise that threatens the livelihood of friendly, local bookshops.</p> <h2>Some features</h2> <p>Various people’s online bookshelves inspired me to create one on this site, including <a href="https://highlights.melanie-richards.com/">Melanie Richard’s highlights</a>, focused on highlights, <a href="https://daverupert.com/bookshelf">Dave Rupert’s Bookshelf</a>, which features many short reviews and half stars, <a href="https://macwright.com/reading/">Tom McWright</a>’s, <a href="https://maggieappleton.com/library">Maggie Appleton</a>’s, <a href="https://aworkinglibrary.com/reading/">Mandy Brown</a>’s, <a href="https://books.alexwlchan.net/">Alex Chan</a>’s, <a href="https://highlights.sawyerh.com/">Sawyer Hollenshead</a> (also with highlights) and <a href="https://amandapinsker.com/reading">Amanda Pinkster</a> (includes where she read them).</p> <p>I like the processes of other people: <a href="https://katydecorah.com/code/read/">Katy Decorah uses GitHub actions</a>, <a href="https://what.pm/">Nienke uses her own What.pm</a> and <a href="https://adactio.com/journal/17596">Jeremy Keith tags notes with ISBN numbers</a>. My process is still different from each of them though, for no particular reason.</p> <p>For me, a personal book repository does not require a lot, but these are some features I wanted to have: </p> <dl> <dt><strong>Separate views for Dutch and English</strong> </dt> <dd>I mostly read in these two languages, some viewers may only be interested in either section.</dd> <dt><strong>Hand-picked book covers</strong></dt> <dd>‘Never judge a book by its cover’, they say. Well, I like book covers as expectation setters and <a href="https://hidde.blog/how-i-turned-my-goodreads-data-into-a-self-hosted-website-with-eleventy/#did-not-automate">did not automate</a> the cover art collection process.</dd> <dt><strong>Links to author’s personal sites</strong></dt> <dd>Personal sites deliver on the promise of the web, said Matthias Ott in <a href="https://css-tricks.com/make-it-personal/">Make it personal</a>. I haven’t enriched a lot of the data with this piece of information, but will be.</dd> <dt><strong>Dark mode</strong></dt> <dd>Because CSS is fun. I went for a <code>midnightblue</code> background with <code>khaki</code> text.</dd> <dt><strong>No tracking</strong> </dt> <dd>This site does not track users. <a href="https://hiddedevries.nl/en/blog/2020-03-09-minimum-viable-data-collection/">Minimum Viable Data Collection</a> (zero, in this case) ftw.</dd> </dl> <h2>What I could automate</h2> <h3>CSV entries to front matter in Markdown</h3> <p>I decided to use <a href="https://11ty.dev/">Eleventy</a> to turn my data into a web page, as I like its flexibility, its focus on simplicity and its firm hesitation to make decisions for developers using it. </p> <p>Goodreads provides reading data in CSV files, which are reasonably well structured. For the Eleventy site, I needed a folder full of Markdown files, one for each book, with basically the metadata from the Goodreads export as <a href="https://yaml.org/">Yaml</a> front matter:</p> <pre class="language-yaml"><code class="language-yaml"><span class="token punctuation">---</span> <span class="token key atrule">title</span><span class="token punctuation">:</span> <span class="token string">"Uncanny Valley"</span> <span class="token key atrule">author</span><span class="token punctuation">:</span> <span class="token string">"Anna Wiener"</span> <span class="token key atrule">isbn</span><span class="token punctuation">:</span> <span class="token string">"0374278016"</span> <span class="token key atrule">isbn13</span><span class="token punctuation">:</span> <span class="token string">"9780374278014"</span> <span class="token key atrule">rating</span><span class="token punctuation">:</span> <span class="token string">"5"</span> <span class="token key atrule">publisher</span><span class="token punctuation">:</span> <span class="token string">"MCD"</span> <span class="token key atrule">pages</span><span class="token punctuation">:</span> <span class="token string">"281"</span> <span class="token key atrule">publishYear</span><span class="token punctuation">:</span> <span class="token string">"2020"</span> <span class="token key atrule">read</span><span class="token punctuation">:</span> <span class="token string">"2020"</span> <span class="token key atrule">goodreads_id</span><span class="token punctuation">:</span> <span class="token string">"45186565"</span> <span class="token punctuation">---</span></code></pre> <p>I did this in Node using a slightly modified version of <a href="https://github.com/ninjality/convert-csv-markdown/">CSV to Markdown</a>. The project is archived and I could not get the Noderize wrapper to work, but the provided script in <code>index.js</code> did the job for me. </p> <p>It seems like Hay Kranen’s <a href="https://hay.github.io/dataknead/">dataknead</a> may be a great alternative to do this work (in Python).</p> <h3>Image processing</h3> <p>This site has a lot of images, and resizing or optimising would not be my definition of fun. I used the official <a href="https://www.11ty.dev/docs/plugins/image/">Image plugin for Eleventy</a> to generate correctly sized images from my source images, and the documented Nunjucks shortcode to output a <code>picture</code> element with <code>webp</code> and <code>jpg</code> versions in various sizes. </p> <p>I used the native lazyloading attribute, <code>loading=&quot;lazy&quot;</code> , which I learned only in this project, is not added to the <code>picture</code>-element, but to the fallback <code>&lt;img&gt;</code> .</p> <h3>The grid</h3> <p>I knew how I wanted my content to be layed out, but I didn’t know what my content would be. Grid Layout is fantastic if that’s your situation. I used grid’s <a href="https://www.w3.org/TR/css-grid-1/#grid-item-placement-algorithm">autoplacement</a> feature: I defined a grid, added the content in HTML and each book magically appeared in its right place.</p> <img alt="books with grid browser tools overlayed" src="https://hidde.blog/_images/grid.png" /> <p>On small screens, I used the non-default autoflow value <code>column</code>, to make new items appear horizontally.</p> <h2 id="did-not-automate">What I didn’t automate</h2> <p>In web projects, we often balance between spending time to automate versus doing it manually. Sure, automation can be a fun thing to work on. But if I’m honest, I only want to do it if it saves more time than it costs. </p> <h3>Book covers</h3> <p>Cover art is among the highest forms of graphic design. Covers of music and books can be incredibly creative. Film posters can be a prone to <a href="https://www.youtube.com/watch?v=1ThnxSaExzU">cliche overuse</a>, but have you seen <a href="https://www.youtube.com/watch?v=nRpGSDsu_tg">Saul Bass’s movie posters</a>? </p> <p>Books often get different covers when they are reprinted or distributed in different countries. This project was the perfect excuse to handpick my favourite for each book.</p> <h3>CSS authoring</h3> <p>There was not enough complexity to warrant any form of CSS processing, so I just created a single CSS file and started adding styles. I used no methodology or framework. I did mostly avoid classes, because in my day to day work I overuse them and it seemed like a fun challenge.</p> <h3>Extra data</h3> <p>I’ve also added some data manually that I didn’t have in Goodreads, like the language I read a book in. And I want to slowly add more data to some books, like the URI for the author’s <em>personal</em> website, and, in case I wrote a review, a link to that review.</p> <h2>Future features</h2> <p>There are some things that I would like to improve when there’s more time or less lockdown. A website is never finished! </p> <dl> <dt><strong>Some interface to add data</strong></dt> <dd>Adding a new book now involves me manually creating a Markdown file with the right front matter and a JPG file with the same name for the book cover. I could automate at least part of this.</dd> <dt><strong>Filters</strong></dt> <dd>Books can currently display by language. If I started adding tags to books, I could create sub lists, “Show books about topic X”. That would be fairly trivial to do.</dd> <dt><strong>Better sorting</strong></dt> <dd>I messed up transforming the date field in the Goodreads export, so now I only have a year and no way to sort by reading date. I plan to add this for new books.</dd> <dt><strong>RSS</strong></dt> <dd>I doubt anyone would subscribe to something like this, but wide availability of reading list RSS feeds would allow us all to create a decentralised Goodreads in feed reader software of our choice.</dd> <dt><strong>Better lazyloading</strong></dt> <dd>Currently, all images on the book site have the <code>loading="lazy"</code> attribute. The recommended way is to only add this attribute for images that are not in the viewport. I’m not sure how to solve that on this site, because my grid grows with the viewport. Which images are in <em>your</em> viewport, depends on how wide it is.</dd> <dt><strong>Better markup</strong></dt> <dd>Maybe I can use more standard markup for the books, like microformats. The <a href="https://indieweb.org/personal_library">indieweb personal library</a> page has some pointers, including <a href="http://paulmunday.net/book-microformats">Paul Munday’s example of microformats for books</a>.</dd> </dl> <p>Woops, that’s quite the list. Let me just postpone it to the next sprint. </p> <h2>Wrapping up</h2> <p>So, my book site is available on <a href="https://books.hiddedevries.nl/">books.hiddedevries.nl</a>, the source is on <a href="https://github.com/hidde/books">GitHub</a>. This has been a fun weekend project, and to be honest, I am very much looking forward to continue expanding the existing data and add new stuff. </p> <p>If you have one of these digital bookshelves yourself, please do share them in the comments or reply on Twitter! If you have any thoughts or opinions on what I’ve done, feel free to let me know.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/how-i-turned-my-goodreads-data-into-a-self-hosted-website-with-eleventy/">How I turned my Goodreads data into a self-hosted website with Eleventy</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20How I turned my Goodreads data into a self-hosted website with Eleventy">Reply via email</a></p> It's easier when you do it earlier 2021-02-04T00:00:00Z https://hidde.blog/its-easier-when-you-do-it-earlier/ <p>Web accessibility becomes easier and cheaper, when you address it earlier. In this post, we’ll look at various ways to do that, like picking the right CMS and making accessibility part of the agile process. Combine them for maximum effect.</p> <p>A quick disclaimer before we start: while this post is about web accessibility, the same probably goes for web security, web privacy and other important aspects of a healthy web.</p> <p>To make websites accessible, most organisations choose to follow the Web Content Accessibility Guidelines (<a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1">WCAG</a>). It’s also the standard most governments embed in their rules. Meeting WCAG does not guarantee accessibility, but the standard is a good baseline. It is our best bet as a shared understanding ‌of what ‘this is accessible’ means. </p> <h2>Choose a CMS that helps with accessibility</h2> <p>WCAG is about the accessibility of content, so it makes sense to optimise what we do when we <strong>create</strong> content. We could pick CMSes that help editors create accessible content. In my talk “<a href="https://talks.hiddedevries.nl/wOPHj5/your-cms-is-an-accessibility-assistant">Your CMS is an accessibility assistant</a>”, that I did last year, I discuss just that. </p> <p>What if a CMS, when you add a video, prompts for subtitles? What if it, when you place text on a hero image, it helps you pick a color that has sufficient contrast, or suggests to add a background color? Some CMSes already ship with features like this. </p> <p>WordPress’s Gutenberg editor, for instance, will tell you when you’re starting to use colours with insufficient contrast:</p> <img alt="white text and light gray background, with on the right a color settings panel that shows a warning saying the color combination may be hard to read and suggests making the background darker" src="https://hidde.blog/_images/screenshot-2021-02-04-at-14.03.11.png" /> <p>Features like this are super helpful, because they let us spot accessibility issues early in the process. Without them, we may have only found out about problems once the functionality went live and got audited. With good early warning systems, WCAG audits can focus on the more complex issues.</p> <h2>Check accessibility with every user story</h2> <p>A lot of web projects rely on some form of agile project management, many move new functionality through a set of stages. If you can build accessibility steps into the process, somewhere before the last stage, you can find and fix accessibility problems before they go live.</p> <p>There are many ways to do this. You may not want to do a full WCAG audit on each piece of functionality, but I’ve seen teams leverage checklists that address low hanging fruit. When you combine a bunch of fairly easy to execute manual checks with some automated accessibility checker, you will likely be able to address problems while they emerge. For instance, add that keyboard handler while you’re building the widget, rather than following a formal accessibility audit months after the feature initially launched.</p> <p>Some checks you could include are:</p> <ul> <li>do the automated checks (for instance from <a href="https://github.com/dequelabs/axe-core">axe-core</a>, <a href="https://tenon.io/">Tenon</a>, <a href="https://polypane.app/blog/find-and-fix-accessibility-issues-with-polypane/">Polypane</a> or <a href="https://siteimprove.com/en/accessibility/">Siteimprove</a>) return zero issues? <em>Note, automated checks can only check 10-30% of WCAG issues, don’t rely on just automated checks</em></li> <li>can all controls in the feature be used with only a keyboard? </li> <li>can you still use everything if the browser is set to 400% zoom?</li> <li>for all form inputs, does the input activate when you click on the label?</li> </ul> <img alt="screenshot of terminal window running axe and another screenshot of wikipedia zoomed in 300%" src="https://hidde.blog/_images/screenshot-2021-02-04-at-14.10.19.png" /> <p>Checklists have caveats though… the most important is to realise that “what’s most easy to check” is not necessarily the same as “what’s the most important to check”. It would be quite the coincidence if it was. But having said that, easy checks are probably the checks that are most feasible to include with each piece of functionality. </p> <h2>Level up on HTML proficiency</h2> <p>A large portion of issues I find in my WCAG audits relates to HTML and how to use it. Developers who know the <a href="https://html.spec.whatwg.org/dev/">HTML spec</a> inside out are at a massive advantage when it comes to the WCAG compliance of the product they work on. Which elements to use when, how to build <code>form</code>s, what attributes exist for <code>tables</code>… it will all help write more accessible code.</p> <p>For instance, developers who are aware that <code>input</code>-elements have an <a href="https://html.spec.whatwg.org/dev/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute"><code>autocomplete</code> attribute</a>, will have no trouble meeting <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1#identify-input-purpose">Identify input purpose</a> (Success Criterion 1.3.5, which requires that attribute for form fields that collect personal information).</p> <p>Ensuring new developers can bubble sort may be important to your business goals, but so is testing for HTML proficiency. Even, maybe especially, when you interview a full stack developer for your team, make sure you also interview for the HTML bit of the stack. It will help the team create accessible code from the start. </p> <h2>Wrapping up</h2> <p>In conclusion, with the right CMSes, checklists for every user story and high levels of HTML proficiency, teams can get a lot of their accessibility right early in the process. These all may all seem like no-brainers, but I’ve only seen very few organisations adopt them. I’m curious if others have more strategies for putting accessibility earlier in the process, please do reply via email or socials, or in the comments below.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/its-easier-when-you-do-it-earlier/">It's easier when you do it earlier</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20It's easier when you do it earlier">Reply via email</a></p> My typical day 2021-02-15T00:00:00Z https://hidde.blog/my-typical-day/ <p>In recent weeks, people have been publishing “typical day” posts. They have been fun to read. In what Ethan Marcotte aptly <a href="https://ethanmarcotte.com/wrote/a-day-typical/">called a “blogging chain”</a>, started by <a href="http://cdevroe.com/2021/01/07/my-typical-day/">Colin Devroe</a>, <a href="https://css-irl.info/my-typical-day/">Michelle tagged me</a> and some others. So, here it goes, some typical things about my daily life.</p> <p>I’ve been admiring other people’s ability to wake up early, go for early-morning runs and/or have carefully carved out daily schedules. If you want to read what other people’s days look like, I liked those of <a href="https://css-irl.info/my-typical-day/">Michelle</a>, <a href="https://matthiasott.com/notes/my-typical-day">Matthias</a>, <a href="https://ethanmarcotte.com/wrote/a-day-typical/">Ethan </a>, <a href="https://www.cassie.codes/posts/my-typical-day/">Cassie</a>, <a href="https://adactio.com/journal/17750">Jeremy</a> and <a href="https://www.sarasoueidan.com/desk/typical-day/">Sara</a>.</p> <p>Days have been very different in the last six weeks, as I’ve taken most days off during the Dutch daycare lockdown. Those days were full of cooking together with the kids, long walks with the kids and, when it rained, painting loo rolls (again, with the kids). Super challenging, because how do you balance all that and a freelance business? Working with a baby on one arm and a toddler running around the room is a myth. It was also super rewarding, for all the obvious reasons: babies and toddlers can be immensely cute and lovely. We learn a lot from and about each other.</p> <p>Below, you’ll find a description of a somewhat regular day. The times and activities can vary.</p> <h2>07.00-8.30</h2> <p>A combination of wake up, make breakfast and coffee. We get everyone dressed, read the morning paper. I read my morning paper physically. This was initially so that I could skip online news, but who am I kidding–even with most news sites blocked via my <code>/etc/hosts</code>, I can’t resist and go peek on my phone. </p> <h2>08.30-9.30</h2> <p>Walk kids to daycare. If I’m alone, this is usually my chance to listen to audiobooks or podcasts on the way back home, and take a longer route if time allows. Podcast-wise, I’m a sucker for long form interviews, like <a href="https://www.nporadio1.nl/kunststof">NTR Kunststof</a>, <a href="https://www.nporadio1.nl/podcasts/nooit-meer-slapen/834469-lale-guel-12-februari-2021">Nooit meer slapen</a> and <a href="https://www.volkskrant.nl/kijkverder/t/podcasts/serie/met-groenteman-in-de-kast/">Groenteman in de kast</a> in Dutch, and James O’Brien’s <a href="https://www.lbc.co.uk/radio/podcasts/full-disclosure-james-obrien/">Full Disclosure</a> and Brené Brown’s <a href="https://brenebrown.com/podcast/introducing-unlocking-us/">Unlocking us</a> in English. </p> <h2>09.30-13.30</h2> <p>This is where I try to get a lot of work done. I usually don’t have meetings, as my US counterparts are still asleep. I may be working on an accessibility audit or presentation slides, or, if it’s a W3C day, I may be coding accessibility conformance tooling, review surveys from the <a href="https://www.w3.org/WAI/about/groups/eowg/">Education & Outreach Working Group</a> or generate the WCAG XSLT over and over for our current redesign project. Usually I drink <a href="https://www.puretaiwantea.com/high-mountain-tea">Taiwanese high mountain tea</a>.</p> <h2>13.30-14.00</h2> <p>Lunch time! I extend it sometimes, especially if I have evening meetings, so that I can go outside and/or cook hot lunch. </p> <h2>14.00-17.00</h2> <p>This is usually a combination of meetings, 1:1s and getting work done. I may be doing some work on components for the <a href="https://w3.org/WAI">WAI website</a>, talk to CMS vendors for <a href="https://www.w3.org/WAI/about/projects/wai-guide/">WAI-Guide</a> or attempt to split up large amounts of work into GitHub issues. Some time into the global pandemic, I purchased a second hand hifi set and placed it inside my home office, so that I can listen to all the jazz, ambient, pop, rock and hiphop when not in meetings. I check the number of positive COVID tests, which is easier if it decreases.</p> <h2>17.00-19.30</h2> <p>Daycare pick up, cooking and eating. Depending on how smooth things went and how much time there still is, we also use food delivery. I get better at not feeling too guilty about that. After dinner we usually put on music and dance a bit. <a href="https://www.youtube.com/watch?v=64si_CTae2c">Sting and Shaggy</a>, <a href="https://www.youtube.com/watch?v=-vLoM-EqWq8">Chika</a>, <a href="https://www.youtube.com/watch?v=vj6xdQ2_0B">Gregory Porter</a>, <a href="https://www.youtube.com/watch?v=Mnla8aVREj0">Nile Rodgers</a> and <a href="https://www.youtube.com/watch?v=cZeJpGl1Tg8">Moby</a> have been recent favourites. <a href="https://www.youtube.com/watch?v=EcWOBLHYCBQ">K3 and their song about washing hands</a> and <a href="https://www.youtube.com/watch?v=NWC4qu-YQxQ&">Juf Roos</a>, too.</p> <h2>19.30-21.00</h2> <p>Trying to get the kids to sleep, read bed time stories, answer mesmerising questions about the universe and its workings. Also wash up and prepare baby food. Sometimes I have an evening meeting. On Thursdays I recently started attending <a href="https://www.w3.org/community/open-ui/">Open UI</a> telecons.</p> <h2>21.00-23.00</h2> <p>Oh, is it this late already? We may watch <a href="https://www.youtube.com/watch?v=_ENYJhOVHj8">Mock the Week</a> if there are new episodes, see <a href="https://www.youtube.com/channel/UCV1OpUwWJCMiv6gJCRR6yAg">how Ku explores Taiwan</a> or how <a href="https://www.vpro.nl/programmas/reizen-waes.html">Waes visits Japan</a>. Travel and food themed shows help remind there was a prepandemic world. They give me hope that some of it may come back. Sometimes there’s a book I can’t stop reading or a guest in one of the late night talk shows that I don’t want to miss. I go to bed with a <a href="https://books.hiddedevries.nl/">book</a>.</p> <h2>Wrapping up</h2> <p>So, this is what my days roughly look like. I don’t really have any useful productivity hacks, but feel that walking, reading, listening, cooking and (even) cleaning are some things that I’m pleased to have in my days.</p> <p>I’d like to invite <a href="https://zellwk.com/">Zell Liew</a>, <a href="https://ohhelloana.blog/">Ana Rodrigues</a> and <a href="https://ericwbailey.design/">Eric Bailey</a> to join this <em>chain</em> to talk about their days, if they want to!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/my-typical-day/">My typical day</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20My typical day">Reply via email</a></p> Accessible front-end components: claims vs reality 2021-04-02T00:00:00Z https://hidde.blog/accessible-front-end-components-claims-vs-reality/ <p>My mission in web accessibility is to make it easier for people who want to create accessible interfaces. There are many means to that end, from building good understanding of how people with disabilities use the web to providing clear and well-tested code examples. </p> <p>I mean, if you understand how people use the web with a mouse, it is easier to design a mouse cursor that works for them, or write the code to implement one. This also applies to keyboard, switch controls, voice navigation, touch and screenreaders. </p> <p>I like the power of reusable components, as they allow for <a href="https://hiddedevries.nl/en/blog/2019-05-24-baking-accessibility-into-components-how-frameworks-help">baking accessibility into components</a>, whether in frameworks or vanilla. One day there may be <a href="https://open-ui.org/">better UI controls in the web platform</a> and/or <a href="https://hiddedevries.nl/en/blog/2020-03-01-more-accessible-defaults-please">more accessible defaults in browsers</a>. Now, teams often build their own components (see <a href="https://www.smashingmagazine.com/2021/03/complete-guide-accessible-front-end-components/">Smashing’s guide</a> for tips). Of course, not all project teams can always build their own components every single time. <a href="https://www.youtube.com/watch?v=WiQmQhA-OrM">This is not ‘Nam</a>, there are deadlines. And so, we commonly use third-party components like custom selects, autocompletes and date pickers. </p> <p>In this post, I will warn you about blindly trusting accessibility claims and share some questions to ask with each third party component you consider for your project.</p> <h2>“Accessible” doesn’t say it all</h2> <p>As accessibility-aware developers, we may look specifically for components that are accessible. Maybe we search the web for ‘accessible X’. If you do that, be aware that there are more components that <em>claim</em> to be accessible than components that <em>actually are</em> usable or great to use for people with disabilities.</p> <p>Sometimes, ‘accessible’ means only partially accessible. That’s a problem, as accessibility is about making interfaces work for people with a broad range of disabilities (see <a href="https://www.w3.org/WAI/people-use-web/abilities-barriers/">Diverse abilities and barriers</a>). For instance, what to think of a widget that was made to work with a keyboard, but breaks badly when zoomed in? It has perfect colour contrast, but no HTML semantics? The screenreader experience is excellent, but it is tricky for users who control their system with voice?</p> <p>Sometimes, ‘accessible’ means ‘has a bunch of ARIA attributes’. In the best case ‘has ARIA attributes and keyboard behaviours that exactly meet the <a href="https://www.w3.org/TR/wai-aria-1.1/">ARIA standard</a>’. Sometimes that it is a 1:1 implementation of the <a href="https://www.w3.org/TR/wai-aria-practices/">ARIA Authoring Practices Guide</a> (APG), a set of examples (not a standard) written by a <a href="https://www.w3.org/WAI/ARIA/task-forces/practices/">subgroup of the ARIA Working Group</a>. The APG is an <em>excellent</em> resource if you want to know how to write technically correct ARIA. But… it does not make claims about screenreader compatibility, see <a href="https://aria-at.w3.org/">ARIA-AT</a> and/or <a href="http://a11ysupport.io/">a11ysupport</a> for that. It also does not make claims about user experience, so always be sure to test the patterns with people, or read blog posts from others who tested with people. Lastly, it also does not recommend whether to use ARIA or go HTML-only… it is just about using ARIA. Sometimes, HTML-only patterns are easier to understand for end users. More ARIA does not mean more accessibility.</p> <p>Sorry, I realise none of this makes it particularly easy to find accessible components, but I want to be honest. In any case: don’t give up. Remember what <a href="https://tink.uk/">Léonie Watson</a> once <a href="https://decks.tink.uk/2016/ffconf/index.html#89">said</a> about accessibility: “it doesn’t have to be perfect, it just has to be a little bit better than yesterday”. The more research we do, the better informed our choice will be.</p> <h2>Some questions to ask</h2> <p>If we want to have a little more certainty about the accessibility of a component, there are some checks we can do.</p> <h3>How did they test?</h3> <p>It’s good news when a component’s website explains how a component was tested. Usually browser support is listed, sometimes support for assistive technologies like screenreaders is included, too. Maybe they’ve done formal WCAG testing or they have some sort of checklist. They may be running only automated tests, which are good and useful, but limited to things that can be automatically tested (most of WCAG cannot be). Information about the type(s) of testing can help inform us about the accessibility of a component.</p> <h3>Who did they test with?</h3> <p>Testing accessibility is ultimately not about technology, though, it is about making sure the pattern works for people with disabilities. If we look at a component, can we find whether they specifically included people with disabilities? Was a broad range of disabilities included?</p> <p>Representation matters; accessibility often requires testing a broad range of people, disabilities and assistive devices. When <a href="https://marcysutton.com/">Marcy Sutton</a> user tested patterns for accessible routing, users of screenreaders, voice navigation and switch controls had varied experiences and comments (see <a href="https://www.gatsbyjs.com/blog/2019-07-11-user-testing-accessible-client-routing/">What we learned from user testing accessible client-side routing</a>).</p> <h3>Are they open about pros and cons of their approach?</h3> <p>Accessibility is not always one size fits all, sometimes there may be caveats to an approach, there may be things that may still be experimental. It’s a good sign if the component developer is open about this. Sometimes there will be an <a href="https://www.w3.org/WAI/planning/statements/">accessibility statement</a> with known issues and planned fixes.</p> <h3>Who created them?</h3> <p>Sometimes I put extra trust if the people or organisations that created components work for the public good and/or in accessibility. Government-backed component libraries like the <a href="https://design-system.service.gov.uk/">gov.uk design system</a>, the <a href="https://design-system-alpha.digital.govt.nz/">New Zealand government design system</a> and the <a href="https://designsystem.digital.gov/">US government’s design system</a> contain gems. So do pattern libraries created by accessibility practitioners like <a href="https://pattern-library.dequelabs.com/">Deque’s Cauldron</a> and <a href="https://www.tenon-ui.info/">Tenon UI</a>.</p> <h2>More indicators</h2> <p>I also <a href="https://twitter.com/hdv/status/1376813976936407041">asked around</a> on social media! Below are some of the tips that were shared there (❤️ thanks all!)</p> <h3>Look at GitHub issues</h3> <p><a href="https://twitter.com/_marcusherrmann/status/1376814886999748609">Marcus</a> recommended to look at GitHub issues about WCAG or accessibility, “their presence would be a warning sign”. <a href="https://twitter.com/Woebin/status/1376910719455797249">Thea</a> said it can also be a “sign that people care”, she suggests looking at activity and discussions on issues. <a href="https://twitter.com/mitchellrevan/status/1377698091156049923">Mitchell</a> agreed: “the quest for optimal usability and interoperability is never done”. <a href="https://twitter.com/stommepoes/status/1377622729545891841">Mallory</a> +1’ed too and looks at how authors respond.</p> <h3>Accessibility as an integral part</h3> <p><a href="https://twitter.com/SaraSoueidan/status/1376775773927931904">Sara</a> warned to be wary of treating accessibility as a separate feature rather than an integral part of the work. If there is an accessible version and a non-accessible version, they’ve probably failed that test!</p> <h3>Find specifics</h3> <p><a href="https://twitter.com/CerovacBogdan/status/1376828907605884936">Bogdan</a> would look for specifics of the accessibility claim: which version and level of WCAG are we talking? He and <a href="https://twitter.com/WestonThayer5/status/1376924973546184704">Weston</a> also said to look for which specific screenreaders were tested.</p> <h3>Perform basic checks</h3> <p>Various people said basic checks can give away a lot: do the docs even mention accessibility (<a href="https://twitter.com/_ovlb/status/1376814546850045953">Oscar</a>), is there sufficient colour contrast (<a href="https://twitter.com/RamboNo5/status/1376825179809198080">Martin</a>), does it work with just a keyboard (<a href="https://twitter.com/_Brentnew/status/1376823428058079233">Brent</a> and <a href="https://twitter.com/ericwbailey/status/1376900806969032710">Eric</a>)?</p> <h3>Find out about committment</h3> <p><a href="https://twitter.com/treadlightly/status/1376907958072832004">Heather</a> recommended to look at the website of the component; obvious accessibility issues there say something about the claimed commitment to accessibility.</p> <p><a href="https://twitter.com/yakimvanzuijlen/status/1376816742492692480">Yakim</a> said we should look at the testing method to gauge how sustainable accessibility efforts are: “are they ongoing and proactive, or are they reactive?”</p> <p>In his blog post <a href="https://adrianroselli.com/2016/03/be-wary-of-accessibility-guarantees-from-vendors.html">Be wary of accessibility guarantees of accessibility vendors</a>, which is more about accessibility of tools in general, <a href="https://adrianroselli.com/2016/03/be-wary-of-accessibility-guarantees-from-vendors.html">Adrian</a> recommends going on Twitter and searching the company name combined with the <code>#a11y</code> hashtag.</p> <h3>Customisability</h3> <p>If nothing is perfect, why not improve one of the most promising candidates? <a href="https://twitter.com/accessabilly/status/1376903699545649154">Martin</a> mentioned licensing: with a permissive license, we could fix any accessibility barriers ourselves. He and <a href="https://twitter.com/jasonwebb/status/1376931411895087109">Jason</a> mentioned this too: if the component has easy to use APIs and hooks for customisability, we can take matters into our own hands.. </p> <h2>Wrapping up</h2> <p>To sum up: not all ‘accessible components’ are created equal, some will work a lot better for our end users than other. In this post I have listed a number of things you can look at if you are considering third-party components.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/accessible-front-end-components-claims-vs-reality/">Accessible front-end components: claims vs reality</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Accessible front-end components: claims vs reality">Reply via email</a></p> Queuing up 2021-04-25T00:00:00Z https://hidde.blog/queuing-up/ <p>Distributing speaking time can be tricky when meeting face to face, but it is usuallly worse in virtual meetings. Especially those spanning long distances. In my current team, I learned how queues in remote meetings can make them better for everyone. Here’s how we queue.</p> <h2>Queues matter</h2> <p>As a Dutchman in Bristol, UK, where I lived for ~3 years, I’ve had to learn how to queue. Growing up Dutch teaches one about cycling, consensus and clogs, but it leaves most folks behind on the queuing front. Skills are sometimes culture-based. You see, when a Dutch train arrives, people will try and stand close to the entrance. When the door opens, they will try and push themselves in before others. Brits do this differently: they first look for a queue, form one if none exists, and so on. Most likely there are still significant gaps in my understanding of it all.</p> <p>Anecdotes aside, fair queuing is important. In any kind of organisation. In a recent interview, a female Dutch cabinet minister shared how the prime minister always seemed to let male counterparts talk earlier and longer. It was resolved with promises to improve, but this is way too common in meetings everywhere. Some talk a lot, others find it hard to join in (I’ll say that I’ve been both depending on circumstances).</p> <h2>The queue bot</h2> <p>Since I started working with the W3C, I’ve learned to love a meeting management system that is old, but very effective. Meetings at the W3C are generally scribed: one or more people volunteer to write down who says what. This happens on <a href="https://en.wikipedia.org/wiki/Internet_Relay_Chat">IRC</a>, which is a bit like Slack, but much older. It’s also not just a service, but an open and long proven protocol for which you don’t need (but can have) an account. That’s useful for us, as our meetings typically involve people from outside our own organisation.</p> <p>Anyway, in W3C meetings, the group usually shows up both on some video conferencing platform and simultaneously on IRC. When the meeting is ongoing, if you want to speak, you type:</p> <pre class="language-bash"><code class="language-bash">q+</code></pre> <p>This puts you on the speaking queue. Other meeting attendees will generally be on IRC, too, and see this. The chair of the meeting (usually) ensures that people speak in queue order—those who jumped on first, get to speak first. Unless there are practicalities, like the subject they were on queue for. </p> <p>If you want to remind yourself or others of the subject or your point, you can write: </p> <pre class="language-bash"><code class="language-bash">q+ to ask about comms plan</code></pre> <p>There are lots of hacks, like <code>qq+</code> (put me on the queue, but skip to the front), and there is a bot in the meeting that will keep track of who’s on queue. If anyone asks <code>q?</code>, the bot responds with a list in the right order. I know, a machine that learns!</p> <p>The bot, called <a href="https://www.w3.org/2001/12/zakim-irc-bot">Zakim</a>, was named after a bridge near the Massachusetts Institute of Technology, I learned recently. In turn, that bridge is named after a <a href="https://en.m.wikipedia.org/wiki/Leonard_P._Zakim">human rights activist</a>. It does more than just queuing, it also manages meeting agendas and who’s attending.</p> <h2>Wrapping up</h2> <p>Meeting with this system doesn’t guarantee equal talking time, nor does it pretend to, but the visible method of queuing is really nice to have, especially in virtual meetings. I wonder if other organisations have tools like this, and if not, why not?</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/queuing-up/">Queuing up</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Queuing up">Reply via email</a></p> What's ‘normative’ in WCAG? 2021-04-27T00:00:00Z https://hidde.blog/whats-normative-in-wcag/ <p>I’m currently involved in a project to make some of the <a href="https://www.w3.org/TR/WCAG/">WCAG</a> guidance more clear. One of the distinctions we’re hoping to clarify is: what’s normative in WCAG?</p> <p>‘Normative’, meaning something like ‘required to meet the norm’, is a common phrase in (web) specifications. You’ll find it in WCAG, but also in HTML, CSS and many others. Specifications say what we should do (‘do X’), in a way that can be evaluated afterwards (‘was X done?’). </p> <p>For instance, the normative sentence ‘Web pages have titles that describe topic or purpose’ (from: <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1&showtechniques=131%2C136%2C145%2C241#page-titled">Page titled</a>) can be evaluated: if a web page has a title <em>and</em> it describes topic or purpose, it’s a pass. Otherwise, it’s a fail. </p> <p>The opposite of ‘normative’ is ‘informative’, it is something that is not required for conformance to the norm. You may also find it is called ‘non-normative’, ‘not required’ or descriptive in some places. </p> <p>As an aside, the words ‘may’, ‘must’, ‘must not’, ‘not recommended’, ‘recommended’, ‘should’ and ‘should not’ have special meaning in the context of specifications like WCAG. This meaning is defined in a document called <a href="https://www.rfc-archive.org/getrfc.php?rfc=2119#gsc.tab=0">RFC 2119</a>.</p> <h2>What’s normative in WCAG</h2> <p>The part of WCAG that is normative is the main WCAG text itself: the Principles, the Guidelines and the Success Criteria. </p> <h2>What’s not normative in WCAG</h2> <p>Some of the WCAG text is not normative, like the Introduction section. It is marked as such (“This section is non-normative”).</p> <p>There is also a number of documents to help use WCAG, including <a href="https://www.w3.org/WAI/WCAG21/Techniques/">Techniques</a> and <a href="https://www.w3.org/WAI/WCAG21/Understanding/">Understanding documents</a>. These documents are not normative either. They are additional information, context and examples, but not requirements to meet the norm (see <a href="https://www.w3.org/TR/WCAG21/#interpreting-normative-requirements">5.1, Interpreting Normative Requirements</a>). </p> <p>For instance, if you would evaluate whether a website meets the WCAG criteria, what matters for conformance is the text of the relevant criterion. The text in a Technique or Understanding document can help understand the intents and purposes <em>of</em> the norm, but it is not the norm. You don’t need to follow any specific Technique to be conformant.</p> <p>The same goes for pages like ARIA Authoring Practices Guide, which is a <a href="https://www.w3.org/standards/types#groupnotes">Working Group Note</a>. For more info on different kinds of see also <a href="https://www.w3.org/standards/types">Documents published at W3C</a>.</p> <h2>The norm is the core</h2> <p>In most standards, the part that has become the norm was discussed and tweaked by many people over an extended time. Working Groups often spend years ensuring a wide variety of people was consulted and many views heard. There are likely many other things that could have made it in, but this was the text on which the Working Group reached <a href="https://www.w3.org/Consortium/Process#Consensus">consensus</a>: it was supported by a substantial part of the group, and no formal objection was registered.</p> <p>That leads me to an important point regarding WCAG: the normative part is the minimum to make your site work for users with disabilities. There are lots of best practices outside WCAG scope that benefit actual people–absolutely do find and use those!</p> <h2>Conclusion</h2> <p>In WCAG, the main text is normative, which means it is required to meet the standard. Other texts like Techniques, Understanding documents and ARIA Authoring Practices are not, they provide useful context, examples, background information and more.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/whats-normative-in-wcag/">What's ‘normative’ in WCAG?</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20What's ‘normative’ in WCAG?">Reply via email</a></p> Criticism pushes the web forward 2021-05-08T00:00:00Z https://hidde.blog/criticism-pushes-the-web-forward/ <p>This week, a friend shared a blog post that critiqued a popular framework for CSS. Twitter started to discuss if it’s okay to criticise tools. In this post, I’ll say it is not just okay, it is also important.</p> <p>I was a little disappointed to see the replies to this tweet. Among the many replies, the person who came up with the framework exclaimed seeing the post shared by her “ruined” his day. Note: the post was not about him, it was about the framework (the one that, on its homepage, criticises other people’s CSS methodologies) . Other commenters said the article was “not worth sharing”, “you’re just starting of fights” and “why would you amplify that?”.</p> <p>I’m not interested in attacking anyone here, or going into the merits or faults of The Post, but would like to answer that last question. Or, in fact, a more generic one: “is it okay to criticise tools?” </p> <h2>Listening helps</h2> <p>The short answer is: yes. As long as it is aimed at the tool, not the person that created it, it is better to share criticisms than not. I have never been involved in the development of frameworks for the web, but in standards for the web, like HTML, CSS and ARIA, there is lots of criticism. People poke holes in each other’s assumptions, suggest ways to make features better and explain why things don’t work well for them. Good standards require diverse perspectives. </p> <p>Again, the kind of criticism I’m talking about here is criticism of the content, not a person. Is some proposal <a href="http://info.cern.ch/Proposal.html">vague</a>? Should we really <a href="https://lists.w3.org/Archives/Public/www-style/1995Sep/0002.html">call that property “left justify”</a> or <a href="https://lists.w3.org/Archives/Public/www-style/1995Oct/0005.html"><code>number-form</code> seems counterintuitive as a property name</a>–just two examples of critiques of the first version of CSS, in 1995. They’ve made CSS better, because we’ve ended up with better names. Thanks to the people who took the time to send in comments. This is, for over 25 years, how we’ve evolved the web: by listening to each other and not taking critical comments personal.</p> <h2>Can we “just not use it”?</h2> <p>Maybe web standards like CSS are different. The web is built on it and you cannot <em>not</em> use CSS when you build a website. Browsers have stylesheets. But if we’re honest, the most popular tools and frameworks <em>also</em> impact all of us. Most web developers don’t always get to choose their own tools and frameworks, they join a team with existing code or have team members with other opinions.</p> <p>I’ve never included Bootstrap in a project myself, but have contributed code to many projects that did. Just like it is helpful to comment on web standards, it is helpful to comment on tools and frameworks, because they too affect us all. This goes both for whether to use the thing at all, and for features the thing has or lacks.</p> <p>Like critical thinking pushes the world of ideas forward, I mean in <a href="https://plato.stanford.edu/entries/critical-thinking/">philosophy</a>, criticism of ideas for standards, tools and frameworks pushes the web forward. We should give feedback respectfully and constructively, but we should give feedback. And open up to feedback, not demand it to go away. It may not be easy, but it is important to include perspectives outside your own.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/criticism-pushes-the-web-forward/">Criticism pushes the web forward</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Criticism pushes the web forward">Reply via email</a></p> 150 2021-05-18T00:00:00Z https://hidde.blog/150/ <p>This blog has now reached the somewhat random milestone of 150 posts. When I asked around what post #150 should be about, the Twitterverse said “blogging”. Well, OK!</p> <p>Fun fact, this isn’t my first blog: from 2008 to 2014, I had a <a href="http://web.archive.org/web/20081209003007/http://www.waarishidde.com/">travel blog</a>, where I tried to write funny posts about my trips abroad for family and friends. This blog is different as I try to, ahem, add “something” to the field of web development, I fact-check, look for previous work to credit and try to keep posts with technical recommendations up to date.</p> <h2>Why personal blogs are great</h2> <p>The fact that so many people publish their thoughts and share knowledge, is something I’ve always loved about the web. Whether it is practical stuff about how to solve a coding issue or some kind of opinion… everyone’s brain is wired differently. It may resonate, it may not, that’s also fine. </p> <p>People’s blogs are what helped me get started in this industry and get a feeling for the kinds of problems we’re trying to solve. I started doing web development around 2006, and at that time, lots of people blogged. Many of the conversations happened on blogs. Since 2013, this blog is my attempt to join some of the conversations. </p> <p>Blogging is like “a kind of catharsis”, <a href="https://brucelawson.co.uk/2005/posting-to-posterity/">said Bruce Lawson once</a> in 2005:</p> <blockquote> <p>In the old days, people used to shout at passers-by in the street; these days, we blog. </p> </blockquote> <p>(Don’t follow the link and read about his other analogies to blogging)</p> <p>Writing in public feels great, even if no one reads it, says Sara Soueidan in her post <a href="https://www.sarasoueidan.com/desk/just-write/">Just write</a>: </p> <blockquote> <p>Just write.</p> <p>Even if only one person learns something from your article, you’ll feel great, and that you’ve contributed — even if just a little bit — to this amazing community that we’re all constantly learning from. And if no one reads your article, then that’s also okay. </p> </blockquote> <p>It is ideal to do this on your own website. Matthias Ott put it beautifully in his post <a href="https://matthiasott.com/articles/into-the-personal-website-verse">Into the Personal-Website-Verse</a>—personal websites are about expressing and exploring yourself:</p> <blockquote> <p>Personal websites are called personal websites because they are just that: personal. Thus, the primary objective still is to have a place to express ourselves, to explore ourselves, a place that lasts while the daily storms pass by. A place of consideration, and yes, a place of proudly sharing what we do, what we think, and what we care about. A place to contribute your voice and help others. A home on the internet. A place to tell your story.</p> </blockquote> <p>This resonates so much.</p> <h2>Why blog</h2> <h3>Social media is hard to search</h3> <p>Do you ever think “there was this tweet by X about Y” and attempt to find it? This can be really hard, as new tweets appear all the time in this endless stream of opinions, thoughts, jokes and anger. You may want to go to a person’s profile and look for the tweet, but with the endless loading that breaks <code>CTRL/⌘ + F</code>, I usually wish my past self had saved a direct link. </p> <p>In contrast, your blog is “a place that lasts”, as Matthias says above. If you take those tweets and put them into context on your blog, that will make the conversation easier to find them later.</p> <h3>Social media is not optimised for organising thoughts</h3> <p>Not only do posts on social media fade away over time, they also have character limits. While you save words, you likely leave out nuance. Threads exist, of course, but on your website, people don’t have to click to try and expand more content. You get all the space you need.</p> <h3>Own your content</h3> <p>When you publish on your site, you own your content in a way not available on any of the centralised platforms, like Twitter or Medium.</p> <p>Khoi Vinh says about this in <a href="https://ownyourcontent.wordpress.com/2019/05/14/khoi-vinh-on-how-his-blog-amplified-his-work-and-career/">an interview</a>: </p> <blockquote> <p>I personally can’t imagine handing over all of my labor to a centralized platform where it’s chopped up and shuffled together with content from countless other sources, only to be exploited at the current whims of the platform owners’ volatile business models.</p> </blockquote> <p><a href="https://ohhelloana.blog/">Ana Rodrigues</a> lists this and many other advantages of owning your own content in her fantastic post <a href="https://www.smashingmagazine.com/2020/08/autonomy-online-indieweb/">Autonomy online: a case for the IndieWeb</a>, which also contrasts the IndieWeb with the Corporate Web.</p> <h2>What I write about</h2> <p>This blog isn’t particularly structured, but scrolling through the past 149 posts, I did find some common themes. I had forgotten about a lot of the stuff. Warning: there are a lot of links below.</p> <h3>Summaries of events</h3> <p>Sometimes, I write summaries of the conferences I attend, like when I <a href="https://hiddedevries.nl/en/blog/2014-01-08-meeting-the-tag">met the TAG</a>, <a href="https://hiddedevries.nl/en/blog/2016-05-24-confconf">attended ConfConf</a> and <a href="https://hiddedevries.nl/en/blog/2018-11-04-my-first-mozfest">joined MozFest</a>. This requires me to hold my phone while listening, frantically taking notes, while being focused on what is being said. After the event, I structure my writings and try to piece together summaries per talk, adding links, sometimes revisiting slide decks if they’re available. This is exhausting, but helps me personally process what I’ve learned. It usually also leaves me with many tabs open and a bunch of self doubt about properly representing the speakers’ points.</p> <h3>Opinions</h3> <p>I’ve also published some ‘hot takes’. The one I’m now most embarrassed by is the clickbaitily titled <a href="https://hiddedevries.nl/en/blog/2016-08-09-bootstrap-considered-harmful">Bootstrap considered harmful</a>. Let’s say I had not read Eric Meyer’s awesome <a href="https://meyerweb.com/eric/comment/chech.html">“Considered Harmful” Essays Considered Harmful</a> yet, and I was younger. I also wrote about <a href="https://hiddedevries.nl/en/blog/2015-07-02-what-kind-of-web-components-do-we-need">Web Components and which kinds we need</a>, <a href="https://hiddedevries.nl/en/blog/2015-04-20-solving-problems-with-css">overengineering CSS</a>, <a href="https://hiddedevries.nl/en/blog/2017-04-20-mom-jokes-as-part-of-corporate-culture">“your mom” jokes in corporate culture</a>, <a href="https://hiddedevries.nl/en/blog/2018-04-20-for-everyone">why Uber’s for everyone isn’t like Timbl’s</a> and why <a href="https://hiddedevries.nl/en/blog/2015-05-18-the-web-is-fast-by-default-lets-keep-it-fast">slowness of websites is optional</a>. </p> <h3>Components</h3> <p>In the last 10 years component systems ruled front-end development. Before that, it would not be uncommon to be hired to build some full pages. Those times are gone. Components have been a favourite subject to write about. Recently this was about <a href="https://hiddedevries.nl/en/blog/2021-04-02-accessible-front-end-components-claims-vs-reality">accessibility claims of third-party components</a>, before that I wrote about <a href="https://hiddedevries.nl/en/blog/2019-05-24-baking-accessibility-into-components-how-frameworks-help">baking accessibility into components</a>, <a href="https://hiddedevries.nl/en/blog/2019-02-28-component-frameworks-and-web-standards">frameworks and standards</a>, <a href="https://hiddedevries.nl/en/blog/2017-10-19-web-components-as-compositions-of-native-elements">Web Components and native elements</a>, <a href="https://hiddedevries.nl/en/blog/2016-01-19-the-website-as-an-instantiation-of-your-design-system">the websites as an instance of a design system</a>, <a href="https://hiddedevries.nl/en/blog/2015-12-08-the-role-of-grid-systems-in-component-based-front-end-builds">grids and components</a> and <a href="https://hiddedevries.nl/en/blog/2017-07-13-testing-the-accessibility-of-pattern-libraries">accessibility in pattern libraries</a>.</p> <h3>Reading lists</h3> <p>I did some reading lists, too, with recommendations about <a href="https://hiddedevries.nl/en/blog/2018-08-07-an-ai-reading-list">AI</a>, <a href="https://hiddedevries.nl/en/blog/2019-08-23-equality-a-reading-list">equality</a>, <a href="https://hiddedevries.nl/en/blog/2019-12-03-tech-vs-society-a-reading-list">tech and society</a> and <a href="https://hiddedevries.nl/en/blog/2020-07-16-equality-a-reading-list-2">more equality</a>.</p> <h3>Accessibility</h3> <p>Some of my more technical articles are about accessibility. I wrote about <a href="https://hiddedevries.nl/en/blog/2019-06-27-how-accessibility-trees-inform-assistive-tech">how accessibility trees work</a>, <a href="https://hiddedevries.nl/en/blog/2018-02-06-you-dont-always-need-alternative-text">alternative text and when you don’t need it</a>, <a href="https://hiddedevries.nl/en/blog/2019-04-18-naming-things-to-improve-accessibility">accessible names</a> and <a href="https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element">focus traps</a>. There were also posts about <a href="https://hiddedevries.nl/en/blog/2017-07-13-testing-the-accessibility-of-pattern-libraries">testing pattern library accessibility</a>, <a href="https://hiddedevries.nl/en/blog/2017-04-04-how-to-make-inline-error-messages-accessible">inline error messages</a> and <a href="https://hiddedevries.nl/en/blog/2015-04-16-making-our-websites-even-more-mobile-friendly">making websites more mobile friendly</a>.</p> <h3>CSS</h3> <p>I praised the wonders of CSS in many of the posts. It lets you <a href="https://hiddedevries.nl/en/blog/2016-02-23-cascading-and-cognitive-overhead">style things that don’t even exist yet</a>, has <a href="https://hiddedevries.nl/en/blog/2017-07-03-did-css-get-more-complicated-since-the-late-nineties">simplicity as its core principle</a> and <a href="https://hiddedevries.nl/en/blog/2019-01-31-three-ways-to-build-crouwels-hiroshima-poster-in-css">can be used to rebuild awesome posters</a>. To me, <a href="https://hiddedevries.nl/en/blog/2016-02-23-cascading-and-cognitive-overhead">the cascade is a feature, not a bug</a> and I feel <a href="https://hiddedevries.nl/en/blog/2018-08-11-lets-serve-everyone-good-looking-content">simple fallbacks for Grid Layout are preferred to complex ones</a>.</p> <p>My favourite local conference is CSS Day in Amsterdam and I did write-ups for <a href="https://hiddedevries.nl/en/blog/2019-06-18-css-day-2019-some-things-i-learned">CSS Day 2019</a>, <a href="https://hiddedevries.nl/en/blog/2017-06-16-browser-api-special-and-css-day">CSS Day 2017</a>.</p> <h3>Progressive enhancement</h3> <p>One of my first posts about progressive enhancement was about <a href="https://hiddedevries.nl/en/blog/2015-04-03-progressive-enhancement-with-handlers-and-enhancers">an approach for progressive enhancement with <code>data-</code>-attributes</a> and I did a follow-up on <a href="https://hiddedevries.nl/en/blog/2017-01-10-on-initialising-javascript-from-markup">initialising script from mark-up</a>. More recently I wrote about the <a href="https://hiddedevries.nl/en/blog/2016-02-23-cascading-and-cognitive-overhead">merits of separating HTML, CSS and JS</a>. </p> <h2>Here’s to the years to come!</h2> <p>There are lots of things I would like to do better. One is to write better, maybe by writing more. Maybe also by submitting to other publications, so that I can get more feedback on my writing. There’s so much to learn about writing and it’s hard to learn alone. I would also like to write more interesting content (don’t we all? 🤓). So far I noticed something interesting can come out when I don’t expect it, and write something short that I never really planned to write about. Probably think about it less?</p> <p>Anyway… I’ve really enjoyed having my own blog and I hope to continue posting for many years to come. Thanks everyone for support and encouragement, you know who you are! I hope to be back soon with a post that is more useful than this one.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/150/">150</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20150">Reply via email</a></p> Introducing: an Eleventy starter project for WCAG reports 2021-05-24T00:00:00Z https://hidde.blog/introducing-an-eleventy-starter-project-for-wcag-reports/ <p>When I audit websites for accessibility, I write Markdown files that <a href="https://www.11ty.dev/">Eleventy</a> turns into reports. Today, I’ve shared the code I use for that. In this post I’ll provide some context. </p> <p>At <a href="https://github.com/hidde/eleventy-wcag-reporter">eleventy-wcag-reporter</a>, I have published my Eleventy starter for reports about conformance to the <a href="https://www.w3.org/WAI/standards-guidelines/wcag/glance/">Web Content Accessibility Guidelines</a> (WCAG). It is issue oriented, promotes rich text, comes with a PDF export script and supports two languages (English and Dutch). </p> <p><img src="https://hidde.blog/_images/example-report-shows-an-issue-with-code-example-a-listing-of-wcag-criterion-severity-and-difficulty-and-what-the-sample-is.png" alt="Example report shows an issue with code example, a listing of wcag criterion, severity and difficulty and what the sample is" /> <em>There is an <a href="https://eleventy-wcag-reporter.netlify.app/reports/example/">example report</a> available.</em></p> <p>Note: this is just one specific way to create accessibility conformance reports. This works for me and my clients. Other approaches and requirements exists, and I can’t guarantee this works for you. </p> <h2>Issue-oriented reporting</h2> <p>WCAG conformance reports document whether a website meets the <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1">criteria in the WCAG standard</a>. It will tell the reader which Success Criteria met the standard, which did not.</p> <p>Many WCAG conformance reports list WCAG in its entirety and then specify the result for each. Say, a website is tested for WCAG 2.1, Level AA and 10 problems are found. The report will show all 50 Success Criteria (SCs): 10 say “Failed”, 40 “Passed” (or something else, like “Cannot Tell”). The accessibility problems are metadata of the success criteria, so to say.</p> <p><img src="https://hidde.blog/_images/screen3.png" alt="Screen3" /> <em>In this Eleventy project, you’ll create one file for each issue</em></p> <p>In my personal experience, teams that commission a report are mostly interested in the actual accessibility problems. They want to know “what needs fixing”. They may also want to know: how severe are the issues in comparison, which expertise can solve it (design? development?) and which assistive technology is affected. And, where relevant, what the issue or solution looks like in code. This is why I provide clients with an issue-oriented report: a list of issues, rather than a list of SCs. The Success Criterion is added as metadata of the issue, rather than the other way around.</p> <p>A benefit of the issue-oriented approach, is that it can integrate better with a team’s workflow. Issue trackers are more common in workflows than SC-trackers. It also, as mentioned, makes it easier to include other meta data like responsibility and severity, and to include code examples and screenshots.</p> <p><a href="https://www.w3.org/TR/WCAG-EM/">WCAG-EM</a>, the standard methodology for accessibility conformance reporting, does not specify either of the two approaches. What is important for a conformance report is that all Success Criteria were evaluated, and that this fact is made clear. You want to be sure that “no issue filed for an SC” really means the sample did not contain any issues for that SC. </p> <p>In other words: the report is only done when you’ve checked all sample pages for all WCAG Success Criteria in your scope (i.e. all 50 criteria for WCAG 2.1, Level A + AA). Always test them all. If your report follows the SC-based approach this is explicit, in the issue-based approach it is implicit. </p> <h2>The power of Markdown and YAML</h2> <p>One of the benefits of using Eleventy for my reports, is that it makes it easy to write rich text. That may sound like a no-brainer, but in many reporting tools I’ve seen, issues are described in plain text. The main reason I want to use rich text to describe issues, is that they can make tips more clear. Lists, links, images, code examples and even text level stuff like bold and italics can make a report more readable. This is important, because it increases the chance the team can fix the issues found. </p> <p><a href="https://en.wikipedia.org/wiki/Markdown">Markdown</a> is my favourite syntactic sugar for rich text, so that’s what I use, but you can use whatever else. HTML should work, too.</p> <p>For each issue that is described, there is also a set of meta data, like which Success Criterion it relates to. It is described in <a href="https://en.wikipedia.org/wiki/YAML">Yaml front matter</a>, so at the top of an <code>issue.md,</code> you would add something like: </p> <pre><code>--- sc: 2.1.1 severity: High difficulty: High title: Main menu does not work with keyboard sample: homepage --- </code></pre> <p>Spelling out the meta data in front matter makes it powerful. We can do things like add up the issues filed for a specific page, or count how many were filed for a given Success Criterion.</p> <h2>Some essential metadata in WCAG conformance reports</h2> <p>Pointing out accessibility problems and solutions is the bread and butter of my conformance reports, as my goal is usually to help the team fix all issues. But accessibility reports are used in various contexts. There is some important metadata that helps someone looking at the report what’s going on, including monitoring bodies like governments. They may require publication of accessibility conformance reports to help them perform their regulatory duties, good metadata aids this monitoring. </p> <p>Logius, the Dutch government department that keeps track of WCAG conformance reports that Dutch governmental organisations provide, uses a <a href="https://www.digitoegankelijk.nl/toegankelijkheidsverklaring/controle-door-logius">checklist</a> to verify if conformance reports meet their requirements: </p> <ul> <li>is the methodology (eg WCAG-EM) mentioned?</li> <li>is the scope mentioned (domain and/or sub domains that are in scope, and those outside scope)</li> <li>does the report declare that all 50 Success Criteria in WCAG 2.1, Level A + AA were evaluated?</li> <li>is the level of accessibility support described (for instance: “the website can be used by all common browsers and assistive technologies“)?</li> <li>is there a list of technologies used (eg HTML, CSS, SVG, etc)</li> <li>is there a list of pages that were included in the evaluated sample?</li> <li>is the person or company that did the evaluation listed?</li> <li>are browsers and other software, including versions, listed?</li> <li>is it dated?</li> <li>are the results published in a human-readable or machine-readable format (<a href="https://www.w3.org/WAI/standards-guidelines/earl/">EARL</a>)?</li> </ul> <p><em>The above is my translation of the checklist on the <a href="https://www.digitoegankelijk.nl/toegankelijkheidsverklaring/controle-door-logius">Controle door Logius</a> page; many of these are also recommended in <a href="https://www.w3.org/TR/WCAG-EM/">WCAG-EM</a>; the requirements likely vary where you or your client are based.</em></p> <p>The eleventy-wcag-reporter starter project has variables for each of these checkpoints. A lot of the meta data is added to the report’s <code>index.njk</code> as YAML front matter, so that it can be displayed.</p> <h2>FAQ</h2> <p>After reading this, you may have questions before trying to use the code. The questions below weren’t actually asked frequently, but I hope they have useful answers.</p> <dl> <dt>Will this find accessibility issues?</dt> <dd>No, <em>you</em> find issues, create a Markdown file for each and then add some frontmatter. The code will then include it in a pretty report. Or really, a report that you can make pretty.</dd> <dt>Why not integrate with automated tooling?</dt> <dd>There are tools that can find issues, for ~20% of WCAG criteria (other estimates exist). You can use those tools to find issues and add them manually. It is usually easier for a human to group issues in a way that is most useful to readers of the report. For instance, if a brand’s primary colour contrasts badly with a white background, you may not need to file that more than once.</dd> <dt>Can more languages be supported?</dt> <dd>Yes, feel free to contribute. We need <a href="https://github.com/hidde/eleventy-wcag-reporter/blob/main/src/_data/sc_to_slug.json">all of WCAG in JSON format</a> (I have code to scrape) and translations for <a href="https://github.com/hidde/eleventy-wcag-reporter/blob/main/src/_data/translations.json">strings</a>.</dd> <dt>How many issues should I add to a report?</dt> <dd>There is no minimum or maximum, but you should check all pages in your sample for all Success Criteria in your scope, and have issues for all situations where a SC is not met, in order to create a full report.</dd> <dt>What about PDFs?</dt> <dd>I like HTML as a report format. Some organisations prefer to receive a PDF document. Like web pages, PDFs also need to be accessible, and simply pressing “Save as PDF“ in a browser will be unlikely to include all semantics. So I use <a href="https://www.princexml.com/">PrinceXML</a>, which supports a lot of print CSS. There are licenses for a machine or server, or you can use the SaaS version <a href="https://docraptor.com/">DocRaptor</a>. The starter project has a <a href="https://github.com/hidde/eleventy-wcag-reporter/blob/main/create_pdf.sh">Shell script</a> to generate a PDF with PrinceXML, you will need a license or end up with a watermark in your resulting PDF.</dd> </dl> <h2>Wrapping up</h2> <p>So, find my starter project at <a href="https://github.com/hidde/eleventy-wcag-reporter">eleventy-wcag-reporter</a>, please don’t laugh at my code. Feedback is very much welcomed by email, DMs or in GitHub. I may not be able to get back very quickly, as the open version of this is a side project. Happy accessbility conformance report writing!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/introducing-an-eleventy-starter-project-for-wcag-reports/">Introducing: an Eleventy starter project for WCAG reports</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Introducing: an Eleventy starter project for WCAG reports">Reply via email</a></p> Solutionism 2021-06-28T00:00:00Z https://hidde.blog/solutionism/ <p>There is this <a href="https://en.m.wikipedia.org/wiki/Carte_Jaune">internationally recognised physical proof of vaccination</a>. Earlier this year, the Dutch health ministry said it won’t be used for registration of Dutch COVID-19 vaccinations. Why not? Well, an app was on the way. </p> <p>The ministry was somewhat right. There <em>wasn’t</em> international agreement about use of that physical card for covid vaccinations. But there were other authorities, like the German government, that already <a href="https://www.auswaertiges-amt.de/en/einreiseundaufenthalt/coronavirus">accepted</a> it. There was a use case. The <a href="https://ec.europa.eu/info/live-work-travel-eu/coronavirus-response/safe-covid-19-vaccines-europeans/eu-digital-covid-certificate_en">EU Digital Covid Certificate</a>, that the ministry put their money on, does sound promising. And it’s standardised across the EU. </p> <p>But the dismissal of the paper proof, I feel, is a case of “solutionism”: you work on one solution for a problem, then forget there may be other ways to solve it, too. Why is that an issue? Multiple layers of solutions often work better. Especially if the <em>dismissed</em> is something physical and the <em>new solution</em> is some fancy new technology (see also: tech stacks on the web).</p> <p>Don’t get me wrong, I like apps (though I prefer web apps). I work in technology. I like technology, and all the advancements it brings us. But as websites are best built from the simplest part of the stack outwards—HTML first, the rest later—something similar goes for including technology in society.</p> <p>One of the powers of progressive enhancement is that it lets you cover use cases you didn’t know existed. Did your user’s JS download fail as they lost connection in a train tunnel? No biggie, you didn’t uniquely rely on JS, you didn’t assume it, it was just one of your layers.</p> <p>A paper proof of vaccination could be a sensible baseline, on top of which more demanding technological solutions could be built. Demanding in the sense that they require digital literacy, smartphone ownership and what not. For some, the paper proof was their only way to enter the country they worked, especially if that was a country outside the EU. Paper proofs have their benefits and their problems, so do digital proofs. </p> <p>IRL progressive enhancement is quite common when you think of it. You can board planes with paper boarding cards, but also with technology like QR codes and digital wallets. You can pay for a coffee with cash, card or phone. The variety serves diverse sets of people. Just like in web development, not dismissing the baseline lets us cover use cases we didn’t know existed. It is fragile, though: some manager somewhere probably has a fantasy about replacing everything with fancy tech and fancy tech only. (In fact… it’s quite common for shops not to accept cash where I live) </p> <p>Just recently, the Dutch health ministry turned around and changed their guidance: the paper proof of vaccination will now be stamped for those who ask. In a different context, a service from that same ministry now offers a way to <a href="https://coronacheck.nl/en/print/">print a QR code</a> to gain access to events following a recent corona infection, negative test or vaccination. Folks can use the app if they want to. Heck, the app is probably more convenient for many, but at least there is a paper fallback. Yay!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/solutionism/">Solutionism</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Solutionism">Reply via email</a></p> A case for accessibility statements in app stores 2021-08-03T00:00:00Z https://hidde.blog/a-case-for-accessibility-statements-in-app-stores/ <p>In Apple’s App Store and Google’s Play Store, apps can have certain bits of meta data. Categories, localisations, price, privacy policy URL… but where is the meta field for accessibility statements?</p> <p>I’m more of a web person than an app person, but my clients sometimes need to publish statements about their apps. Accessibility is important to a large part of app users, showed Dutch web consultancy Q42: in over a million app users, they saw <a href="https://accessibility.q42.nl/">43% use accessibility settings</a>. </p> <p>If app stores would have a field for accessibility statements, this would be good for users, organisations and developers, plus it highlights accessibility as something to compete on. </p> <h2>What is an accessibility statement?</h2> <p>An accessibility statement shows users that you care about accessibility and helps them understand what the expected level of accessibility is on your website or application (see also: <a href="https://www.w3.org/WAI/planning/statements/">Developing an Accessibility Statement</a>).</p> <p>Sites and apps that fall under <a href="https://eur-lex.europa.eu/eli/dir/2016/2102/oj">EU Directive 2016/2102</a> (Article 7, section 1) require an accessibility statement, in a specific format. Other sites and apps can also benefit from some form of accessibility statement.</p> <h2>What is included in an accessibility statement?</h2> <p>In their accessibility statement, website or application creators declare whether their app is <em>fully</em>, <em>partially</em> or <em>not</em> accessible. If one of the latter two, they also list what the known issues are. Commonly, there is also information about when the website or application plans to address each issue. </p> <p>Accessibility statements also include evidence of their accessibility claims. Usually this is a full WCAG conformance evaluation report, following a methodology like <a href="https://www.w3.org/WAI/test-evaluate/conformance/wcag-em/">WCAG-EM</a>. But accessibility does not equal WCAG conformance, you might say. This is true, it is ‘just’ a baseline. Yet, there is no other document with such a widely agreed baseline, so it is best to use this one. </p> <p>Accessibility statements can also contain a feedback mechanism (they must, if published in a country that has implemented that EU Directive). Feedback mechanisms let people find out how to request content in a format that is accessible to them (e.g. can I have that untagged PDF as a Word document?), and where to report accessibility issues. </p> <h2>App stores have fields for privacy statements</h2> <p>Both the Apple App Store and the Google Play Store have a meta field available for privacy statements. </p> <p>In Apple’s ecosystem it seems to be part of <a href="https://developer.apple.com/documentation/appstoreconnectapi/list_all_app_infos_for_an_app">App Infos</a>, in Google Play, developers can <a href="https://android-developers.googleblog.com/2021/07/new-google-play-safety-section.html?m=1">submit it through the Google Play Console</a>. </p> <p>Google does this, because they care about user privacy. They write in <a href="https://android-developers.googleblog.com/2021/07/new-google-play-safety-section.html?m=1">their Google Play Safety Section blog post</a>: </p> <blockquote> <p>At Google, we know that feeling safe online comes from using products that are secure by default, private by design, and give users control over their data. </p> </blockquote> <p>It’s framed as letting developers <em>showcase</em> how well they do on privacy: </p> <blockquote> <p>This new safety section will provide developers a simple way to showcase their app’s overall safety. </p> </blockquote> <p>I, for one, applaud this effort. User privacy is super important and explaining privacy features is helpful. A standard way to do it helps users find this information more easily.</p> <p>I would say we can apply the same thinking to accessibility. As mentioned earlier, app users require accessibility. It is likely they will want to find accessibility information easily. App developers and designers work hard on ensuring their app’s accessibility, so why not give them a way to showcase that too?</p> <h2>Why app stores need accessibility meta info</h2> <p>Accessibility meta info in app stores would be good for several reasons: </p> <ul> <li>helps users understand the accessibility of an application better, and learn easily and consistently about where to file accessibility bugs or request accessible versions</li> <li>helps organisations comply better with EU Directive 2016/2102, which says they should display an accessibility statement</li> <li>helps developers show their commitment</li> <li>renders accessibility as yet another aspect to compete on for application developers, because many consumers will use this to make purchasing decisions</li> </ul> <h2>Conclusion</h2> <p>App stores can be a helpful proxy between users and app creators. The vetting mechanisms and categorisations (try to) filter out low quality. They also make it easier for users to find what they need. This is why they provide filters for user-oriented features. If that’s great for privacy, it would be great for accessibility, too. Please, app store makers? 🙏</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/a-case-for-accessibility-statements-in-app-stores/">A case for accessibility statements in app stores</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20A case for accessibility statements in app stores">Reply via email</a></p> How AI is made matters, confirms “Atlas of AI” 2021-08-16T00:00:00Z https://hidde.blog/how-ai-is-made-matters-confirms-atlas-of-ai/ <p>Artificial Intelligence (AI) is often described as smart, efficient and superhuman. That sounds quite nice, but it leaves out a lot of details. In her book <em>Atlas of AI</em>, Kate Crawford maps out the power systems, impact on society and stakes that come with deploying AI. That’s important, because we, and the systems that affect us, increasingly rely on these technologies. </p> <p>There are lots of worthwile pursuits in AI: we can make computers understand our speech, teach medical devices to recognise irregularities in scans and analyse financial transactions for fraud. But there is plenty of applications that may not actually contribute all that much, or are downward hostile if you consider what could go wrong. Systems deployed to surveil workers, filter resumes or drive cars (sorry) may not be worth their damage. </p> <img alt="book cover Atlas of AI" src="https://hidde.blog/_images/screenshot-2021-09-02-at-16.16.26.jpg" /> <h2>Natural resources and people</h2> <p>The impact of AI starts with the raw materials of machines, Crawford explains. Computers need chips and those require rare earth materials like tin. It’s easy to forget about that: mining such materials isn’t without consequences. It badly affects workers (and their conditions when working in mines), their direct environment (pollution) and the earth at large. Once the chips exist and machines run, there is also an environmental impact. The data centres that compute our data require enormous amounts of gas, water and electricity. One of the largest US data centres uses 1.7 million gallons of water per day, is just one of the many examples Crawford provides. When a company says ‘our product uses AI’, their product also uses these raw materials, these data centres and this energy. </p> <p>Reassuringly, most big tech companies have very green ambitions, like powering 100% of their data centres with renewable energy. This is good. But when not all of the world’s energy is renewable, we’ve got to be sure there are good reasons for any energy that is used. We’ve got to focus on using less of it, and endlessly processing ginormous amounts of data does not help. </p> <h2>Input data and classification</h2> <p>Crawford also writes about the basic ingredient for AI and specifically machine learning: data. To teach machines about a thing, we need to show them examples of the thing. To produce AI, a company needs to collect data, ‘mine’ it, if you will. Data, like text messages, photos, audio or video. It is often collected without the consent of the people involved, like the people who are in the photos. Crawford warns us against ‘the unswerving belief that everything is data and is there for taking’ (AAI, 93). </p> <p>There are exceptions, like <a href="https://commonvoice.mozilla.org/">Common Voice</a>, a Mozilla project that aims to ‘teach machines how real people speak’ by asking people to ‘donate their voice’. The teaching machines part is not unlike other machine learning projects, but the data collection is. Common Voice data is not taken from some place, people provide it consentually and for the very purpose of training machines. This is uncommon (pardon the pun). </p> <p>And then there is the issue of context. When images become data, context is considered irrelevant, it no longer matters. They serve to optimise technical performance and nothing else. This data is now seen as neutral, but, explains Crawford, it is not:</p> <blockquote> <p>‘Even the largest trove of data cannot escape the fundamental slippages that occur when an infinitely complex world is simplified and sliced into categories’ (AAI, 98)</p> </blockquote> <p>Taking data out of context also doesn’t <em>remove</em> all context. A data set could affect privacy in unexpected ways. Crawford discusses a set of data from taxi rides, that may have looked quite innocent and useful from the outset. What could go wrong? Well, from the data, researchers could deduce religions, home addresses and strip club visits.</p> <h3>Classification</h3> <p>Machine learning requires input data to be classified. This is a fire hydrant, that is a bicycle. Some firms pay people through Mechanical Turk… there are workers who spend all day describing images. Other companies demand the work to be done for free by users who want to login (hi recaptcha).</p> <p>Perhaps more important than who does the work are the philosophical problems of classification. Is there a fixed set of categories? Does everything neatly fit in them? Such questions have boggled philosophers’ minds for, literally, millenia. It’s safe to say most would say no to either question. Yet, AI firms seem more confident. They have to, as classification of data is at the heart of how machine learning works. </p> <p>The harm caused by classification problems depends on the subject, but it is widespread. Maybe the AI that was trained with some wrongly classified fire hydrants won’t cause too much trouble. But there are endlesss examples of AI exhibiting awful bias, including towards race and sexual orientation. Bias in AI has been seen as a bug to be fixed, but it should be seen as a problem of classification itself. ‘Classification is an act of power’, says Crawford (AAI, 127). The categories can be forgotten and invisible once their work in the model training phase is over, but their impact remains. </p> <p>You can’t fix bias by merely diversifying a set of data, Crawford says:</p> <blockquote> <p>‘The practice of classification is centralizing power: the power to decide which differences make a difference’ (AAI, 127)</p> </blockquote> <p>Sometimes researchers measure the wrong thing, because are constrained by what they can measure. For example, it’s easy to measure skin colour, but it’s not the thing to measure if you’re after understanding something about race or ethnicity. It doesn’t work that way… ‘the affordances of the tools become the horizon of truth’, Crawford concludes. </p> <p>Open data collections often show categories that reinforce racism and sexism, and that’s just the sets we can see. Is there a reason to assume the sets of Facebook and Google avoided these problem?</p> <h2>Emotion recognition and warfare</h2> <p>The last two chapters of “Atlas of AI” consider two of the scariest answers to ‘what could possibly go wrong?’: AI tech for emotion recognition and warfare.</p> <img alt="person in front of mirror that says in large pink letters 'you are 86 percent surprising'" src="https://hidde.blog/_images/screenshot-2021-09-02-at-16.16.12.jpg" /> <p><em>Me at <a href="https://theglassroom.org/netherlands">The Glass Room in Leeuwarden</a> in front of an art work about emotion recognition</em></p> <p>Research in emotion recognition, Crawford writes, comes from a ‘desire to extract more information about people than they are willing to give’ (AAI, 153). It is already in use by HR departments to scan applicants and try and match their facial expressions to personality traits.</p> <p>Can it work? Scientists including <a href="https://www.paulekman.com/universal-emotions/">Paul Ekman</a> tried to find out whether emotions are universal. Some were confident, but as of yet there is no consensus on which emotions exist and how they manifest (AAI, 172). Crawford explains there is growing critique doubting the very possibility that there is a clear enough relationship between facial expressions and emotional states (AAI, 174). It’s merely correlations, she says:</p> <blockquote> <p>In many cases, emotion detection systems do not do what they claim. Rather than directly measuring people’s interior mental states, they merely statistically optimize correlations of certain physical characteristics among facial images (AAI, 177)</p> </blockquote> <p>So, like with other AI systems, AI for emotion recognition relies on categorisation, which Crawford explained is flawed and an act of power, so it has many of the same problems: </p> <blockquote> <p>[An analysis of the state of emotion recognition] returns us to the same problem we have seen repeated: the desire to oversimplify what is stubbornly complex, so that it can be easily computed, and packaged for the market. </p> </blockquote> <p>And while this may work for companies selling AI systems, the end result is likely a lack of nuance: </p> <blockquote> <p>AI systems are seeking to extract the mutable, private, divergent experiences of our corporeal selves, but the result is a cartoon sketch that cannot capture the nuances of emotional experience in the world.</p> </blockquote> <p>Governments use AI for warfare, in the US the ‘Third Offset’ strategy includes leveraging Big Tech to create infrastructure of warfare (189). In “Project Maven”, the US Department of Defense paid Big Tech firms to analyse military data from outside the US, like drone footage, to build AI systems that could recognise ‘vehicles, buildings and humans‘ (AAI, 190)</p> <p>Crawford describes a shift from debating whether to use AI in warfare at all, to, as former Google CEO Eric Schmidts said, whether AI would be able to ‘kill people correctly’ (AAI, 192)</p> <p>‘Militarised forms of pattern detection’, Crawford explains, go beyond national interests when companies like Palantir sell their technology widely (eg local law enforcement and supermarket chains). They are focused not on enemies of the state, but ‘directed against civilians’. Machine learning based patten recognition tech is used to find ‘illegal’ immigrants to deport (‘illegal’, because no humans are illegal). In Europe, IBM was tasked to use data analysis to assign refugees a ‘terrorist score’, capturing the likelihood of them being a terrorist. This would be a bad idea if AI systems were 100% able to make such distinctions, and let’s be clear: they can never be. Because of the inevitability of bias and the very nature of categorisation. If even humans don’t universally agree about what constitutes a terorrist, and they don’t, how can any human categorisation we do successfully help teach machines?</p> <p>When systems impact government decisions, they requires oversight, and there is very little of that, explains Crawford (AAI, 197). Without that, we risk making things worse, she says:</p> <blockquote> <p>Inequity is not only deepened, but tech-washed, justified by the systems that appear immune to error yet are, in fact, intensifying the problems of overpolicing and racially biased surveillance</p> </blockquote> <h2>Summing up</h2> <p><em>Atlas of AI</em> provides insight in what we give up when employing AI. There may be applications that are mostly helpful and little harmful, like language. There are applications that probably harm more than help, like emotion and warfare. </p> <p>The book also reassures us that some things may not be as computable as they seem. Good categorisation is hard for humans and harder for machines. There is this fantastic tv show broadcasted on Dutch television called <em>Zomergasten</em>: a person of interest is interviewed for 3 hours straight on live television, and they bring in their favourite video fragments. YouTube may have state of the art machine learning powered recommendation engines, the suggestions these people bring often delight and surprise me more. </p> <p>Above all, <em>Atlas of AI</em> will give you a fresh perspective that you can use when you read about the next thing AI is claimed to solve. Yes, the possibilities are promising. The features often cool. But we’ve got to keep our feet on the ground and assess AI technologies carefully.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/how-ai-is-made-matters-confirms-atlas-of-ai/">How AI is made matters, confirms “Atlas of AI”</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20How AI is made matters, confirms “Atlas of AI”">Reply via email</a></p> Trying out spicy sections on here 2021-08-17T00:00:00Z https://hidde.blog/trying-out-spicy-sections-on-here/ <p>This week I had some fun with <code>&lt;spicy-sections&gt;</code> , an <a href="https://github.com/tabvengers/spicy-sections">experimental custom element</a> that turns a bunch of headings and content into tabs. Or collapsibles. Or some combination of affordances, based on conditions you set.</p> <h2>Background</h2> <p>Introduced in Brian Kardell’s post <a href="https://bkardell.com/blog/SpicySections.html">Tabs in HTML?</a>, the <code>&lt;spicy-sections&gt;</code> element is a concept from some folks in the Open UI Community Group. In this CG, we analyse UI components that are common in design systems and on the web. The goal is to find out which ones might be suitable additions to the platform, the HTML spec and browsers.</p> <p>All design systems teams could come up with their own tabs and figure out semantics, accessibility, security and behaviours. But what if some (or all) of those things could be built into HTML, with browsers implementing smart defaults? A bit like the <code>video</code> element… as a developer you only need to feed it a video and some subtitles, and boom, your users can enjoy video. <em>Maybe</em> your specific website needs the play button to be pink or trigger confetti, but generally, there are quite a lot of websites where the default is just right. </p> <p>The nice thing about platform defaults is also that it can be optimised for the platform that renders it: a <code>select</code> on iOS is different than a <code>select</code> on Microsoft Edge. They work well on these respective platforms. Yes, everyone would like more control over styling of selects, and Open UI is looking at that too (and yay, <a href="https://twitter.com/Una/status/1427688970289287172"><code>accent-color</code> is a thing soon</a>). But can we know which styles a given user needs as well as the platform can? </p> <h2>Why spicy sections?</h2> <p>Tabs are among the most frequently requested components. They are also tricky. Some of the considerations:</p> <ul> <li>meaning: tabs in your browser manage windows, tabs in a webpage manage, eh, sections? These are quite distinct. </li> <li>accessibility: with ARIA, there are at least two ways to do tabs (eg activate on focus or not?), and in some user tests I saw, users prefers ARIA-less tabs</li> <li>what about <a href="https://open-ui.org/components/tabs.research.parts#disabled-tabs">disabled tabs</a> and <a href="https://open-ui.org/components/tabs.research.parts#dismiss-close-delete-remove">user dismissable ones</a>? </li> <li><a href="https://open-ui.org/components/tabs.research.parts#tab-list-overflow">overflow</a>: what if not all tabs fit on the screen? scrollbars?</li> </ul> <p>(The <a href="https://open-ui.org/components/tabs.research.parts">Tabs Research</a> from Open UI CG has many more tab engineering considerations)</p> <p>The overflow issue begs the question: does content displayed in tabs <em>always</em> belong in tabs, or might there be better controls in some situations? Maybe on small screens we need to get rid of the tabs and use collapsibles? (Maybe we need to <a href="https://bkardell.com/blog/DesignAffordanceControls.html">‘uncontrol’</a> them in specific cases, like print?) </p> <p>This makes all the more sense if you consider tabs in web pages are really just a different way to display sections and their headings. <a href="https://hiddedevries.nl/en/blog/2018-09-01-heading-structures-are-tables-of-contents">Headings are tables of contents</a>, after all. “Spicy sections”, then, would be a web platform feature that lets you display sections in different ways: linear, as is the default way to display sections now, as tabs or as collapsibles. You pick which based on constraints, and media queries are the way the <code>spicy-sections</code> demo defines those constraints.</p> <p>Yes, <code>&lt;spicy-sections&gt;</code> is a demo, the element exists to explore ideas and start the conversation. Brian encourages you to share your thoughts:</p> <blockquote> <p>Play with it. Build something useful. Ask questions, show us your uses, <a href="https://github.com/tabvengers/spicy-sections/issues">give us feedback about what you like or don’t</a>. This will help us shape good and successful approaches and inform actual proposals. </p> </blockquote> <p>As Brian says in <a href="https://bkardell.com/blog/SpicySections.html">his post</a>: it is critical that web developers see these proposals way before they exist in browsers. So if you happen to be a front-end developer reading this… consider if you like this experiment, share your thoughts or questions, don’t feel shy to open a GitHub issue. </p> <h2>Four sections, but spicier</h2> <p>On this website I have a fairly <a href="https://hidde.blog/en/what-i-do">boring page</a> that lists some stuff I do as a freelancer: services. Each service has a <code>h2</code> and a bit of content. I decided to use this for testing the <code>spicy-sections</code> element IRL.</p> <p>To get it to work, I included <a href="https://github.com/tabvengers/spicy-sections"><code>SpicySections.js</code></a>, a JavaScript class that defines a custom element. The element looks in your CSS for a definition of when you want which affordances. I went for this configuration:</p> <ul> <li>collapsibles when <code>max-width: 50em</code> (my mobile state) matches</li> <li>tabs when <code>min-width: 70em</code> matches </li> <li>otherwise, just the headings and content as they are</li> </ul> <p>I could set this in my CSS, using:</p> <pre class="language-css"><code class="language-css"><span class="token selector">spicy-sections</span> <span class="token punctuation">{</span> <span class="token property">--const-mq-affordances</span><span class="token punctuation">:</span> [screen and <span class="token punctuation">(</span><span class="token property">max-width</span><span class="token punctuation">:</span> 50em<span class="token punctuation">)</span> ] collapse | [screen and <span class="token punctuation">(</span><span class="token property">min-width</span><span class="token punctuation">:</span> 70em<span class="token punctuation">)</span> ] tab-bar<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>I rewrote my markup to have the following expected structure: </p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>spicy-sections</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span><span class="token punctuation">></span></span>Name of heading<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">></span></span> content be here <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span> … repeat the h2 and div for more sections <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>spicy-sections</span><span class="token punctuation">></span></span></code></pre> <p>(also works with other headings; <code>h1</code>, <code>h3</code>, etc)</p> <p>Note: this isn’t final syntax, it could be something else entirely, suggestions are welcomed. </p> <h2>Some overrides</h2> <p>After I had ensured my markup had the right shape, I included the <code>SpiceSections</code> JavaScript and I set my constraints in CSS, it worked very much as advertised. There were two things I tweaked.</p> <h3>Vertical tabs</h3> <p>With <code>spicy-sections</code>, you’re using headings as tab names. It seems my page has quite long headings. Horizontally, I didn’t have sufficient space, so I wanted mine to go vertical instead.</p> <p>I got this to work by adding an extra affordance to the web component class, some code to set <code>aria-orientation</code> to <code>vertical</code> and a bit of CSS to make it work visually. I set <code>white-space</code> to <code>normal</code> and made <code>spicy-sections</code> a flex container in the row direction, for easy same height columns. </p> <p>I could have done this all in CSS, except for <code>aria-orientation</code>, but I am unsure about the benefit of the attribute here: arrow keys for both orientations are supported by default.</p> <h3>Overriding a margin</h3> <p>In my website’s CSS, I have this line (don’t judge 😬): </p> <pre class="language-css"><code class="language-css"><span class="token selector">*, *::before, *::after</span> <span class="token punctuation">{</span> <span class="token property">margin</span><span class="token punctuation">:</span> 0<span class="token punctuation">;</span> <span class="token property">padding</span><span class="token punctuation">:</span> 0<span class="token punctuation">;</span> <span class="token property">box-sizing</span><span class="token punctuation">:</span> border-box<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>It somehow overwrote the right margin on the arrows that <code>spicy-sections</code> throws in for the collapsed view. No biggie, with CSS’s excellent cascading functionality this was easy to fix.</p> <h3>Nesting</h3> <p>I have also put some <code>spicy-sections</code> inside my <code>spicy-sections</code>: I have some ‘examples’ listed on the side on larger screens, it made sense to me to show them collapsed on smaller screens. This can be done with a combination of <code>spicy-sections</code>:</p> <pre><code>&lt;spice-sections&gt; &lt;h2&gt;A section&lt;/h2&gt; &lt;div&gt; &lt;spicy-sections&gt; &lt;h3&gt;Oh my, I am nested!&lt;/h3&gt; &lt;div/&gt; &lt;/spicy-sections&gt; &lt;/div&gt; … &lt;/spicy-sections&gt; </code></pre> <p>and this CSS: </p> <pre class="language-css"><code class="language-css"><span class="token selector">.spicy-services-examples</span> <span class="token punctuation">{</span> <span class="token property">--const-mq-affordances</span><span class="token punctuation">:</span> [screen and <span class="token punctuation">(</span><span class="token property">max-width</span><span class="token punctuation">:</span> 50em<span class="token punctuation">)</span> ] collapse<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>So basically, I only list one affordance and it only applies to “small screens”, or what that means on this site.</p> <h2>Thoughts</h2> <p>This is all a long winded way to say: I quite like the idea of conditionally changing the appearance of sections. I think it makes sense on the web, because our sites and apps are viewed on so many different screen types and sizes (<a href="https://www.youtube.com/watch?v=9z0tl4c8EH0">screen spanning</a>, anyone?). Horizontal tabs are probably not always the best affordance, other affordances make sense in some situations, so a mechanism to switch between them is useful. </p> <p>The way the experimental component works happens to be very styleable. When I was implementing it on my site, I felt I could make everything look exactly the way I wanted it to look. The tabs are just <code>h2</code> elements and you can do whatever you want to them, using the styling language we all know and love: CSS. </p> <p>Reusing media query-like syntax for defining when to use which affordances is helpful. Folks who build responsive websites will be used to them already.</p> <p>There are also some uncertainties that came to my mind: </p> <ul> <li>will people get it? Wrapping some content into a <code>spicy-sections</code> sections element fits well into the way I think about content on the web, I think about markup a lot, it matters to me. I fear it could feel weird to others, especially designers and developers who aren’t very concerned with markup, or who don’t see <a href="https://hiddedevries.nl/en/blog/2018-09-01-heading-structures-are-tables-of-contents">headings as tables of contents</a></li> <li>is this easy to author in a CMS? In theory this would work well with any CMS content, it could be used with CMSes that exist today, because the markup that is required is “just” headings and content. There may be some trickery required to wrap the content underneath each heading into a <code>div</code>, and the set of sections into the right element, but that should be minor. </li> <li>are there other affordances that are not in the current proposal? Maybe something that automatically generated a table of contents kind of thing, like GitHub does for READMEs?</li> <li>could it confuse users that semantics and accessibility meta data (roles, states) can change based on constraints?</li> </ul> <h2>Wrapping up</h2> <p>Thanks for reading this write-up! If you like, please <a href="https://codepen.io/bkardell/pen/VwpJGGL?editors=1100">play with Brian’s demo on Codepen</a>, perhaps <a href="https://github.com/tabvengers/spicy-sections">use spicy-sections</a> somewhere and <a href="https://github.com/tabvengers/spicy-sections/issues">give feedback</a> if you have any.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/trying-out-spicy-sections-on-here/">Trying out spicy sections on here</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Trying out spicy sections on here">Reply via email</a></p> Subsets and supersets of WCAG 2021-09-08T00:00:00Z https://hidde.blog/subsets-and-supersets-of-wcag/ <p>“Could you give us a checklist for accessibility, please”, is a frequently asked question to accessibility consultants. Checklists, while convenient, reduce WCAG to a subset. To maximise accessibility, we likely need a superset. This post goed into how both subsets and supersets can be helpful in their own ways. </p> <h2>Why WCAG</h2> <p>In this post, I’ll consider <a href="https://www.w3.org/WAI/standards-guidelines/wcag/glance/">WCAG</a> the baseline, as many governments and organisations do. Accessibility standards are by no means perfect, but they are essential. To get their web accessibility right at scale, organisations need a solid definition of what “success” means when building accessibly. Something to measure. Such definitions require a lot of input and perspectives. They necessarily take long. Standards like WCAG are the closest we have to that, and yes, they have gotten a wide range of input and perspectives. In other words, full WCAG reports are a great way for organisations to monitor their accessibility.</p> <p>We can’t be doing full audits all the time, if only because those are best done by external auditors, outside the project team. On the other end of the spectrum, just performing WCAG audits isn’t enough. To maximise accessibility, our organisation should test with users with disabilities and include best practices beyond WCAG.</p> <h2>Subsets</h2> <p>Using subsets of WCAG, more team members can work on accessibility more often. More team members, because checklists often require less expertise, and more often, because doing a few checklists requires no planning, unlike conducting a full WCAG audit. </p> <h3>Why settle for less?</h3> <p>Accessibility standards can be daunting to use. If we commit to WCAG 2.1 Level A + AA conformance, there are 50 Success Criteria that we should check against. For every aspect (content, UI design, development etc), for every component. I often hear teams say that this too much of a burden. If we want to decide what applies when and to which team members, we’ll need to be well-versed in WCAG, or hire a consultant who is. Regardless of whether we do that (please do, regular full audits are essential), it makes sense to have some checks that anyone can perform.</p> <p><em>Sidenote</em>: of course, in real projects, it takes less to evaluate against the full set of WCAG Success Criteria, as not everything always applies. For instance, a component that doesn’t include any “time based media”, can assume the four Level A/AA criteria that relate to such media don’t apply. And responsibilities per Success Criterion differ too (for more background: <a href="https://www.w3.org/WAI/EO/wiki/ARRM_Project_-_Accessibility_Roles_and_Responsibilities_Mapping">the ARRM project</a> works on a <a href="https://www.w3.org/WAI/EO/wiki/ARRM_Success_Criteria_Matrix">matrix mapping Success Criteria to roles and responsibilities</a>).</p> <h3>Have checks that anyone can perform</h3> <p>Checks that anyone can perform don’t require special software or specialist accessibility knowledge. Examples:</p> <ul> <li>if you zoom in your browser to 400%, does the interface still work?</li> <li>can you get to all the clickable things with just the <code>TAB</code> key, use them <em>and</em> see where you are? (this one may require <a href="https://www.a11yproject.com/posts/2017-12-29-macos-browser-keyboard-navigation/">some setup</a> if you’re on a Mac)</li> <li>when you click on form labels, does the input gain focus?</li> </ul> <p>So that’s one subset of WCAG. Ideally, we would pick our own for our organisation or project, based on types of websites or content (will we have lots of forms? lots of data visualisation? mostly content? super interactive? etc). Pick checks that many people can perform often.</p> <p>I’ve seen this approach can be a powerful part of an accessibility strategy. You know, Conway’s Game of Life only has <a href="https://en.wikipedia.org/wiki/Conway's_Game_of_Life#Rules">four rules</a>, yet you can use it to build spaceships, gliders, Boolean logic and finite state machines… sometimes there’s power in simple rules and checks. </p> <h2>Supersets</h2> <p>With a superset of WCAG, our website can become more accessible. </p> <p>It’s no secret that WCAG doesn’t cover everything and this only makes sense. Creating standards takes a lot of time, the web industry is in continuous evolution and some barriers can be put into testable criteria more easily than others. The <a href="https://www.w3.org/groups/wg/ag/participants">Accessibility Guidelines Working Group</a> (AGWG) in W3C does fantastic work on WCAG (sorry, I am biased), including to cover more and different user needs and take into account the ever-changing web. I mean, WCAG 2.* is from 2008 and the basic principles still stand after all those years.</p> <h3>Test with people</h3> <p>One of the most effective ways to find out if our work is accessible, is to test with users with disabilities, either by including them in our regular user tests, or as separate user tests.</p> <p>User testing with people with disabilities is mostly similar to ‘regular’ user testing, but some things are different. In <a href="https://frozenrockets.nl/articles/en/user-testing-with-disabled-people">Things to consider when doing usability testing with disabled people</a>, Peter van Grieken shares tips for recruiting participants, timing, interpretation and accomodation. </p> <p>The Accessibility Project also has a <a href="https://www.a11yproject.com/resources/#professional-testers">list of organisations that can help with testing with users with disabilities</a>.</p> <h3>Guidance beyond WCAG</h3> <p>There are also lots of accessibility best practices beyond WCAG, some provided by the W3C as <a href="https://hiddedevries.nl/en/blog/2021-04-27-whats-normative-in-wcag">non-normative guidance</a>, some provided by others.</p> <p>For instance, see:</p> <ul> <li><a href="https://www.w3.org/TR/coga-usable/">Making Content Usable for People with Cognitive and Learning Disabilities</a> , a document filled with UX recommendations, specifically related to people with cognitive and learning disabilities, but useful for all</li> <li><a href="https://www.w3.org/TR/xaur/">XR Accessibility User Requirements</a> for if you’re building anything “extended reality”-like, such as virtual reality and augmented reality</li> <li><a href="https://www.w3.org/TR/low-vision-needs/">Accessibility Requirements for People with Low Vision</a> on how to make web content accessible to people with low vision</li> <li><a href="https://accessibility.blog.gov.uk/">GOV.UK accessibility blog</a>, where the folks behind GOV.UK share stories from their accessibility practice, tests they’ve done and more</li> <li>Scott O’Hara’s <a href="https://github.com/scottaohara/accessible_components">Accessible Components</a></li> </ul> <h2>Summing up</h2> <p>Many use WCAG as a baseline to ensure web accessibility. This matters a lot, it is important to have regular WCAG audits done (e.g. yearly). In this post, we looked at what we can do beyond that, when we use subsets and supersets of the standard. Subsets can help anyone test stuff anytime, which is good for continually catching low hanging fruit. Supersets are useful to ensure you’re really building something that is accessible, by user testing and embedding guidance and best practices beyond WCAG.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/subsets-and-supersets-of-wcag/">Subsets and supersets of WCAG</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Subsets and supersets of WCAG">Reply via email</a></p> Patterns 2021-11-02T00:00:00Z https://hidde.blog/patterns/ <p>Last week, I attended a conversation with <a href="https://twitter.com/ceciliakang">Cecilia Kang</a>, the New York Times journalist who co-authored <a href="https://www.harpercollins.com/pages/anuglytruth"><em>An Ugly Truth</em></a> with <a href="https://twitter.com/sheeraf">Sheera Frankel</a>. It was a lot about patterns in Facebook’s decisions, leadership style and press relations. </p> <img alt="round conference hall with blue lights and cecilia kang on slide and on stage" src="https://hidde.blog/_images/uglytruth.jpg" /> <p>I was delighted to be back in a conference hall, and it happened to be the one where we hosted <a href="https://fronteers.nl/congres/2009">Fronteers 2009</a> and <a href="https://mobilism.nl/2011/">Mobilism 2011</a>, the memories! These events had sponsors like Opera, Internet Explorer 8 and Blackberry. Anyway, I digress, let’s talk about Facebook.</p> <h2>Profit over people</h2> <p>Facebook wants two things, Kang emphasised: connect all people together through technology and grow their business. Sounds reasonable? Maybe, but these goals impact one another in a very specific way. Facebook sells ads. You can get most people to look at ads if the content triggers people, including when it is upsetting, hateful content. Growing business ends up growing hate. The site does bring people together, yes, but it profits most when they are upset together. And, problematically, maximising profit is the end goal, <em>The Ugly Truth</em> shows.</p> <p>Is bad content a problem? Kind of, but most platforms have some of that and we should probably blame the authors of that content, not Facebook. Is profit a problem? Or maximising it? It isn’t that per se. All companies try to make profit, most try to make a lot. The problem is profit at the expense of people’s wellbeing and safety. This is where the tobacco and oil company comparisons come in. Facebook understands which content <a href="https://www.wsj.com/articles/facebook-algorithm-change-zuckerberg-11631654215?mod=article_inline">angers</a> or <a href="https://www.wsj.com/articles/facebook-knows-instagram-is-toxic-for-teen-girls-company-documents-show-11631620739?mod=hp_lead_pos7&mod=article_inline">harms</a> people. They <a href="https://slate.com/technology/2014/06/facebook-unethical-experiment-it-made-news-feeds-happier-or-sadder-to-manipulate-peoples-emotions.html">ran experiments with happier and less depressing newsfeeds</a>. They knew about <a href="https://www.reuters.com/article/us-myanmar-rohingya-facebook/u-n-investigators-cite-facebook-role-in-myanmar-crisis-idUSKCN1GO2PN">persecution of Rohingya people in Myanmar</a>, fired up by <a href="https://www.wsj.com/articles/facebook-hate-speech-india-politics-muslim-hindu-modi-zuckerberg-11597423346">a politician they gave a voice</a>. They <a href="https://www.ft.com/content/abaf9ea7-c5dc-4ba7-8f80-48b488aee5ae">knew about extremists using their platform to organise storming the Capitol</a>. They knew about <a href="https://www.wsj.com/articles/facebook-mark-zuckerberg-vaccinated-11631880296?mod=article_inline">the medical misinformation that undermined solutions for the global COVID-19 pandemic</a>. </p> <p>The thing is, extremism, misinformation and hate thrive on <em>amplification</em>, on being widely shared. Facebook’s inaction is so problematic, because it facilitates and accelerates that amplification to make more money. There would be extremists, liars and haters in a world without Facebook, but they would thrive a lot less less. They would thrive less on regular tv, and they would thrive less on a social media platform with more ethical content priorities. There are other platforms too that are based on amplification, which often have similar problems, but this is post is not about them.</p> <p>The Facebook Papers, a large set of documents released by whistleblower Frances Hauben to a dozen news outlets, clearly confirm the conclusions of <em>An Ugly Truth</em>: Facebook knows what they amplify and don’t care enough to stop. Of course, they contract huge amounts of content moderators and mark COVID-19 information from trusted sources, but leadership decisions consistently put engagement (profit) before safety (moderating harmful content). </p> <p>The Atlantic’s Adrienne LaFrance:</p> <blockquote> <p>Again and again, the Facebook Papers show staffers sounding alarms about the dangers posed by the platform—how Facebook amplifies extremism and misinformation, how it incites violence, how it encourages radicalization and political polarization. Again and again, staffers reckon with the ways in which Facebook’s decisions stoke these harms, and they plead with leadership to do more.</p> <p>And again and again, staffers say, Facebook’s leaders ignore them.</p> </blockquote> <p>(From: <a href="https://www.theatlantic.com/ideas/archive/2021/10/facebook-papers-democracy-election-zuckerberg/620478/">‘History Will Not Judge Us Kindly’</a> in The Atlantic)</p> <p>The Wall Street Journal’s <em>Facebook Files</em> series evolves around the same conclusion in its opening words: </p> <blockquote> <p>Facebook Inc. knows, in acute detail, that its platforms are riddled with flaws that cause harm, often in ways only the company fully understands. (…)Time and again, the documents show, Facebook’s researchers have identified the platform’s ill effects. Time and again, despite congressional hearings, its own pledges and numerous media exposés, the company didn’t fix them.</p> </blockquote> <p>(From: <a href="https://www.wsj.com/articles/the-facebook-files-11631713039?st=4xf8au0njvbdh27">‘The Facebook Files’</a>)</p> <p>Inaction is a pattern <em>An Ugly Truth</em> confirms. Time after time, when Facebook leadership can choose between what’s good for people and what’s makes them more profit, they choose profit. These aren’t always at odds, but when they are, profit is consistently prioritised. And with that, the amplification of bad content.</p> <p>Besides amplification of harmful content for profit, Facebook also engages in large scale data collection, as Shoshana Zuboff explained in <a href="https://hiddedevries.nl/en/blog/2019-03-06-book-review-the-age-of-surveillance-capitalism">The Age of Surveillance Capitalism</a>. <a href="https://digiday.com/media/why-facebook-keeps-collecting-peoples-data-and-building-their-profiles-even-when-their-accounts-are-deactivated/">Facebook tracks even users who deactivated</a> and had <a href="https://www.nytimes.com/interactive/2018/06/03/technology/facebook-device-partners-users-friends-data.html">shady data sharing deals with device manufacturers</a>. </p> <p>Journalists have reported on lots and lots of serious problems related to Facebook’s priorities, some of which I linked above. This brings us to another pattern: Facebook’s press teams downsize the problems or outright deny them. They’ll call a story an absurd suggestion, only for it to turn out to be mostly accurate. They will also often point to the competition, which sometimes has similar problems. Or they attack the messenger. When Frances Hauben was testifying, Andy Stone, a Facebook PR person, shamelessly tweeted:</p> <blockquote> <p>Just pointing out the fact that @FrancesHaugen did not work on child safety or Instagram or research these issues and has no direct knowledge of the topic from her work at Facebook.</p> </blockquote> <p>Which is why she brought documents, as <a href="https://twitter.com/orientaljanedoe/status/1445422385084059656">Jane Chung aptly replied</a>. This time the press team responded childishly, the book also shows that they like to spin stories and deny truths when they see a chance.</p> <h2>The leadership</h2> <p>The book also goes into the people running Facebook and how to see the world. When I think of Mark Zuckerberg’s world view, I think about that time he called people who trusted him with their data <a href="https://www.businessinsider.com/well-these-new-zuckerberg-ims-wont-help-facebooks-privacy-problems-2010-5">“dumb fucks”</a>. I hesitate to reduce a person’s world view to one quote from their past, but reading <em>The Ugly Truth</em> made me feel that his decisions and priorities of today still show he tends to dismiss other people’s safety. </p> <p>When he <a href="https://www.politico.com/news/2019/10/17/zuckerberg-georgetown-speech-050110">addressed Georgetown University</a>, he said he doesn’t want to ‘censor political speech’ and focused on free speech. The ideology seems to be that a president’s freedom to incite violence or spread covid misinformation, and the public’s freedom to ‘judge for themselves’, are more important than people’s safety. Everyone wants freedoms, but the question is whose freedom gets priority.</p> <p>Mark Zuckerberg, Kang explained in Amsterdam, is inspired by Silicon Valley men like the controversial libertarian Peter Thiel, and not so much by what his own employees tell him. They often don’t bring important things to him, Kang said, as the company has a culture of protecting the leader. People want to be friends with him, not appear too critical. Maybe that’s the case for many CEOs, but it does make one wonder what the company had looked like under different leadership, that took inspiration from different places.</p> <h2>So, what now?</h2> <p>I think everyone gets how Facebook, Instagram, WhatsApp, React and Oculus have their merits. They can and often do bring people together. Make the world a better place. I don’t mean this sarcastically. Ok, I’m not personally so convinced of Oculus, I’m more of a real world person, but I’ll leave that for a later post. These platforms aren’t inherently bad, they bring lots of good to many people. The bad they bring sometimes merely reflects the bad that’s out there in the world. But it’s clear that Facebook’s role is often that of a megaphone, not just a mirror. </p> <p>Some of the audience questions were along the lines “could we remove the bad parts of Facebook?” This is a tricky question, because of where most of the problems manifest. They aren’t in one team that messes things up, they are right in the business model that pays everyone’s salary. Removing the bad parts might not leave us with much left. There are also countless stories of people trying to “change the company from within”, which has now become a bit of a meme.</p> <p>More legislative controls are expected, likely in the US and Europe and likely somewhere in the next 5 years or so. Maybe this will get us more of the good parts and less of the bad parts of Facebook. </p> <p>Until, then, this is my personal list of things we can all do now:</p> <ul> <li>refuse to work at Facebook; it’s like voting, your individual vote doesn’t matter, but millions of individual votes can push the world in a clear direction, in this case one where Facebook has a hard time finding employees</li> <li>quit working at Facebook (I know, <a href="https://mobile.twitter.com/EmilyKager/status/1453825233169772547">controversial</a>), for the same reasons</li> <li>stop or reduce usage of Facebook/Meta and its products (including, dare I say it, React)</li> <li>help non-tech friends and family move away from Facebook </li> <li>stop advertising on Facebook (<a href="https://www.nasdaq.com/articles/patagonia-joins-the-north-face-in-facebook-ad-boycott-2020-06-22">some companies have</a>)</li> <li>help small business friends by building them a simple website outside Facebook’s walled garden</li> <li>read up on patterns in tech companies, check out books like <a href="https://www.harpercollins.com/pages/anuglytruth">An Ugly Truth</a> and <a href="https://www.mike-isaac.com/">Super Pumped</a> (on Uber)</li> </ul> <h2>Wrapping up</h2> <p>In conclusion, the issue isn’t that Facebook has harmful content or makes profit, it’s that its leadership consistently decides to prioritise their profit over preventing harm. They know they have problems, but decide against fixing them and aren’t honest about this to the press. This is why we all need a lot less Facebook in our lives, and I urge you to join the movement.</p> <p>Looking back, the time of Opera, Internet Explorer 8 and Blackberry felt more innocent. The monopolies felt less harmful. I, for one, am very curious how the world will look back at today’s Facebook in ten years time. Let’s hope their patterns will have changed for good.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/patterns/">Patterns</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Patterns">Reply via email</a></p> In person 2021-11-16T00:00:00Z https://hidde.blog/in-person/ <p>The applause seemed louder than usual. They were stoked, this community of European nerds, designers and lots of people in between. At last. After almost two years without <a href="https://beyondtellerrand.com/">Beyond Tellerrand</a> conferences, <a href="https://twitter.com/marcthiele">Marc Thiele</a> decided to make it work and run another event. It was great to see him back on stage, introducing speakers and more.</p> <img alt="two photos, on the left beyond tellerrand flags outside with blue background, on the right a stage with a ten years beyond tellerrand slide with creative lettering" src="https://hidde.blog/_images/bt.jpg" /> <p>Of course, it was anything but a normal event. Not all regulars could or wanted to attend. Naturally, they were missed. Those who did attend, mostly local or local-ish, had to stick to the ‘2G+’ rule: to be vaccinated, recovered or PCR tested. I felt lucky I could be there, to attend a number of wonderful talks, meet folks in person and speak. I didn’t find the risk assessment easy… for myself, for others… but, given the circumstances, it seemed like the right call to attend. </p> <h2>The talks</h2> <p>Recordings of last week’s Beyond Tellerrand are already up on YouTube and Vimeo. Check out the <a href="https://beyondtellerrand.com/events/dusseldorf-2021/speakers">event page</a> for links: there is awesome content about variable fonts, quarantine life, sketching as a tool, the <code>&lt;head&gt;</code> tag and how it affects web performance, the attention economy, OAuth from a usability perspective, creative typography and how modern font tech allows for it, data visualisation and experiencing disability.</p> <p><a href="https://beyondtellerrand.com/events/dusseldorf-2021/speakers" title=""><img alt="beyond tellerrand speakers page; screenshot of youtube player showing welcome back video and a list of beyond tellerrand talks" src="https://hidde.blog/_images/beyond.jpg" /></a> <em>Recordings for all talks are available</em> </p> <p>I opened the second day with a full length talk just about semantics. Inspired by the Austrian-British philosopher Ludwig Wittgenstein, who equated <em>meaning</em> to <em>use</em>, I explained semantics is fundamentally about a system of meaning that is shared. Shared through a standard: <a href="https://developers.whatwg.org/">HTML</a>. This is how it differs from other examples of shared languages, like design systems and APIs. Through examples, I tried to show how semantic HTML affects end users and talked a little about gotchas (see the <a href="https://www.youtube.com/watch?v=YG9WQUfH7ZU&t=1s">recording</a> for more).</p> <h2>In person</h2> <p>It was special to me to speak at Beyond Tellerrand. Not only was it ten years after attending the <a href="https://beyondtellerrand.com/events/dusseldorf-2011/speakers">first edition</a>, it was also after over a year of just virtual talks. Virtual events are great. They have allowed me to speak in more places, without the travel. Last month I could attend <a href="https://www.w3.org/2021/10/TPAC/">W3C TPAC</a> and <a href="https://conf.a11yto.com/">Accessibility Toronto</a> on the same day, while I also met my manager in Boston for a 1:1 and cooked family dinner at home. Which brings me to the downside… if you can be everywhere at once, are you really anywhere fully?</p> <p>In virtual events, I’ve often not attended the whole thing, because I find that a lot harder while at my desk and at home. At my desk, there is also other work waiting. At home, there is family. I love my work, but picking between work and family is easy, I will pick family, unless I’ve actually travelled away. </p> <p>In person, it felt easier to focus on just the event. It meant that I could bump into people in the hallways. Not literally, of course. I got more immediate feedback and much more time with attendees, organisers and fellow speakers. The feeling of being in an auditorium with others, laughing about the same jokes, enjoying the same beautiful typography on a huge screen, inpromptu ramen lunches… it’s all hard to replicate virtually.</p> <h2>Accessibility Club and Indie Web Camp</h2> <p>In the days after the conference, some of us gathered in the newly opened Zentralbibliothek, Düsseldorf’s public library. On Wednesday there was an <a href="https://accessibility-club.org/event/accessibility-club-meetup-10-12">Accessibility Club Meetup</a>. I talked about opportunities for <a href="https://talks.hiddedevries.nl/Lh9wu2/could-browsers-fix-more-accessibility-problems-automatically">browsers to contribute to accessibility issues</a>. Molly Watt shared her experiences as a deafblind user of technology and urged us to make less assumptions about and test more with users. Karl Groves warned us to not trust vendors of accessibility overlays. This was all livestreamed and it was awesome to watch <a href="https://twitter.com/marcthiele">Marc</a> and <a href="https://twitter.com/aaronpk">Aaron</a> setting up their elaborate streaming setup. </p> <p>On Thursday, I left for home, but not before I had attended the informal yet important pre-event coffee session and the planning for that day’s <a href="https://indieweb.org/">Indie Web Camp</a>. It was my first Indie Web Camp, and I had wanted to attend for a while. I decided to work on the Webmentions on this website. That afternoon, in my train back, I tweaked how likes and shares, the most common form of Webmention I receive here, are displayed. They now show all in one paragraph, rather than as individual comment-like entries. This cleaned up the comment section for most posts on this site, which was nice.</p> <h2>Summing up</h2> <p>This was fun, and I hope it can happen again in the not too distant future. In the next few weeks, I have some more virtual and hybrid <a href="https://talks.hiddedevries.nl/#upcoming">events</a>. Here’s to hoping that 2022 will bring more opportunities to safely gather in person with web friends, including those who live further away. Because, for one, I missed this.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/in-person/">In person</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20In person">Reply via email</a></p> Meeting “2.2.2 Pause, Stop, Hide” with prefers-reduced-motion 2021-12-03T00:00:00Z https://hidde.blog/meeting-2-22-pause-stop-hide-with-prefers-reduced-motion/ <p>With prefers-reduced-motion, developers can create UIs that don’t move when users opt out. Could this feature be a way of meeting WCAG <a href="https://www.w3.org/WAI/WCAG21/Understanding/pause-stop-hide.html">2.2.2 Pause, Stop, Hide</a>?</p> <p><a href="https://twitter.com/rianrietveld">Rian</a> recently asked this question in Fronteers Slack and I thought I would write up some thoughts around this for later reference. I will go into three things: what’s 2.2.2 about, how could using <code>prefers-reduced-motion</code> be a way to meet it and is that desirable?</p> <h2>What is 2.2.2 about?</h2> <p>Moving, blinking and scrolling content can be a barrier to: </p> <ul> <li>people who cannot read text fast or track moving objects</li> <li>people who use screen readers, this kind of content can cause trouble there</li> <li>people who have attention deficit disorders </li> </ul> <p>Success Criterion 2.2.2 says that for such content, there should be a “mechanism for the user to pause, stop, or hide it”. The exception is content that is considered “essential”, like when removing it would radically change the content or if this UI is really the only way to display the functionality. If this content auto-updates, a mechanism to set how often updates happen is also fine.</p> <p>All of this is about content that moves regardless of user interaction. For content that moves when people “interact” (eg scroll or zoom), think parallax effects, this could badly effect people with vestibular disorders. <a href="https://www.w3.org/WAI/WCAG21/Understanding/animation-from-interactions.html">2.3.3 Animation from Interactions</a> (Level AAA) is specifically about this interaction-triggered motion.</p> <h2>Is prefers-reduced-motion sufficient for 2.2.2 conformance?</h2> <h3>What and how</h3> <p>These days, most operating systems let users indicate whether they want to see less motion. </p> <p><img alt="macOS accessibility settings menu with motion checked" src="https://hidde.blog/_images/screenshot-2021-12-03-at-09.06.421.png" /> <em>On macOS, the setting is under Accessibility, Display, Reduce motion</em> </p> <p>This functionality exists for pretty much the same reasons as Success Criterion 2.2.2. In <a href="https://www.w3.org/TR/mediaqueries-5/#prefers-reduced-motion">Media Queries, Level 5</a>, CSS adds a way for web developers to respond to and honour the setting to prefer reduced motion.</p> <p>In CSS, it works like this: </p> <pre class="language-css"><code class="language-css"><span class="token selector">.thing</span> <span class="token punctuation">{</span> <span class="token comment">/* some rules */</span> <span class="token punctuation">}</span> <span class="token atrule"><span class="token rule">@media</span> <span class="token punctuation">(</span>prefers-reduced-motion<span class="token punctuation">)</span></span> <span class="token punctuation">{</span> <span class="token selector">.thing</span> <span class="token punctuation">{</span> <span class="token comment">/* some rules for if user prefers reduced motion*/</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span></code></pre> <p>In JavaScript, you can also read out the value for <code>prefers-reduced-motion</code> with <code>matchMedia</code>, and even add listen to its change event: </p> <pre class="language-javascript"><code class="language-javascript"><span class="token keyword">var</span> query <span class="token operator">=</span> window<span class="token punctuation">.</span><span class="token function">matchMedia</span><span class="token punctuation">(</span><span class="token string">'(prefers-reduced-motion: reduce)'</span><span class="token punctuation">)</span><span class="token punctuation">;</span> query<span class="token punctuation">.</span><span class="token function">addEventListener</span><span class="token punctuation">(</span><span class="token string">'change'</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span> <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>query<span class="token punctuation">.</span>matches<span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token comment">/* some rules */</span> <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span> <span class="token comment">/* some rules for if user prefers reduced motion*/</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span></code></pre> <h3>Conformance</h3> <p>I would say a UI that has moving parts that would cause it to fail 2.2.2, could meet it if those moving parts are removed under the condition of <code>prefers-reduced-motion</code> being set to true. In practice, for this to work, a user would have to set this preference in their operating system and they use a browser that supports it. </p> <p>The crucial part of the Success Criterion text, I think, is:</p> <blockquote> <p>for [moving, blinking and scrolling content] there is <strong>a mechanism</strong> for the user to pause, stop, or hide it </p> </blockquote> <p>(emphasis mine; exception and exact definition of the content this applies removed for clarity)</p> <p>I feel setting ‘prefers reduced motion’ could count as such a mechanism, for most cases of moving content. </p> <h3>Is it “accessibility supported”?</h3> <p>In WCAG, there is this concept of ‘<a href="https://www.w3.org/TR/WCAG21/#dfn-accessibility-supported">accessibility supported</a>’, meaning that you can somewhat trust on platform features, but only if you’re certain they will work for most of your users. Like, if there was an amazing new HTML tag that allowed you to do very accessible tabs, but only one obscure browser can actually render it, that is not considered accessibility supported. </p> <p>“Accessibility supported” requires two things to be true: it has to work in a user’s assistive technology and there are browsers, plugins or even paid user agents that support the feature (paid, as long as price and findability are same for users with and without disabilities). W3C and the WCAG authors (AGWG) only provide these rules, not a specification of what meets them or doesn’t meet them, so it’s up to the accessibility community to agree.</p> <p>I believe this is a feature that doesn’t depend on assistive technology support as it lives in browsers, so I will deem that first clause to be not applicable and look just at the browser support. For ‘prefers-reduced-motion`, <a href="https://caniuse.com/?search=prefers-reduced-motion">caniuse </a> shows 93% of users are on browsers that support it. It is important to note that some screenreader users may be on older browsers, for a variety of reasons. Among respondents to <a href="https://webaim.org/projects/screenreadersurvey9/#browsercombos">WebAIM’s most recent screenreader user survey</a>, Internet Explorer usage was 3.3%. To include even those users, one could <a href="https://codepen.io/patrickhlauke/pen/YzPPdeo">use prefers-reduced-motion defensively</a>.</p> <p>I wrote this would be fine to meet WCAG in ‘most cases’. When is it not? Examples could be those when the ‘moving’ means the site adds new content, like in a stock ticker, as <a href="https://github.com/w3c/wcag/issues/988#issuecomment-563447368">Jonathan Avila suggests on GitHub</a>. Not adding that content would be undesirable, as it would make that content unavailable to users with the setting turned on. </p> <h2>Is this desirable?</h2> <p>If we want an accessible web, we shouldn’t just look for the bare minimum to conform. When I carry out accessibility conformance evaluations, measuring that minimum is what I consider my goal, but, of course, web accessibility is about more than such audits. People with disabilities should have equal usability and that requires best practices and user testing, in addition to standards conformance.</p> <p>So, ‘is this desirable?’ is a usability question. Will people who need the setting actually discover, understand and use it? The setting can be in a variety of places. MDN has a <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion#user_preferences">list of settings</a> that cause Firefox to honour <code>prefers-reduced-motion</code>, presumably these are similar for Chromium and Webkit based browsers. It seems likely to me that lots of people won’t find this setting. So it doesn’t just give control to end users, it also shifts the burden of knowing and using the setting to them. Operating systems can (and sometimes do) improve discoverability of features like these, though.</p> <p>Generally, I love the idea of features like <code>prefers-reduced-motion</code> standardised primitives to accommodate specific user requirements. I think it’s better than every web developer inventing their own controls to meet the same user needs. In the case of 2.2.2, controls like pause buttons or duration settings. I love the idea that the platform offers generalised controls that aren’t just used on one specific website, but can be respected by all websites. </p> <h2>Similar features</h2> <p>After I published this post, Bram Duvigneau of the Dutch accessibility consultancy <a href="http://firmground.nl/">Firm Ground</a>, sent me a note that included a few more web platform features that help meet WCAG criteria: </p> <ul> <li>in most modern browsers, there is a global mute key. Might this mean websites don’t need to build their own mute buttons to meet <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1&showtechniques=131%2C1410#audio-control">1.4.2 Audio Control</a>?</li> <li>also in most modern browsers, are controls to decrease and increase text size: we no longer expect websites to have their own buttons for this either</li> </ul> <p><img alt="screenshot of tab titled CSS Speech with mute tab" src="https://hidde.blog/_images/screenshot-2021-12-06-at-10.37.541.png" /> <em>The ‘Mute this tab’ button in a Firefox tab</em> </p> <p>The mute and text sizing buttons are much easier to find in web browsers for users. Should browsers also expose a much easier to find ‘stop motion’ button whenever a website implements <code>prefers-reduced-motion</code>, so that a user is more explicitly presented with this option? </p> <h2>Summing up</h2> <p>As you can read, I’m a little torn on whether <code>prefers-reduced-motion</code> is a sufficient way to meet 2.2.2 Pause, Stop, Hide for specific cases of that criterion. In terms of conformance, I would say yes, this is acceptable (with exceptions). In terms of actual usability, which is what is most important, I’m torn as it only actually works if real users find this setting on their device. </p> <p>Over to you! If you’re reading this, I would love to hear what you think!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/meeting-2-22-pause-stop-hide-with-prefers-reduced-motion/">Meeting “2.2.2 Pause, Stop, Hide” with prefers-reduced-motion</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Meeting “2.2.2 Pause, Stop, Hide” with prefers-reduced-motion">Reply via email</a></p> The better version of digital life is real life, not ‘the metaverse’ 2021-12-04T00:00:00Z https://hidde.blog/the-better-version-of-digital-life-is-real-life-not-the-metaverse/ <p>In a Dutch podcast, I heard a prominent tech journalist praise Mark Zuckerberg’s recent Metaverse PR event: finally, the company had presented a grand vision and it looked so cool! In my own tech bubble on Twitter, I saw mostly memes to poke fun at the concept, the presentation and the presenter, and lots of insightful scrutiny. </p> <p>The COVID pandemic has accelerated the move of work to digital spaces rather than physical ones. Metaverse-enthusiasts often claim that more Metaverse-tech can give us a much better version of digital life. I’m not sure about that.</p> <p>Though it was refreshing, I will say I was disappointed by the tech journalist’s enthusiasm. Not because Mark Zuckerberg deserves the laughs, or because it somehow scratches an itch ito criticise people who are genuinely trying to make exciting new tech. I mean, maybe… but really, it is because Facebook’s actions prove time over time they require scrutiny. This corporation makes decisions that put their profit above the safety of both people and the societies they live in, and it plays innocent through a clever PR apparatus (see <a href="https://hiddedevries.nl/en/blog/2021-11-02-patterns">my post on <em>An Ugly Truth</em></a>). The US Congress and European Commission aren’t looking into their practices because they felt bored. It is because they capitalise on surveillance, hate and misinformation, all of which threaten the basic structures of democracy.</p> <p>If Facebook (or Meta) claims they will prioritise security, interoperability and improving human relationships, as Zuckerberg did in <a href="https://stratechery.com/2021/an-interview-with-mark-zuckerberg-about-the-metaverse/">interviews</a>, such claims need scrutiny. Scrutiny from journalists, from software engineers, from activists and from trend watchers. This company has demonstrated on many occasions to be capable of mostly the opposite of security, the opposite of interoperability and the opposite of improving the quality of human relationships. What would Rohinga muslims or the White House staff think when they hear Zuckerberg say security matters to him? What about web developers who try to build interoperable web apps, only to find Facebook’s staff working on the React framework work around more than <em>with</em> web standards? What about the many societies that are driven apart by an effective machinery for medical and political misinformation? Will they feel their human to human relationships have improved?</p> <p>As someone with family, friends and colleagues abroad, I have seen struggles with current digital spaces. They could improve by means of technology and better priorities. But should this be lead by the company whose technology and priorities <em>worsened</em> digital spaces so much? </p> <p>And are more advanced digital environments the answer or does a better world already exist, as in, the real world? Mixing digital and real, as some Metaverse tech does, is super beneficial for corporations that see the web as a place to extract profit from. A Mixed Reality overlay adds not just fun or useful interactions, it adds another thing to measure. More data, for corporations like Facebook, means more profits. </p> <p>Maybe I would be less sceptical if Zuckerberg had outlined in more detail how this would benefit the world first, or even demonstrate ways to guarantee the Metaverse won’t be just another layer of his data extraction machine. Of course, it is a free world and corporations can profit however they want. Including by building a <a href="https://hiddedevries.nl/en/blog/2019-03-06-book-review-the-age-of-surveillance-capitalism">data extraction machine</a> and getting rich off that. Profit is fine, my company aims for profits too. It’s really Zuckerberg’s failure to address what could go wrong, given so much in his current enterprise has gone wrong, that tires me. It’s the combinaton of that data extraction machine for profit and the undesired impacts of it on society.</p> <p>For a corporation wanting to extract data for profit, augmented reality is better than reality. For end users, reality itself, I mean, <em>unaugmented</em> reality, might be the better version of the mostly digitial lockdown life that many of us desire. First of all, it’s <em>real</em>, I mean, did you have a chance to experience life music after lockdowns? It’s nice, right? Secondly, it doesn’t require scary filming glasses or uncomfortable and nausea-inducing headsets. Thirdly, you have to worry less about whether your privacy is invaded. And if Facebook or Meta run things, you can be quite sure of that. I won’t be applying to one of the 50,000 ‘Metaverse jobs’ they said they’ll open in Europe.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/the-better-version-of-digital-life-is-real-life-not-the-metaverse/">The better version of digital life is real life, not ‘the metaverse’</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20The better version of digital life is real life, not ‘the metaverse’">Reply via email</a></p> How many people with disabilities use our site? 2021-12-05T00:00:00Z https://hidde.blog/how-many-people-with-disabilities-use-our-site/ <p>When I talk to teams about web accessibility, often someone will ask how many people with disabilities use their site(s), or some variation of that question. It’s complicated, and other questions can be more helpful.</p> <p>My standard answer usually includes that we can’t measure assistive technology usage for (good) privacy reasons, that our analytics won’t show customers that went to a more accessible competitor and that accessibility benefits everyone.</p> <h2>Accessibility ROI irrelevant (says… Apple!)</h2> <p>One other aspect though, let’s go into that straight away, is that looking for this data hints at trying to find return on investment. A counter question could be: what will we do with that data? Let’s say we get the number and deem it a very small percentage… whatever that is… equal access is still the right thing to aim for, it is still a human right and it is still required by law in most places. So, basically, our organisation has three good reasons to prioritise accessibility that exist regardless of a number of users with disabilities. </p> <p>Or, as Apple CEO Tim Cook once told a shareholder:</p> <blockquote> <p>When we work on making our devices accessible by the blind, I don’t consider the bloody ROI. When I think about doing the right thing, I don’t think about an ROI. If that’s a hard line for you, then you should get out of the stock.</p> </blockquote> <p>(From: <a href="https://webcache.googleusercontent.com/search?q=cache:Fz87-xFCXdgJ:https://www.latimes.com/business/la-xpm-2014-mar-01-la-fi-tn-apple-tim-cook-shareholders-meeting-20140301-story.html+&cd=1&hl=en&ct=clnk&gl=us">Apple’s Tim Cook gets feisty, funny and fiery at shareholders meeting</a>, Los Angeles Times, 1 March 2014)</p> <p>This makes sense for the web too. The web is all about accessibility, both <em>of information</em> and <em>for end users</em>.</p> <h2>Privacy trumps metrics</h2> <p>A web user’s need for privacy trumps our need for analytics. This is especially the case for people with disabilities, who rightly don’t want their disability to be one of your metrics. Standards organisations are careful not to add features to the Web Platform that allow such tracking, because it would invade individual user needs too much. </p> <h2>Your analytics don’t show market potential</h2> <p>Even if we could accurately measure how many people with disabilities used our site, it isn’t a very meaningful number. If our site is inaccessible to people who use voice control, chances are those people are shopping with our competitor instead. The reason they don’t show up in our numbers might be just that. </p> <p>For the potential, we could look at the <a href="https://www.who.int/publications/i/item/9789241564182">World Health Organisation’s Report on Disability</a>, published in 2011. In a comprehensive chapter on demographics, they conclude 15-20% of the world’s population has a disability. These numbers aren’t exact, as countries have different methods of counting, but they give a reasonable estimate that we can work with. </p> <h2>Accessibility benefits everyone</h2> <p>Accessibility features on our site won’t benefit everyone all the time, that would be an exaggeration, but they often benefit many more people than just specific groups of people with disabilities. Dark mode is a feature some users need to avoid headaches or to read content, but many others still apply such settings, for a wide variety of reasons. </p> <p>And it doesn’t just benefit a large parts of our user base, accessibility can also inspire innovation in our organisations. When an Italian inventor created the first typewriter for his blind friend, he invented a thing that is at the centre of what all of us do all day. Voice controlled software, audiobooks… the examples of things that were initially designed for people with disabilities but used by many more, are countless. </p> <h2>Conclusion</h2> <p>We probably don’t need to know how many people with disabilities use our sites, as regardless of what that number would be, we should want to build accessible sites, for many ethical, legal and business reasons.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/how-many-people-with-disabilities-use-our-site/">How many people with disabilities use our site?</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20How many people with disabilities use our site?">Reply via email</a></p> 2021 in review 2021-12-28T00:00:00Z https://hidde.blog/2021-in-review/ <p>Well, guess what, we’re nearing the end of the year! In this post I’ll share what I was up to this year, as well as some things I learned along the way.</p> <p>As usual, my year wasn’t <em>all highlights</em>… like in <a href="https://hiddedevries.nl/en/blog/2020-12-17-2020-in-review">2020</a>, <a href="https://hiddedevries.nl/en/blog/2019-12-20-2019-in-review">2019</a>, <a href="https://hiddedevries.nl/en/blog/2018-12-26-2018-in-review">2018</a> and <a href="https://hiddedevries.nl/en/blog/2017-12-29-2017-in-review">2017</a>, the lowlights are intentionally left out of this public post. Ok, let’s go! </p> <h2>Highlights</h2> <h3>Work</h3> <p>Throughout the year, for W3C/WAI, I was involved in the launch of the redesigned <a href="https://www.w3.org/WAI/eval/report-tool/">WCAG-EM Report Tool</a>, worked on a unified layout for the W3C’s accessibility guidance (like Techniques, Understanding and the ARIA Authoring Practices Guide) and did some work around accessibility of authoring tools in higher education, Epub and XR.</p> <p>This year also was my last at the W3C/WAI. I won’t get into too much detail, but I can say I struggled with the leadership style and decision making process. I had wanted to drive more change from within. I had also wanted to do more to make accessibility more accessible, but the standards game seems easier to play for folks who have been in it longer. When my contract neared the end I decided not to extend. I am grateful for the opportunity though, and was able to learn a lot about standards, web accessibility and the web, and contribute to a wide range of interesting projects.</p> <p>Besides my W3C work, I also did over 25 WCAG conformance audits, mostly for governments, and a couple of in-house workshops, including two for the teams building the Dutch national citizen’s authentication system (<a href="https://digid.nl/">DigiD</a>). </p> <p>I also worked with <a href="https://elevenways.be/">Eleven Ways</a> on an advisory project for the European Commission and a project on virtual event accessibility. Lastly, I just started a short stint with <a href="https://mozilla.org/">Mozilla</a>, to help with some accessibility aspects of the upcoming <a href="https://developer.mozilla.org/">MDN</a> redesign.</p> <p>In February, I will start a new job 🎉, which I am super stoked about. Like my role at the W3C, it focuses on outreach to developers and will let me continue to work on making it easier for developers to build things. I am excited, because it is at a product company that works on solving a very real and interesting problem, and it is <em>very</em> authoring tool related.</p> <h3>Speaking</h3> <p>This year included one <a href="https://hiddedevries.nl/en/blog/2021-11-16-in-person">in person event</a> and I was so happy the covid-shaped stars aligned this time for me. I had recently had my vaccin, the European winter wave had not yet exploded and <a href="https://en.wikipedia.org/wiki/2G-Regel">2G</a> applied.</p> <p>The other talks I did were all remote: </p> <ul> <li><a href="https://talks.hiddedevries.nl/u59Pzr/accelerating-accessibility-in-a-component-based-world">Accelerating accessibility in a component based world</a> at SimpleWebConf (June), JSConf India (November), BLD Conf (November) and Git Commit Show (November)</li> <li><a href="https://talks.hiddedevries.nl/KKW74X/could-browsers-fix-more-accessibility-problems-automatically">Could browsers fix more accessibility problems automatically</a> at a11yTO (October), Accessibility Club Meetup (November) and Tech A11y Summit </li> <li><a href="https://talks.hiddedevries.nl/Ahs3lw/more-to-give-than-just-the-div-semantics-and-how-to-get-them-right">More to give than just the div: semantics and how to get them right</a> at Web Directions: Access All Areas (October) and Beyond Tellerrand (November)</li> <li><a href="https://talks.hiddedevries.nl/XWlAnr/procuring-accessible-software-for-e-learning-how-atag-can-help">Procuring accessible software for e-learning: how ATAG can help</a> with my colleague Joshue O’Connor at WP Campus Online (September)</li> </ul> <p>You can like and subscribe this stuff on <a href="https://www.youtube.com/channel/UC6YfRUNWCmXe8uNWb74uIQA">YouTube</a> should you wish to.</p> <p>I also joined the Gebruiker Centraal (“User Centered”) podcast of the Dutch government (<a href="https://www.gebruikercentraal.nl/podcast/wcag-wat/">WCAG What?</a>) and Ben Meyer’s Some Antics livestream (<a href="https://www.youtube.com/watch?v=lXZ2o69PDho">Audit Site for Accessibility</a>).</p> <h3>Reading</h3> <p>I read 54 books this year. I <a href="https://hiddedevries.nl/en/blog/2021-01-04-how-i-turned-my-goodreads-data-into-a-self-hosted-website-with-eleventy">created a website</a> for this as I love judging books by their covers, now you can too on <a href="https://books.hiddedevries.nl/">books.hiddedevries.nl</a>. This is updated manually—if you want real time updates, add me on Goodreads.</p> <p>Below are some books I particularly liked. They have in common that they are set in parts of the world I have travelled to and would have liked to return to if it wasn’t for the pandemic.</p> <ul> <li><a href="http://francescha.com/">If I had your face</a> by Frances Cha – this is about four women in Seoul and their lives, obsessions and friendships.</li> <li><a href="https://laurenoyler.com/Novel">Fake accounts</a> by Lauren Oyler – what if you find out your partner is actually a complot theorist with a secret Instagram account? Funny and smart satire of contemporary life, partially set in Berlin. Got very mixed comments on Goodreads.</li> <li><a href="https://www.katiekitamura.com/">Intimacies</a> by Katie Kitamura – this book’s main character works at the International Criminal Court in The Hague—ok I have travelled there during the pandemic… it uses precise language, but also shows how much precision of language matters. There was a scene in which people buy old books just for the purpose of decorating their house.</li> <li><a href="https://en.wikipedia.org/wiki/Kafka_on_the_Shore">Kafka on the shore</a> by Haruki Murakami – I reread <em>Kafka on the shore</em>, set in Yamanashi and Takamatsu, Japan, and, like a lot of Murakami books, it involves a road trip, lots of music and lots of cats </li> <li><a href="https://en.wikipedia.org/wiki/Free_Food_for_Millionaires">Free food for millionaires</a> by Min Jin Lee – set in New York, describes a college graduate plotting her future, describing both her generation and her parents, jumping between life’s different environments</li> </ul> <h3>Writing</h3> <p>I didn’t write a lot, but have not stopped posting either—this is the 20th post of this year. Things I wrote about included:</p> <ul> <li><a href="https://hiddedevries.nl/en/blog/2021-12-04-the-better-version-of-digital-life-is-real-life-not-the-metaverse">the “metaverse” and why real life is better</a> – I guess I am sceptical of a lot of the ideas posed by Zuckerberg in this year’s Facebook event</li> <li><a href="https://hiddedevries.nl/en/blog/2021-12-05-how-many-people-with-disabilities-use-our-site">numbers</a> – I get asked a lot how many people have disabilities and I feel that’s the wrong metric</li> <li><a href="https://hiddedevries.nl/en/blog/2021-04-27-whats-normative-in-wcag">“normative’ in WCAG</a> – a lot of my work this year focused around redesigning WCAG-related guidance for W3C/WAI, and part of my research showed users struggle with deciding which guidance is “required” to meet WCAG (spoiler: most of WCAG’s main text is, most other stuff isn’t)</li> <li><a href="https://hiddedevries.nl/en/blog/2021-04-02-accessible-front-end-components-claims-vs-reality">components and what to look for</a> – I love component systems and feel strongly they can contribute to a more accessible web. However, the opportunity they provide is neutral: if components contain barriers, they could make the web less accessible too, so we want to use components that repeat accessibility, not inaccessibility</li> <li>I would love <a href="https://hiddedevries.nl/en/blog/2021-08-03-a-case-for-accessibility-statements-in-app-stores">accessibility statements in App Stores</a> and wrote about that</li> </ul> <h3>Cities</h3> <p>I stayed within the borders of The Netherlands for another year, with one exception: a short train ride across the Netherlands-Germany border for the first <a href="https://beyondtellerrand.com/">Beyond Tellerrand</a> in 2 years. </p> <h2>Things I learned</h2> <p>Towards the end of the year I try to think about what I learned. A lot of this year’s was quite specific to myself, but these are some random learnings that might interest others:</p> <ul> <li>One aspect that makes accessibility of XR tricky is that virtual worlds usually don’t have DOM nodes like web pages do. Accessibility trees are based on DOM nodes, without those XR worlds will need some other mechanism to define accessibility meta information (more about <a href="https://www.w3.org/TR/xaur/">XR Accessibility User Requirements</a>).</li> <li>There is a <a href="http://idpf.org/epub/a11y/">standard for Epub accessibility</a>, but none specifically for native app accessibility, eventhough some organisations in European Union Member States need their apps to be <a href="https://eur-lex.europa.eu/eli/dir/2016/2102/oj">accessible since earlier this year</a>.</li> <li>I was late to the Eleventy party, but eh, Eleventy is nice. I released two Eleventy-based projects: my <a href="https://hidde.blog/2021-in-review/books.hiddedevries.nl/">books site</a> and a <a href="https://github.com/hidde/eleventy-wcag-reporter/">starter pack for WCAG reporting using Eleventy</a>. </li> <li>Open sourcing a thing can make it better! Months after I released my Eleventy WCAG Reporting thingy, friendly folks contributed <a href="https://github.com/hidde/eleventy-wcag-reporter#supported-languages">translations</a> into Portuguese, Finnish, German and Spanish. This is onlly a super small project, but it was nicer than not releasing it could have ever been.</li> <li>Standardising design system components, as in, make common design system needs somehow part of the web platform, is fun and useful. It could mean the world to accessibility and developer experience. It’s also hard. I am trying to contribute to some of this through <a href="https://open-ui.org/">Open UI CG</a> and I learn lots in the meetings and issues.</li> <li>I found it helpful to apply at multiple companies when I looked for my next role. I wasn’t sure if I wanted to, at first, but was glad I did, as it let me talk to many different companies and gave me a lot more decision points to compare towards the end of the process.</li> </ul> <p>Anyway, thanks so much for reading my blog this year and sharing posts with others. It means a lot to me. I wish you the best for 2022!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/2021-in-review/">2021 in review</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%202021 in review">Reply via email</a></p> Twitter needs manual language selection 2021-12-30T00:00:00Z https://hidde.blog/twitter-needs-manual-language-selection/ <p>Lots of Twitterers speak languages that are not English. For people who read tweets that are not in English, it is important that these tweets are marked as such. I feel Twitter needs a feature for this. </p> <p>It would be nice if, when writing a tweet, we could manually select which language the tweet is in, and that Twitter would use that information to set the appropriate <code>lang</code> attribute on our content:</p> <p><img alt="screenshot of tweet creation widget with a set language button; the tweet says in Dutch that I would like to share my opinion on using clasnames for everything" src="https://hidde.blog/_images/screenshot-2021-12-30-at-11.12.05.png" /> <em>Sharing a controversial opinion on CSS frameworks in the Dutch language</em></p> <p>Twitter is an authoring tool, for which the Authoring Tool Accessibility Guidelines recommend that “accessible content production is possible” (<a href="https://www.w3.org/TR/ATAG20/#gl_b12">Guideline B.1.2</a>).</p> <h2>The <code>lang</code> attribute</h2> <p>Language attributes identify which language some web content is in. They are usually set on a page level, added to the HTML element: </p> <pre class="language-html"><html"><code class="language-html"><html"></html"></code></html"></pre> <p>Most developers don’t write these attributes often, the code often lives somewhere in a template that we don’t touch every day, or ever. But it’s an important attribute. Setting it correctly gets your page to pass one whole WCAG criterion (<a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1#language-of-page">3.1.1 Language of page</a>).</p> <p>In some cases, we have to set language attributes on individual elements, too, like if some of our content is not in the page’s main language. On the website I built for the British-Taiwanese band Transition, we combine content in Mandarin with content in English on one page: </p> <p><img alt="website screenshot, there is English text with Chinese text alongside of it, and links to YouTube videos" src="https://hidde.blog/_images/screenshot-2021-12-30-at-09.45.43.png" /> <em>The Transition “Music” page</em></p> <p>We picked <code>en</code> as the main language and set it on the <code>&lt;html&gt;</code> element. This meant we had to mark all Chinese content as <code>zh</code>, in this case <a href="https://en.wikipedia.org/wiki/Zh-TW"><code>zh-TW</code></a> as it is specifically Mandarin as spoken in Taiwan. Of course, we could have written this the other way around, too. Usually we want to pick the language that’s most common on the page as the page’s language.</p> <p>Setting a <code>lang</code> attribute on parts of a page is its own WCAG criterion, too (<a href="https://www.w3.org/WAI/WCAG21/quickref/#language-of-parts">3.1.2 Language of parts</a>), by the way.</p> <h2>The user need</h2> <p>Setting the language is important for end users, like:</p> <ul> <li>people who use a screenreader to read out content on a page</li> <li>people who use a braille display</li> <li>people who end up seeing a default font (browsers <a href="https://www.w3.org/International/questions/qa-lang-why#fonts">can select these based on language</a>)</li> <li>people who use software to translate content</li> <li>people who want to right click a word in our content to look it up in a dictionary</li> <li>people who use user stylesheets </li> </ul> <h2>The author need</h2> <p>There is also an author need, both for people who write content and for web developers.</p> <h3>Content editors</h3> <p>People who write content may get browser-provided spellcheckers. They will work better if they know what the content’s language is. I think Twitter.com has somehow turned browser spellcheck off, but there may be Twitter clients or indeed other authoring tools where this is relevant.</p> <h3>Web developers</h3> <p>Language attributes are important for web developers, too, as it allows them to use the <a href="https://www.w3.org/International/questions/qa-css-lang"><code>:lang()</code> pseudo class in CSS</a> more effectively. </p> <p>Some CSS will behave differently based on languages. When you use <code>hyphens: auto</code>, the browser needs to look up words in a dictionary to apply hyphenation correctly. It has to know the language for this. </p> <p>With appropriate language attributes, you can also use CSS features like writing modes and typographic properties more effectively. See <a href="https://chenhuijing.com/blog/css-for-i18n">Hui Jing Chen’s deep dive into CSS for internationalisation</a> for more details.</p> <h2>Automating and <code>lang-maybe</code></h2> <p>Identifying languages can be automated. In fact, Twitter does this. When they recognise a tweet’s language, they add the relevant <code>lang</code> attribute proactively. See for instance the European Commission chair’s multilingual tweets: </p> <p><img alt="three tweets by Ursula von der Leyen, in French, German and English with dev tools open and each tweet pointing to the lang attribute in the markup" src="https://hidde.blog/_images/screenshot-2021-12-30-at-10.52.06.png" /> <em>Twitter’s auto-added <code>lang</code> attributes in action</em></p> <p>Yay! I think this is very cool (thanks <a href="https://twitter.com/ThainBBdL/status/1476467805662887938">ThainBBdl</a> for pointing this out). The advances in natural language processing are really impressive. </p> <p>Having said that, any automated system makes mistakes. Vadim Makeev <a href="https://twitter.com/pepelsbey_/status/1476486010079002628">shared</a>: </p> <blockquote> <p>Yes, sometimes they take my Russian tweets and render them as Bulgarian. It’s not just the lang, they also use some Cyrillic font variation that makes them harder to read.</p> </blockquote> <p>It is safe to assume such mistakes will skew towards minority languages and miss subtleties that matter a lot to individual people, especially in areas where language is political.</p> <p>On the one hand, I think it makes sense to deploy automated language identification. As there are a lot of users, Twitter can safely assume not everyone would set a language for all of their tweets. People might not know or care (insert sad face here), a fallback helps with that. On the other hand, if this tech exists, might it make more sense if a browser would deploy it rather than an individual website? Why not have the browser guess the content’s language, for every website and not just Twitter? </p> <p>If browsers would do this, Twitter’s <code>lang</code> attributes may get in the way. They kind of give the impression that this information is author-provided. This makes me wonder, should there be a way for Twitter to say their declaration is a guess? <code>lang-maybe</code>? </p> <h2>Manual selection</h2> <p>Automated language detection probably works best if it complements manual selection. It could help provide a default choice or suggestion for manual selection, and work as a fallback. So, I’m still going to make the case for a method for users to specify a language manually.</p> <p>A per-tweet manual language picker would be great as it can:</p> <ul> <li>give willing authors more control to avoid issues</li> <li>avoid that language identification benefits are only had by users of the majority languages that AI models are best trained for</li> <li>let authors express their specific intent</li> </ul> <h2>Summing up</h2> <p>For non-English tweets to meet WCAG, they need to have their language declared with a <code>lang</code> atttribute. Twitter currently guesses languages, which is a great step in the right direction, but is likely of little help to speakers of minority languages. A manual selector would be a great way to complement the automation.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/twitter-needs-manual-language-selection/">Twitter needs manual language selection</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Twitter needs manual language selection">Reply via email</a></p> The web doesn’t have version numbers 2022-01-03T00:00:00Z https://hidde.blog/the-web-doesnt-have-version-numbers/ <p>Like ‘Web 2.0’, ‘web3’ is a marketing term. There is no versioning system for the web. There are also lots of exciting uses for the web and problems with it outside the realm of ‘web3’.</p> <img src="https://hidde.blog/_images/screenshot-2022-01-04-at-11.23.06.jpg" alt="Screenshot 2022 01 04 at 11.23.06" /> <p>It’s the later half of the 2000s. People had been building websites and online services for a while. Suddenly, everyone started using the phrase ‘Web 2.0’. It didn’t have one one clear definition, like ‘carrot’ or ‘dentist’. It referred to a bunch of things at once. Websites with ‘user generated content’, users tagging their data, software as a service, async JavaScript, widgets and open (!) APIs that allowed for mashups: sites that displayed content from other sites. New companies had names with less vowels, like Tumblr and Flickr, and there was RSS on everything. ‘You’ was <a href="https://en.wikipedia.org/wiki/You_(Time_Person_of_the_Year)">made TIME Person of the Year</a>. I’ve been returning to some stuff from that time, and it’s been interesting.</p> <p>Many of the things that fit the above description of ‘Web 2.0’ were useful, they often still are on today’s web. We lost some, we kept some. But if we’re fair, ‘Web 2.0’ wasn’t some new iteration, a new version of something that was different before. It was largely reuse of existing web tech, like HTTP and XML. Exciting reuse, for sure. But a lot of it already existed in non-commerical forms before the phrase ‘Web 2.0’. Not everyone knows, but the first web browser, WorldWideWeb, was <a href="https://thehistoryoftheweb.com/web-first-and-second-browser/">meant to be both viewer and editor</a>. That’s quite ‘user generated’, I would say. So, what did Web 2.0 mean? ‘Web 2.0 is, of course, a piece of jargon, nobody even knows what it means’, Sir Tim Berners-Lee commented in <a href="https://web.archive.org/web/20120821185101/http://www.ibm.com/developerworks/podcast/dwi/cm-int082206txt.html">an interview with IBM at the time</a>.</p> <p>Like ‘Web 2.0’, ‘web3’, and I’m not sure what’s with the removed space and dot, or the lowercase ‘w’, is just a marketing phrase. Definitions of ‘web3’ seem to be all over the place. From what I gathered, it is a vision of a web that runs largely on the blockchain, in order to make ‘owning’ assets better for people who create them and people who purchase them, by cutting out middlemen. This vision is not to be confused with the Semantic Web, which was also called Web 3.0, and discussed years before (see <a href="https://www.nytimes.com/2006/05/23/technology/23iht-web.html">an article from 2006</a>).</p> <p>Here’s the thing. There is no institution that regularly releases new versions of the web, and recently happily announced this one. Instead, the phrase ‘web3’ was coined in 2014 by <a href="https://en.wikipedia.org/wiki/Gavin_Wood">a co-inventor of a blockchain technology</a> and since used by crypto asset enthusiasts and certain venture capitalist firms, for what is, some argue, close to <a href="https://www.usenix.org/publications/loginonline/web3-fraud">ponzi schemes</a> and, in its current form, very environment unfriendly. It also puts vulnerable people at risk (see Molly White ‘s <a href="https://web3isgoinggreat.com/">web3 is going great</a> for examples of those claims). </p> <p>I’ll keep my issues with ‘web3’ for a later post, for now I just wanted to make the point that it’s unfair to claim a version number for the web for a specific set of innovations you happen to like. There are many ways the web evolves. Sometimes they involve the kinds of technology that ‘web3’ adepts use, but usually they don’t. These are some web innovations I like:</p> <ul> <li>New standards are written to harmonise how web tech works and invent new tech responsibly and across user agents, like CSS Grid Layout, WebAssembly and map/filter/reduce in JavaScript</li> <li>New companies start useful services, like payment integration services and ‘content as data’ headless CMSes</li> <li>Individuals start blogging on their <a href="http://personalsit.es/">personal sites</a>, on which they own their content</li> <li>Governments and organisations roll out reliable, useful and accessible authentication services (like <a href="https://www.digid.nl/en/">DigiD</a>)</li> <li>Video conferencing companies bring their software to the browser</li> <li>Adobe <a href="https://www.bram.us/2021/10/27/adobe-photoshop-in-the-browser-thanks-to-emscripten-web-components-and-project-fugu/">brought <em>Photoshop</em> to the browser</a></li> <li>A couple of Dutch museums put all their entire catalogue of art online (eg <a href="https://www.rijksmuseum.nl/en/rijksstudio">Rijksmuseum</a>, <a href="https://www.stedelijk.nl/en/dig-deeper/collection-online">Stedelijk</a> and <a href="https://www.vangoghmuseum.nl/en/collection/">Van Gogh Museum</a>)</li> </ul> <p>Maybe that list is a bit random, you probably have a list of your own. Many of these things are working just fine. I could personally go on and on about some very useful plans for the web. There are also lots of unsolved problems, like lack of web accessibility or Facebook’s business model. Cool things are planned for the web all the time and there are lots of problems that aren’t yet addressed. Most of the web is fine. At the same time, there are also plans and problems. Frankly, I don’t think we should use version numbers just to market a specific subset of plans and problems for the web. Especially not if that’s such a controversial subset.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/the-web-doesnt-have-version-numbers/">The web doesn’t have version numbers</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20The web doesn’t have version numbers">Reply via email</a></p> Joining Sanity 2022-01-07T00:00:00Z https://hidde.blog/joining-sanity/ <p>Mid February I will start a new job: I am excited to join the developer relations team at <a href="https://www.sanity.io/">Sanity</a>! </p> <p>I had my last day at W3C in October (look, <a href="https://www.w3.org/People/hidde/">my cool URI didn’t change</a>) and set out to be mostly away from work for a couple of months. I guess I’m not great at this, as, besides another school lockdown here, I got fairly busy with existing projects. I did some WCAG audits, workshops, conference talks and… interviewing. I wanted to make sure to find the right place and took the time to do it. Having been a contractor for over a decade, it was my first time doing interviews, eh, ever.</p> <p>My work at WAI taught me to consider the web in terms of systems like authoring/developer tools and user agents, as they impact the web in some very specific ways. It became clear to me I wanted my next role to be at a company that is heavily involved in somehow making the web better through tools like that. Whatever a better web looks like… more accessible, more secure, more privacy-aware… I got to talk to a number of different companies working on browsers, design system tooling, browser add-ons, web standards and content management tools. I could write about the job hunting process, but <a href="https://muan.co/2021/12/15/notes-on-looking-for-a-job/">Mu-An already did that brilliantly</a>. </p> <p>The Sanity developer relations team made a great impression. The company has a cool product that solves some important problems, a friendly community (plus focus on keeping it <a href="https://www.sanity.io/blog/where-is-your-code-of-conduct">healthy</a>), lots of ecosystem, aaaand… there could be lots of new ecosystem possibilities. Sanity’s <a href="https://www.sanity.io/blog/2021-a-year-in-review">Year in 2021</a> blog post has a lot more detail on what Sanity is up to. </p> <p>For the next few weeks, I will be finishing my current accessibility consulting projects with the Dutch government and Mozilla, go on holiday and then, get this new chapter started!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/joining-sanity/">Joining Sanity</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Joining Sanity">Reply via email</a></p> Boolean attributes in HTML and ARIA: what's the difference? 2022-01-12T00:00:00Z https://hidde.blog/boolean-attributes-in-html-and-aria-whats-the-difference/ <p>Some attributes in ARIA are boolean(-like). These attributes may seem a lot like boolean attributes in HTML, but there are some important differences to be aware of.</p> <p><img alt="black and white drawing of man in suit" src="https://hidde.blog/_images/boole-w300.png" /> <em>George Boole, the philosopher and mathematician who came up with a type of algebra that has just true and false as its variables</em></p> <h2>Boolean attributes in HTML</h2> <p>In HTML, some attributes are <a href="https://html.spec.whatwg.org/dev/common-microsyntaxes.html#boolean-attributes">boolean attributes</a>, which basically means they can be <code>true</code> or <code>false</code>. They are the case, or they are <em>not</em> the case. They compute to one, or they compute to zero. Examples of these attributes include <code>checked</code>, <code>required</code>, <code>disabled</code> and <code>open</code>. </p> <p>Boolean attributes in HTML are true when they are present: </p> <blockquote> <p>The presence of a boolean attribute on an element represents the <code>true</code> value, and the absence of the attribute represents the <code>false</code> value.</p> </blockquote> <p>(From: <a href="https://html.spec.whatwg.org/dev/common-microsyntaxes.html#boolean-attributes">HTML, Common microsyntaxes, Boolean attributes</a>)</p> <p>So, if a checkbox is checked, it has the <code>checked</code> attribute, otherwise it does not. The attribute, when present, can have any value, like <code>checked="checked"</code>, though the <a href="https://html.spec.whatwg.org/dev/common-microsyntaxes.html#boolean-attributes">HTML spec</a> explicitly says we should not use <code>true</code> or <code>false</code> as attribute values for boolean attributes: </p> <blockquote> <p>The values “true” and “false” are not allowed on boolean attributes. To represent a false value, the attribute has to be omitted altogether.</p> </blockquote> <p>It would work though: the <code>checked</code> attribute works with any value, even <code>checked="true"</code> or <code>checked="false"</code> represents that the input is checked: </p> <pre class="language-markup"><code class="language-markup"><span class="token comment">&lt;!-- on first render, the following checkboxes are in checked state --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>checkbox<span class="token punctuation">"</span></span> <span class="token attr-name">checked</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>checkbox<span class="token punctuation">"</span></span> <span class="token attr-name">checked</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>false<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>checkbox<span class="token punctuation">"</span></span> <span class="token attr-name">checked</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hello<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> <span class="token comment">&lt;!-- on first render, the following checkboxes are not in checked state --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>checkbox<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span></code></pre> <p>In some cases, browsers will help us manage the presence of these attributes. They don’t for <code>checked</code>, but they do for <code>details</code>/<code>summary</code> (the <code>open</code> attribute on the <code>details</code> element when its <code>summary</code> is expanded or collapsed). In other cases, the browser can’t manage presence or absence, like for the <code>required</code> attribute. Whether an element is set to required, is up to the author’s intention, the browser defaults to “not required”.</p> <p>The attributes I discussed earlier are what specifications call ‘content attributes’, we write them in our markup. In JavaScript, we can also affect the truth value of these HTML attributes with so-called <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes#content_versus_idl_attributes">IDL attributes</a>, for instance:</p> <pre class="language-javascript"><code class="language-javascript">element<span class="token punctuation">.</span>checked <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span> <span class="token comment">// sets checked state to true</span> element<span class="token punctuation">.</span>checked <span class="token operator">=</span> <span class="token string">'checked'</span><span class="token punctuation">;</span> <span class="token comment">// sets checked state to true</span> element<span class="token punctuation">.</span>checked <span class="token operator">=</span> <span class="token string">'foo'</span><span class="token punctuation">;</span> <span class="token comment">// also sets checked state to true</span> element<span class="token punctuation">.</span>checked <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span> <span class="token comment">// sets checked state to false</span> element<span class="token punctuation">.</span>checked <span class="token operator">=</span> <span class="token string">''</span><span class="token punctuation">;</span> <span class="token comment">// sets checked state to false</span></code></pre> <h2>Boolean attributes in ARIA</h2> <p>In ARIA, there are also attributes that can be <code>true</code> or <code>false</code>, but their state is expressed differently. It is a different language than HTML, after all. HTML is the most common host for it, but ARIA can also be used in other languages, like XML and SVG.</p> <p>As explained previously, HTML has the concept of boolean attributes. It also has the concept of <a href="https://html.spec.whatwg.org/dev/common-microsyntaxes.html#keywords-and-enumerated-attributes">keyword and enumerated attributes</a>. These attributes can come with a fixed number of string values. When ARIA is used in HTML, we use these types of attributes. This means that when we say “boolean” in ARIA, we’re really talking about strings that happen to be use the words “true” or “false”.</p> <p>According to the <a href="https://www.w3.org/TR/wai-aria-1.1/#typemapping">type mapping table</a> in the WAI-ARIA 1.1 specification, there are three different attribute types in ARIA that explictly list ”true” and “false” as possible values:</p> <ul> <li>attributes that are “boolean”, which accept only <code>"true"</code> or <code>"false"</code> (eg <code>aria-busy</code>, <code>aria-multiline</code>, <code>aria-readonly</code>)</li> <li>attributes that accept <code>"true"</code>, <code>"false"</code> and <code>"undefined"</code> (eg <code>aria-hidden</code>, <code>aria-expanded</code>, <code>aria-grabbed</code>, <code>aria-selected</code>)</li> <li>“tristate” attributes, which accept <code>”true”</code>, <code>"false"</code> or <code>"mixed"</code> (eg <code>aria-checked</code>, <code>aria-pressed</code>)</li> </ul> <p>That’s not all, as there are also properties with different and larger sets of possible values:</p> <ul> <li><code>aria-invalid</code> (takes <code>"grammar"</code>, <code>"spelling"</code>, <code>"false"</code> and <code>"true"</code>) </li> <li><code>aria-haspopup</code> (takes <code>"true"</code>, <code>"false"</code>, <code>"listbox"</code>, <code>"menu"</code>, <code>"tree"</code>, <code>"grid"</code> and <code>"dialog"</code>)</li> <li><code>aria-current</code> (takes <code>"true"</code>, <code>"false"</code>, <code>"page"</code>, <code>"step"</code>, <code>"location"</code>, <code>"date"</code> and <code>"time"</code>)</li> </ul> <p>All of these fall into that “keyword and enumerated attributes” bracket, they take a <a href="https://www.w3.org/TR/wai-aria-1.2/#enumerated-attribute-values-html">nullable DOMString</a>. </p> <p>ARIA attributes can be set using <code>setAttribute()</code>. From <a href="https://www.w3.org/TR/wai-aria-1.2/">ARIA 1.2</a>, which is currently a “Candidate Recommendation Draft” (it’s <a href="https://www.w3.org/2021/Process-20211102/#publishing-crud">like a Candidate Recommendation</a>, but with significant updates made to it), ARIA attributes can be specified using IDL attributes, too, for instance: </p> <pre class="language-javascript"><code class="language-javascript">element<span class="token punctuation">.</span>ariaChecked <span class="token operator">=</span> <span class="token string">"true"</span><span class="token punctuation">;</span> <span class="token comment">// sets `aria-checked` to true</span></code></pre> <p>Scott O’Hara wrote about this upcoming feature in his post <a href="https://www.scottohara.me/blog/2021/07/23/aria-idl.html">New in ARIA 1.2: ARIA IDL attributes</a>.</p> <h2>HTML vs ARIA booleans</h2> <p>So, for HTML boolean attributes it’s all about presence and absence, while in ARIA boolean attributes, the boolean state is expressed via <code>"true"</code> and <code>"false"</code> string values and there are bunch of attributes that take those strings and a couple more.</p> <p>Some examples of these differences: </p> <ul> <li>The absence of the <code>checked</code> boolean attribute <a href="https://www.w3.org/TR/html-aam-1.0/#html-attribute-state-and-property-mappings">maps to <code>aria-checked="false"</code></a> (unless it was modified, that is… so this mapping only applies in the elements default state)</li> <li>The presence of the <code>disabled</code> attribute maps to <code>aria-disabled="true"</code></li> <li>The presence of the <code>open</code> attribute on <code>details</code> maps the state of its <code>summary</code> to <code>aria-expanded="true"</code>, the absence of it maps it to <code>aria-expanded="false"</code></li> </ul> <h2>Summary</h2> <p>So, there are <em>boolean</em> attributes and <em>keyword and enumerated</em> attributes in HTML. When ARIA booleans are used in HTML, they are of the latter type. They take one of two keywords: <code>"true"</code> or <code>"false"</code>. There are also ARIA attributes that take <code>"true"</code> and <code>"false"</code>, but also other keywords in addition. Those may look like booleans at first sight, but are not. That’s all, thanks for reading!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/boolean-attributes-in-html-and-aria-whats-the-difference/">Boolean attributes in HTML and ARIA: what's the difference?</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Boolean attributes in HTML and ARIA: what's the difference?">Reply via email</a></p> Use Firefox with a dark theme without triggering dark themes on websites 2022-01-12T00:00:00Z https://hidde.blog/use-firefox-with-a-dark-theme-without-triggering-dark-themes-on-websites/ <p>With <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme"><code>prefers-color-scheme</code></a>, web developers can provide styles specifically for dark or light mode. Recently, Firefox started to display dark mode specific styles to users who used a dark Firefox theme, even if they have their system set to light mode. </p> <p>There is a flag in Firefox that determines whether dark/light preferences are taken from the browser or from the browser theme. </p> <p>This is how you set it: </p> <ol> <li>Go to <a href="https://support.mozilla.org/en-US/kb/about-config-editor-firefox"><code>about:config</code></a></li> <li>Search <code>layout.css.prefers-color-scheme.content-override</code> </li> <li>Set it to <code>0</code> to force dark mode, <code>1</code> to force light mode, <code>2</code> to set according to system’s colour setting or <code>3</code> to set according to browser theme colour</li> </ol> <p>(via <a href="https://support.mozilla.org/en-US/questions/1360640">support.mozilla.org</a>)</p> <p>Personally, I feel respecting the system setting worked better. I hope it gets changed back. In the mean time, I hope this override helps.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/use-firefox-with-a-dark-theme-without-triggering-dark-themes-on-websites/">Use Firefox with a dark theme without triggering dark themes on websites</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Use Firefox with a dark theme without triggering dark themes on websites">Reply via email</a></p> More to give than just the div: semantics and how to get them right 2022-01-23T00:00:00Z https://hidde.blog/more-to-give-than-just-the-div-semantics-and-how-to-get-them-right/ <p>One of the web’s killer features is that it comes with a language for shared semantics. When used right, HTML helps us build websites and apps that work for a broad range of users. Let’s look at what semantics are and how to get them right.</p> <p>This post is a write-up of a new talk that I did in November at Web Directions and Beyond Tellerrand. A <a href="https://youtu.be/YG9WQUfH7ZU">video</a> is available if you prefer.</p> <p><a href="https://www.youtube.com/watch?v=YG9WQUfH7ZU" title=""><img alt="video with name hidde de vries in space theme with YouTube player" src="https://hidde.blog/_images/screenshot-2022-01-24-at-19.18.561.jpg" /></a> </p> <h2>Semantics as shared meaning</h2> <p>Semantics, in the simplest defininition that I know of, is what stuff means. This isn’t just a thing on the web… for literally millennia philosophers have argued about what stuff means, going from Plato in ancient Greek to people like Wittgenstein, Quine and Davidson in the last century. </p> <p>Some of the earliest theories of meaning are correspondence theories. They say the meaning of a word is the thing itself… so the meaning of the phrase “that glass of water” is that actual glass of water. If I want to say the glass if half full, you can verify if my claim is true by checking the contents of the actual glass. That’s somewhat straightforward.</p> <p>The 20th century philosopher Ludwig Wittgenstein initially had a theory like that, but changed his mind towards the end of his life. He then, famously, concluded that the meaning of a word is not the thing it refers to, but its use in the language. Meaning equals use. </p> <p><img src="https://hidde.blog/_images/witt.jpg" alt="Witt" /> <em>Wittgenstein and one of his most famous works: <em>Philosphical Investigations</em></em> </p> <p>‘Meaning equals use’ is about how words are used day to day, in a community… if everyone uses ‘water’ as a word to talk about water, that’s what is meaningful. If some of us started using ‘bater’ instead of ‘water’, and we continue to do that, it works for us, like, we effectively exchange water using that word, that then starts to be meaningful. We have a shared understanding. </p> <p>‘Meaning equals use’ is also Wittgenstein moving away from talking and theorising endlessly about words and their meaning. It doesn’t really matter, in many cases, what words mean, unless they are things that matter to a community of people. </p> <p>So, basically, <em>meaning</em> requires that a group of people uses a phrase in the same way. Now what if you’re alone? Wittgenstein argued <a href="https://plato.stanford.edu/entries/private-language/">there can’t be a private language</a>. In other words: there can only be meaning if it is shared. There’s an interesting parallel between that idea of shared meaning and the web, especially when it comes to web accessibility.</p> <h2>Shared meaning on the web</h2> <p>In a way, your design system is a shared language. It’s a collection of shared concepts, shared patterns, between people in your team, your organisation. There is meaning, because you all use the same words for stuff on your websites. Language plays a huge part, because design systems don’t work as well if developers, designers and content folks all use different terminology. It’s that alignment that matters, the fact that you’re using the same words to describe your patterns.</p> <p>APIs are another example of shared semantics in practice… they’re a written contract about how a service will respond to requests with certain phrases, names.</p> <p>Whatever framework you prefer… when you write code, the names of your components, you use a shared language. In the names of files, classes or functions, for instance.</p> <p>Naming and what to call things depends on place and culture, too. When I first visited the US, I was surprised by the enormous size of a ‘small’ coffee… similarly, beers in Germany exist on a very different scale than they do in The Netherlands. The classification is different, or, you know, we use different categories.</p> <p>Semantics is agreement about what things are, and this can be hard. There can be disagreements about meaning and classification. So, moving from philosophy back to technology… what does this mean on the web? </p> <h2>Semantics on the web</h2> <p>You could have lots of semantics on the web, too. With XML schemas, you can create your own language, for instance. If you want to mark up an invoice, you can invent your own tags for everything on the invoice. With an XSD file you can define your own schema and say what’s what in your world, which is helpful for validation and stuff. </p> <p><img src="https://hidde.blog/_images/xsd1.png" alt="Xsd(1)" /> <em>Your own schemas!</em></p> <p>Now, for accessibility, we don’t want a semantics specific to our needs… we need one, agreed-upon set. We have this: it’s <a href="https://html.spec.whatwg.org/">HTML</a>! HTML is a standard way for your website to declare semantics. It is standard in the sense that every website uses it. Any system that parses the web can make the same assumptions about what stuff is in HTML and what it means. Browsers, assistive technologies, add-ons… you name it!</p> <p>To clarify a common confusion: HTML <em>isn’t</em> a way to declare what stuff looks like on the page… something may look like a button, but if it goes somewhere, the correct semantic is link… the anchor tag. </p> <h2>Why HTML matters</h2> <p>So, does HTML matter? Well, it certainly <em>enables</em> a lot. </p> <h3>A multi device web</h3> <p>As a shared system for semantics it enables a multi device web. The first WorldWideWeb server, multimedia browser and web editor ran on a NeXT machine, which looked like… well, just like what personal computers looked like 30 years ago.</p> <p><img alt="next computer with external monitor, keyboard and mouse" src="https://hidde.blog/_images/next.jpg" /> <em>This NeXT machine was used to develop and run the first WWW server, multimedia browser and web editor</em></p> <p>It’s only thanks to HTML that the same web pages from those days can still display on today’s devices, and that one HTML structure can be served to desktops, tablets and refrigerators with different layouts. CSS can do this, only <em>because</em> of HTML. It’s pretty much what powers the responsive web. </p> <h3>Default stylesheets</h3> <p>Default stylesheets are another example: because we define page structure in HTML, browsers can come up with defaults for things like headers, so that even in documents that have no styles, there can be visual distinction. And this could go even beyond visual stylesheets… your car could speak websites to you and emphasise parts of a sentence that are marked up as needing more emphasis. Assistive technologies could do that too.</p> <h3>Navigate by heading</h3> <p>Or what about using structure to provide easier access? Screenreader users commonly browse using headings on a page… for instance in VoiceOver, one can go through a list of headings. That only works if they are marked up as headings.</p> <h3>Default behaviour</h3> <p>HTML enables default behaviour too, tied to semantics. If you say something is a button, by using a button tag, and place it in a form, it will submit that form by default.</p> <h3>Reader modes</h3> <p>Or what about reader modes? If pages have useful markup, like headings, lists and images, the heuristics of your browser’s reader mode can go ahead and render it better. This is important, because in 2021, websites often have intrusive ads, cookie consent mechanisms, paywalls and newsletter signup overlays… some websites collect them all. Reader modes are useful tools to deal with the web of today, they give users control. </p> <p>Okay, so HTML is nice, it enables lots of things, given that we use its semantics correctly anyway. Of course, the elephant in the room is that not all websites get their HTML right. Some miss out of these advantages. This is why I feel it makes sense to hire for HTML expertise. For most developer roles, it’s not or hardly an issue in interviews or resume scans. It should be, HTML knowledge in your teams can save your organisation money… hire for this expertise or train developers.</p> <h2>Semantics in HTML</h2> <p>Ok, so what do semantics look like in practice? The HTML standard has a section about semantics, and it explains that semantics in HTML is in three places: </p> <ul> <li>elements: you can wrap text in a heading element and boom, it has heading semantics</li> <li>attributes: the <code>controls</code> attribute on a video marks it as a video that can be controlled. </li> <li>attribute values, for instance you can distinguish between email and phone input fields with the <code>type</code> attribute, or between opened and closed <code>details</code> elements with the <code>open</code> attribute</li> </ul> <p>Besides using semantic HTML elements, like button, you can also opt to use non-semantic HTML elements, like <code>&lt;div&gt;</code> and then add the semantics with a role attribute, in this case, role equals button, using something called WAI-ARIA. That’s not ideal, because it only adds the semantics for button. It doesn’t add all the other stuff browsers do when they encounter a button, like keyboard handling, submitting forms if they’re in a form with the default button type and the button cursor…</p> <p>So, if possible, use the actual button element, it has the broadest support and comes with the most free built-in behavior.</p> <h2>How do semantics help practically?</h2> <p>In his post <a href="https://brucelawson.co.uk/2018/the-practical-value-of-semantic-html/">The practical value of semantic HTML</a>, Bruce Lawson explains semantic HTML is ‘a posh term for choosing the right HTML element for the content’. It has observable practical benefits., he says. This is an essential point, and what I want to emphasise too. Adding semantics to a page is choosing the right elements for the content, which makes a page easier to use for a wide range of people on a wide range of technologies. Let’s look at some examples of those.</p> <h3>Headings</h3> <p>We’ll start with headings. If you use heading elements, that is <code>h1</code>, <code>h2</code>, <code>h3</code> and so on, users can see those elements as headings when they use reader mode. That’s nice. You’re also creating what is essentially a table of contents for users of some assistive technologies.</p> <p>When you use a Word processor you have this feature to generate a table of contents automatically… often used in documents like an academic thesis or a complex business proposal.</p> <h3>Buttons</h3> <p>Buttons, then… I mentioned them before. When you use a button element for any actions that users can perform on your page, or in your app, they can find it in the tab order, they can activate it with just their keyboard and they can even submit forms, depending on the button type. That even works when JS is disabled.</p> <h3>Lists</h3> <p>With lists, like ol, ordered list, ul, unordered list and dl, description lists, users of screenreaders can get information about the length of the list, and, again, users of reader mode are able to distinguish the list from regular content.</p> <h3>Input purpose</h3> <p>If you use the autocomplete attribute on inputs, you’re programmatically indicating what your input is for. Software can act on that information. For instance, browsers could autofill this content. This is very helpful for users who may have trouble typing or use an input method on which typing takes more time (you know, the kind of interface where you enter text letter by letter, like on tvs with your remote control). Assistive technologies can also announce the purpose when the user reaches the field, which can be helpful. Lastly, for improved cognitive accessibility, users can install plugins that insert icons for each of the fields, to make them easier to recognise.</p> <h3>Tables</h3> <p>If you’re using table elements, for instance if you have some data on your page, you’ll want to add a caption to describe what is in the table, to distinguish it from potential other tables on the page. But also use th elements for the headings and scope attributes on those the elements to say whether they apply to a column or a row. This is to ensure assistive tech can make sense of it.</p> <p>There are a lot of tags available in HTML, each with their own advantages, many have implied semantics. To find out when to use what, use <a href="http://developers.whatwg.org/">developers.whatwg.org</a>. To learn about what to avoid, see Manuel Matuzovic’ excellent <a href="https://www.htmhell.dev/">HTMHell</a>. </p> <h2>Gotchas</h2> <p>Ok, so you’re following the HTML spec and avoiding the tragedies described on HTMHell, are you there yet? For a large part, yes. But there are some gotchas. </p> <p>Even with the right intentions, the web platform may have some surprises. Sometimes, assistive tech uses heuristics to fix bad websites, which may affect even your good website. Let’s look at some of these gotchas. </p> <h3>CSS can reset semantics</h3> <p>The first relates to CSS. When you add CSS to your HTML, it can cause your intended semantics to reset. </p> <p>The <code>display</code> property does this, as <a href="https://adrianroselli.com/2020/10/a11yto-conf-css-display-properties-versus-html-semantics.html">Adrian Roselli has documented in detail on his blog</a> and elsewhere. Whenever you use display <code>block</code>, <code>inline</code>, <code>grid</code>, <code>flex</code> and <code>contents</code> on an element, that element can lose its semantics. This happens on elements including lists and tables. It’s especially bad on tables, because they can be complex. Though assistive technologies have mechanisms in place specifically built to navigate tables, those mechanisms rely on consistent and correctly marked up tables, with the right markup and with the right semantics. </p> <p>Not only can these CSS properties can affect semantics, how they do differs per browser, some browsers drop more semantics than others and some may fix these problems, which I feel we can consider browser bugs mostly, in the future. Adrian’s post has some compatibility tables mapping properties to HTML elements and specific browsers, </p> <h3>Lists without bullets</h3> <p>Lists can also lose semantics if you undo their visual styling. This has to do with a tension that sometimes exists between on the one side, websites and how they are built, and, on the other side, assistive tech trying to give the right experience to end users. These kinds of things aren’t bugs, they are the result of a careful balancing act. </p> <p>Because, really… what is a list? If you list a couple of ingredients on your recipe websites and visually display bullets, that is clearly a list. It looks like a list, it feels like a list, it needs list semantics.</p> <p>Let’s say you have a list of products, maybe they are search results or a category view of some kind. Is that a list? I said list of products… but there are no bullet… some browsers argue that if there are no bullets, there is probably no list. Safari is one of them.</p> <p>James Craig, who works for Apple, <a href="https://mobile.twitter.com/cookiecrook/status/1084138985763426304">explained on Twitter</a> that “listitis”, developers turning too many things into lists, was a commonly complained about phenomenon, by end users:</p> <blockquote> <p>Lististis on the Web was one of our biggest complaints from VoiceOver users prior to the heuristic change. </p> </blockquote> <p>(<a href="https://mobile.twitter.com/cookiecrook/status/1084138985763426304">tweet from James Craig</a>)</p> <p>The decision was about the user’s experience, he explains. He feels the <a href="https://github.com/WebKit/webkit/blob/main/Source/WebCore/accessibility/AccessibilityList.cpp">heuristics</a> make sense, but also invites suggestions. </p> <h3>Nesting semantics</h3> <p>Nesting also matters when browsers determine the semantics for a specific element on a page. Sometimes, browsers will undo semantics when you nest unexpectedly.</p> <p>One place I recently came across this at work, is when using a <code>details</code> element as an expand/collapse. With the <code>summary</code> element, you define the content that’s always there and acts as a toggle for the remaining content. Sometimes it can make sense for the toggle to also be a heading.</p> <p>Let’s say your content is a recipe. Maybe you have one heading for ingredients and one heading for method. Having the headings makes this content easier to find for users of screenreaders, having the expand/collapse could make the content easier to digest for other users. Can we have this food and, ehm, eat it too?</p> <p>It turns out, not really, at least not in all combinations of browsers and screenreaders. In JAWS, for instance, the headings are no longer headings when they are in the summary element, and I should thank my former colleague <a href="https://es.linkedin.com/in/daniel-montalvo-charameli-17802922/en">Daniel Montalvo</a> for pointing me at this. </p> <p>It kind of makes sense, a <code>summary</code> expands and collapses, it’s an action, a button, so how can it have those semantics, but heading semantics too? The spec says a <code>summary</code> element can contain phrasing content, which is, basically, just words, but it also says ‘optionally intermixed with heading content’, in other words, the spec says it’s ok to put headings in <code>summary</code>. It seems we can call this a bug of this specific screenreader. A screenreader trying to do the right thing and “unconfuse” what they think could be confusing. </p> <p>That’s a common theme in many of these things. There are some more heuristics that screenreaders apply, that could somewhat mess with your intentions.</p> <h2>The future</h2> <p>So, we’ve looked at what semantics is, how it works on the web and what specifically can affect it on your websites or apps. </p> <p>Let’s now have a look at the future. I’m interested in two questions:</p> <ul> <li>does the web need more semantics, eg does the shared language of the web need to be expanded in the future?</li> <li>do developers of the future still need to define semantics or can machines help?</li> </ul> <h3>More semantics</h3> <p>Let’s start with the first. As a matter of fact, our design systems commonly contain things that don’t exist as such in HTML, they don’t have their own elements… I’m thinking of common components like tabs and tooltips.</p> <p>Sometimes we also build things that do exist, but not with the desired level of styleability, think components like select elements. What if we want the select semantics, but not that default UI?</p> <p>The <a href="https://open-ui.org/">Open UI Community Group</a> at the W3C tries to change this, or as it says on the Open UI homepage:</p> <blockquote> <p>we hope to make it unnecessary to reinvent built-in UI controls</p> </blockquote> <p>There are three goals to Open UI:</p> <ul> <li>to document component names as they exist today. What are people building in their design systems? Again, trying to find where language is shared, common denominators. </li> <li>to come up with a common language to describe UIs and design systems</li> <li>to turn some of this into browser standards… wouldn’t it be cool if there were more built-in elements that are well-defined and follow common practices?</li> </ul> <p>I believe this work to be quite a big deal… not just for semantics, but for web accessibility in general. With more defaults, and also <a href="https://hiddedevries.nl/en/blog/2020-03-01-more-accessible-defaults-please">better defaults</a>, it will be easier for folks to build things that are accessible. That will greatly increase our chances of a web that is generally more accessible.</p> <h3>AI and semantics</h3> <p>Then one last thing to leave you with… the question whether Artificial Intelligence (AI) could guess semantics, so that we don’t need to rely on authors to get them right. I can tell you that personally I am sceptical… AI is notoriously bad at understanding intentions and context, which, as we’ve seen, are both at the core of what defining semantics is about. </p> <p>There may be some low hanging fruit, things like lists are fairly easy to guess, but, thinking back of that button and links example earlier… how should a machine understand that that thing that looks like a button is actually a link? Author intentions are essential. </p> <p>Having said that, I have heard friends at browsers say they are experimenting with recognising semantics in pages, with some success. I will be following this with a lot of interest.</p> <h2>Conclusion</h2> <p>Thanks for reading all the way to the end, or for skipping to the conclusion. I’ll summarise the three main points once more. Firstly, semantics only work if they are shared, so study and use the <a href="https://developers.whatwg.org/">HTML standard</a>. HTML is the shared language for semantics on the web and this is what browsers and assistive tech are most likely to build upon. Secondly, semantics on the web are beneficial in many ways, some may be unexpected. Lastly, beware of how CSS, ARIA and assistive tech can impact your semantics, and, ultimately, the end user.</p> <p>So, how do you get semantics right? Basically, by figuring out what end users will experience for all of the HTML your write. For all the content that is not merely for styling. In fact, <a href="https://www.scottohara.me/blog/2022/01/20/divisive.html"><code>div</code>s are fine</a> for many things on your page. But if your page contains headings, links, buttons, form fields, tables, lists and navigations… marking them up in the right HTML tags makes your site easier to parse for browsers and, consequently, easier to browse for end users.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/more-to-give-than-just-the-div-semantics-and-how-to-get-them-right/">More to give than just the div: semantics and how to get them right</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20More to give than just the div: semantics and how to get them right">Reply via email</a></p> Re: nuance in ARIA 2022-01-28T00:00:00Z https://hidde.blog/re-nuance-in-aria/ <p>In a recent post, Dave Rupert wrote about how <a href="https://daverupert.com/2022/01/html-is-general-aria-is-specific/">HTML is general and ARIA is specific</a>. He explains that unlike HTML, in ARIA is quite specific. </p> <p>This resonated with me. Of course, to use HTML, you’ll want to be specific about what you use, because <a href="https://hiddedevries.nl/en/blog/2022-01-23-more-to-give-than-just-the-div-semantics-and-how-to-get-them-right">semantics</a>. But, as Dave writes, there is usually more than one way to do something. Between different ARIA roles, states and properties, there is more nuance. </p> <p>One reason ARIA is more nuanced, is that the world of ARIA mimicks the world of assistive technologies, <a href="https://hiddedevries.nl/en/blog/2019-06-27-how-accessibility-trees-inform-assistive-tech">through platform accessibility APIs</a>. Assistive technologies already exist, and they already interact with platform APIs in <a href="https://www.w3.org/TR/core-aam-1.2/">specific, defined ways</a>. When web developers build interactions that assistive technologies are aware of, ARIA can be used to describe most of these specific interactions. </p> <p>ARIA specifically distinguishes between menu items and links, or between alerts and alert dialogs, because operating systems and assistive technologies do. Technologies like voice control software, hardware switch controls and screenreaders rely on the roles, states and properties that are conveyed to them. Being specific helps them get it right. Whatever their ‘it’ is, there is a wide variety of tools that convey web content and parse accessibility meta data. Standardised nuance makes things more interoperable, reducing gaps between what websites want to do and what different assistive technologies are able and used to do. It also makes things more consistent for end users. </p> <p>Because ARIA maps to the nuance of operating systems’ accessibility APIs, web developers have to understand those nuances too. Or… the nuance gets lost. In WCAG audits, I often find ARIA where the developer missed some of the nuances of specific ARIA concepts. I hear the same from other auditors, and, anecdotally, it feels to me that ARIA misunderstandings in real websites are quite common. To nobody’s fault, really, the nuance exists and it can be complex. </p> <p>When developers misunderstand the nuances and specifics of ARIA, end users draw the short end of the stick. Which brings me to a closing question… what if there are ways to move the specifics and the nuance of ARIA towards browser code?</p> <p>As Greg Whitworth <a href="https://twitter.com/gregwhitworth/status/1486737770999533568">tweeted</a> the other day:</p> <blockquote> <p>My personal goal is that the majority of web developers don’t have to touch ARIA for 80% scenarios. Thus devs will be delivering our users a more accessible and yet richer experience</p> </blockquote> <p>Nicole Sullivan <a href="https://twitter.com/stubbornella/status/1450700684957863938?s=21">tweeted</a> about this in October, too. Quoting from the middle of her thread (read the <a href="https://twitter.com/stubbornella/status/1450700684957863938?s=21">full thread</a>, it is good):</p> <blockquote> <p>I’m advocating for CSS & HTML that can swap from one tab to another.</p> <p>Could we cover 80% of the use cases for tabs if we had a declarative way of building them? Then JS could handle the 20% of tabs that are so custom they can’t be declarative? Idk yet, but let’s try?</p> <p>I’m also advocating for a11y to be built in. It’s beyond nonsense that every developer has to manage individual ARIA properties.</p> </blockquote> <p>The ARIA part got over a 100 likes, it seems there is interest in this stuff!</p> <p>I would love to see some of the current Open UI CG and CSS WG work lead to this. I’m thinking HTML elements that have ARIA baked in, and/or CSS properties that impact accessibility trees. You wouldn’t set ARIA as a developer, but if you would look at the afffected DOM nodes in the accessibility tree, you would find that the expected accessibility information is conveyed. This is, of course, easier said than done. Because web developers will have to indicate somewhere what it is they want. Browsers can’t magically make up the ‘nuance’ (but in some cases, they could cover quite a lot of ground).</p> <p>As I understand it, ARIA attributes were once introduced as a temporary solution. Moving more ARIA specifics to browser code could reduce the surface for problematic ARIA in individual websites. The challenge, I guess, is to come up with ways to let developers express the same ‘ARIA nuance’, but in HTML and/or CSS, maybe by combining specific bits of nuance into easier to grasp primitives (this is non trivial; if it sounds like fun, join us in <a href="http://open-ui.org/">Open UI</a>!).</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/re-nuance-in-aria/">Re: nuance in ARIA</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Re: nuance in ARIA">Reply via email</a></p> Menlo Park 2022-02-26T00:00:00Z https://hidde.blog/menlo-park/ <p>I’m in Menlo Park. Not only is a controversial social media platform headquartered here, it is also home to the (just opened) <a href="https://guildtheatre.com/">Guild Theatre</a>, where <a href="https://www.youtube.com/channel/UCbI0u4X87G0Ddvw6V7VpDLg">Robert Glasper</a> performed tonight.</p> <p>I love it when people happily cross over the borders of their disciplines. Musicians are great at this. Robert Glasper’s music made it into the top 10 of multiple charts, because his music is in multiple genres: jazz, R&B and hiphop. And then probably some more. In 2012 he created the <a href="https://en.m.wikipedia.org/wiki/Black_Radio">Black Radio</a> album, and followed up with <a href="https://en.wikipedia.org/wiki/Black_Radio_2">Black Radio 2</a> in 2013. Over the years he played with his quartet the Robert Glasper Experiment and the Robert Glasper Trio, and has done lots of awesome collaborations. He worked with legendary rappers like Q-Tip, Snoop Dogg and Kendrick Lamar, and played his own versions of anything from Radiohead (<a href="https://www.youtube.com/watch?v=DSw7TXt3DZE">“I’m a reasonable man, get off my case”</a>) to Miles Davis. I mean, why pick one specific genre and stick with it forever? </p> <p>Many web developers cross between and learn about different parts of our industry, too. They might be specialists in web accessibility, security or the JavaScript ecosystem, but also learn and understand other parts. There are so many sub disciplines. Of course, nobody knows everything, that’s not realistic nor the goal. But expanding skills and knowledge widely is worthwile (also, eh, <em>especially</em>, outside the realm of tech). My favourite web developers are the curious ones, open to figure out how things fit together and learning new things. I feel curiosity and crossing disciplines can result in better products.</p> <p><img alt="pianist, MC, bass player and drummer on a stage" src="https://hidde.blog/_images/glasper.jpg" /> <em>Glasper at The Guild Theatre, 25 February 2022</em></p> <p>Anyway, I managed to get tickets, masked up and enjoyed the music! The concert was very good and memorable, both Glasper’s performance and the awesome MC who played “a couple of records” before the band got on stage. It was well worth the trip to Menlo Park. I did not take a selfie with the Meta logo.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/menlo-park/">Menlo Park</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Menlo Park">Reply via email</a></p> Photo blogging with Sanity and Eleventy 2022-03-23T00:00:00Z https://hidde.blog/photo-blogging-with-sanity-and-eleventy/ <p>After two years of being mostly inside, I developed an increasing desire to travel. I’m also a millennial developer in the age of social media, so I felt like I needed a way to share where I was going. In this post, I will show how I built a personal photo blog. My tools of choice: Sanity and Eleventy.</p> <p><em>Disclaimer: I recently started working at Sanity, so I am biased. Of course, other authoring tools and content platforms exist too; use what works for you etc.</em></p> <p><a href="https://where.hiddedevries.nl/"><img alt="page with header where is hidde and a lot of square photos" src="https://hidde.blog/_images/screenshot-2022-03-24-at-08.59.08.jpg" /></a> <em>where.hiddedevries.nl</em></p> <h2>A wishlist</h2> <p>There are a lot of ways to share photos online, but what would I do if the proverbial sky was the limit? Here’s some things I wanted for my photo blog.</p> <h3>Control</h3> <p>Something I find particularly important on websites, especially when they have my personal content, is that I have control. Control over where the content would live was important, I wanted to be able to move my stuff to elsewhere. I wanted to decide what URLs looked like. I also wanted control over how my content was presented. </p> <h3>Works from a phone</h3> <p>Travel updates are particularly place and time specific. I usually find time to write updates while I’m still traveling, so the ability to compose on the go would be a must have. This could have different shapes and forms. The photo-taking would always be on the go, of course, phones and cameras are very portable. But I also wanted to <em>publish</em> photo content from a mobile device. In my case that meant not using git for content, but a CMS (!).</p> <h3>Can put location data to use</h3> <p>These days, most (phone) cameras can save location data into the image file: latitude, longitude and level. This is fairly privacy sensitive, so I would not always want to share it. On a photo blog though, for photos I picked, it seemed like a useful thing to add, especially since this would be data under my control.</p> <h3>Is a product instead of me</h3> <p>I didn’t want to <em>be</em> the product, I wanted to pay for storing my content, or at least store my data in a place that charges customers for storage.</p> <h3>Lives on a URL I control</h3> <p>To decrease reliance on specific systems, I desired to set this personal archive up with URLs that I control. This makes it possible for me to move my data to a different URL, without breaking <em>The Web</em>.</p> <h3>Has simple syndication</h3> <p>To ensure that people have an easy way to find new content, I also wanted to implement <a href="https://en.wikipedia.org/wiki/RSS">RSS</a>, or Really Simply Syndication. It points RSS readers to my content, so that they can show it in their timeline.</p> <h2>Building blocks</h2> <p>Ok, so with that wishlist in mind, I started out building myself a photoblog using Sanity, Eleventy and Netlify. Except for Eleventy, these are commercial tools, but they have free tier quota that a personal photo blog will be unlikely to exceed. In any case, they meet the “I’m not the product” item on the wishlist.</p> <h3>Sanity</h3> <p>Let’s start with the Sanity part. As mentioned, I recently joined the Sanity team, and this project is my first deep dive into the product. Or products, really.</p> <p>Sanity has multiple products that together form an ecosystem that can power your content creation and delivery process.</p> <p>The first is an authoring tool, called <a href="https://www.sanity.io/studio">Sanity Studio</a>, that presents a UI that mirrors your content structure. If you have a recipe website, it can have fields for “ingredients”, “method” and “vegan-friendly”, if you are a concert venue, you may want fields for artists, genres and photography. You can have fields that are strings of text, dates or images, to name a few.</p> <p>There is also a place to store content, called <a href="https://www.sanity.io/docs/datastore">Content Lake</a>, to which you can send data, using the Studio or using anything else that can do HTTP, like <code>curl</code>. This is where content is saved in the structure you define, and without storing any HTML. The Studio saves your stuff in real time, which also comes in handy if you work on content with multiple people simultaneously. </p> <p>And then there is a query language called <a href="https://groq.dev/">GROQ</a>, that you can use to request precisely the content you need in your website (or any JSON file, also outside Sanity). It’s a little bit like GraphQL, for those familiar with that, Sanity supports that too (yay choice!). In my case, if I wanted to query photos, I could ask for them all, or request photos taken in a specific location or with a specific aspect ratio. I can then specify which data I want from that selection, such as the description or alternative text.</p> <p>So, Sanity has a set of tools that each deal with a specific part of your content processes, covering the creation, storing and fetching of content. What it doesn’t offer is a front-end, this is by design.</p> <h3>Eleventy</h3> <p>For building front-end projects, I’m a huge fan of <a href="https://11ty.dev/">Eleventy</a>, a Node tool that can create static websites. I love it for being unassuming and unopiniated. It is great for progressive enhancement, too, as it doesn’t ship with JavaScript in the runtime if you don’t ask it to. You feed it data, write templates and it will create HTML for you that you can host somewhere.</p> <p>Eleventy makes it easy to set up an RSS feed with the <a href="https://www.11ty.dev/docs/plugins/rss/">RSS plugin</a>, set up URLs however you like and output HTML that you have full control over, so that’s a few of my wishlist boxes checked.</p> <h3>Netlify</h3> <p>Which brings me to hosting. When Eleventy has built a folder of static HTML files and assets, we’ll need to put that folder somewhere to see it on the web. We’ll use Netlify for that, as it can conveniently integrate with GitHub as well as Sanity, i.e. do its thing when there are changes in code or content. </p> <h2>Process</h2> <p>With those tools, I built my personal photoblog. Below, I will go into some of the stages I went through from start to finish. I used a starter project, defined a content structure, ensured I could add photos, wrote a query to fetch my data, built a front-end to display that data and then set up automated deployments.</p> <h3>Starter projects</h3> <p>I got started using the <a href="https://www.sanity.io/create?template=sanity-io%2Fsanity-template-eleventy-blog">Sanity / Eleventy starter project</a>. These starter projects ‘magically’ set up everything you need for a Sanity project: the authoring tool, the data storage, a GitHub repo and some minimal starter code that shows how to query and then use the data you get returned. The starter project tool sets all this up for you and does the necessary plumbing to leave you with working development and production environments.</p> <p><img alt="three screenshots, first two show logged in accounts, the third is not yet logged in" src="https://hidde.blog/_images/steps1.png" /> <em>The three steps of this starter: connect Sanity, connect to GitHub and connect to Netlify. With these permissions, the starter script sets things up on behalf of you.</em></p> <p>Magic and code, not everyone loves it. I might opt to set up each part manually, but it was nice to see the steps in action and have a working environment in minutes.</p> <h3>Content structure</h3> <p>With the setup out of the way, my next task was to figure out how to structure my content. After trying some different structures and ideas, I ended up with just two content types, Photo and Category. For categories, I wanted to save a name. For photos, I wanted to save an image including colour and location data, a text alternative, a title, a date and a Category.</p> <p>In Sanity, content structure is defined in code, this is part of what my main image type lools like: </p> <pre class="language-javascript"><code class="language-javascript"><span class="token punctuation">{</span> <span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'mainImage'</span><span class="token punctuation">,</span> <span class="token literal-property property">type</span><span class="token operator">:</span> <span class="token string">'image'</span><span class="token punctuation">,</span> <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">'Image'</span><span class="token punctuation">,</span> <span class="token literal-property property">options</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token literal-property property">hotspot</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token literal-property property">metadata</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">'location'</span><span class="token punctuation">,</span> <span class="token string">'palette'</span> <span class="token punctuation">]</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token literal-property property">fields</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token punctuation">{</span> <span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'alt'</span><span class="token punctuation">,</span> <span class="token literal-property property">type</span><span class="token operator">:</span> <span class="token string">'string'</span><span class="token punctuation">,</span> <span class="token literal-property property">title</span><span class="token operator">:</span> <span class="token string">'Alternative text'</span><span class="token punctuation">,</span> <span class="token literal-property property">description</span><span class="token operator">:</span> <span class="token string">'What\'s on this picture?'</span><span class="token punctuation">,</span> <span class="token function-variable function">validation</span><span class="token operator">:</span> <span class="token parameter">Rule</span> <span class="token operator">=></span> Rule<span class="token punctuation">.</span><span class="token function">error</span><span class="token punctuation">(</span><span class="token string">'You forgot to describe this image'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">required</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token literal-property property">options</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token literal-property property">isHighlighted</span><span class="token operator">:</span> <span class="token boolean">true</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">]</span><span class="token punctuation">,</span></code></pre> <p>It has an image field with “hot spot”, so authors can say which part of the photo should be prioritised in case of cropping and it has a compulsory field for alternative text. </p> <p>For images, Sanity strips out most metadata by default. In my case, I actually wanted to share location data, so I turned that on manually, adding <code>location</code> to the content structure. I also opted for Sanity to extract colours from uploaded images using the opt-in <a href="https://www.sanity.io/docs/image-metadata#5bb0c7e96f42"><code>palette</code></a> feature. For more information, see Sanity’s <a href="https://www.sanity.io/docs/image-metadata">Image Metadata documentation</a>.</p> <h3>Adding photos</h3> <p>The authoring tool is in your repo, too. You can run it on a local server, host it with Sanity or host it with any web hosting. It is “just” a Single Page App that does HTTP requests.</p> <p><img alt="post editor on desktop view and mobile view plus screenshot of outputted JSON" src="https://hidde.blog/_images/studio.png" /> <em>Editing a post on desktop and mobile</em> </p> <p>In my case, my wishlist said I wanted to do some of this on my phone, so I deployed my Sanity Studio on a URL, in my case on Netlify. I say “I deployed”, but the first Netlify deployment of my Studio was actually set up by the starter project. The Studio works on phones, because it has a responsive UI and not a lot of fluff that requires screen real estate. Sanity’s image upload component is a regular file upload, that, on my phone, was able to take input from my photo library as well as from the camera directly.</p> <p>A common, <a href="https://jamstack.wtf/">Jamstacky</a> way to host a blog or photo content would be to put the content in a git repository, probably using some combination of Markdown for content and Yaml for metadata. I do that for my <a href="https://books.hiddedevries.nl/">Books</a>, and it works ok for me. But for editing on the go, it is actually nice to have a CMS, not content in git. It saves from the trouble of finding a way to run or trigger <code>add</code>, <code>commit</code> and <code>push</code> commands from my cli-less mobile OS. </p> <h3>Data collection</h3> <p>As mentioned earlier, Sanity supports this query language called GROQ. There is a <a href="https://css-tricks.com/query-json-documents-in-the-terminal-with-groq/">CSS-Tricks post on how to use GROQ on your data</a>, but I’ll go through my query for content too. </p> <p>GROQ queries can have these three parts:</p> <ul> <li>the dataset with all your documents</li> <li>a filter (which subset of documents you want)</li> <li>a projection (the shape of the data from that subset)</li> </ul> <p>Let’s look at an example that combines the first two parts. First, it requests all content in my dataset (<code>*</code>) , then it filters for data of the “post” type that has a slug and has a “published” date before now (so anything that’s not set to be published in the future):</p> <pre class="language-javascript"><code class="language-javascript"><span class="token operator">*</span><span class="token punctuation">[</span>_type <span class="token operator">==</span> <span class="token string">"post"</span> <span class="token operator">&amp;&amp;</span> <span class="token function">defined</span><span class="token punctuation">(</span>slug<span class="token punctuation">)</span> <span class="token operator">&amp;&amp;</span> publishedAt <span class="token operator">&lt;</span> <span class="token function">now</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">]</span></code></pre> <p>Then, from that data, we can define a specific set that we need for the photo blog:</p> <pre class="language-javascript"><code class="language-javascript"><span class="token punctuation">{</span> _id<span class="token punctuation">,</span> publishedAt<span class="token punctuation">,</span> title<span class="token punctuation">,</span> slug<span class="token punctuation">,</span> mainImage <span class="token punctuation">{</span> <span class="token operator">...</span><span class="token punctuation">,</span> asset<span class="token operator">-</span><span class="token operator">></span> <span class="token punctuation">}</span> <span class="token punctuation">}</span></code></pre> <p>This requests an object of a specific shape for each post that is returned. The <code>_id</code> is an internal property, <code>publishedAt</code> and <code>title</code> are the publish date and a title, the <code>slug</code> is a URL friendly string and <code>mainImage</code> has a pointer to where the image lives.</p> <p>From the <code>mainImage</code>, we’re specifically requesting two things with the projection (<code>{}</code>):</p> <ol> <li>First, we “spread” all the properties of the <code>mainImage</code> object with <code>...</code>, a bit like the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax">spread syntax in JavaScript</a>. </li> <li>Then, we also join in the reference found in <code>asset-></code>. </li> </ol> <p>The thing is, my posts don’t contain the image data, they contain <a href="https://www.sanity.io/docs/reference-type">references</a> to the image data. So if I had asked for <code>asset</code>, I would only get access to an ID that I could use to find the referenced asset. The good news is that I don’t actually need to find it myself, as with <code>asset-></code>, we’re getting the data <em>of the referenced asset</em> and use it right there. In other words, the properties that the image asset object had are returned in place.</p> <p>A “reference” is an indexed pointer to another document that you can query. In this case, the relationship is between a post and an image. This works two ways. If you’re listing images, for each image, you can request the post it relates to. If you’re listing posts, you can request the image that it relates to. </p> <h3>Front-end</h3> <p>For the front-end, I’ve gone with a page that lists all photos and a simple header and footer. There are also individual pages for each photo.</p> <h4>Image URL fun</h4> <p>Sanity has a lot of features that you can access by manipulating your image’s URL. If you know the image URL, you can add <a href="https://www.sanity.io/docs/image-urls">parameters</a> to request:</p> <ul> <li>specific crops; I use this for square images on my index page</li> <li>formats; I use “<a href="https://www.sanity.io/docs/image-urls#auto-777d41f23d56">auto formats</a>” so that the CDN returns <a href="https://en.wikipedia.org/wiki/WebP">webp</a>’s to browsers that support them, yay performance</li> <li>manipulated versions of your images, eg with different resolutions and sharpnesses</li> </ul> <h4>Photo-based header colours</h4> <p>On the single photo page, the background of the header has the colour of the most prominent colour in the photo. I was able to build this, because Sanity can return a <code>palette</code> object with a bunch of colour info, including the most prominent and a color that contrasts with it. In my template, I use the HEX value from this <code>palette</code> property to overwrite the CSS variable that the header’s <code>color</code> and <code>background-color</code> are set with.</p> <p>In the (Nunjucks) template for a single photo, I have this HTML snippet:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>style</span><span class="token punctuation">></span></span><span class="token style"><span class="token language-css"> <span class="token selector">body</span> <span class="token punctuation">{</span> <span class="token property">--header-background-color</span><span class="token punctuation">:</span> <span class="token punctuation">;</span> <span class="token property">--header-color</span><span class="token punctuation">:</span> <span class="token punctuation">;</span> <span class="token punctuation">}</span> </span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>style</span><span class="token punctuation">></span></span></code></pre> <p>For the header colour, my site’s main stylesheet has a <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties">custom property</a>, as CSS’s built-in variables are called. With this snippet, I overwrite it. Custom properties in CSS take part in the <a href="https://www.w3.org/TR/css-cascade-5/#cascade-sort">cascade</a>, CSS’s system to figure out which style to use when style rules compete. In this case, the definition in my main stylesheet and the one in this template compete, and the latter wins. </p> <h4>Blurry previews</h4> <p>Photos can take time to load, so I pondered displaying something while you’re waiting. I’ve never been a fan of spinners, or, unpopular opinion, skeletons, but I found Sanity can return a ‘blurhash’. This is a string that looks like this:</p> <pre class="language-javascript"><code class="language-javascript">d79Z$<span class="token constant">I</span><span class="token operator">-</span>o4<span class="token operator">:</span>IoxaofR<span class="token operator">*</span>WC00Io<span class="token operator">?</span>GxtM<span class="token punctuation">{</span><span class="token literal-property property">Rkt7s</span><span class="token operator">:</span><span class="token operator">~</span>VxaNGRk</code></pre> <p>It <a href="https://www.sanity.io/docs/image-metadata#1bc0229e31a2">can be converted</a> into a very blurry and small image that is specifically useful to show while waiting for the full image. This is mostly useful for users on slower connections. I have left this out from the final site.</p> <h3>Deployment</h3> <h4>Own URL</h4> <p>My personal site is <code>hiddedevries.nl</code> and I want to use <code>where.hiddedevries.nl</code> for this project. I set up my nameservers so that they point to Netlify, where I’m hosting the website. The site now mostly meets the “own your URL” requirement, and if I get unhappy with my current setup, I can move my data elsewhere.</p> <p>One aspect where I don’t own my URLs though, is image assets. When I requested images with GROQ earlier, I got a URL of Sanity’s CDN. This has end user benefits, including that it can serve assets from the data centre that is closest to you, caching and, less of an issue with HTTP/2, allows for more more concurrent downloads by having a separate hostname. For full control and with the same benefits, you might want this on your own separate hostname too. I’m told this is currently only possible in Sanity’s enterprise plan. If it’s your thing, you could totally build some sort of proxy yourself, too.</p> <h4>Hooks</h4> <p>Our generated files from Eleventy are on Netlify and need to be deployed to Netlify. When is a good time? Probably when either the code, on GitHub, or the content, in Sanity, change. We can keep Netlify posted of changes in either using webhooks:</p> <ul> <li>GitHub can tell Netlify about changes, these are set in the Netlify settings</li> <li>Sanity has <a href="https://www.sanity.io/docs/webhooks">GROQ-powered webhooks</a>: given a GROQ query on your content, whenever the queried set of data changes, it can perform a HTTP request to a URL (and yes, that can be a <a href="https://docs.netlify.com/configure-builds/build-hooks/">Netlify build hook</a>’s URL)</li> </ul> <p>Whenever either of these happen, Netlify will run my build process. The build process comes down to:</p> <ul> <li>it grabs my latest data from Sanity (the response to my GROQ query, including photo URLs, metadata like titles, text alternatives, location and colour palette)</li> <li>it runs Eleventy to combine the data with my photoblog HTML/CSS</li> <li>it places the folder that Eleventy outputs on the server</li> </ul> <h2>Wrapping up</h2> <p>In this post, I’ve shown how I built a personal photo blog, managing content with Sanity, generating a static site with Eleventy and hosting that site on Netlify. That’s a lot of concerns, but I feel like they are separated in a sensible way, where each piece could be replaced by some other piece if needed.</p> <p>I didn’t manage to check all of the boxes: uploading photos with location data in iOS and Android seems to be impossible, they are stripped upon uploading, probably for privacy (may be continued in another blog post). To have fun with location data, I will have to upload photos from desktop. </p> <p>This was a fun learning experience, thanks for reading it, I hope it was helpful! You can look at the website at <a href="https://where.hiddedevries.nl/">where.hiddedevries.nl</a>. The code is on <a href="https://github.com/hidde/where-is-hidde">hidde/where-is-hidde</a>, the schema for a post is in <a href="https://github.com/hidde/where-is-hidde/blob/main/studio/schemas/documents/post.js">post.js</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/photo-blogging-with-sanity-and-eleventy/">Photo blogging with Sanity and Eleventy</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Photo blogging with Sanity and Eleventy">Reply via email</a></p> Common accessibility issues that you can fix today 2022-04-12T00:00:00Z https://hidde.blog/common-a11y-issues/ <p>This week, WebAIM published their latest <a href="https://webaim.org/projects/million/">“WebAIM Million” report</a>. It details accessibility issues they found when they tested the web's top million websites automatically. What is some low hanging fruit you could fix today?</p> <p>For context, WebAIM, a non profit based out of Utah in the US, have done their ‘<a href="https://webaim.org/projects/million/">WebAIM Million</a>’ project since 2019. They post an extensive analysis every year, looking at trends and improvements/decline in web accessibility over time. I find these posts very insightful and use them to inform my own workshops and outreach. It’s definitely recommended reading! </p> <p>There are some caveats to be added with surveys based on automated accessibility testing. One is that ‘ease of detectability’ does not correlate with ‘impact on end users’. There are issues that are easy to detect and issues that impact end users most, these are not necessarily the same. Automated tests also cover only a small part of all accessibility, as some things aren’t detectable by machines (yet, or ever). I’m not suggesting this makes the survey less useful or good, but wanted to call it out explicitly. The <a href="https://act-rules.github.io/pages/about">ACT-Rules Community Group</a> at the W3C works on harmonising test rules for things that <em>are</em> testable.</p> <p>Ok, let’s look at the top issues and how developers, browsers and CMSes can take away barriers today. Some of these include ideas about what users can do (important caveat: none of this should be user responsibility, website owners should not expect users to use or know about these tools).</p> <h2>Low text contrast</h2> <p>There are cases where text colour and the background colour have a ratio lower than the <a href="https://www.w3.org/WAI/WCAG21/quickref/#contrast-minimum">threshold in WCAG</a> (see also <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_WCAG/Perceivable/Color_contrast">MDN on contrast</a>). </p> <p><strong>Designers</strong> can check contrast manually install plugins (using a tool like <a href="https://contrast-ratio.com/">Contrast Ratio</a>) or install a plugin like <a href="https://www.getstark.co/">Stark</a> for Figma or Sketch.</p> <p><strong>Developers</strong> can use an automated contrast checker to make sure you avoid low contrast text. Run a checker like the one in <a href="https://firefox-source-docs.mozilla.org/devtools-user/accessibility_inspector/index.html#color-contrast">Firefox Dev Tools Accessibility Panel</a> or <a href="https://www.deque.com/axe/">axe</a> in CI/CD, or paste two colours into a manual tool like <a href="https://contrast-ratio.com/">Contrast Ratio</a>. </p> <p><strong>Designers</strong> and <strong>developers</strong> alike can use Polypane’s <a href="https://polypane.app/color-contrast/">contrast checker that suggests accessible alternatives</a>, which makes it a lot easier to not just find the issue, but also fix it while you’re at it. </p> <p><strong>Users</strong> could use a plugin like <a href="https://fixa11y.com/">Fix Contrast</a> to not be affected: it tweaks colours on the fly so that you don’t have to suffer low contrast text. </p> <p>There are some discussions on new colour contrast algorithms for WCAG, but this is still under discussion and <a href="https://yatil.de/blog/wcag-3-is-not-ready-yet">not ready any time soon</a>. </p> <h2>Missing alternative text</h2> <p>When you create content, describe your images. In your CMS, on Twitter and even in GitHub issues: use that alternative text feature, so that users who can’t see the image can access the content in them. On platforms that don’t support alternative text, like Slack or mobile LinkedIn (!), you can describe images in text. If you choose a CMS or content platform, ensure it can handle alternative text or set it up to do so. </p> <p>In the resulting HTML, you’ll want something like: </p> <pre class="language-markup"><code class="language-markup"><span class="token comment">&lt;!-- image with text --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>img</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>website-logo.png<span class="token punctuation">"</span></span> <span class="token attr-name">alt</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hiddedevries.nl<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> <span class="token comment">&lt;!-- image with redundant content --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>img</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hidde.png<span class="token punctuation">"</span></span> <span class="token attr-name">alt</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">></span></span>Photo of Hidde<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">></span></span></code></pre> <p>You can make your decisions on alternative text using the <a href="https://www.w3.org/WAI/tutorials/images/decision-tree/">Alt Decision Tree</a>, but basically the gist is that if you were to replace your image with a square, what would you write in the square for it to still be useful? Leaving it empty is an option if that’s the most useful alternative for the image. Like in the example above, there is a photo with a paragraph underneath that describes it. In this case, writing “Hidde” or “Photo of Hidde” in the <code>alt</code> attribute is redundant, it would be best to use an empty <code>alt</code> (but do leave the attribute in there, or some browsers will use the image URL as an alternative).</p> <p><strong>Users</strong> can use Microsoft Edge, which fills in missing alternatives. AI aren’t very good at intentions or context, but pretty much perfect at recognising text. Next time a news website posts an image of new covid rules with no alternatives (as the main Dutch news website used to do throughout the pandemic), users of Edge can follow along. </p> <h2>Empty links and buttons</h2> <p>When links, buttons or other interactive elements don’t have names, assistive technologies like screenreaders or voice controls have no way to uniquely refer to them. If it is to be interacted with, it needs a name.</p> <p>Imagine the difference between a screenreader saying “here's 4 buttons: button, button, button and button”, versus “here's 4 buttons: publish content, delete content, change to draft, upload image”. In the first instance, you'd need to press them before you know what they do, in the second, it is clear what you're in for, with no further context needed.</p> <p>Names are derived from text content, like the actual text that’s inside a button, or can be added through an attribute. See <a href="https://hiddedevries.nl/en/blog/2019-04-18-naming-things-to-improve-accessibility">Naming things to improve accessibility</a> for more detail or <a href="https://www.w3.org/TR/accname-1.1/">the spec that defines how controls get their names</a>. </p> <p><strong>Developers</strong> need to ensure all controls they build (links, buttons, form fields, etc) have names, ideally that make sense out of context: </p> <pre class="language-markup"><code class="language-markup"><span class="token comment">&lt;!-- names that make sense out of context --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span><span class="token punctuation">></span></span>Submit form<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span><span class="token punctuation">></span></span>Publish content<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span><span class="token punctuation">></span></span>Expand filters<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>//wikipedia.org<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Wikipedia<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>//twitter.com<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Hidde on Twitter<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span> <span class="token comment">&lt;!-- names that are confusing --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>/<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>click here<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span><span class="token comment">&lt;!-- avoid --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>/<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>read more<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span><span class="token comment">&lt;!-- avoid --></span> <span class="token comment">&lt;!-- names that are missing; avoid or add a name --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>//twitter.com/<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>svg</span><span class="token punctuation">/></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span><span class="token comment">&lt;!-- avoid --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>//linkedin.com<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>img</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token punctuation">"</span></span> <span class="token attr-name">alt</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span><span class="token comment">&lt;!-- avoid --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>img</span><span class="token punctuation">/></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span><span class="token punctuation">></span></span><span class="token comment">&lt;!-- avoid --></span></code></pre> <p><strong>Browsers</strong> can sometimes derive names from nearby text, some do this when there is no text to derive a name from. This is not ideal, can lead to wrong and confusing guesses and be bad end user experience. The developer of this control will know best what the thing does and therefore how it should be named.</p> <h2>Missing form labels</h2> <p>Form labels kind of fall under naming things, as they name form elements specifically.</p> <p><strong>Developers</strong> can fix this by ensuring form fields have a <code>&lt;label&gt;</code> element of which the <code>for</code> attribute points to the <code>id</code> of the <code>input</code>/<code>select</code>/<code>textarea</code> , this also makes that clicking label moves the cursor to the input:</p> <pre class="language-markup"><code class="language-markup"><span class="token comment">&lt;!-- “for” and “id” are same, this connects them --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>label</span> <span class="token attr-name">for</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>field<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Address<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>label</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>field<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span></code></pre> <p>They can also add an <code>aria-label</code> attribute to the input to name it that way (but be careful, <a href="https://adrianroselli.com/2019/11/aria-label-does-not-translate.html">ARIA labels don’t get translated well</a>).</p> <h2>Missing languages</h2> <p>Proper language indication can get you a Pass on two (!) WCAG Success Criteria (<a href="https://www.w3.org/WAI/WCAG21/quickref/#language-of-page">3.1.1</a> and <a href="https://www.w3.org/WAI/WCAG21/quickref/#language-of-parts">3.1.2</a>), and you only need to know one attribute for it. </p> <p><strong>Developers</strong> should ensure the <code>&lt;html&gt;</code> element has a <code>lang</code> attribute with the right language:</p> <pre class="language-markup"><code class="language-markup"><span class="token comment">&lt;!-- marks this document as 'in English --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>html</span> <span class="token attr-name">lang</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>en<span class="token punctuation">"</span></span><span class="token punctuation">></span></span></code></pre> <p>Sometimes this is forgotten as the <code>&lt;html&gt;</code> element lives in some template you never touch, but it’s not hard to do, so always double check that this attribute exists and is set to the right language.</p> <p>If there is content on part the page that is in another language, mark that too, again, with a <code>lang</code> attribute on the relevant DOM node. When you pick a plugin for internationalisation, ensure it sets the <code>lang</code> s or makes it easy for you to do so.</p> <p><strong>CMSes</strong> can make sure that <code>lang</code> attributes are set and set correctly. <strong>Browsers</strong> can guess languages, but they aren’t always good at this, specifically when it comes to distinguishing dialects: they often matter a lot to people, less so to machines.</p> <h2>Wrapping up</h2> <p>These are some tips based on the most common issues that <a href="https://webaim.org/projects/million/">WebAIM Million 2022</a> identified. Let’s all put in the work to make sure we, our colleagues, our clients and our users avoid these issues. Like, actually. We need WCAG auditors to focus on higher hanging fruit, by fixing the lower hanging stuff for good.</p> <p>If this is all new to you, hi, thanks for reading! I hope this helps and feel free to get in touch with questions. If you already knew all of this, please keep spreading the word, so that in next year’s survey, we’ll see steady improvements for the web at large. </p> <p>Want to learn more about fixing low hanging fruit accessibility issues? In response to the same survey, Christian Heilmann blogged about <a href="https://christianheilmann.com/2022/04/12/one-million-broken-web-sites-and-a-way-to-prevent-that/">how to fix accessibility issues using your browser</a></p> <hr/> <p>Originally posted as <a href="https://hidde.blog/common-a11y-issues/">Common accessibility issues that you can fix today</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Common accessibility issues that you can fix today">Reply via email</a></p> The URLs are new 2022-04-15T00:00:00Z https://hidde.blog/new-uris/ <p>This blog has had pretty long URLs for legacy reasons. Today I've made some updates to change that.</p> <p><em>Redirects and RSS should all work, though some feed readers seem to surface old posts as unread, sorry for any inconvenience.</em></p> <p>For context, this used to be my company's website. I only really ever updated the blog section, so I decided to make that the main thing. The old structure lasted just over 8 years and my hope is that the new one will break that record.</p> <p>URLs are such a cool part of the web, especially if they're set up thoughtfully. Like <a href="https://traintimes.org.uk/">traintimes.org.uk</a>, where you can add <code>/london/bristol</code> to get times for trains from London to Bristol, and <code>/9:00</code> to that if you want the ones that leave from 9am.</p> <p>I don't know of ways to give blog URLs very thoughtful structures, there isn't a lot of structure in this blog anyway. Anne van Kesteren's <a href="https://annevankesteren.nl/2004/08/weblog-system">classic post on how to do blogs</a> has some good pointers, like where an archive should live.</p> <h2>New blog post URLs</h2> <p>On this blog, a post URL used to be something like:</p> <p><code>hiddedevries.nl/en/blog/2022-04-02-my-post</code></p> <p>It's now:</p> <p><code>hidde.blog/my-post</code></p> <p>The main changes are:</p> <ul> <li>new host name, reducing lots of characters, easier to remember and put on slides</li> <li>single language setup, removing the need for <code>en</code></li> <li>no more dates in the URL structure</li> </ul> <p>I wasn't super sure about removing dates, so I <a href="https://twitter.com/hdv/status/1514138955498856448">asked on Twitter</a>. I didn't have a specific reason for including dates before, it was a default of my CMS and I kind of liked it at the time.</p> <h2>Dates matter</h2> <p>A couple of people replied to my question that dates on blog posts are <a href="https://twitter.com/KittyGiraudel/status/1514164778696065025">important to readers</a>. Especially for blog posts that share technical advice, as they <a href="https://twitter.com/ronderksen/status/1514172161627504643">could go out of date</a>.</p> <p>Other reasons for including a date are:</p> <ul> <li>a <a href="https://twitter.com/mpatdung/status/1514162347740258304">less messy file system</a>, if you put posts into actual folders in the file system; this is moot if your routes are handled by some system</li> <li>it can be <a href="https://twitter.com/briankardell/status/1514246200148606978">helpful for blog owners that code</a> to have the date as part of the file name</li> <li><a href="https://twitter.com/jimniels/status/1514235643374710789">prevents naming collisions</a></li> <li>it's <a href="https://twitter.com/chriscoyier/status/1514286966971539458">nice for analytics</a></li> <li>it's <a href="https://twitter.com/webrocker/status/1514146023488303106">a default</a> in a lot of blog software or a <a href="https://twitter.com/tomayac/status/1514487818470531073">choice from the past</a></li> <li>it <a href="https://twitter.com/davatron5000/status/1514241747492220930">provides context</a></li> </ul> <p>But there are drawbacks too:</p> <ul> <li>date is usually creation date, this could make posts seem old, while the author may be frequently keeping content up to date, this could be <a href="https://twitter.com/simonrjones/status/1514151464536522756?s=20&amp;t=XpX0WGz2VCadv3XGn0UxWw">confusing</a></li> <li>dates <a href="https://twitter.com/mathias/status/1088075719975018497">are really metadata</a>, they don't belong in the URL</li> <li>it's not as <a href="https://twitter.com/foobartel/status/1514142862195134468">simple and readable</a></li> </ul> <p>I've gone for simplicity. I do agree dates matter though, especially on tech posts, so I have the publication date in the post content near the title (I do use GitHub's <a href="https://github.com/github/time-elements"><code>&lt;time-ago&gt;</code> Web Component</a> to display it relatively). I also include dates when I make updates, though I add those at the end rather than near the title (I probably want to improve that).</p> <p>That's all for today. I've also moved away from the CMS, so if you notice anything is broken, please do slide in my <a href="https://twitter.com/hdv">DMs</a> or email my first name at <a href="http://hiddedevries.nl/">hiddedevries.nl</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/new-uris/">The URLs are new</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20The URLs are new">Reply via email</a></p> Action, inaction and ‘cancel culture’ 2022-05-06T00:00:00Z https://hidde.blog/action-inaction/ <p>The health and inclusiveness of a community can be affected by action, but also by inaction. In this post, I'll share some reflections on banning pretty much objectively bad content and on issues with the word ‘cancel culture’.</p> <p>When a political party tries to attract voters with racism, sexism and homophobia, should all pages on their website be banned from a healthy, inclusive coder community? Last week I got into a discussion I didn't expect I would get into… it could be summarised as this question. (Spoiler alert: to me, the answer is yes).</p> <p>In one of my communities, someone had shared a link to a blog post on the website of a controversial, far right political party that perpetuates all sorts of racism, sexism, homophobia and misinformation. Just like that, a link in the <code>#general</code> channel that all members join by default, for roughly 7000 people to see, who signed up to collaborate on and talk about code. The blog post itself didn't contain such things per se, but the party owns the website.</p> <p>In short: I feel such a <em>link</em> should not be allowed on a healthy, inclusive coder community. Failing to moderate this content can make those marginalised by systemic racism, sexism and homophobia feel unwanted. It signals that this community has no specific problems with the link, at least not specific enough to ban it. It could unintendedly scare people away and send out a message about who belongs. Should a community prioritise people who want to share or say whatever they want or people who don't want to have racism, sexism or homophobia affect their daily lives?</p> <p>My point is… healthy, inclusive communities do the work to make people, especially those who are marginalised, feel wanted. For so many reasons. Sure, banning the post and maybe even the poster could make the <em>poster</em> feel unwanted. That's not great. But… we've got to prioritise the marginalised over the marginalisers (after all, they did post the link).</p> <p>Do I feel links to all political parties should be banned? No. What about the extreme left or the somewhat right, where does it end? I don't know, but in this case it was easy to tell as this was a party with years of controversies that reasonably go against community spirits. Community members and managers should speak out if they can, remove problematic content actively and reinforce principles. Because not doing that is a message too, and it reinforces something too.</p> <h2>‘Cancel culture’ is the wrong word</h2> <p>I ended up calling for moderation and got into some conversations after that. One person called my request an opinion. Challenging my inner pedant: non discrimination is part of human rights declarations that almost all of the world's countries have signed. A request to reduce discrimination isn't an opinion, it's an attempt to claim basic human rights that whole societies agree on. Except, maybe, in communities of human rights scepticists, but this wasn't one of those.</p> <p>Others said moderation would be like ‘cancel culture’ or ‘censorship’. The book <a href="https://www.hachette.co.uk/titles/hannah-jewell/we-need-snowflakes/9781473672161/">We need snowflakes</a> by Hannah Jewell, which I happen to be currently reading, does a great job dissecting these frames and the people who use them. Very often, she explains, those who claim to be cancelled ostensibly still have their platforms, be it their job or their status.</p> <p>The word ‘cancel culture’ is a red flag. When you hear it used, it's worthwile considering how it's employed to shift who the victim is. In The Netherlands, we recently had football club director Marc Overmars ‘cancelled’ for sending female staff photos of his genitals. The word ‘cancel culture’ suggests calling out wrongs is an activity people do for little more than their own entertainment, and that Overmars is now some kind of victim, rather than the women he had literal power over. <em>He</em> was hired in the same position by a Belgian football club weeks later and his Wikipedia page hardly mentions the event (it does have a list of honours). A more apt response would be to ask: <em>how are the women doing?</em></p> <p>I am getting carried away a bit, but let's also consider ‘censorship’. Again, paraphrasing Hannah Jewell's book: is one truly <em>censored</em> if no government put rules in place to limit their free speech? If one can still say whatever they want in plenty of other places? If they aren't arrested for what they did? The ‘censorship!1!’ exclaimers should compare what they're exclaiming about to actual censorship that sadly happens in various states around the world.</p> <p>In healthy communities, asking someone to remove content is simply a request to stop their harm in a specific community. Because it happens to be a community that has a principle on whose feelings to prioritise. Because that matters.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/action-inaction/">Action, inaction and ‘cancel culture’</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Action, inaction and ‘cancel culture’">Reply via email</a></p> Test in many browsers 2022-05-12T00:00:00Z https://hidde.blog/test-in-many-browsers/ <p>I use Firefox as my main browser, both for development and for just regular… browsing. Increasingly, core functionality of websites breaks for me, as, presumably, not all developers test in Firefox anymore.</p> <p>Yesterday, for instance. I signed up for a conference and their signup form wouldn't submit. It relied on JavaScript, which borked in Firefox. Some ES feature was used that isn't supported in Firefox yet, with no feature checks or fallbacks. As forms have been part of the web for decades, in all browsers, my primary response was ‘hey this shouldn't have to be broken!’</p> <p>Testing your work in Firefox matters. Right? Well, it does to me, like testing in lots of browsers and assistive tech does. When I shared this on Twitter, realising a little late that this point is controversial, I saw some themes in the responses.</p> <p>Some said Firefox should test with <em>their websites</em>. They do, actually… Mozilla hosts and sponsors the <a href="https://webcompat.com/">web compat community</a> which helps debug sites that work in one browser and not another and feeds into improving those browsers. This is really hard and complex work, I remember from hanging out some of the people working on this when I was at Mozilla (<em>the stories…</em>). I recommend <a href="https://www.youtube.com/watch?v=h-KH6-PaSNI">Mike Taylor's talk about web compat at View Source 2019</a>.</p> <p>Others signalled they found it too much work. For a large part of my career, front-end development was all about making stuff work across browsers, because they weren't as well aligned as they are today. I, for one, am so happy to be past the years of needing multiple VMs to test versions of Internet Explorer. With tools like Browserstack and Browsersync, we've come a long way.</p> <p>Lastly, some said it's ‘not worth it’ given Firefox's marketshare. To be honest, I hadn't checked Firefox's market share before I tweeted and did not realise how small it is today 😢. The percentage <em>is</em> small.</p> <p>I guess I can understand the idea that organisations prioritise browser support by browser market share. But shouldn't we want browser diversity and browser engine diversity? (This nuance is nicely explained in Brian Kardell's <a href="https://bkardell.com/blog/WhatEvenIsABrowser.html">What is actually a web browser?</a>).</p> <p>Yes, some of the web's smartest and nicest minds work on Chrome and Chromium, I have see them do great work improving the web and prioritise (mostly) the right things over and over. Increasingly so now that the Edge people are also working on making Chromium better. I'm a fan of their work and most of the time Google push the web forward in ways it would simply not have without them. But, as Tim Kadlec mentions in a blog post, <a href="https://timkadlec.com/remembers/2018-12-04-risking-a-homogenous-web/">they don't always</a>.</p> <p>It's in everyone's interest to not give one company a near monopoly over what the web can do through their browser, or a handful of companies through their engine (Microsoft Edge, Samsung Internet, Brave and many others also use Chromium). Various people wrote about this when Edge announced they would use Chromium. “No single company, let alone a user-tracking advertising giant, should control the internet”, said Jeffrey Zeldman in <a href="https://www.zeldman.com/2018/12/07/browser-diversity-starts-with-us/">Browser diversity starts with us</a>. <a href="https://css-tricks.com/the-ecological-impact-of-browser-diversity/">Competition is about growing</a>, wrote Rachel Nabors, in a post where she compares the browser ecoystem with the world's ecosystem. <a href="https://andregarzia.com/2018/12/while-we-blink-we-lose-the-web.html">Hurting engine diversity hurts the web</a>, explains Andre Garzia.</p> <p>Less browser engines doesn't necessarily mean that all decision making power lies with one company, though. In <a href="https://bkardell.com/blog/Beyond.html">Beyond Browser Vendors</a>, Brian Kardell mentions the origin story of CSS Grid as an example: originally conceived by CSS co-inventors Bert Bos and Håkon Wium Lie, further worked on years later by Bert Bos, then picked up by Microsoft and ultimately paid for by Bloomberg to be implemented in Webkit and Chromium by teams from <a href="https://www.igalia.com/">Igalia</a>, a company that works on all major browsers and JavaScript engines. This is <em>also</em> how potential futures of the web can be decided.</p> <p>In any case… I'm curious how thinking may have shifted over the last years. How do <em>you</em> think about browser testing in 2022?</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/test-in-many-browsers/">Test in many browsers</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Test in many browsers">Reply via email</a></p> More common accessibility issues that you can fix today 2022-05-16T00:00:00Z https://hidde.blog/more-common-a11y-issues/ <p>Last month, I wrote about <a href="https://hidde.blog/common-a11y-issues/">fixing common accessibility issues</a>. That post seems to have resonated with people, so I have written up five more fixes you could do to your codebase today. Let's go!</p> <p>I have tried to make these as hands-on as possible. For each, you'll find a description of what the issue problem, how fixing it helps end users and which team member can take the lead on it.</p> <p>In my last post, the issues were what WebAIM described as the top 5 isuses in their WebAIM Million project. This time, I have looked into accessibility audit reports I wrote and combined that with what <a href="https://deque.com/coverage-report/">Deque wrote about coverage</a> and the numbers that 200OK took from public data about <a href="https://www.digimonitor.nl/succescriteria-in-toegankelijkheidsverklaringen/">common issues across the Dutch government websites</a> (taken from the register of accessibility statements).</p> <h2>Missing focus states</h2> <p>If an element on a page is focusable, it needs a focus state. This goes for all <a href="https://html.spec.whatwg.org/multipage/dom.html#interactive-content-2">interactive elements</a>:</p> <blockquote> <p><code>a</code> (if the href attribute is present), <code>audio</code> (if the controls attribute is present), <code>button</code>, <code>details</code>, <code>embed</code>, <code>iframe</code>, <code>img</code> (if the <code>usemap</code> attribute is present), <code>input</code> (if the <code>type</code> attribute is not in the Hidden state), <code>label</code>, <code>select</code>, <code>textarea</code>, <code>video</code> (if the controls attribute is present)</p> </blockquote> <p>(from: <a href="https://html.spec.whatwg.org/multipage/dom.html#interactive-content-2">HTML, Interactive content</a>)</p> <p>It also goes for as well for <code>div</code>s or other elements that have <code>click</code> and keyboard events (but best use <code>button</code>s in those cases while you're at it; see below).</p> <img src="https://hidde.blog/_images/focus-outline-moving-between-links.gif" alt="animated gif that shows focus moving between a set of links" /> <p>For all of these, <strong>designers</strong> can come up with a focused state (ideally this is one thing, eg an outline, that is the same for all elements on the site, so that it's easy to spot when focus moves). <strong>Developers</strong> can remove any <code>outline: none</code>s from their stylesheets (if you must undo default outlines, because you're using some other CSS property for outlines, best use <code>outline-color: transparent</code> instead so that <a href="https://twitter.com/alastc/status/1252213068542676992">it doesn't break in High Contrast Mode</a>).</p> <p><strong>Browsers</strong> can also ship with a feature that forces focus indication, some do. <strong>Users</strong> could also use user styles, though no website owner should expect they will, it requires CSS knowledge and a plugin in most browsers these days.</p> <p>More: <a href="https://hidde.blog/indicating-focus-to-improve-accessibility/">Indicating focus to improve accessibility</a></p> <h2>Missing captions and transcriptions</h2> <p>When you publish how-to videos, vlogs, podcasts, basically anything that has audio and/or video, the content should be available as text, too.</p> <p>My friend Darice de Cuba has written about <a href="https://www.darice.org/2022/04/29/usable-podcast-transcripts-for-everyone/">how to create podcasts transcripts</a>. Part of this applies to video, too. Captions and transcripts are created for end users with disabilities. They also benefit users who are learning your language and users who want to catch your content but are in public without headphones. Transcripts and captions can even benefit your SEO strategy.</p> <p><img src="https://hidde.blog/_images/captioned.jpg" alt="video of Hidde presenting about accessibility tree with visible caption" /> <em>One of my own videos with captions turned on (<a href="https://www.youtube.com/watch?v=_GfelgpDLwI&t=130">It's the markup that matters on YouTube</a>)</em></p> <p>Writing out all recorded content isn't necessarily something you could do <em>today</em> as it can take a bit of time, especially if you have lots of content. I still felt I could include this common issue here, because most teams don't do this themselves and outsource the work to specialised agencies. These are costs you can budget for. If there is too much current content, you could consider starting with future or most popular content?</p> <p><strong>Project managers</strong> can make sure captioning and transcribing are part of any project that includes audio or video. <strong>Developers</strong> can ensure the CMS has fields for transcripts and captions. <strong>Designers</strong> can design the UI to allow for full transcript display. <strong>Social media managers</strong> can produce caption any videos for LinkedIn or Twitter.</p> <h2>Invalid HTML</h2> <p>There used to be a time when websites would proudly display a <a href="https://www.w3.org/QA/Tools/Icons">badge</a> that showed the current page was composed of valid HTML. These badges have disappeared from most websites, but validation is still a sound accessibility strategy.</p> <p>The HTML of web pages is parsed by lots of tools, like browsers and assistive technologies, if the HTML is invalid it can lead to unexpected bugs. Simon Pieters' <a href="https://htmlparser.info/">Idiosyncrasies of the HTML parser</a> is a great book about this, especially if you want a deep dive into what could possibly go wrong.</p> <p>Since HTML5, error handling is specified as part of HTML, which should improve unexpected bugs due to invalid HTML, but there are still plenty of accessibility problems you can find by validating your HTML. Did you accidentally nest a <code>&lt;button&gt;</code> inside of a <code>&lt;a&gt;</code>? The validator will call it out and help you prevent the myriad of problems that could cause.</p> <p>So… <strong>developers</strong> and <strong>test automation engineers</strong> can ensure HTML validation is included in tests.</p> <p>More: <a href="https://validator.nu/">validator.nu</a> that allows inputting HTML by URL, file upload or pasting is (can run from command line per <a href="https://github.com/validator/validator">instructions in README</a>)</p> <h2>Headings that don't describe their section</h2> <p>In HTML, headings (<code>h1</code>-<code>h6</code> elements) exist in the context of a section, they are supposed to describe the content that follows them. When I say section, I don't mean specifically content in a <code>&lt;section&gt;</code> (or other “<a href="https://html.spec.whatwg.org/dev/dom.html#sectioning-content-2">sectioning content</a>”), I mean more generically content that forms a logical part of a page, regardless of <a href="https://docsfordevelopers.com/">which</a> HTML element used.</p> <p>Descriptive headings are useful, because some users access <a href="https://hidde.blog/heading-structures-are-tables-of-contents/">headings in a page as a table of contents</a>. For example, your one page band website could have a “Discography”, “Tickets” and “Merchandise” headings. Your search application could have a filters section with a “Filters” heading. Some websites useheading tags (<code>h1</code>-<code>h6</code>) to mark up text that's “just” bigger or bolder, which will break the experience for people who navigate by headings, as it will add entries into their navigation that don't describe sections.</p> <p><strong>Content designers</strong> can ensure headings describe sections, and that things that don't describe sections aren't marked up as headings. <strong>developers</strong> can ensure that if there are headings in their front-end components, that they describe content and don't just exist for style reasons.</p> <h2>Can't do all things with just a keyboard</h2> <p>Accordions, tabs, ‘toggletip’ triggers… if your page or app has things that users can click on, they should also be usable with just a keyboard.</p> <p>Fixing this issue is great for people who can only use a keyboard, and for users with numerous other devices that may or may not be keyboard like (there's some examples in <a href="https://www.w3.org/WAI/people-use-web/">How people with disabilities use the web</a>).</p> <p>Often, this issue occurs when clickable elements are <code>div</code>s with a <code>click</code> handler. <strong>Developers</strong> can make sure they use a <code>button</code> element whenever things can be clicked (or <code>a</code> if it navigates to somewhere). Yes, you need some CSS to change the styling to your liking, but this is do-able, it makes it easier for you to get all of the web platform's buttonness in one package and, most importantly, your users will thank you.</p> <h2>Wrapping up</h2> <p>So, that's five more common accessibility issue that you could fix in your codebase today. I hope this is helpful to some readers. Should you still have questions about any of these, please feel free to contact me on Twitter (<a href="https://twitter.com/hdv">@hdv</a>) or via email.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/more-common-a11y-issues/">More common accessibility issues that you can fix today</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20More common accessibility issues that you can fix today">Reply via email</a></p> Accessibility from different perspectives 2022-05-22T00:00:00Z https://hidde.blog/a11y-perspectives/ <p>I worked in web accessibility in different setups: as a freelance developer specialised in accessibility, as a WCAG auditor and as a full time team member of the W3C's Web Accessibility Initiative. As a developer I would receive audit reports, as an auditor I would write them and as a WAI team member I would work on promoting and documenting the standards these audits are based on. An observation: in the developer role, advocating for accessibility can be the hardest in various ways.</p> <h2>Perspectives</h2> <p>Writing audit reports, a company would request in-depth feedback with the intent to fix stuff (ideally; sometimes it's just because the law says they have to 🤷). At WAI, I engaged with accessibility standards and practices on more of a meta level. When developing tools or resources, I never had to explain why I wanted videos to be captioned or have a visible focus indicator on the stuff we published, because everyone else on the team had worked with WCAG for years, often decades, and many had lived experienced to draw from.</p> <p>In the developer role, I had more responsibilities than ensuring accessibility, I also had to make sure our assets didn't break under an updated Content-Security-Policy, fix a deployment pipeline or figure out with which templating language my client could use their design system most widely. And then there was accessibility, my main interest and priority. I mean, why have a web app if it's inaccessible… I would often do that work under the radar, sometimes because other developers in the team weren't interested or skilled in that particular area, sometimes because I felt it would take more time to get extra time for a thing than to just do the thing.</p> <h2>Accessibility and support</h2> <p>Accessibility is hard to do bottom up, I found. In some cases, especially when working for government and non profits, accessibility would explicitly be in the requirements and or I would specifically be hired for that expertise. This was great and gave something to work with. In other situations, it was much more of a challenge. Time would go into making a business case (I learned about <a href="https://www.w3.org/WAI/business-case/">WAI's business case page</a> late), trying to get budget for external audits or screenreader licenses (procuring JAWS is no fun) and figuring out how to go about recruiting users with disabilities for user tests. And that's still the meta stuff.</p> <p>When it comes to writing code as an accessibility specialised developer, you can ensure you follow lots of users with disabilities and accessibility specialists to try and learn about implementation issues early. You can find lots of good resources. My favourite are blog posts by developers and accessibility specialists who have tested a solution with users and go at length to describe all the ifs and buts you need to understand the nuance and compromise. But let's be honest, if you want to rely on the official documentation (<a href="https://hidde.blog/whats-normative-in-wcag">normative</a> or not) that is also used by browsers and assistive technologies, it can be pretty difficult to find out exactly what to do.</p> <h2>Gaps in documentation</h2> <p>There are systematic problems in accessibility standards documentation:</p> <ul> <li>outdated examples are often not marked as outdated and hardly ever removed</li> <li>it is not always clear if examples are ready to use or merely displays of how stuff ‘should work’ if all browsers and assistive technologies followed the standards (a problem <a href="https://www.w3.org/WAI/ARIA/apg/practices/">ARIA Authoring Practices Guide</a> has)</li> <li>it's hard to find user-tested examples</li> <li>the guidance can be scattered across many places</li> </ul> <p>From the standards org perspective this is all explainable. There is a lot of work on few plates, the consensus process and organisational structure have, besides benefits, an impact on how responsibilities can be and are distributed. It's understandable, but has an effect. It impacts how effectively developers (and designers, content editors etc) can build accessible products. Even if from the standards side of things, you can only do so much to try and have standards that are implemented interoperably by browsers <em>and</em> assistive technology makers. There are relatively few people in the space who specialise in this.</p> <h2>Channeling one's inner developer</h2> <p>From the auditor's perspective, as well as from the standards org perspective, accessibility looks different. The system is, sadly, ableist and almost every website you look at has accessibility conformance and usability issues… it has often frustrated me and made me more cynical than I want to be. You write down the same issues over and over, knowing they are just a few lines of code. I always had to channel my inner developer again, and remember what it can be like. Yes, removing the line <code>outline: none</code> is trivial, and it's extremely ableist to keep it in, but what can a developer do if the QA and/or design departments flag it as a bug and they're the only one on the team who ‘gets’ this need. Let's not blame the developer, let's blame the ableist system we all operate in. Or, as Adrian Roselli recently said, ‘arm developers’ with useful feedback so that they are more enpowered to make the changes (being an auditor often puts one in this somewhat rewarding position).</p> <p>I don't know where I'm going with this, but thinking about what I'd like to see for the web if I had a magic wand, I would want to see better accessibility documentation (clear, up to date and user tested), more engineering budget for compatibility between standards, browsers and assistive technologies and have legal requirements that make it so that serious organisations see accessibility like they see security and data protection. At least some if not all of these wishes are in progress, of course, in various places… they have been for years, I just wish ✨ change ✨ could be sooner.</p> <h2>Developer experience <em>and</em> user experience</h2> <p>Some say ‘user experience is more important than developer experience’, and I'm all for that sentiment. Of course. Web accessibility is all about users with disabilities. That's the point of it. Developers ‘just’ need to do the job.</p> <p>But companies who make products they want developers to use effectively, like browsers, have dedicated developer experience teams to try and ensure that developers can use their stuff well. To try and set them up for success. In their case, that makes good business. Might we, as the accessibility field, also benefit from better developer experience (of web accessibility) to get to more widely spread <em>user</em> experience?</p> <p>What if standards orgs hired content designers, like governments with similarly complex content do so successfully? Isn't <em>explaining</em> standards essential when <em>making</em> standards? In the majority of cases, an inaccessible pattern can be addressed in code, by developers. Might some focus on developer experience be a sensible means to an end? If it was less frustrating to find out how to build, say, a combobox, in practice not in theory, we would more easily get to the end goal: less frustrating experiences to end users.</p> <p>Besides a focus on quality of documentation, I feel like we should keep the individual developer's perspective in mind, acknowledging they may have constraints beyond their control. We could contribute to fight those constraints by providing executives and team leads with the right tools too. We've got to set teams up for success. That way we all win.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/a11y-perspectives/">Accessibility from different perspectives</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Accessibility from different perspectives">Reply via email</a></p> ATAG: the standard for accessibility of content creation 2022-05-29T00:00:00Z https://hidde.blog/content-creation-accessibility/ <p><a href="https://www.w3.org/TR/ATAG20/">ATAG</a> is a set of guidelines for the accessibility of authoring tools. In this post I'll talk about what it is and why it matters.</p> <p>Most people working on websites will be familiar with <a href="https://www.w3.org/TR/WCAG21/#dfn-technologies">WCAG</a>, the Web Content Accessibility Guidelines. There are two more related standards, one for user agents (like browsers) and one for authoring tools (like CMSes, WYSIWYG or Markdown editors, e-learning platforms and website creators). They work together: if we care about the accessibility of web content, we should also care about how it is created (in authoring tools) and displayed (in user agents).</p> <img src="https://hidde.blog/_images/typewriter.jpg" alt="vintage typewriter illustration" /> <p>“Web content” in accessibility standards refers to websites, apps and other content on the web. I like to think of it as the HTML that browsers serve to the user when they access your website or app. There isn't a definition for “web content” in WCAG, but there is one for “<a href="https://www.w3.org/TR/WCAG21/#dfn-technologies">web content technologies</a>”. From that definition we can draw that web content includes anything that is <em>rendered by user agents</em>, like HTML and SVGs.</p> <h2>Why ATAG matters</h2> <p>Better accessibility of content tools is critical for three reasons:</p> <ol> <li>Everyone should be able to create content for the web, regardless of disability.</li> <li>Authoring tools are in between the user and the HTML they create.</li> <li>The authoring tool can have the unique ability to prevent inaccessibility.</li> </ol> <p>Let's look at these reasons in a little more detail.</p> <h3>Content creation is for everyone</h3> <p>‘The web is for everyone’, as web inventor Tim Berners-Lee likes to say, applies as much to accessing websites as it does to creating them. His <a href="https://www.w3.org/People/Berners-Lee/WorldWideWeb.html">first browser</a> had both viewing and editing capabilities, so clearly the web was always meant to be about both consumption and creation. Many of us love to create vlogs, set up online classes, publish recipes, tweet, make TikToks, create art… this should just work for people with or without disabilities. If content creation tools have barriers, that's everyone's loss.</p> <p><img src="https://hidde.blog/_images/first-browser.gif" alt="screenshot, shows bunch of windows including CERN experiments, CERN Welcome and The World Wide Web Library. Screenshot is linked from and described in the page linked on this page with the “first browser” link" /> <em>The first web browser, “WorldWideWeb”, was also an editor.</em></p> <p>In business, it would be illogical (and illegal) if you couldn't hire content professionals with disabilities, just because they can't use your content tools. In your company today, Harry from marketing might be able to use a mouse, but when he leaves his successor might only use keyboards.</p> <h3>Support for all of HTML</h3> <p>The second part to authoring tool accessibility is their ability to output accessible content. Imagine two tools to create bulleted lists. One does this with <code>div</code>s and images of bullets, the other uses the standard <code>ul</code> and <code>li</code> elements. The latter is what we need, and not just when dealing with lists, but for all kinds of markup:</p> <ul> <li><code>tables</code> with <code>caption</code>s</li> <li><code>videos</code> with <code>track</code> elements and <code>muted</code> and <code>autoplay</code> attributes</li> <li><code>fieldset</code>s with <code>legend</code>s</li> <li>images with <code>alt</code> attributes</li> <li>translated content with <code>lang</code> attributes</li> </ul> <p>Not all tools let you create all or these structures, at which point they basically become the accessibility issue.</p> <h3>Authoring tools as accessibility assistants</h3> <p>Even cooler than outputting sensible and appropriate markup, authoring tools could provide hints. They could try to be a helpful “<a href="https://talks.hiddedevries.nl/WOsDsG/your-cms-is-an-accessibility-assistant">accessibility assistant</a>”, by point our potential barriers when they notice you're creating them. For instance, if an authoring tool lets you pick a foreground and background colour, it could warn you when you pick two colours that have insufficient contrast.</p> <p>ATAG recommends various ways of assisting with making content more accessible: accessible default components and templates, solid documentation and, as described above, suggestions and hints.</p> <h2>Who meets ATAG</h2> <p>At the time I am writing this, I am not aware of any authoring tools that meet 100% of ATAG, as in, all criteria at level A or AA. That doesn't mean all is lost, every bit helps and there are a lot of authoring tools that meet many bits of the standard.</p> <p>With the <a href="https://www.w3.org/WAI/atag/report-tool/">ATAG Report Tool</a>, people can create a report with specific details about which parts of ATAG they do or do not meet.</p> <img src="https://hidde.blog/_images/atag-report-tool.png" alt="ATAG Report Tool screenshot" /> <p>As described above, there are lots of good reasons to try and meet ATAG. It is a worthwhile pursuit for authoring tool makers and a worthwhile request for procuring departments to put in tenders.</p> <h2>What's in ATAG</h2> <p>There are two parts to the ATAG standard:</p> <ul> <li>editing experience (part A): does the tool work for people with disabilities?</li> <li>output (part B): does the tool output accessible content?</li> </ul> <p>If you're still with me, I'd like to describe ATAG in a bit more detail. Like <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1">WCAG</a>, ATAG has Principles, Guidelines and Success Criteria. In the following sections, I will discuss the Principles and Guidelines in my own words. Full and official wording is in the <a href="https://www.w3.org/TR/ATAG20/">ATAG 2.0</a>, published by the W3C. <em>This is not legal advice.</em></p> <h3>Authoring tool UI meets accessibility guidelines</h3> <ul> <li><em>Web-based functionality is accessible</em>:<br /> The full editing experience conforms to WCAG 2.0 or other accessibility guidelines. (A.1.1)</li> <li><em>Non-web-based functionality is accessible</em>:<br /> The interface conforms to platform-specific accessibility guidelines. (This one specifically applies to authoring tools that are not web-based, which was more common when ATAG came out) (A.1.2)</li> </ul> <h3>Editing UI is perceivable</h3> <ul> <li><em>Alternative content available to editors</em>:<br /> If there is anything visible that is not text, like icons, images or video, there is alternative text available. (A.2.1)</li> <li><em>What's indicated visually in the UI can be programmatically determined</em>:<br /> Status indicators (like changes or spelling errors) and text properties (like italics or bold) are conveyed to users of assistive technologies. (A.2.2)</li> </ul> <h3>Editing UI operable</h3> <ul> <li><em>Works with keyboard</em>:<br /> Everything that can be done with a mouse, can just as easily be done with a keyboard, including drag and drop and drawing capabilities. There should be no keyboard traps. Keyboard usage should be efficient and easier to use than just with sequential access (for example: use WAI-ARIA landmarks or offer keyboard shortcuts). (A.3.1)</li> <li><em>Enough time</em>:<br /> Time limits in the editor, like for auto-save, can be turned off or extended (some exceptions apply). (A.3.2)</li> <li><em>Flashing content optional</em>:<br /> Flashing content, like videos, including previews of that kind of content, can be paused or turned off. (A.3.3)</li> <li><em>Content can be navigated by structure</em>:<br /> Users can navigate quicker by structure, for example headings, lists or HTML elements. (A.3.4)</li> <li><em>Content searchable</em>:<br /> Users can search in text content, results are focused when shown. If there are no matches, this is indicated. User can search in two directions (backwards and forwards). (A.3.5)</li> <li><em>Supports display preferences</em>:<br /> If there are user settings for display, this only affects the editing view, not the output. If a content editor uses OS settings like high contrast mode or their own stylesheet, this does not break the editing experience. (A.3.6)</li> <li><em>Previews are accessible</em>:<br /> When the tool shows a preview of the content, that preview is at least as accessible as in current browsers and other user agents. (A.3.7)</li> </ul> <h3>Editing UI is understandable</h3> <ul> <li><em>Helps editor prevent and correct mistakes</em>:<br /> The tool lets users undo changes and settings. (A.4.1)</li> <li><em>(Accessibility) features documented</em>:<br /> The tool has documentation for all features, including accessibility features. (A.4.2)</li> </ul> <h3>Fully automatic processes produce accessible content</h3> <ul> <li><em>Generates accessible markup</em>:<br /> When the tool generates markup, that markup is accessible. If accesssibility information is required, like alternative texts, the content editor is prompted to provide that information. (B.1.1)</li> <li><em>Preserves accessibility information</em>:<br /> If content is pasted from a word processor or converted from one format into another, any accessibility information is preserved. (B.1.2)</li> </ul> <h3>Supports producing accessible content</h3> <ul> <li><em>Accessible content production is possible</em>:<br /> If some options produce more accessible content than others, they are displayed more prominently. If properties and attributes can be set, those relevant for accessibility can also be set. (B.2.1)</li> <li><em>Editors guided</em>:<br /> Editors are guided to produce accessible content. (B.2.2)</li> <li><em>Text alternatives can be managed</em>:<br /> There is a tool for providing text alternatives to “non-text content”, like images, videos and data visualisation. (B.2.3)</li> <li><em>Accessible templates available</em>:<br /> There are accessible templates available. If there is a repository of templates, it is easy to find the ones that prioritise accessibility. (B.2.4)</li> <li><em>Accessible components/plug-ins available</em>:<br /> If any components or plugins are built-in to the tool, they are accessible. If there is a gallery of components or plug-ins, it indicates accessible options. (B.2.5)</li> </ul> <h3>Helps with improving the accessibility of existing content</h3> <ul> <li><em>Checks accessibility automatically</em>:<br /> Has built-in checks for common accessibility problems, for example a check to identify missing alternative text. (B.3.1)</li> <li><em>Helps content editors fix problems</em>:<br /> Provides suggestions to content editor about accessibility problems. (B.3.2)</li> </ul> <h3>Promotes and integrates accessibility features</h3> <ul> <li><em>Accessibility features prominent</em>:<br /> Accessibility features are on by default and a prominent part of the editing workflow. Documentation shows examples of how to create accessible content, for instance with example markup or screenshots. (B.4.1)</li> <li><em>Documentation promotes accessibility</em>:<br /> The tool provides suggestions to content editors about accessibility problems. (B.4.2)</li> </ul> <h2>Wrapping up</h2> <p>In summary, ATAG recommends two things:</p> <ul> <li>a fully accessible authoring tool interface (basically, one that meets WCAG)</li> <li>the possibility to produce accessible “web content” and help with that in the form of documentation, default templates and suggestions</li> </ul> <p>The instructions are more detailed in the standard, but that's what it comes down to in most cases.</p> <p>Though the standard is only met at most partially by most tools today, a wider landscape of ATAG-supporting tools would be fantastic for web accessibility (because <a href="https://hidde.blog/its-easier-when-you-do-it-earlier/">it's easier when you do it earlier</a>). Increasingly, authoring tool makers start to realise this and that is wonderful.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/content-creation-accessibility/">ATAG: the standard for accessibility of content creation</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20ATAG: the standard for accessibility of content creation">Reply via email</a></p> How I built a dark mode toggle 2022-06-20T00:00:00Z https://hidde.blog/dark-light/ <p>This site has had dark and light modes for a while, but it never offered any choice. If your system preference was “dark”, that's what you would get (unless you used <a href="https://hidde.blog/use-firefox-with-a-dark-theme-without-triggering-dark-themes-on-websites/">fancy browser flags</a>). Yesterday, I implemented a dark mode toggle, so that you can override that at your leisure. In this post I will talk about some of the choices I made along the way. Basically, it's a long winded way of saying why it took me so long.</p> <p>This is fun to fiddle around with, but really, it seems to me that all websites have this requirement, so why isn't this built into browsers? In other words, I agree with <a href="https://www.bram.us/">Bramus Van Damme</a>, <a href="https://www.bram.us/2022/05/25/dark-mode-toggles-should-be-a-browser-feature/">dark mode toggles should be a browser feature</a>. His post has more reasons: however you support light and dark modes, you will likely end up with code duplication somewhere, and toggles that live in developer land require JavaScript.</p> <h2>The choices</h2> <h3>HTML</h3> <p>There are a lot of HTML elements that you can use to give users a choice between one out of many options. Radio buttons and <code>&lt;select&gt;</code>s come to mind. A checbox could be an option too… if there is only one option, checkboxes too allow just the one option.</p> <p>I started out with radio buttons as I thought that was clever, and even ended up building the control all the way from coding a form a <code>fieldset</code>, <code>legend</code> and <code>options</code>. I went ahead to visually hide the control itself and then use the <code>:checked</code> pseudo class to only display the option that wasn't picked. In other words, when dark mode was on, the light mode option was visible and vice versa.</p> <p><img src="https://hidde.blog/_images/themeswitch.gif" alt="screen recording of dev tools and the toggle, in the dev tools the code is as described, with a form, fieldset, legend, options and svgs" /> <em>It's a whole form!</em></p> <p>It must have been late, because only when I started testing this with keyboard, a sanity check I do with all controls, I realised it didn't feel right. With a keyboard, you would need arrow keys to pick the other option and that feels weird, especially for a control that is styled to not look like radio buttons. I guess the lesson is: never style elements too far from their original purpose.</p> <p>I ended up going for just the one <code>button</code> element. To switch styles, I would need JavaScript either way, so I would not benefit from having a checkbox in this case. In <a href="https://adrianroselli.com/2019/08/under-engineered-toggles-too.html">Underengineered Toggles Too</a>, Adrian Roselli explains that the button makes sense if the control only works with JavaScript (check; we need to toggle a class or attribute to apply the CSS), if it only has true or false states, not mixed (check; we allow either light or dark) and if flipping the control immediately performs an action (check; the color scheme changes straightaway). The great thing about a <code>button</code> element, just for the record, is that it comes with keyboard support built-in. No extra cost.</p> <p><img src="https://hidde.blog/_images/swt.gif" alt="screen recording of dev tools and the toggle, in the dev tools the code is a button" /> <em>It's a button!</em></p> <p>One button, like mine, does mean that users can't explicitly choose that they want my site to follow their browser or OS setting. In his post <a href="https://kilianvalkhof.com/2020/design/your-dark-mode-toggle-is-broken/">Your dark mode toggle is broken</a>, Kilian Valkhof makes the case for including a “system” setting that would solve this very problem.</p> <h3>CSS</h3> <p>With CSS, I made the button look like <em>not</em> a button. I <a href="https://www.a11yproject.com/posts/how-to-hide-content/">visually hid the text inside of it</a>. I also added an SVG icon that I applied <code>pointer-events: none</code> to, so that clicks on the SVG would be registered as clicks on the button.</p> <h3>JavaScript</h3> <p>In script, I wanted a couple of cases to be covered. Let's walk through the various parts of the implementation.</p> <p>First, I stored the button and the query to find out if a dark color scheme is preffered, and created an empty variable for the current theme:</p> <pre class="language-javascript"><code class="language-javascript"><span class="token keyword">var</span> button <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">querySelector</span><span class="token punctuation">(</span><span class="token string">'.theme-selector'</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token keyword">var</span> prefersDark <span class="token operator">=</span> window<span class="token punctuation">.</span><span class="token function">matchMedia</span><span class="token punctuation">(</span><span class="token string">'(prefers-color-scheme: dark)'</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token keyword">var</span> currentTheme<span class="token punctuation">;</span></code></pre> <p>I also added a function to set a theme, which adds an attribute to the <code>html</code> element and stores the preference in <code>localStorage</code>:</p> <pre class="language-javascript"><code class="language-javascript"><span class="token keyword">function</span> <span class="token function">setTheme</span><span class="token punctuation">(</span><span class="token parameter">currentTheme</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token keyword">var</span> pressed <span class="token operator">=</span> currentTheme <span class="token operator">===</span> <span class="token string">'dark'</span> <span class="token operator">?</span> <span class="token string">'true'</span> <span class="token operator">:</span> <span class="token string">'false'</span><span class="token punctuation">;</span> document<span class="token punctuation">.</span>documentElement<span class="token punctuation">.</span><span class="token function">setAttribute</span><span class="token punctuation">(</span><span class="token string">'data-theme-preference'</span><span class="token punctuation">,</span> currentTheme<span class="token punctuation">)</span><span class="token punctuation">;</span> localStorage<span class="token punctuation">.</span><span class="token function">setItem</span><span class="token punctuation">(</span><span class="token string">'theme-preference'</span><span class="token punctuation">,</span> currentTheme<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>Then I figured out what the theme should be. First I checked if there is something in localStorage, if not if there is a preference for dark mode, and if not, I set it to default to light mode:</p> <pre class="language-javascript"><code class="language-javascript"><span class="token keyword">if</span> <span class="token punctuation">(</span>localStorage<span class="token punctuation">.</span><span class="token function">getItem</span><span class="token punctuation">(</span><span class="token string">'theme-preference'</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> currentTheme <span class="token operator">=</span> localStorage<span class="token punctuation">.</span><span class="token function">getItem</span><span class="token punctuation">(</span><span class="token string">'theme-preference'</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>prefersDark<span class="token punctuation">.</span>matches<span class="token punctuation">)</span> <span class="token punctuation">{</span> currentTheme <span class="token operator">=</span> <span class="token string">'dark'</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span> <span class="token comment">// default</span> currentTheme <span class="token operator">=</span> <span class="token string">'light'</span><span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>We also want ways to change the theme. First off, when the user clicks the button:</p> <pre class="language-javascript"><code class="language-javascript">button<span class="token punctuation">.</span><span class="token function">addEventListener</span><span class="token punctuation">(</span><span class="token string">'click'</span><span class="token punctuation">,</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token parameter">event</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> currentTheme <span class="token operator">=</span> document<span class="token punctuation">.</span>documentElement<span class="token punctuation">.</span><span class="token function">getAttribute</span><span class="token punctuation">(</span><span class="token string">'data-theme-preference'</span><span class="token punctuation">)</span> <span class="token operator">===</span> <span class="token string">"dark"</span> <span class="token operator">?</span> <span class="token string">"light"</span> <span class="token operator">:</span> <span class="token string">"dark"</span><span class="token punctuation">;</span> <span class="token function">setTheme</span><span class="token punctuation">(</span>currentTheme<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> <p>Secondly, when the user changes their theme preference:</p> <pre class="language-javascript"><code class="language-javascript">prefersDark<span class="token punctuation">.</span><span class="token function">addEventListener</span><span class="token punctuation">(</span><span class="token string">'change'</span><span class="token punctuation">,</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token parameter">event</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> currentTheme <span class="token operator">=</span> event<span class="token punctuation">.</span>matches <span class="token operator">?</span> <span class="token string">'dark'</span> <span class="token operator">:</span> <span class="token string">'light'</span><span class="token punctuation">;</span> <span class="token function">setTheme</span><span class="token punctuation">(</span>currentTheme<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> <p>(This listens to changes in the browser's <a href="https://www.w3.org/TR/cssom-view-1/#the-mediaquerylist-interface">MediaQueryList</a>, which could change when the setting is changed in the browser or the OS).</p> <p><img src="https://hidde.blog/_images/theme-setting-fx.png" alt="Website appearance setting, that allows to choose between Nightly theme, System theme, Light or Dark" /> <em>In Firefox, you can pick light or dark mode, if you don't want it to just follow the system or your choice of Firefox theme. There is no per website setting at the time of writing.</em></p> <h3>ARIA</h3> <p>In my book, it's ideal to only use ARIA when it is for something that:</p> <ol> <li>doesn't exist in HTML</li> <li>brings a known benefit to end users</li> </ol> <p>In this case, we're using a standard <code>button</code> element, which exists in HTML. But there is one detail about it that doesn't exist in HTML, which is that this is the type of button <em>that toggles</em>. We can add this by setting the <a href="https://www.w3.org/TR/wai-aria-1.2/#aria-pressed"><code>aria-pressed</code> </a> with a <code>&quot;true&quot;</code> or <code>&quot;false&quot;</code> value.</p> <p>This brings a known benefit to end users, specifically to users of screenreaders, who will now hear this is a toggle button. For toggle buttons, it is important that the content doesn't change. As the button text, I have used “Toggle dark mode”.</p> <p>If we would update the label of the button from “Turn on light” to “Turn on dark”, we kind of have a toggle (<a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed#description">as MDN suggests</a>), but that way, it wouldn't be recognised by the browser and set in the accessibility tree to <em>be</em> a toggle, and, because of that, not announced as a toggle by screenreaders.</p> <h2>Compromises</h2> <h3>Code duplication</h3> <p>In <a href="https://www.bram.us/2022/05/25/dark-mode-toggles-should-be-a-browser-feature/#the-problem-with-dark-mode-toggles">his post</a>, Bramus explains that when you want to build a dark mode toggle, you will end up with duplicated CSS. That is, if you both want to see color changes support the <code>prefers-color-mode</code> media query, and the class or attribute that you're toggling with your toggle. I went for not supporting that media query directly in CSS. Instead, I rely on my script to set the right data attribute. This means that without JavaScript, users will only see the light mode, even if their system or browser setting is to use dark mode.</p> <h3>Honouring the system preference</h3> <p>As mentioned above, my toggle doesn't have a “do whatever the system does” setting. However, when you change the system setting, it will notice and use that system setting. That is, until you change your preference again, either via the toggle or the system setting.</p> <h3>Many themes</h3> <p>The toggle I ended up with can only swap between two states. Initially I had wanted it to work for any number of states, I mean, why not have lots of different themes between light and dark? It's tricky, because how do those two settings, that the media query currently supports checks for, map to my many themes? This may be something for future iterations, probably with some way to map two specific themes to be the browser's “light” and ”dark”.</p> <h2>Summing up</h2> <p>To build a dark mode toggle is an exercise full of compromises. There are many ways that, proverbially, lead to Rome, as you can read above. I was happy enough with the current result to ship it for now, but am more than open to feedback.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/dark-light/">How I built a dark mode toggle</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20How I built a dark mode toggle">Reply via email</a></p> “That's not accessible!” and other statements about accessibility 2022-06-30T00:00:00Z https://hidde.blog/accessibility-objectivity/ <p>“We're 100% accessible”, some digital products claim. “That solution is inaccessible”, an accessibility specialist might say. These sorts of statements almost suggest that web accessiblity is a binary thing. Is it though?</p> <p>In this post, I'll talk about why it's most helpful to see a website's accessibility as a continuum (or, you know, multiple continua). Even then, in some contexts, it makes sense to pretend it is binary.</p> <p><em>If you find this interesting, but want actionable advice, see also Adrian Roselli's post <a href="https://adrianroselli.com/2024/08/things-to-do-before-asking-is-this-accessible.html">Things to Do Before Asking “Is This Accessible?”</a></em></p> <h2>It is a spectrum</h2> <p>The accessibility of a website is a spectrum, in terms of different disabilities that exist, in terms of timing and in terms of objective claims.</p> <p>The goal of web accessibility is that <a href="https://www.w3.org/WAI/people-use-web/">people with disabilities can use the web</a>. In other words, <strong>it is about people</strong> and maximising the portion of people who can use our UI well. There are people who can't move their arms, who use their screen zoomed in, whose vision is blurry, who control their computer with their voice, and so forth. Accessibility is about people with a wide range of disabilities, that sometimes overlap, too. Our UI could be accessible to most or all of these people, or to some, or to none. Most products are accessible to at least some people with disabilities. Many have specific barriers for users from specific groups. Some do really well at continuously identifying barriers and removing them. Some don't.</p> <p>Second, <strong>it is about timing</strong>: today all podcasts on our site may be transcribed, tomorrow we may upload an episode without a transcript. Or launch a new campaign that was done by this agency that didn't take all accessibility requirements into account. It happens. Accessibility can't be solved once and then shipped, it's a continuous process of tracking potential barriers and removing them. “That site is accessible” is a statement that changes over time on websites where content changes.</p> <p>Third, accessibility conformance testing is <strong>subjective to some extent</strong>. This isn't a bug in accessibility standards, it's more like a most reasonable choice… If we tried hard, we could invent success criteria that can be evaluated with 100% certainty, but then we would need many of them, they might go out of date fast and they might end up a lot less technology agnostic. The subjectivity serves a purpose, but it's there, and again, a reason that a claim like “this is accessible” is hard to make.</p> <p>So, basically, there is a degree of subjectivity in determining whether something is accessible, because it matters to which user(s), when it is checked and what is checked. For that reason, a statement like “this is accessible” or “this is not accessible” is best taken with a pinch of salt.</p> <h2>Why pretend it's not</h2> <p>A claim of “great accessibility” is subjective, a bit like “great user experience” and “great design”. Especially when you view “meeting WCAG” as a minimum and aim much higher by doing regular user testing and following best practices beyond WCAG (see my other post about <a href="https://hidde.blog/subsets-and-supersets-of-wcag/">using a superset of WCAG</a>). But sometimes it makes sense to try and make <em>formal</em> and <em>objective-like</em> claims about the accessibility of a website or set of websites. To publish reports that say things like “60% of webshops in Germany are inaccessible” or “Only 10% of online banking is accessible”. Those are usually based on automated tests and/or accessibility conformance reports that refer to standards like WCAG.</p> <p>One example of when it makes sense to pretend accessibility is objective, is the effectiveness of policy. National governments and organisations like the European Commission want to have a more accessible web, they have this as a <a href="https://digital-strategy.ec.europa.eu/en/policies/web-accessibility">policy goal</a>. For that to be more than dreams or empty statements, they need to make it practical and tangible. Their method of measuring success is, roughly speaking, to gather accessibility statements and conformance reports. On the one hand, this reduces the experiences of people with disabilities to checking boxes in a standard, on the other hand, this provides insights at scale, while maintaining a reasonably good representation of individual experiences.</p> <p><a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1">WCAG</a> is used as a way to make statements about websites. Combined with a method like <a href="https://www.w3.org/TR/WCAG-EM/">WCAG-EM</a>, a detailed process for evaluating conformance published by the W3C, governments can get some level of certainty.</p> <p>As an example, The Dutch government has a <a href="https://toegankelijkheidsverklaring.nl/register?w=&amp;page=68">register of over 3500 accessibility conformance statements</a>. They are each about a specific website, to which a rating between A (“fully meets WCAG”) and D (“does not meet WCAG”) is assigned. Rating E means “statement is missing”. Other efforts include <a href="https://www.allable.co.uk/research/accessibility-statements-v4">AllAble's accessibility statements research</a>, looking at accessibility statements from public sector bodies in the United Kingdom.</p> <p>Of course, this approach is not perfect. Individual organisations might be using an auditing agency that is biased or not very good at evaluating WCAG. Some might self-evaluate (generally not a good idea). Or a website could have serious accessibility issues that happen to not be captured by WCAG (it happens). But even with some of those caveats in mind, even if the data is not 100% objective (is data ever?), collecting information from a large set of websites is the best a government can do. Regular formal WCAG/ATAG audits is a great thing for companies and organisations to do too, though ideally that strategy is supplemented by regular user tests and review of best practices.</p> <h2>Wrapping up</h2> <p>In summary: yes, measuring web accessibility is somewhat subjective and claims like “X is accessible” or “X is inaccessible” are tricky. If someone makes such statements, grab a pinch of salt! But, having said that, it can be helpful to talk about accessibility as “meets the criteria in this standard” and “does not meet the criteria in this standard”. Governments do this to measure the success of their policies and companies can do it to have some measurement of their own success. That's mostly useful, even though user tests and best practices based on them are even more meaningful.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/accessibility-objectivity/">“That's not accessible!” and other statements about accessibility</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20“That's not accessible!” and other statements about accessibility">Reply via email</a></p> Two talks about documentation 2022-07-01T00:00:00Z https://hidde.blog/making-documentation/ <p>In two recent conference talks, I learned about making better documentation. First, I heard <a href="https://twitter.com/adrienneTacke/">Adrienne Tacke</a> focus on the documentation's content, explaining how to make it more usable and effective. Then I saw <a href="https://twitter.com/Rich_Harris">Rich Harris</a> go into how to build a documentation environment, showing a way to approach documentation of projects with a server-side components.</p> <p>Both talks resonated with me. Good documentation is the backbone of every software project (and also crucial elsewhere, including <a href="https://hidde.blog/a11y-perspectives/#heading-3">for web standards like WCAG</a>). For software companies there are countless business reasons to invest in documentation, and for anyone else, yes, improving documentation is still rewarding in many ways.</p> <h2>Types of documentation</h2> <p>To clarify what we're talking about here, Daniele Procida's <a href="https://diataxis.fr/">Diátaxis framework for technical documentation</a>, which I found out about in Rich's talk, identifies four types of documentation:</p> <ul> <li><strong>tutorials</strong>, to teach people how to use the thing in the first place</li> <li><strong>how-to guides</strong>, to teach an experienced user how to do specific things with your tool</li> <li><strong>explanation</strong>, to give a high level overview of concepts in your tool</li> <li><strong>reference documentation</strong>, to provide matter-of-fact information about functions, APIs etc, to be consulted not read; can be automatically generated</li> </ul> <p>Adrienne's and Rich's talks focused mostly on the first two: tutorials and how-tos.</p> <h2>Be concise and valuable</h2> <p>In her talk, <a href="https://www.youtube.com/watch?v=wBGOswx6MSw">Documentation: the missing pieces</a>, Adrienne went into some very common problems in documentation. She showed how documentation can be unclear and unhelpful, and then went on to show how to be concise and valuable instead. The whole talk is a must watch, but here are some highlights:</p> <ul> <li>be more explicit, by expanding acronyms (they can depend on context and not all acronyms are familiar to everyone) and by using the <a href="https://chrisdone.com/posts/german-naming-convention#german-naming-convention">German naming convention</a> (if you can be more explicit in a variable name, do it)</li> <li>be aware of the steps in what you are teaching and avoid <em>skipping</em> steps at all times; this is another moment of stepping (no pun intended) into the shoes of the reader of your documentation, they don't know your project as well as you do, so you want to be explicit and list all gotchas</li> <li>avoid surprises, always tell readers what they will need to make their way through the tutorial (prerequisities, dependencies, paid plans, time)</li> <li>focus on the thing you want folks to learn and help abstract the unrelated setup and configuration stuff away, by creating a starter app, Docker container or sandboxed environment, anything that isn't core to the thing you're currently teaching, but still needs to exist in order for the reader to get started</li> </ul> <h2>Interactive tutorials with a server-side component</h2> <p>In <a href="https://youtu.be/RwBolXX9Pis?t=40">his recent JS Nation talk</a> (start at 40s to avoid the crypto advertisement edited into the video 🥲), Rich explained tutorials are essential, as they actually show users what to do, but they are often overlooked. He showed <a href="http://learn.knockoutjs.com/">Learn Knockout</a>, a very early example of a tutorial he loved, and which <a href="https://svelte.dev/tutorial/">the Svelte Tutorial</a> was later inspired by, and others, like <a href="https://lit.dev/tutorials/intro-to-lit/">Lit tutorial</a>, that follow the same model.</p> <p>For the documentation of Svelte and SvelteKit, the frameworks he created, Rich used four principles:</p> <ul> <li>create a sandboxed environment, so that it is safe to make mistakes</li> <li>help muscle memory by disabling copy/paste (controversial!)</li> <li>provide a way to get straight to the solution if you're stuck (Rich calls this “panic button”)</li> <li>meet users where they are (in Svelte/SvelteKit's case: the browser)</li> </ul> <p>Sandboxes for “full stack” projects need both a client and a server component. Some services provide a way to access a virtual server from a sandbox (like <a href="https://codesandbox.io/post/announcing-codesandbox-containers">CodeSandbox Containers</a>), but they have authentication barriers, to avoid abuse (like bitcoin mining) and can come with some latency, Rich explained. Then he found that on <a href="https://stackblitz.com/">Stackblitz</a>, the server is, rather impressively, ran <em>inside the browser</em> by compiling Node to WebAssembly and running that inside the browser's security sandbox (this is called <a href="https://blog.stackblitz.com/posts/introducing-webcontainers/">WebContainers</a>). And that wasn't enough: as he found a StackBlitz environment is made for coding, not learning, Rich teamed up with the StackBlitz team to have some kind of headless version of StackBlitz in order to create what's now in beta as <a href="https://learn.svelte.dev/">learn.svelte.dev</a>.</p> <h2>Summing up</h2> <p>While these talks were about different aspects of documentation, the speakers were equally determined to ensure that users of their documentation would actually learn the thing easily. It's not easy, neither when creating the content, nor in technically setting up the environment, but it can clearly make a difference.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/making-documentation/">Two talks about documentation</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Two talks about documentation">Reply via email</a></p> Two levels of customising <selectlist> 2022-07-04T00:00:00Z https://hidde.blog/custom-select-with-selectlist/ <p>The proposed <code>&lt;selectlist&gt;</code> will have powerful styling options <em>and</em> full control over the different parts. In other words, there would be not one, but two levels of customisation. In this post, we'll look at what they are and when they are useful.</p> <p><code>&lt;selectlist&gt;</code>, you ask? It's a <a href="https://open-ui.org/components/selectlist/">proposed new HTML element</a> that is like <code>&lt;select&gt;</code>, but fully customisable. Why? Because so many people are building their own selects, from scratch or with libraries, and that should be easier to do. With accessible defaults where possible and by leaving the parts that browsers are good at to the browser (like knowing where to position it, to place it on the top layer or to automatically dismiss it when appropriate (‘light dismiss’)).</p> <p>For context, <code>&lt;selectlist&gt;</code> is a proposal by the <a href="https://open-ui.org/">Open UI Community Group</a>. This group was founded to study common components and controls that people build on the web (in design systems, see the <a href="https://open-ui.org/research/component-matrix">component name matrix</a>), and suggest Web Platform features to make it easier to build such controls. Think new HTML elements, CSS features or APIs, as well as things that surface across HTML, CSS and JS.</p> <p><a href="https://open-ui.org/" style="display:block"><img src="https://hidde.blog/_images/openui-logo.png" alt="Open UI homepage" /></a></p> <p><code>&lt;selectlist&gt;</code> doesn't ‘exist’ just yet, it is an idea that is being prototyped in Chromium, with other browser engines currently not opposed, but also not implementing it (as far as I'm aware). While you would't use it in projects yet, you <a href="https://open-ui.org/prototypes/selectmenu"><em>can</em> experiment with it</a> in Chrome or Edge Canary with Experimental Web Platform Features flag on, and <a href="https://github.com/openui/open-ui/issues">file issues</a> if something doesn't work as expected or desired. For brevity, this post will refer to it as if it exists, to avoid saying ‘would’ in every sentence.</p> <h2>The anatomy of a <code>&lt;selectlist&gt;</code></h2> <p>The <code>&lt;selectlist&gt;</code> element, as currently prototyped, is a lot like the <code>&lt;select&gt;</code> element that we've had for years. We can use it in a form, users can select an option out of many and their choice becomes part of the data that we process.</p> <p>But where a <code>&lt;select&gt;</code> comes with free built-in styles that we can't change, <code>&lt;selectlist&gt;</code> consists of some explicitly designed parts that can be changed (more on that a later). Often, the browser built-in styles of a <code>&lt;select&gt;</code> are just fine, sometimes they are not.</p> <p><img src="https://hidde.blog/_images/selectmenu-anatomy.png" alt="example of the parts described in this section, the example is a WYSIWYG style dropdown where the options for heading types have different sizes" /> <em>In Sanity's Portable Text editor, the user can choose text types. Each option is styled like something of that type is commonly styled, and there is some shadows, rounded corners and arrows that a regular <code>&lt;select&gt;</code> can't have.</em></p> <p>The parts are:</p> <ul> <li><code>select</code>, the root element, wrapping/containing all the parts</li> <li><code>button</code>, the toggle/button the user activates to open the options</li> <li><code>listbox</code>, the part that is toggled, it wraps the options</li> <li><code>optgroup</code>, a part that we can optionally use to group related options together</li> <li><code>option</code>, an actual choice, a value that a user can pick</li> <li><code>selected-value</code>, the element that displays the currently selected value</li> </ul> <p>(from: <a href="https://open-ui.org/prototypes/selectmenu">Anatomy of the selectmenu</a>)</p> <p>When using regular <code>&lt;select&gt;</code>s, it is possible to make the button part look however we want. In some browsers, we can also apply some specific styles to options, like background colours.</p> <p>With <code>&lt;selectlist&gt;</code>, these parts are not just parts in the colloquial sense, they are <code>&lt;part&gt;</code>s in the Web Component sense, meaning that they exist as elements in the shadow tree of the component. Consequently, all of these parts can be changed.</p> <p>There are two levels to that: the first is to write CSS, where we can use all the power CSS has to offer, the second is to completely replace the DOM structure to what we want or need.</p> <h2>Option 1: CSS</h2> <p>In the <code>&lt;selectlist&gt;</code> prototype, the options are part of the (light) DOM like they are in a <code>&lt;select&gt;</code> element, which means we can target them with CSS (and unlike with <code>&lt;select&gt;</code>, our styles will actually get applied).</p> <p><img src="https://hidde.blog/_images/styling-options.jpg" alt="Codepen screenshot with <option> elements in HTML, and styles applies by targeting with option--h1, option--h2 as the selector, plus a preview. " /> <em>You could even give each option its own style! See <a href="https://codepen.io/hidde/pen/XWZyNqg?editors=1100">Codepen</a> (view in Canary with Experimental Web Platform Features flag on)</em></p> <p>This is the most basic example of styling a selectmenu: you apply CSS to the options, like you would to any other HTML element.</p> <p>The other parts of the selectmenu are targeted differently: we'll use a <code>::part()</code> selector referencing the respective part name.</p> <p><em>Deprecation warning: this is currently under discussion; the final implementation will likely use elements and not ::part() to select parts of a selectlist</em></p> <p>For example, to style the button:</p> <pre class="language-css"><code class="language-css"><span class="token selector">selectmenu::part(button)</span> <span class="token punctuation">{</span> // add any button styles <span class="token punctuation">}</span></code></pre> <p>(<a href="https://codepen.io/hidde/pen/JjpeKQP">Codepen of example with styled options</a>)</p> <p>To style other parts, you use that part's name instead, for instance <code>::part(listbox)</code>. Just last week, a resolution was passed to <a href="https://github.com/openui/open-ui/issues/548#issuecomment-1171538107">also expose the arrow as a part</a>, to allow for easy styling or icon-replacing (part name to be decided).</p> <p>In case you, like me, had not used the <code>::part</code> selector, it is part (no pun intended) of the <a href="https://www.w3.org/TR/css-shadow-parts-1/">CSS Shadow Parts module</a>.</p> <p>For background: Web Components can have a <em>light</em> and a <em>shadow</em> DOM. The light DOM is part of the DOM like anything else and can be styled, but the shadow DOM is internal to the element. This a bit like public and private functions. For styling purposes, the CSS Shadow Parts module states that the creator of a Web Component can choose to expose parts of their shadow DOM by names. Developers provide a list of parts (element names) to be exposed, and then the elements can be targeted through <code>::part(partname)</code>. With <code>&lt;selectlist&gt;</code>, we get a browser built in Web Component that has parts exposed (except for <code>option</code>, which is in the light DOM).</p> <p>This is huge… I mean, being able to throw CSS at the different parts of a selectmenu unlocks a lot of possibilities. Many of us will likely just use it to round some corners, add some shadows, maybe a little color or typography. And that's fine, we never could unless we built or loaded a library for custom selects.</p> <p>I'm excited about being able to add a few finishing touches to selects, alone. But CSS has numerous powerful features, so that's only the surface. With all of CSS at our fingertips, custom selectmenu styles are probably going to be used in more interesting ways than we can think of now.</p> <h2>Option 2: full control by replacing parts</h2> <p>If we need more than ‘just’ styles, it is also possible to replace entire parts with whatever we like. For instance, we could write our own button entirely, and tell the browser to use that instead.</p> <p>Replacing a part is done with slots. Let's say we created a button with markup of our choice:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span><span class="token punctuation">></span></span>select option<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span></code></pre> <p>We can then tell the browser that, actually, we want this to be what the button part is, adding <code>slot=&quot;button&quot;</code> and <code>behavior=&quot;button&quot;</code>:</p> <p><em>Deprecation warning: this will probably not work this way in the final implementation</em></p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">slot</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>button<span class="token punctuation">"</span></span> <span class="token attr-name">behavior</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>button<span class="token punctuation">"</span></span> <span class="token punctuation">></span></span>select option<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span></code></pre> <p>(<a href="https://codepen.io/hidde/pen/XWZyNqg?editors=1100">Codepen of example with replaced button part</a>)</p> <p>Now, the button will be what's used for the part called ‘button’ (as it is slotted into the right place with <code>slot</code>) and get the browser's select button behavior and accessibility accomodations (set through <code>behavior</code>). We could do the same for the other parts.</p> <p>We could also do this in JavaScript, with <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow"><code>Element.attachShadow()</code></a>, so that the markup we want to use can live in our JS, and we only need one HTML element at the point of usage rather than one plus a few more for slotting.</p> <p>But wait… if we're replacing all the parts with our own things, isn't this just like rolling our own selects entirely? Well, yes, it is the advanced option, and usually CSS should suffice. But even if we replace some or many parts, the selectmenu would still get a bunch of things from the browser for free, like positioning, being on the top layer and light dismiss, features that would be hard to impossible to code in JavaScript.</p> <h2>Accessibility risk: avoid unexpected nests</h2> <p>There is an important accessibility risk to be aware of for folks planning to replace parts in their selectmenus. Browsers and assistive technologies have certain <a href="https://www.w3.org/TR/html-aam-1.0/">expectations</a> about what HTML is and does. If we divert from those expectations, we risk causing real problems for end users, which could include controls becoming unusable.</p> <p>One example is what would happen if we would nest an interactive element like a link or button inside an <code>option</code>. Maybe one of our options has a tooltip? All of this should be avoided, at least for the time being (as far as I understand, this may change when <a href="https://gist.github.com/smhigley/8dbe67f834cc472e3a14bf6b289e6f0c">secondary actions</a> become a thing, see also <a href="https://github.com/w3c/aria/issues/1440">w3c/aria#1440</a>). The reason is: assistive technologies expect just text inside of options, not controls, so this would break badly and it could mean users wouldn't find those buttons or links, or wouldn't be able to interact with them. For this reason, it is strongly recommended to avoid interactive elements inside of options, i.e. do not add links or buttons in options.</p> <h2>Summing up</h2> <p>In this post, we looked at two ways to customise the parts of a selectmenu element. We can use CSS, which should cover a large amount of use cases and offer flexibility and room for creativity. Or we can replace entire parts with whatever we would like, the more advanced option that has accessibility risks if not thoroughly checked against specs and implementations. For a lot of the use cases that I see in design systems I have worked on, I feel CSS alone will cover all the needs. And it will do so very elegantly, often in <em>literally</em> a few lines of code.</p> <p>Again, this is all in the future, the element is just being tested out. But, it may well be that this same pattern of having both CSS and parts-replacement for control customisation will come to other Open UI work, too. Generally, I am a fan of this layered approach. As a developer, I like the principle of being able to make things as simple or complex as I want.</p> <p>If you want to see more demos, the Microsoft Edge team has built a series of cool <a href="https://microsoftedge.github.io/Demos/selectmenu/"><code>&lt;selectlist&gt; demos</code></a>, when these were published it was still called <code>&lt;selectmenu&gt;</code> (as they note, pushing the limits and some with accessibility issues). You can see and play with these, using Edge or Chrome Canary with Experimental Web Platform Features turned on. These demos include a lot of part replacements, too. If you have feedback, want to follow this work more closely or chime in, head to <a href="https://github.com/openui/open-ui/issues/">Open UI issues on GitHub</a> or join us on <a href="https://discord.gg/DEWjhSw">the Open UI Discord community</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/custom-select-with-selectlist/">Two levels of customising <selectlist></a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Two levels of customising <selectlist>">Reply via email</a></p> With :focus-visible, you can have focus styles when it makes sense 2022-07-21T00:00:00Z https://hidde.blog/focus-visible-more-than-keyboard/ <p><a href="https://hidde.blog/indicating-focus-to-improve-accessibility/">Focus outlines are a great way to improve accessibility</a>. They are traditionally set with the <code>:focus</code> pseudo class. That still works, but with <code>:focus-visible</code> we have a new way to only show focus styles when they make sense. How does that work?</p> <p>The <code>:focus-visible</code> pseudo class has been in the works for over <a href="https://github.com/WICG/focus-visible/commit/bb8c3a5ea593a0a77aee958450e9b79d0ca62f8b">seven years</a> and we recently got to a situation where it is <a href="https://caniuse.com/?search=focus-visible">now in stable versions of all modern browsers</a>: Chrome/Edge (from 86), Safari (from 15.4) and Firefox (from 85).</p> <h2>What is <code>focus-visible</code> anyway?</h2> <p>The thing is, <code>:focus-visible</code> isn't a “indicate focus only to keyboard users” pseudo class, it is “indicate focus when the browser thinks it's right, based on some heuristics”.</p> <p>“When it is right”, what does that even mean? Well, it has to do with when browsers decide to show their default outline. For example, most browsers show an outline when you press a button with a keyboard, but they don't when you click a button with a mouse. In other words, focus styles in browsers only show <em>sometimes</em>, in specific cases. The <code>:focus-visible</code> pseudo class is meant to match those cases.</p> <p>This makes <code>:focus-visible</code> very different from <code>:focus</code>, which matches whatever the currently focused element is, regardless of whether it makes sense to highlight it or not. That's why you might see the styles you applied through <code>:focus</code> even if you click on something with a mouse, a behavior that could leave users confused and causes some developers to turn off highlights completely (but friends don't let friends do this, you would not do <code>cursor: none</code> either).</p> <p>From <a href="https://www.w3.org/TR/selectors-4/#the-focus-visible-pseudo">CSS Selectors, Level 4, 9.4</a>:</p> <blockquote> <p>[<code>:focus-visible</code> allows] authors to change the <strong>appearance</strong> of the focus indicator without changing <strong>when</strong> a focus indicator appears.</p> </blockquote> <p>So it lets you target the cases where browsers would normally apply focus styles, and, importantly, it <em>excludes</em> the cases where browsers don't paint their default outline, for instance when the user clicks on a thing with a mouse.</p> <p>Consequently, browsers apply <code>:focus-visible</code> styles to more non-mouse cases than just keyboard users. Which cases are they?<br /> There are lots of devices that are keyboard-like, as <a href="https://ericwbailey.design/">Eric Bailey</a> explains in <a href="https://css-tricks.com/focusing-on-focus-styles/">Focusing on focus styles</a>:</p> <blockquote> <p><a href="https://webaim.org/articles/motor/assistive">Wands, sticks, switches, sip and puff devices, voice recognition, and eye tracking technology</a> can all create input in a digital system. These devices will identify a content area and activate it. This is similar to how you can hit the tab key on a keyboard and the next cell in a spreadsheet will be highlighted, indicating that it has been moved to and is ready to be edited.</p> </blockquote> <p>Some of these technologies present themselves as keyboards (like <a href="https://www.afb.org/node/16207/refreshable-braille-displays">braille displays</a>), they could fall under the <code>focus-visible</code> umbrella, others (like voice control) are more mouse-like and may not trigger these heuristics. Some assistive technologies also come with their own highlighting, like VoiceOver on iOS and the macOS Switch Control UI.</p> <h2>Pointers vs non-pointers</h2> <p><a href="https://www.w3.org/TR/selectors-4/#example-5e32edd8">An example</a> (non-normative) in the specification for <code>:focus-visible</code> suggests that <code>:focus-visible</code> should apply to interactions “via keyboard or some other non-pointing device”. This made me wonder what the exact difference is between a pointing device and a non-pointing device. The <a href="https://www.w3.org/TR/pointerevents2//">Pointer Events specification</a> has some answers (thanks <a href="https://twitter.com/bramus/status/1549902058760929281">Bramus</a>!).</p> <p>Basically, there are input methods that can do mouse clicks and input methods that aren't really a mouse but can simulate mouse clicks, like touchscreens and pen input. Pointer Events tries to abstract all of those input methods into a new concept called “pointer”.</p> <p>The <a href="https://www.w3.org/TR/pointerevents2/#dfn-pointer">definition of a pointer</a> in that specification:</p> <blockquote> <p>A hardware agnostic representation of input devices that can target a specific coordinate (or set of coordinates) on a screen, such as a mouse, pen, or touch contact.</p> </blockquote> <p>I haven't found a definition for non-pointer devices, like keyboards, but my best bet at a description would be: non-pointing devices are devices that let you step between the different interactive parts of a user interface. Others also call it “sequential navigation”.</p> <p>Examples of non-pointer or sequential navigation:</p> <ul> <li><code>TAB</code>/<code>shift + TAB</code> or arrow keys when you use a keyboard</li> <li>gestures when using VoiceOver on iOS, you flick between the different elements</li> <li>item mode in switch control (see <a href="https://www.youtube.com/watch?v=piZ5VZIp3O0">Milan Patel's switch control demo</a>, item mode demo at 3:59, note switch control has a pointer mode too, which Milan mentions he finds easier)</li> </ul> <p>For the sake of completeless, there is also the concept of “spatial navigation”. This is similar to sequential navigation, but you don't just go back and forward—you can go up and down too, like when you select something to watch on a streaming service on your TV.</p> <h2>Input methods differ and overlap</h2> <p>Even with this distinction between pointing devices and non-pointing devices, none of this is very binary. There are users who always use a keyboard or users who never do, but most people will be somewhere in between. They could be switching between a mouse and a keyboard in one browser session, or use devices that allow for multiple input methods. Someone could connect a bluetooth keyboard to until-then touch-only tablet. Switch Control in iOS has both a point mode and an item mode.</p> <p>And even if you could detect every type of device, people are not the same. You likely have users who use a mouse, but still benefit from seeing what currently has focus: users with low vision and users with cognitive disabilities.</p> <p>In a comment discussing <code>focus-visible</code>, <a href="https://github.com/WICG/focus-visible/issues/128">Jonathan Avila shares how he switches between modalities</a>:</p> <blockquote> <p>I often switch between input modalities such as by clicking and dragging off a button to set focus somewhere then use the keyboard to navigate from there. I may click on a radio button and then use arrows to select other radio buttons. I will switch between touch, mouse, keyboard, and many other settings such as large text, screen reader, or zoom depending on the situation.</p> </blockquote> <p>The cool thing about <code>:focus-visible</code> is that it allows browsers to be smart about when to show focus styles. Browsers won't just hop into visible focus mode when you press any key, it takes things like using command/control + key combos into account, as Alice Boxhall explains in a recent <a href="https://www.igalia.com/chats/alice-and-rob">Igalia Chats episode</a>. The heuristics develop over time, too.</p> <h2>Ok, so what now?</h2> <p>This post turned out a little longer than I intended, but what I've tried to capture is what I started with: that and why <code>:focus-visible</code> is more than a way to show focus styles just to keyboard users.</p> <p>If you want to hear more about <code>:focus-visible</code> from people who worked on this, the aforementioned <a href="https://www.igalia.com/chats/alice-and-rob">recent Igalia Chats episode with Brian Kardell, Alice Boxhall and Rob Dodson</a> covers some of the history and evolution.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/focus-visible-more-than-keyboard/">With :focus-visible, you can have focus styles when it makes sense</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20With :focus-visible, you can have focus styles when it makes sense">Reply via email</a></p> Individual climate action: small steps matter 2022-07-28T00:00:00Z https://hidde.blog/individual-climate-action/ <p>We need bigger steps to combat <a href="https://extinctionrebellion.uk/the-truth/the-emergency/">the climate emergency</a>, but small steps matter too. This week Dave <a href="https://daverupert.com/2022/07/where-i-m-at-on-climate-change/">shared</a> he feels climate action falls on consumers too much, rather than large companies and governments. Michelle responded that as tech workers, “<a href="https://css-irl.info/tech-workers-and-climate-action/">we have the power to push for for change</a>”, that we can “extend reach of our actions far beyond ourselves”. Matthias added that <a href="https://matthiasott.com/notes/doing-our-part">we all do something</a>, “even if it feels like we are the only person doing it, it will make a difference.” Great posts.</p> <p>Like Michelle and Matthias, I feel we can make a difference. I agree that we can use our privilege as tech workers, and that we can do individual things, even if small. I also agree with Dave—companies and governments need to facilitate these individual actions much better. Companies could provide more sustainable defaults, governments could have more tax incentives for sustainability. I say “more”, as both of these things continue to happen and the pace increases. Eating plant-based has been challenging for years, today it is trivial, even at fast-food chains known for their meat. The European Commission has negotiating climate action too slowly for decades, but recently launched a <a href="https://ec.europa.eu/info/strategy/priorities-2019-2024/european-green-deal_en">Green New Deal</a>, spending trillions of euros on concrete targets (see also <a href="https://ec.europa.eu/info/strategy/priorities-2019-2024/european-green-deal/delivering-european-green-deal_en">Delivering the European Green Deal</a>).</p> <p>Like most people, I'm a hypocrite when it comes to climate action. I haven't eaten meat for decades, but hey, I eat eggs and dairy sometimes, which can be as bad in terms of climate impact. I use trains for transport mostly, but hey, I still fly for work and family visits sometimes, multiple times a year. I try and buy stuff secondhand, but hey, my current shiny phone was bought new. I buy most produce directly from local farmers through <a href="https://rechtstreex.nl/">Rechtstreex</a>, but hey, I occassionally enjoy avocados and bananas that are flown in from very far away. I don't use plastic bags, but I gave my children diapers made of plastic.</p> <p>What about governments? The Dutch government recently announced to invest billions in expanding the power network so that more solar panels can be connected, but they also still subsidise gas and oil. They have started <a href="https://www.rijksoverheid.nl/onderwerpen/milieubelastingen/co2-heffing-voor-industrie">charging companies for their CO2 emissions</a>, but currently still charge lower VAT on meat than on plant-based alternatives.</p> <p>Or companies? Shell will <a href="https://www.shell.com/media/news-and-media-releases/2022/shell-to-start-building-europes-largest-renewable-hydrogen-plant.html">build Europe's biggest hydrogen plant</a>, which is nice, but I don't even want to get started on how they've undermined climate agreements for decades and continue with fossil fuels on an enormous scale (<a href="https://www.follow-this.org/shop-shell/">Follow This</a> buys Shell shares to then use shareholder privileges to demand greener policy).</p> <p>Still, like Matthias said, we need to look at the good things that are happening, and encourage more good things. From governments, from companies and from ourselves. Small steps matter. In a country with millions of voters, one vote seems like nothing. But each vote ends up as a part of the election results. If we all stay home, nothing happens.</p> <p>It may seem rational to find hypocrisy in my actions, or the government's actions, or those of companies. You'll probably find stuff quickly. But even if I'm inclined to, I don't want to be a cynic about climate action. I'd rather err or the side of being overly naive. Sometimes change is slow and complex, I want to keep the focus on making it work, not on looking for hypocrisy. So I'll continue to do my things. I'll also continue to expect companies and governments to act. In fact, they need to do more and do it faster, and this will impact what I buy and vote. It adds up if all of us buy and vote the right things, especially in countries where small parties can have impact.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/individual-climate-action/">Individual climate action: small steps matter</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Individual climate action: small steps matter">Reply via email</a></p> Keyboard shortcuts need modifier keys 2022-08-05T00:00:00Z https://hidde.blog/keyboard-shortcuts/ <p>One way to make a UI on the web keyboard accessible is to ensure parity between input methods: that things that can be clicked, can also be activated with just a keyboard. In addition, you can also introduce keyboard shortcuts for common actions. If you do, ensure they require a <a href="https://en.wikipedia.org/wiki/Modifier_key">modifier key</a>, like <code>⌃ Ctrl</code> or <code>⌘ Cmd</code>.</p> <h2>Understanding 2.1.4</h2> <p>In WCAG, the standard used to check if websites are accessible, there is a <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1#character-key-shortcuts">specific Success Criterion for keyboard shortcuts</a>, which got added in version 2.1. From the criterion text:</p> <blockquote> <p>If a keyboard shortcut is implemented in content using only letter (including upper- and lower-case letters), punctuation, number, or symbol characters, then at least one of the following is true: (…)</p> </blockquote> <p>In other words: do not use keyboard shortcuts that are just a one letter character (or multiple of those). After the quoted part, exceptions are listed where such a keyboard shortcut would be ok, we'll get to those later.</p> <p>Let's first try and get a little more explicit. Basically, you could do shortcuts that are a single key, like, ‘press <code>N</code> to open a new document’. Or your shortcuts could be in the form of <code>⌘ Cmd + something</code> or <code>⌃ Ctrl + something</code>, requiring a modifier key. This Success Criterion basically says ‘don't do the single key thing, always have a modifier‘ (again, with exceptions, see below).</p> <p>This criterion removes frustration for speech input users, who control their screen with their voice. Their software listens for words or sentences, but also for shortcuts. The issue is that shortcuts that don't use modifier keys could get activated up when the user didn't mean to.</p> <p>An example from the Understanding document:</p> <blockquote> <p>For example, Kim's email software uses common keyboard shortcuts to navigate (&quot;k&quot;), archive (&quot;y&quot;) and mute messages (&quot;m&quot;). Her coworker enters her office and says &quot;Hey Kim&quot; and her microphone picks that up. The Y of &quot;hey&quot; archives the current message. K in &quot;Kim&quot; moves down one conversation and M mutes a message or thread.</p> </blockquote> <p>(From: <a href="https://www.w3.org/WAI/WCAG21/Understanding/character-key-shortcuts#intent">Understanding 2.1.4, Intent</a>; adapted to be shorter)</p> <p>The criterion also improves the experience for people who are prone to accidentally hit keys, like users with <a href="https://en.wikipedia.org/wiki/Fine_motor_skill">fine motor skill</a> related impairments.</p> <p>So basically, the issue with these “unmodified” shortcuts, is that it is harder for software to establish if the user actually wanted to trigger the shortcut. The use of modifier keys is an established pattern that captures this user intent, you would not press those and another key accidentally.</p> <h2>What about <code>/</code>?</h2> <p>When I was testing a website recently, I found that <code>/</code> was used as a keyboard shortcut. I wasn't a 100% sure if this was a WCAG failure per se. The Success Criterion text says keyboard shortcuts should not consist of <em>just</em> letter, punctuation, number of symbol characters. Is <code>/</code> any of those four things? Letters and numbers I know, but what exactly does the full set of punctuation and symbol characters look like? Why doesn't WCAG include a list?</p> <p>Well, there are two answers to that:</p> <ul> <li>it's complicated; there are lots of languages and writing systems and it would be easy to forget a punctuation or symbol character… or even a letter of number, <a href="https://en.wikipedia.org/wiki/CJK_characters">CJK languages</a> have tens of thousands of characters</li> <li>what is really meant here is <em>any</em> character that prints something on the screen</li> </ul> <p>That last answer is what Marjon from the accessibility consultancy <a href="https://firmground.nl/">Firm Ground</a> <a href="https://twitter.com/MarjonBakker/status/1555262342467928064">replied</a> when I asked about my confusion on Twitter. She linked to the WCAG Technique document (yup, <a href="https://hidde.blog/whats-normative-in-wcag/">not normative</a>), where “all number, letter, sign and punctuation keys” are summarised as “printing characters”. That checks out. I'll take this interpretation: <code>/</code> is a printing character and should not be used as a shortcut on its own.</p> <h2>Exceptions</h2> <p>I promised to get back to the exceptions that are in the <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1#character-key-shortcuts">Success Criterion text</a>. It says you can use single characters without modifier keys as shortcuts:</p> <ul> <li>if it the shortcut can be turned off in settings</li> <li>if the UI lets users remap the shortcut… so it's <code>/</code> by default, but users can go to the settings of your app and remap it to be <code>⌃ Ctrl + /</code></li> <li>if the shortcut works only when the relevant component has focus, for instance when you're in a countries <code>select</code> menu and press the <code>T</code> to jump straight to Taiwan (that way, it doesn't interfere)</li> </ul> <p>The remapping option can get tricky if your interface has a lot of shortcuts. The popular email web app that allegedly was used as inspiration for this Success Criterion has a very large number of unmodified shortcuts, so many that it runs into the case where there aren't enough characters to remap them all.</p> <h2>Summing up</h2> <p>Keyboard shortcuts are most accessible when they include modifier keys like <code>⌃ Ctrl</code> or <code>⌘ Cmd</code>, so that they don't frustrate voice input users and users with fine motor impairments. If your interface has shortcuts that are just one or more “printing characters”, any character that prints something on the screen, best combine them with modifiers.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/keyboard-shortcuts/">Keyboard shortcuts need modifier keys</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Keyboard shortcuts need modifier keys">Reply via email</a></p> How I use Twitter 2022-08-19T00:00:00Z https://hidde.blog/how-i-use-twitter/ <p>I like Twitter. When I joined just over 15 years ago (!) I genuinely did not expect the hype to last more than a year. But what did I know? It still does a good job of letting me follow very short content from a list of people I pick. I like Twitter as a remote worker. As someone with many interests. I love being able to interact directly with people whose work I look up to, people who say interesting things or post excellent dad jokes. People with specific areas of interest that I want to stay informed about. People whose books, music, journalism or conference talks I enjoyed.</p> <p>Twitter is great for all those things, but it also has downsides. I'm sure those who read this are aware… it's a walled garden, the company has been too slow banning certain violence inciting politicans, there is lots of harrassment, there are still massive spam and bot issues, the obsession over metrics like follow counts, the verification system that seems biased (like, why is <a href="https://twitter.com/jensimmons/status/1415493148348985346?s=21&amp;t=U0C5LIUgmbpIqCVuLmspyw">Jen Simmons not verified</a>?), the self proclaimed experts, its anxiety inducing effects and so on. I have tried switching to alternatives that work on solutions for some of those things, but always returned for various reasons. I guess I do like it on Twitter.</p> <h2>Tweaking Twitter</h2> <p>Though I net enjoy my time on Twitter, I would have left years ago if I couldn't make these modifications:</p> <ul> <li>'Current topics' hidden, when I use the web version (using <a href="https://addons.mozilla.org/en-US/firefox/addon/better-twitter-extension/">Better Twitter</a>). Where I live, this section is a gateway to mostly fascist voices, terrible takes and disinformation . It seems bad actors simply take over any popular hashtags, so this may be hard to fix, but for me it means I don't want to see it.</li> <li>Ads blocked: because they aren't I'll admit I don't believe there is such thing as relevant ads. Even people who do will likely agree that mismatches happen, in my case crypto ads served to me, a forever crypto sceptic. Please let me pay for the service. On desktop I use an ad blocker, on mobile a paid app that has no ads.</li> <li>Tweets auto-deleted: maybe I would like an archive of my thoughts, but not one that is public, on a centralised platform. It seems like too much risk to keep them around. I use <a href="https://semiphemeral.com/">Semipheral</a> to do this somewhat selectively.</li> <li>People auto-muted: there isn't sufficient time in life to interact with trolls, bullies and cryptobots, tools like <a href="https://www.blockpartyapp.com/">Blockparty</a> are instrumental to automating some of the muting and blocking that makes Twitter more liveable.</li> <li>Time limited: I'm not always great at this one, but I try to avoid looking at Twitter most of the day, this platform is best enjoyed for a limited amount of time per day. I've sometimes done multi-week breaks too.</li> </ul> <h2>Tweaking my tweets</h2> <p>I also try to be better at tweeting.</p> <p>As a rule, I try not to complain about products or services. If a train company didn't treat me well, that's not my followers' problem. In general, I try to limit complaining. I don't find it very easy, as I love complaining, but I am convinced it doesn't contribute that much.</p> <p>I also try to ensure my timeline is accessible. That means I add alternative text with every image and don't retweet images without alternative text. I also avoid ASCII art memes and bold or italic unicode characters (like the ones <a href="https://mothereff.in/twitalics">Twitalics</a> converts to, a tool that actually comes with an accessibility warning). Lastly, I capitalise usernames and hashtags so that screenreaders are more likely to pronounce them in a way that makes sense, for instance #CSSDay instead of #cssday. This doesn't always make a difference, but sometimes can,<br /> like in this example where the capitals cause a pause between CSS and Day where I tested.</p> <p>Another thing I recently tried to do more of is whenever I feel I have something to say, I plan for writing it on this blog and just linking out to it from Twitter. That way I can mitigate the walled garden issue a bit, by putting my content in my a garden that I control.</p> <p>I'm sure there are lots of ways to use Twitter that I haven't made a habit (like, I hear some use <em>lists</em> extensively). How do <em>you</em> use Twitter?</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/how-i-use-twitter/">How I use Twitter</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20How I use Twitter">Reply via email</a></p> Re: AI for content creation 2022-08-30T00:00:00Z https://hidde.blog/re-ai-content/ <p><a href="https://hidde.blog/re-ai-content/twitter.com/mortendk/">Morten</a> described a possible feature, maybe even reality, in which <a href="https://mor10.com/forget-crypto-blockchain-nfts-and-web3-the-next-phase-of-the-web-is-defined-by-ai-generation/">AI-generated content</a> is rampant. But when we start to employ machine learning for content creation, we start to regard content as a means more than an end. In that process, won't we lose what's worth caring about?</p> <p>In his post, Morten explains he sees three types of AI-generated content emerge. The first two, AI-curated content (it helps assemble content and provide you with what it thinks is the most relevant), and AI-assisted content creation (it contributes to content creation) are a thing now. The third, AI-synthesised content, will likely become a thing in the future. <a href="https://mor10.com/forget-crypto-blockchain-nfts-and-web3-the-next-phase-of-the-web-is-defined-by-ai-generation/">Morten's post</a> gives a great overview of what to expect.</p> <p>It reminded me of a project I did in university about automating the arts. My conclusion: we can write code to generate creative works, but code or models can't capture intentions, experiences or beliefs. This requires human input, therefore creating art (or content) requires human input, was my reasoning. There are nuanced differences between AI, machine learning, big data and bots, but in this post I won't go into them.</p> <p>When I want to find a recipe for pizza dough on the web, I would consider myself lucky if I could get ahold of a blog post from someone who cares passionately about the right kind of dough, who maybe ran an artisan pizza kitchen in Naples for the past 30 years or has a background in baking. ‘Dream on’, you think. Well, these people exist on the web and the web is awesome for being an open platform that anyone with a passion can write on. I don't want to find text produced just because someone saw “pizza dough” is a common search phrase and a potential for top result ad money to be extracted. The passion that drives them isn't the pizza dough—that's fine, but it makes their content less relevant to me. Similarly, I also don't want to find text generated by a machine learning model. It can't possibly bring the knowledge and experience I'm hoping for.</p> <p>When I write an email or reply, I try to put what I want to convey into words that I choose. I might choose to include an inside joke that me and the recipient share, fit in an appropriate cultural reference, be extremely polite, or terribly rude. I mean, my intentions and attitude are in that interaction. I don't want Google or LinkedIn or others to suggest what to reply, to reinforce reminiscences of the historical content they trained their machine learning models with. It dehumanises my conversation. Its suggestion may or may not align with <em>my</em> intentions.</p> <p>When I listen to music, I can be touched by the experiences and world views that inspired the artist. Whether you're into the Eagles, Eels or Ella Fitzgerald, their songs capture things that machine learning systems can't because the artists have attitudes. Robots don't love and they don't have opinions. Maybe they can come up with interesting rhythms and melodies, or utter sentences like “I love you”, but the association of their work with intentions and memories needs humans.</p> <p>When I read a newspaper, the order of pages, the focus a layout provides and the choice of photography… they are decided by human beings who have a lot of experience. People who work as a journalist after being a professional sports player for decades. People who followed politics for decades and therefore understand which scandal is worth extra attention. People who can make bold choices based on their world views. Bots don't have world views. Algorithmic prioritisation of content isn't as good as prioritisation by humans, even if it gets close. See also algorithmic timelines on social media versus human-curated lists and contextualisation.</p> <p>When I have a consumer issue, I want to talk to a human representative of the company. Someone who has the authority to make decisions. Who can take us on the shortest path to a mutually satisfactory solution. Did you ever see a chat bot provide more than a repeat of the data it has been fed? Did you see a chat bot make enquiries with empathy? Lack of empathy isn't a bug in bots that we just haven't fixed yet, it arguably isn't empathy if it isn't human-to-human (ok maybe animals can be part of this equation).</p> <p>All these examples lead me to think: the human side of data isn't measurable or computable. The human side of art, content or communication is not just a different side of the same coin, it's a bigger coin. There is more to reality than data can capture, like lived experiences from actual people and intentions and beliefs. <a href="https://en.m.wikipedia.org/wiki/Propositional_attitude">Propositional attitudes</a> that robots can only pretend to have.</p> <p>Basically, I'm worried about overestimating how many human capacities machine learning can take over. At the same time, I don't think machine learning is useless. Quite the opposite, it is fantastic. I love it that computers are getting better at automated captions, translation or even generating images based on prompts. The latter may create a whole new level of art where artists use it as a material for their creations (see also <a href="https://youtu.be/Hu5Jc1yIfas">AI is your new design material</a> by Josh Clarke). Medical applications where machine learning notices abnormalities that a human might miss. Audio recognition engines that will tell you what song is playing. Email spam filters that save us all a lot of time. It's all super valuable and genuinely impressive. And a lot of these use cases don't <em>need</em> lived experiences, intentions or beliefs to be incredibly useful.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/re-ai-content/">Re: AI for content creation</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Re: AI for content creation">Reply via email</a></p> What's new in WCAG 2.2? 2022-09-06T00:00:00Z https://hidde.blog/new-in-wcag22/ <p>WCAG 2.2 is the next version of the <a href="https://www.w3.org/TR/WCAG22/">Web Content Accessibility Guidelines</a>, published 5 October 2023. It includes all of WCAG 2.1, minus 4.1.1 Parsing, plus nine new criteria. Of those, six are in Level A + AA, the most commonly tested combination of levels.</p> <p>Let's look at how you could meet the new Level A + AA criteria (note: this is just my summary and interpretation, for the official specification and wording, refer to <a href="https://www.w3.org/TR/WCAG22/">WCAG 2.2</a>):</p> <ol> <li><a href="https://www.w3.org/TR/WCAG22/#focus-not-obscured-minimum">Focus Not Obscured (Minimum)</a> (2.4.11, AA): don't obscure the element that has focus (eg with sticky headers/footers or modals)</li> <li><a href="https://www.w3.org/TR/WCAG22/#dragging-movements">Dragging Movements</a> (2.5.7, AA): when some action in your UI requires dragging, ensure the same action can also be performed without dragging (with a “single pointer”). Example: a map that can be dragged to move around, but also offers buttons to move up, down, left and right.</li> <li><a href="https://www.w3.org/TR/WCAG22/#target-size-minimum">Target Size (Minimum)</a> (2.5.8, AA): ensure that things you can click (or otherwise “point”, eg using pen, touch etc), are more than the specified minimum size, unless there's enough distance, it's inline or the small size is “essential”</li> <li><a href="https://w3.org/TR/WCAG22/#consistent-help">Consistent Help</a> (3.2.6, A): if your page/app contains help options, they are in the same order across pages (unless user zooms/turns device; these kinds of user-initiated changes are excepted)</li> <li><a href="https://www.w3.org/TR/WCAG22/#redundant-entry">Redundant Entry</a> (3.3.7, A): avoid that users have to enter the same information twice, instead auto-populate or allow previous input to be selected. Some exceptions apply.</li> <li><a href="https://www.w3.org/TR/WCAG22/#accessible-authentication-minimum">Accessible Authentication (Minimum)</a> (3.3.8, AA): if your auth requires a “<a href="https://www.w3.org/TR/WCAG22/#dfn-cognitive-function-test">cognitive function test</a>” (user has to remember, manipulate or transcribe), offer a way without such a test, or allow for assistance (eg <a href="https://hidde.blog/making-password-managers-play-ball-with-your-login-form/">support password managers</a>, don't block copy/paste)</li> </ol> <p>One SC was removed: <a href="https://www.w3.org/TR/2023/CR-WCAG22-20230124/#parsing">Parsing</a> (4.1.1). It existed because assistive technologies had to parse HTML, but they no longer do so directly.</p> <p>Notably, the new SC <a href="https://w3.org/TR/WCAG22/#focus-appearance">Focus Appearance</a> (2.4.13), that was initially put in Level AA, is going to be Level AAA. It has requirements for what focus styles look like, regarding contrast, size of the contrasting area and contrast of adjacent colors (this one may be the most tricky and “<a href="https://www.w3.org/TR/WCAG22/#items-at-risk">at risk</a>”, but there's a lot of examples in <a href="https://w3.org/WAI/WCAG22/Understanding/focus-appearance.html">Understanding Focus Appearance</a>)</p> <p>An overview of the new criteria, including examples of how they are useful to real people can be found on <a href="https://www.w3.org/WAI/standards-guidelines/wcag/new-in-22/">What's new in WCAG 2.2</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/new-in-wcag22/">What's new in WCAG 2.2?</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20What's new in WCAG 2.2?">Reply via email</a></p> The last dConstruct 2022-09-10T00:00:00Z https://hidde.blog/the-last-dconstruct/ <p>The last dConstruct is a wrap! <a href="https://adactio.com/">Jeremy</a> did a great job curating a day that was (loosely) themed around “design transformation”. Here's my writeup of the day.</p> <img src="https://hidde.blog/_images/jeremy.jpg" alt="Jeremy in front of dConstruct opening slide with all of the speaker photos and names" /> <h2>How does content survive 100 years?</h2> <p>When designing <a href="https://en.wikipedia.org/wiki/Flickr">Flickr</a>, <a href="http://abitofgeorge.com/">George Oates</a> tried to design a “context for interaction, not just an application”. It worked. Flickr allowed people to post content and connect it through tags, comments and more. Today, the site has 50 billion pictures posted by millions of people, making it, in <a href="https://en.wikipedia.org/wiki/Jason_Scott">Jason Scott</a>'s words, “a world heritage site”. Archivists may have kilometres of underground storage where they keep historical records, a site like Flickr is unique, as so many people contributed to it. For future generations, the sheer amount of visual data could give away a lot about life today. But Flickr isn't a given. Changing owners a few times, the site was almost killed and all content deleted. Now, at Flickr Foundation, George thinks about keeping this content for the future. And by future, she means the next 100 years. Long term preservation most likely needs selection, George clarified, maybe by letting users mark specific photos of theirs as keepworthy. Maybe it needs printing after all, as we are not sure if JPGs or PDFs are still readable in a 100 years. And how do we preserve a picture that is part of a network, if we can only preserve part of that network? How does this wealth of content survive economic forces and corporate <em>whimsey</em>?</p> <p><img src="https://hidde.blog/_images/IMG_3146.jpg" alt="whiteboard with lots of post its answering what things have survived over 100 years, what should and should not survive 100 years" /> <em>George's team mapping out 100 years</em></p> <p>These questions made me worry about the content I create online: blog posts, tweets, videos… it's on my personal website that I'm most sure there won't be corporate <em>whimsey</em>, but it's also unlikely to survive when I'm not around to pay the hosting bills. Should I update my testament?</p> <h2>The fun part of writing is the research</h2> <p><a href="https://laurenbeukes.com/">Lauren Beukes</a> is a best-selling author. She travels a lot and said she actually enjoys the all this research more than the actual writing. On these trips, Lauren talks to a lot of people, from detectives in Detroit to teenage theatre geeks. She learns from their perspectives, takes in their sometimes horrifying stories and learns how they are treated by the system. Part of what a novelist does, she explained, is asking “what if?”.</p> <h2>Transformation through type</h2> <p>Type designer and calligrapher <a href="https://www.seblester.com/">Seb Lester</a> showed how a <a href="https://www.myfonts.com/collections/neo-sans-font-monotype-imaging">typeface</a> he started designing on a train, came out 8 months later and started getting used. It was on washing powder, sky scrapers and olympic games branding. “When a typeface goes out in the world”, Seb explained, “a little bit of you goes out in the world”. The font was everywhere, but hardly anyone had heard of him (he said). Until he started publishing letter forms and calligraphy on social media. Seb's <a href="https://www.youtube.com/c/SebLester">calligraphy videos</a> and a cheeky comment in an <a href="https://www.salon.com/2013/01/21/seb_lester_the_man_behind_your_favorite_fonts/">interview in Salon</a> got him jobs designing visuals for rocket scientists and Apple. His videos of lettering in progress are extremely soothing to watch, transforming from what seems like a few scribbles into beautiful works of art. Seb's stories were a reminder that success is very much a combination of two things: you want to “work hard”, “find your passion” and “believe in yourself” on the one hand, and be lucky and get noticed by the right people at the right time on the other. That last part is out of your hands, so you can only really try to do the first.</p> <p><img src="https://hidde.blog/_images/IMG_3151.jpg" alt="Seb in front of slide that shows email. Contact request from redacted. Reason for contact: NASA mission logo. Hello Mr. Lester. I work for a NASA mission called SWOT (swot.jpl.nasa.gov) and have been asked by the project to contact you to assess your interest in working with us to produce a mission logo (per your comment in http://www.salon.com/2013/01/21/seblester the man behind your favorite fonts/). If so, we are interested what ideas you have and if there is a match with our needs. Warm regards, redacted." /> <em>TFW NASA takes note</em></p> <h2>Design to make the world better</h2> <p><a href="https://danielburka.com/">Daniel Burka</a> has been a designer for a long time. He worked on the Firefox brand for Mozilla, which was interesting because of open source and their mission. He worked on Digg, which was interesting because of their scale. He worked on a game called Glitch, which was interesting because the <a href="https://www.taskade.com/blog/slack-history/">creators of Flickr were involved</a>, and <a href="https://mashable.com/article/slack-glitch">Glitch became Slack</a>). And then he worked at Google Ventures, where he met a number of companies working on life sciences related products. Then he came to realise that while designers in Silicon Valley are often in a very comfortable position, a lot of the world isn't well designed. This resonated with me: some of our largest's design budgets are used to solve trivial problems, like yet another food delivery service. Education, healthcare, financial services… they are long-term and hard problems. Highly regulated, too, and not very used to having designers on their teams. Daniel ended up working on <a href="https://resolvetosavelives.org/">Resolve to Save Lives</a>, where he makes software that <a href="https://medium.com/simple-dot-org/what-we-are-learning-by-creating-an-ultra-thin-emr-d178e6bbdbd4">makes it easier to register data about high blood pressure patients</a>. This sort of data saves lives by making it easier to get patients to return regularly. But clinicians want to spend time on patients, not data entry. The technological layer needs to be very light, to be effective.</p> <h2>Beware of tech utopians</h2> <p>In technology we trust. So much, that the Paris climate agreement—essential to humanity's survival on earth—is based on the assumption that technological inventions will be available. Techno-utopianism is not new, <a href="https://www.sarahangliss.com/">Sarah Angliss</a> explained. She told us about Muriel Howorth, who was an amateur nuclear scientist who reckoned that if radiation could be used for atomic bombs, it could be used for <a href="https://plantsandpipettes.com/muriel-howorth-and-the-atomic-garden/">atomic gardening</a>. Howorth wanted to use “atom-blasted” seeds to grow a giant vegetable. Sarah also discussed an experiment in which fluoride, which is toxic in high quantities, was added to a city's water supply, with high expectations around improving the citizen's dental health, and “<a href="https://www.unifon.org/pages/bett-dyslexia.html">saxton spanglish</a>”, a phonetic and somewhat controversial method of teaching children English. It reminded me of <a href="https://en.wikipedia.org/wiki/Pinyin">pinyin</a>, that is sometimes used to teach non-native speakers Mandarin Chinese and also controversial for oversimplification and making proper learning harder. They are all <em>attempts</em> to transform through design, that are a little too utopian. Maybe another modern day equivalent, besides climate tech optimism, is that once so popular social network that frantically tries to make the ‘metaverse’ work, or even that we try and sprinkle machine learning on everything, even where it doesn't necessarily make sense (see <a href="https://hidde.blog/re-ai-content/">AI for content creation</a>). Yes, it could work, but it could not.</p> <h2>Computers need to get better at togetherness</h2> <p><a href="https://interconnected.org/">Matt Webb</a> talked about reinventing the workplace. One major reinvention was when the <a href="https://vintagenewsdaily.com/in-1968-computers-got-personal-how-douglas-engelbarts-mother-of-all-demos-changed-personal-technology-forever/">personal computer made its debut</a> (see also: the setup). Here's some utopianism that did end up well. Screens, documents, text processing, the mouse: the mission to put a computer on every desk (and Douglas Engelbart's “mother of all demos”) completely reshaped what offices looked like. Speaking of design transformation! Matt noted how, fascinatingly, much of the history of computing is about furniture design. I didn't know Herman Miller worked with Doug Engelbart's team to invent <a href="https://www.hermanmiller.com/stories/why-magazine/mother-of-invention/">furniture to go along with their machines</a>. Is the office done? Not really, as in 2022 we increasingly find ourselves working together from different locations. The current state of “togetherness” is lacking, Matt explained. We can be in virtual rooms together, but it isn't as good as it could be. For instance, they don't have a window out—you can't see who's approaching the space. There is little of the serendipity you might find in a physical office. With <a href="https://sparklespace.com/kb/what-is-sparkle/">Sparkle</a>, Matt works on a Zoom replacement, a tool that aims to facilitate togetherness better. As a remote worker, and as someone who isn't sure Big Tech has the solution for us, I will be following this work.</p> <img src="https://hidde.blog/_images/IMG_3164.jpg" alt="Matt with slide that says: so much for tools for thought… what about tools for togetherness?" /> <h2>Moonlander with applause-controlled lasers</h2> <p>Lasers: they are fascinating. <a href="https://seblee.me/">Seb Lee-Delisle</a> showed us how he took animations outside of the projected screen to kick off Smashing Conference in Oxford, displayed love for the NHS onto their Brighton building during the pandemic and displayed laser fireworks that people could interact with. It's impressive, really, how much even one laser can do, let alone the over 30 in different strengths that he currently owns. Seb had the arcade game <a href="http://moonlander.seb.ly/">Moonlander</a> (I had to look it up) projected on the wall with lasers, so that we could all try and safely land a moon lander by affecting the vehicle's thrust with our applause.</p> <h2>Everyone perceives differently</h2> <p><a href="https://www.anilseth.com/">Anil Seth</a> concluded the day with a talk about perception. Questions about how we perceive the world outside and our own bodies have puzzled philosohopers for millennia. Today, neuroscientists try to confirm through experiments that we don't perceive the world directly, showing some of these philosophers were correct. Sensory input, Anil explained, is constantly processed by our brain—it fills in the gaps based on what it remembers of the past and predicts of the future. Seb's lasers had just demonstrated that: when he made his laser move in a circle, we perceived a static circle, not that movement. Just like a film is really 60 different images per second… our brain causes us to perceive it as a film. Anil drew an interesting parallel between perception (“controlled hallucination”) and halluccination (“uncontrolled perception”). This constant interpretation of input by individual brains implies what Anil calls “perceptual diversity”, everyone perceives differently. In an art installation called <a href="https://dreamachine.world/experience/">Dream Machine</a>, participants' perception is triggered and then recorded in the form of drawings afterwards.</p> <h2>Wrapping up</h2> <p>There was a bit of design transformation in each of these talks. We were rightly warned about tech utopianism. Design and technology can't transform everything, yet some speakers shared their plans to transform. They (re)defined what it means to perceive ourselves, collaborate on screens or keep content available over a long stretch of time. Some speakers were right in the process of transforming. They talked about turning a series of penstrokes into art, lasers into fireworks, human experiences into novels and patient data collection into a minimal effort task.</p> <p>A lot of our work in web design and technology has a power to transform and that is wonderful, especially when we manage to be intentional about the how and why. With that, I'll conclude this write up of the last dConstruct. If it piqued your curiosity, word goes that audio of the full event was recorded. It will be added to the <a href="https://archive.dconstruct.org/">dConstruct Archive</a> in due time. For now, thanks Clearleft for another excellent event.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/the-last-dconstruct/">The last dConstruct</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20The last dConstruct">Reply via email</a></p> Better accessible names 2022-09-13T00:00:00Z https://hidde.blog/better-accessible-names/ <p>OK, you've added an accessible name to your control. Maybe you've used <code>aria-label</code>, <code>&lt;label&gt;</code> or some other way to name a control. Now you wonder: what makes a name good, effective or useful?</p> <p>I wrote about <a href="https://hidde.blog/naming-things-to-improve-accessibility/">why accessible names matter and where to add them</a> before. In this post, I will go into how to make the actual names more user friendly. These tips are all from an underappreciated piece of content that I love: the <a href="https://www.w3.org/WAI/ARIA/apg/practices/names-and-descriptions/#x5-5-composing-effective-and-user-friendly-accessible-names">Composing Effective and User-Friendly Accessible Names section</a> of the ARIA Authoring Practices Guide. All credits go to the authors, I'm just adding context and examples.</p> <h2>Function over form</h2> <p>An accessible name is used by assistive technologies to refer to things on a web page. For instance, if you use voice control, you could say the accessible name of a particular control to activate it. If you use a screenreader, it is the name that gets read out when you get to the control, or when you pull up a list of controls (eg a list of links on the page).</p> <p>Because of how we use accessible names, we want to keep them functional and avoid naming controls after what they look like. Ideally, you do this in the imperative form, that makes it easiest to quickly grasp what a thing is going to do.</p> <img src="https://hidde.blog/_images/button-examples.png" alt="examples of buttons: three dots stacked vertically in right top of navigation bar; arrow pointing right on top of seris of image; three lines stacked vertically in left top corner of interface; floppy disk in Word interface" /> <p>Examples:</p> <ul> <li>“Open navigation” works better than “Hamburger” and “More options” better than “Kebab”</li> <li>“Next slide” works better than “Arrow right” or “Right pointing triangle”</li> <li>“Save document” works better than “Floppy disk”</li> </ul> <h2>Most unique part first</h2> <p>In a series of names, like a set of buttons, links, etc, start with the most unique part of the name. This makes it easier to distinguish them.</p> <p>Let's say you list a bunch of albums and want to include “album” in each name. Most unique first means you say “Midnight Marauders - Album”, “To Pimp A Butterfly - Album” etc, rather than “Album - Midnight Marauders”, “Album - To Pimp A Butterfly”.</p> <img src="https://hidde.blog/_images/albums.jpg" alt="albums in Spotify UI: Midnight Marauders by A Tribe Called Quest, To Pimp a Butterfly by Kendrick Lamar, Our Pathetic Age by DJ Shadow, Source by Nubya Garcia, Lianne la Havas by Lianne La Havas" /> <p>Or you have actions for a link: “Edit link”, “Copy link” and “Share link” work better than “Link edit”, “Link copy” and “Link share”.</p> <p>This even applies to the <code>&lt;title&gt;</code> of web pages: if you're repeating your company name in it, leave it for last and list what's unique about the page first. Technically not an accessible name, but the same naming advice happens to apply.</p> <h2>Be concise</h2> <p>Keep a name to the most important 1-3 words, prefer brevity.</p> <h2>No roles as part of the name</h2> <p>Things that have names in your page will (or should) have roles too. The browser will derive the role for you, whether you've set it explicitly (e.g. <code>role=&quot;button&quot;</code>) or it comes for free with the element (e.g. <code>&lt;button&gt;</code>). If you add the role, for instance the word ‘button’, to the name, that is redundant and this can be annoying for users.</p> <p>Examples:</p> <ul> <li>use “Close” instead of “Close button”</li> <li>use “Main” instead of “Main nav”</li> <li>use “Save” instead of “Save button”</li> </ul> <h2>Keep names unique</h2> <p>Imagine you work in a school and all your students are named “Alice”. It would be hard to address them… this is the same for the names of controls and components in your page, especially for users who use mostly these names to browse the page.</p> <p>Examples:</p> <ul> <li>instead of an overview page that shows news items with “read more” links, use the title of each news item as the link name</li> <li>instead of saying “click here”, use the name of the page you're linking too, for instance: “See also: [name of the page]”</li> </ul> <h2>Sentences aren't names</h2> <p>The last tip in the document is: start names with a capital letter, for better pronounciation in some screenreaders, and don't end with a period, because a name is not a sentence.</p> <p>I'm not sure if this is the type that this tip is originally referring to, but one example of setences in accessible names is this: a card that has a title, a description and a picture, that is clickable as a whole, implemented by wrapping it all in one <code>&lt;a&gt;</code> element. I've seen this in the wild. It is often problematic, because it creates names that are way too long and confusing. My recommendation would be to do this instead: pick a string that is a more useful (and concise) name and make that the <code>&lt;a&gt;</code>. Then solve the clickability issue with CSS.</p> <h2>Wrapping up</h2> <p>Before I wrap up, I want to assure you that you don't need to use ARIA to provide names, even if this information is part of the ARIA Authoring Practices. Text content in the appropriate HTML elements (<code>&lt;label&gt;</code>, <code>&lt;legend&gt;</code>, <code>&lt;caption&gt;</code>, <code>&lt;button&gt;</code>, <code>&lt;a&gt;</code>) works perfectly fine too. An added benefit is that when you provide visible names with these HTML elements, they can be used by more users, including people who don't use assistive technologies and people collaborating with assistive technology users.</p> <p>That's all. As mentioned above, these tips are from <a href="https://www.w3.org/WAI/ARIA/apg/practices/names-and-descriptions/#x5-5-composing-effective-and-user-friendly-accessible-names">Composing Effective and User-Friendly Accessible Names</a> in the W3C's ARIA Authoring Practices. That specific page has a lot more tips and also covers accessible <em>descriptions</em>, name and description calculation, per-role guidance on whether you need a name, lots of gotchas and various coding techniques for adding names. Happy naming!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/better-accessible-names/">Better accessible names</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Better accessible names">Reply via email</a></p> 2.4.11 Focus Appearance adds more complexity to WCAG than we should want 2022-09-24T00:00:00Z https://hidde.blog/focus-appearance-too-complex/ <p>Like many people, I have been monitoring the creation of <a href="https://www.w3.org/TR/WCAG22/">WCAG 2.2</a>, the upcoming new version of the Web Content Accessibility Guidelines. Nine new Sucess Criteria are proposed. One particularly worries me: <a href="https://www.w3.org/TR/WCAG22/#focus-appearance">2.4.11: Focus Appearance</a>.</p> <p>Focus Appearance builds on two existing WCAG criteria that affect focus indicators: that users can see which element has focus (<a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1#focus-visible">2.4.7</a>), and that focus styles have sufficient contrast (<a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1#non-text-contrast">1.4.11</a>). Focus indication is essential for a wide range of users, including users who browse by keyboard or zoom in. For an introduction to why focus indication matters, see <a href="https://hidde.blog/indicating-focus-to-improve-accessibility/">my post on indicating focus</a>.</p> <p>What's new about 2.4.11 is adds more requirements for what the indicator looks like:</p> <ul> <li>an element with focus needs to have sufficient contrast with its non-focused state</li> <li>an element with focus needs to have sufficient contrast with its surroundings</li> <li>the focus indicator needs to either be a solid line (so not dotted or dashed), or have a certain level or thickness (in which it can be dotted or dashed)</li> </ul> <p>It's a clever new criterion, that addresses important user needs that were previously unaddressed. The Working Group clearly put a lot of research and thought into it. This is hard to do, as co-chair Alastair Campbell mentions in <a href="https://github.com/w3c/wcag/issues/1053#issuecomment-595525157">a GitHub issue</a>:</p> <blockquote> <p>what makes a visible focus indicator is not particularly straightforward</p> </blockquote> <p>This is the crux of why this isn't trivial to solve and I appreciate everyone's <a href="https://github.com/w3c/wcag/issues?page=4&amp;q=label%3A%222.4.11+Focus+appearance%22+is%3Aclosed">efforts on the proposed Success Criterion</a>. I know the text has had revisions and improvements after people have <a href="https://github.com/w3c/wcag/issues/1053">flagged complexity issues</a>. Still, I'm sorry the Success Criterion as it stands now has me worried.</p> <p>“Focus Appearance” is “at risk” of being removed from the final version of WCAG 2.2. My vote would be to drastically change it (again) or remove it entirely. Firstly, the requirements are complex to apply or teach. Secondly, browsers, OSes or assistive technologies could guarantee focus appearance better (and I feel it would be easier to talk to them than to convince all of the world's web developers).</p> <h2>Why I hesitate about including 2.4.11</h2> <h3>Complex to apply</h3> <p>I expect Focus Appearance would be hard to apply, because the Success Criterion text has a lot of complexity. It is full of clauses and sub clauses. It often includes “and” (8 times), “or” (7 times) and “non”/“not” (4 times). There are two ways to meet it (you can choose one or both), and there are two exceptions and three notes. All in all, it's a lot to grasp.</p> <p>The wording requires knowledge of a lot of specialised terminology, especially in the “area of the focus indicator” part. It may be that I am a non-native English speaker, but I had to look up what a “perimeter” is. The Oxford Dictionary of English states:</p> <blockquote> <p>the continuous line forming the boundary of a closed geometrical figure</p> </blockquote> <p>WCAG 2.2 makes this definition more specific to the web by defining “perimeter” as ”continuous line forming the boundary of a shape not including shared pixels, or the minimum bounding box, whichever is shortest”.</p> <p>In this, “minimum bounding box” has its own definition:</p> <blockquote> <p>the smallest enclosing rectangle aligned to the horizontal axis within which all the points of a shape lie</p> </blockquote> <p>And because it is about web content, another clause is added:</p> <blockquote> <p>For components which wrap onto multiple lines as part of a sentence or block of text (such as hypertext links), the bounding box is based on how the component would appear on a single line.</p> </blockquote> <p>This is a lot to take in and it seems easy to misunderstand. There are so many sub definitions needed. One could easily misinterpret the concepts of a bounding box, the perimeter,“shared pixels”, “CSS pixels” (ok, that's already used in <a href="https://www.w3.org/TR/WCAG21/#reflow">Reflow</a> and <a href="https://www.w3.org/TR/WCAG21/#target-size">Target Size</a>) and apply the whole SC wrongly.</p> <p>This makes 2.4.11 Focus Appearance very different from other criteria, like <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1#non-text-content">Non-Text Content</a> or <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1#keyboard">Keyboard</a>. Accessibility specialists will know there are indeed lots of ways not to meet those requirements, but the general idea of how to comply is easier to grasp. Very few people will need to look up what a keyboard or text is.</p> <p>Admittedly, there are easy ways to comply with the proposed Focus Appearance, too. One is to have a solid outline with a minimal offset of 1px that has sufficient contrast (3 : 1) with its background, as James Edwards explains in <a href="https://www.tpgi.com/new-success-criteria-in-wcag22/">New Success Criteria in WCAG 2.2</a>.</p> <h3>Complex to teach</h3> <p>As someone who sometimes teaches WCAG to teams, I also worry about the complexity of 2.4.11. I could teach the ‘easy way’ described above, that doesn't seem too complex to teach. But if I would try to teach the whole Success Criterion with all the requirements, exceptions and notes and also cover what the Understanding document explains, I fear I won't get it across.</p> <p>“But teaching is your job, Hidde!”, you might say. Yes. And I could probably make it work, but it would take class time that I would like to spend on other barriers, and there is still the risk the information sticks with participants less because of the complexity. There will also be people trying to apply this Success Criterion on their own.</p> <h3>Leave it to browsers</h3> <p>We can't just leave all of our problems to browsers to fix. But if I had any say in it, <a href="https://hidde.blog/could-browsers-fix-more-accessibility-problems-automatically/">browsers should fix any accessibility problems they are <em>able</em> to fix</a>. That way, end users have to rely less on individual web developers to make good choices. I feel focus indication is a great example of that: the browser knows what has focus, users want to know it, web developers could fail to add a good indicator. So why rely on web developers?</p> <p>In a discussion on relying on browsers for focus indication, <a href="https://github.com/w3c/wcag/issues/1911#issuecomment-883694397">the Working Group concluded</a> that browsers don't do sufficient default focus indication today, so if we want accessible websites, we need to require it through WCAG. If browsers start to do it later, the requirement could be removed or moved to a different level then. A chicken and egg situation, basically, but with one of them more likely to materialise (I'm not super sure which, to be honest).</p> <p>A second argument is that web designers are in a better position to design an appropriate indicator, one that fits well with the rest of the site's design. But it's unlikely those designers can take into account user needs as well as a browser could with settings. Some users may prefer an indicator they can see move from one element to another, some may want a very high contrast indicator, some may want it more subtle (see also <a href="https://github.com/w3c/wcag/issues/1911#issuecomment-897984741">Rain's comment mentioning high visible focus indicator from a COGA perspective</a>). A browser could provide options. We wouldn't want individual websites to start offering focus indication choosers, right?</p> <p>Forced focus indication already exists in various forms through OS settings, assistive technologies (like VoiceOver) and even some (buried away) browser settings (in Chrome). There is a bunch of <a href="http://www.webaxe.org/force-focus-tools/">browser plugins and bookmarklets that force focus indication</a>, too. So we've got forced visibility. Forced “good appearance”, however, is <em>not</em> fully in browsers and harder to implement, of course. It would need to account for all the things 2.4.11 requires, like sufficient contrast with surroundings (the browser/add-on/plugin would need to make it work with any background) and sufficient contrast with non-focused state.</p> <p>I get the idea of putting this on developers before full browser support exists, but it does feel a bit like solving all problems with one (conformance-shaped) hammer. It also doesn't apply when developers simply don't meet WCAG. Yes, there are human rights, ethics and laws, but we know they are violated a lot today. I fear this will only be more common when the requirements are too complex.</p> <h2>How to make it less complex</h2> <p>I know WCAG 2.2 is close to its last standardisation stages, so I'm sorry to bring this up now. I also don't want to just say ‘don't include 2.4.11’. Let me describe a possible way to make the situation less complex for developers, evaluators and teachers, by replacing Focus Appearance with multiple Success Criteria:</p> <ul> <li>Focus Distance to require a minimum offset between the focused element and its outline</li> <li>Focus Solid to require solid, unless a minimum thickness is used</li> </ul> <p>These two on their own seem a lot less complex to apply, test and teach. As minimum contrast and visibility are already covered in other Success Criteria, these two criteria between them would make focus indication much better for low vision users, while not adding the complexity 2.4.11 adds.</p> <h2>Conclusion</h2> <p>The proposed Focus Appearance criterion does a great job at capturing which problems end users have around focus into requirements. But it lacks understandability for users of the standard: people who make websites, people who evaluate accessibility conformance, developers of testing tools, et cetera.</p> <p>It may seem reasonable to say those understandability concerns are secondary to the ability of end users to use the web. Of course they are. But if there is too much complexity in WCAG wording and mathematics, I worry the web won't actually get better for end users. We'll lose the people who need follow the recommendations. This is already an issue with current requirements, as shown by the many “WCAG in plain words” derivatives and checklists that exist. The original source gets plenty of “appropriate requirements love”, it could use <a href="https://www.gov.uk/guidance/content-design/what-is-content-design">content design</a> love.</p> <p>I'm sorry, but I feel WCAG 2.2 is better off without 2.4.11. Even after some iterations, it (still) adds more complexity than we should want WCAG to have. It's difficult to apply and teach. It may end up like Terms and Conditions: factually correct, but commonly skipped over. That would be problematic in this case, and mean not considering important end user needs.</p> <p>My ideal resolution would be (I know, easier said than done): sit down with browser makers and improve the focus indication game structurally together. Meanwhile, people who make websites can prioritise the 86 other WCAG Sucess Criteria (rather than implementing 2.4.11 until browsers are ready). Focus indicators are a core need web users have, it needs better appearance and likely choice in appearance, let's bring the research from <a href="https://www.w3.org/WAI/GL/">AGWG</a> into (browser) practice.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/focus-appearance-too-complex/">2.4.11 Focus Appearance adds more complexity to WCAG than we should want</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%202.4.11 Focus Appearance adds more complexity to WCAG than we should want">Reply via email</a></p> Do we need an Interop for assistive technologies? 2022-10-30T00:00:00Z https://hidde.blog/at-interop/ <p>I'm so happy about what Interop 2022 is doing for web compatibility in general. It made me think: what if we had something similar, but accessibility-specific, focused on compatibility between our code, assistive technologies and browsers? Excitingly, ARIA-AT pretty much has that goal.</p> <h2>Interop 2022 is great</h2> <p>In the <a href="https://web.dev/interop-2022/">Interop 2022 effort</a>, all major browser vendors, browser engineers and other stakeholders agreed “to solve the top browsers compatibility issues identified by web developers” in one year. I danced a little when I saw that. I mean, they align their priorities between them <em>and</em> web developers get a say in what the priorities are. Excellent.</p> <p>Subgrid, <code>&lt;dialog&gt;</code> and <code>scroll-snap</code> are tremendous features, but consistently cross-browser supported subgrid, <code>&lt;dialog&gt;</code> and scroll snap (and more) are the real deal. Because browser compatibility issues can be quite the nuisance. They make web development harder and more expensive. Web developers end up with a choice between either supporting less browsers or adding hacks and more bloated code. Either option likely trickles down to the experience of end users.</p> <h2>Unrecommendable web platform features</h2> <p>As an accessibility specialist, I spend some of my time giving advice on how to code accessible UI components. From time to time, I want to recommend a thing, but I don't, because of bugs or inconsistencies somewhere between browsers and assistive technologies.</p> <p>I asked on Twitter what people's top issues were:</p> <blockquote> <p>If you could fix 3 bugs in assistive tech or browsers, to make building accessible UI components more straightforward, what would they be?</p> </blockquote> <p>Some responses that came in, all browser focused:</p> <ul> <li><a href="https://adrianroselli.com/2022/07/its-mid-2022-and-browsers-mostly-safari-still-break-accessibility-via-display-properties.html">display properties (still) break default semantics</a> (thanks Adrian Roselli for all his work documenting the issues in detail)</li> <li>the HTML video player has keyboard accessibility, focus management and screenreader issues in various browsers (see also: Scott Vinkle's post <a href="https://scottvinkle.me/blogs/work/how-accessible-is-the-html-video-player">How accessible is the HTML video player?</a> from 2019)</li> <li><a href="https://heydonworks.com/article/aria-controls-is-poop/"><code>aria-controls</code> is not or weirdly supported by screenreaders</a></li> <li>The expanded state of <code>details</code>/<code>summary</code> is not communicated to users of screenreaders in Firefox if the arrow is hidden (as documented by Scott O'Hara in <a href="https://www.scottohara.me//blog/2022/09/12/details-summary.html#impact-of-removing-the-default-disclosure-triangle">The details and summary elements, again</a>). That's a problem: conveying status to assistive technologies is a core feature of functionality that does visual expanding and collapsing</li> <li><a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-owns"><code>aria-owns</code></a> is not supported in Safari (see also: <a href="https://www.youtube.com/watch?v=ELauJdPoDaQ">Diego Haz' demo</a>)</li> <li><a href="https://adrianroselli.com/2019/02/avoid-default-field-validation.html">Default field validation cannot zoom</a></li> </ul> <p>Having these issues open for so long hurts web accessibility:</p> <ul> <li>developers who aren't aware may think that by using the platform they get accessibility by default and unknowingly build something inaccessibly</li> <li>developers who are aware may end up adding all sorts of hacky code to fix the issue on their end, which could lead to maintainability issues in the long term and makes accessibility unnecessarily hard</li> <li>developers generally will have a greater chance of shipping inaccessible interfaces</li> </ul> <p>On Twitter, people also replied with other interesting ways browsers could improve accessibility, like a browser implemention of “skip to <code>&lt;main&gt;</code>” (as <a href="https://twitter.com/LeonieWatson/status/1576212446351597568">Léonie suggested</a>) or even to any landmark (as <a href="https://twitter.com/cwilcox88/status/1577081780473303041">Curtis said</a>).</p> <p>And then there are issues around what browsers do, but (some) accessibility specialists disagree with, like that <code>&lt;dialog&gt;</code>'s focus trap can escape to the browser chrome. I've heard from developers whose accessibility consultants recommended them not to use <code>&lt;dialog</code> in the first place and that's an issue.</p> <p>I believe in personal responsibility when it comes to building a more accessible web. Teams need to test their work and ensure accessibility. But at the same time, change in the primitives (like <a href="https://hidde.blog/could-browsers-fix-more-accessibility-problems-automatically/">browsers</a> and <a href="https://hidde.blog/content-creation-accessibility/">CMSes</a>) is needed and can improve a lot of accessibility at once. All of the above issues are most easily solved by browsers, not individual web developers (see also my earlier post, <a href="https://hidde.blog/more-accessible-defaults-please/">More accessible defaults, please</a>).</p> <h2>ARIA-AT</h2> <p>If we look beyond just browsers and focus on assistive technologies, an interesting project comes to mind. The W3C's <a href="https://aria-at.w3.org/">ARIA-AT Community Group</a> has the goal to ensure “assistive technologies work with web code in predictable ways”. The group works on interoperability in four ways (taken from their homepage):</p> <ul> <li>write tests; they help ensure alignment between how assistive technologies behave, and with that, what users can expect</li> <li>run tests across different assistive technologies (currently focused on screenreaders, including JAWS, NVDA and VoiceOver)</li> <li>build consensus in the industry</li> <li>enable scalable automated testing (for which they are writing a standard, see the <a href="https://github.com/w3c/aria-at-automation">AT Driver explainer</a>)</li> </ul> <p>The <a href="https://vimeo.com/651279608/45aefd646f?embedded=true&amp;source=video_title&amp;owner=3360826">ARIA-AT explainer video</a> explains why this is so important: “there are hundreds of interpretation issues between screenreaders,” and “the way screenreaders and browsers interpret web code changes all the time”.</p> <p>I am very excited for this project, it will be super cool to see the test results pop up in places like the <a href="https://www.w3.org/WAI/ARIA/apg/">ARIA Authoring Practices Guide</a>.</p> <h2>Summing up</h2> <p>It would be great for the web to see browsers prioritise accessibility bugs and align between them on the accessibility aspects of current features like <code>&lt;dialog&gt;</code>, <code>&lt;video&gt;</code>, form validation and <code>aria-controls</code>. Either as part of the regular Interop program, or separately. At the same time, returning to the question I started with: yes, more interop between assistive technologies would be very welcome. Improving how assistive technologies interpret our code is a fantastic goal—I'm excited for the impact ARIA-AT will have.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/at-interop/">Do we need an Interop for assistive technologies?</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Do we need an Interop for assistive technologies?">Reply via email</a></p> Is this the last exodus from Twitter? 2022-11-06T00:00:00Z https://hidde.blog/twitter-exodus/ <p>There have been reasons to leave Twitter since its inception. But it's increasingly compelling to post somewhere else.</p> <p>Why read about what random people do all day? In the spring of 2007, I wasn't sure why I would join Twitter. All the cool web folks at that year's <a href="https://www.sxsw.com/">SXSW Interactive</a> had started using (and hyping) it. I worked at a small web agency at the time. My colleagues convinced me, I think. So I made an account on this new website that had just one text field with the question ‘What are you doing?’.</p> <p>When I started, I mostly bored my readers with facts like “I drank a cup of tea” or “waiting for a bus”. Mentions and retweets didn't exist yet. For the first, maybe, 5 years, my account was private and I had way under 100 followers. I tweeted mostly in Dutch, even in Frisian sometimes. There was a generous API so you could trivially display tweets on your own site. There were local in-person Twitter meetups, at least where I live, to hang out with Twitter folks, including one that had <a href="https://en.m.wikipedia.org/wiki/Dries_Roelvink">Dries Roelvink</a> perform.</p> <p><img src="https://hidde.blog/_images/twitter2007.png" alt="two twitter screenshots, the left one says: a global community of friends and strangers answering one simple question: what are you doing? answer on your phone, IM or right here on the web" /> <em>Twitter homepage in 2007, the logo was a piece of art</em></p> <p>In the years after, the platform expanded beyond the web developer crowd and interesting journalists, authors, musicians came. I used the platform more and more to follow folks I saw speak at conferences. Over the years I found a collection of hundreds of people whose stuff I really enjoyed reading. On web development, but also other interests. Some posted often, others occassionally. Either way, I learned so much from the tweets, links to other sites, discussions and what not. More people started following me too, and I managed to develop real friendships. My DMs got busier too. Twitter, the platform got useful new features, but ultimately, it's the people that attracted me to the platform and people that kept me on there.</p> <p>Yet, there were always compelling reasons to leave. The platform and tweets became more engagement-focused, the Twittersphere started to attract (and reward) grifters. The algorithmic timeline was introduced, although that could be turned off.</p> <p>Abuse also increased, especially for minorities on the platform. Under Jack Dorsey's leadership, Twitter <a href="https://www.huffpost.com/entry/alex-jones-twitter-suspension_n_5b6cb23de4b0530743c85d03">systematically failed to act on reports of racist, homophobic and misogynist accounts</a>, it made Twitter more dangerous to anyone not a cis white male, even got users in physical danger. Some of that was described in a 2018 Amnesty International report on Twitter called “<a href="https://www.amnesty.org/en/latest/research/2018/03/online-violence-against-women-chapter-1-1/">A toxic place for women</a>”, a document full of details on how the company failed to respect women's rights.</p> <p>And then there was the risk of making content on a platform that you don't control. My friend Manuel got <a href="https://www.matuzo.at/blog/2022/your-account-is-permanently-suspended/">permanently suspended</a>, for reasons unknown to him. I can only imagine what it was like for him to lose access, just like that. A lot of us tried to change the minds of “@TwitterSupport”, but until today, it wasn't resolved. For a lot of folks this situation was a wake up call to reconsider where they post. I realised my new ambition was to <a href="https://www.zachleat.com/web/own-my-tweets/">like, Zach, take ownership of my tweets</a>.</p> <p>Last week, I still didn't feel like leaving the platform just because the new owner was an arrogant troll with world views orthogonal to mine. I imagine more services I use have unpleasant owners. Last time I tried Mastodon, I didn't stay. The thing is, I don't even think I really <em>believe</em> in decentralised social networks, I would rather have all my friends in one pub than spread across pubs. I will probably find out I'm wrong about this, as the web at large was <em>designed</em> to be decentralised and it is one of the charms of it and arguably what made it so successful.</p> <p>But then that new owner <a href="https://twitter.com/gerardkcohen/status/1588584459779321857">fired Twitter's entire accessibility team</a>, its <a href="https://gizmodo.com/twitter-layoffs-elon-musk-ai-ethics-1849743051">ethical AI team</a> and <a href="https://www.theverge.com/2022/11/4/23441404/twitter-trust-safety-staff-layoffs-content-moderation">large parts of trust and safety folks</a> working on problems that have very real life consequences (like meddling in elections, spreading of conspiracy theories, hate crimes, impersonation), he unfolded plans for a new ‘Verified’ program that made the feature for sale rather than for security and then he recklessly and cruelly fired half of the staff (and <a href="https://www.bloomberg.com/news/articles/2022-11-06/twitter-now-asks-some-fired-workers-to-please-come-back">seems to be trying to get some back</a>)… it's chaos!</p> <p>So I decided to go ahead and hang out elsewhere, at least to put my content there. That other place is ‘the Fediverse’, and it has a different focus:</p> <blockquote> <p>the Fediverse is different: it isn’t trying to glue your eyeballs to the screen, and it’s harder for things to go viral. There is less media, fewer memes, no advertising. And there are humans explicitly in the loop: Mastodon instances are moderated on an instance-by-instance basis — and should an instance descend into a hellscape, it may find itself defederated. But because of all of this, there is also less opportunism, less trolling, less dunking on your enemies, less nastiness. So it also feels more relaxing, more earnest — and easier to put down.</p> </blockquote> <p>(from Bryan Cantrill's <a href="http://dtrace.org/blogs/bmc/2022/11/05/twitter-when-the-wall-came-down/">Twitter, when the wall came down</a>)</p> <p>Maybe the decentralisation aspect could actually work. <a href="https://willmartian.com/posts/mastodon-is-like-email/">It's a bit like email</a>.</p> <p>It seems like the new owner and his behaviour is driving people in my bubble away from Twitter, towards the Fediverse, personal blogs, RSS and other platforms. Probably mostly in that bubble, but maybe it is a wider thing, time will have to tell. It's probably not the last exodus.</p> <p>I didn't suddenly stop caring about the people I follow on Twitter, I understand not everyone wants to leave, so I will also stay on Twitter for the foreseable future. To catch up on tweets, to DM and to share posts like this one. But for the next while, I plan to hang around on Mastodon more.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/twitter-exodus/">Is this the last exodus from Twitter?</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Is this the last exodus from Twitter?">Reply via email</a></p> Dialogs and popovers seem similar. How are they different? 2022-11-08T00:00:00Z https://hidde.blog/dialog-modal-popover-differences/ <p>Web platform concepts can sometimes <em>be</em> quite different, yet <em>seem</em> very similar. Semantics, behaviours and characteristics can be tricky to distinguish. In addition to the <a href="https://html.spec.whatwg.org/dev/interactive-elements.html#the-dialog-element"><code>&lt;dialog&gt;</code> element</a>, HTML now has a <a href="https://html.spec.whatwg.org/dev/popover.html#the-popover-attribute"><code>popover</code> attribute</a>. This post goes into the differences between dialogs, popovers, overlays and disclosure widgets. We'll also look at what it means when an element is <em>modal</em>. All <em>somewhat</em> related concepts that can seem very similar. At least they did to me. Let's dive in!</p> <p>(If this is too long, I did a <a href="https://www.youtube.com/watch?v=uZRp7yY8SS0">40 minute talk version at All Day Hey</a> and a <a href="https://portal.gitnation.org/contents/dialog-dilemmas-and-modal-mischief-a-deep-dive-into-pop-ups">7 minute version at JS Nation</a> (don't believe the ‘AI’ summary on that page))</p> <div class="toc" style="padding-left: 1em; border-left: .75em solid var(--comments-border-color);"> <style>.toc a { color: var(--text-color); font-weight: bold; } .toc li { margin-left: 0; }</style> <h2 style="font-size: 1em; margin-top: 0; text-transform: uppercase; letter-spacing: 2px;display: inline-block;">In this post</h2> <ol style="list-style: none; margin-left: 1em;"> <li><a href="https://hidde.blog/dialog-modal-popover-differences/#heading-2">Introduction</a></li> <li><a href="https://hidde.blog/dialog-modal-popover-differences/#heading-3">The characteristics</a> (modality, light vs explicit dismiss, top layer presence, backdrop, constrained focus, keyboard dismissable/collapsible)</li> <li><a href="https://hidde.blog/dialog-modal-popover-differences/#heading-4">The main patterns</a> (dialogs, popovers, overlays, disclosure widgets)</li> <li><a href="https://hidde.blog/dialog-modal-popover-differences/#heading-5">FAQ</a></li> <li><a href="https://hidde.blog/dialog-modal-popover-differences/#heading-6">Summing up</a></li> </ol> </div> <div style="padding: 0 1em 1em 1em; margin-top: 1em; background-color: var(--homepage-background-color); color: var(--darker-text-color); border: 1px solid #ccc;"> <p><code>popover</code> is available:</p> <ul style="margin-left: 1em"> <li>Chrome (116) and Edge (115) </li><li>Safari (17) </li><li>Firefox (125) </li></ul> <p>You can use it in production (there is <a href="https://github.com/oddbird/popover-polyfill">popover polyfill</a>), but be sure to test it well, it is new and there may be issues with support, including accessibility support.</p> </div> <h2>Introduction</h2> <p>The thing with words is that not everyone uses them the same everywhere. The words in this post are no different. As a long time contractor I changed environments on the regular—phrases changed when I worked in different teams, companies, countries and even years (see also older resources, like the <a href="https://wiki.whatwg.org/wiki/Dialogs">WHATWG wiki on dialogs</a>). Meanings change over time, also in the world in general… this is normal! But in the case of these components, interpretation differences can lead to bad user experience.</p> <img src="https://hidde.blog/_images/examples.png" alt="Examples of dialogs and popovers; from left to right select your age modal, GitHub checkout repository popout, owned by filter in Google Docs, add feed modal in Feedbin, settings popover in DuckDuckGo" /> <p>A lot of the concepts I'll discuss in this post originated in operating systems: see <a href="https://developer.apple.com/design/human-interface-guidelines/guidelines/overview">Apple's Human Interface Guidelines</a>, <a href="https://learn.microsoft.com/en-us/windows/win32/uxguide/designprinciples">Microsoft's “Win32” guidelines</a> (old) and <a href="https://learn.microsoft.com/en-us/windows/apps/design/controls/">Controls for Windows apps</a> (newer). If we compare those with patterns in <a href="https://www.w3.org/WAI/ARIA/apg/">ARIA Authoring Practices Guide</a>, we'll find similarities. Some similarities are on the surface, they just look the same. Others are similar for users of assistive technologies: the ergonomics of some ARIA components are designed to be similar to the corresponding operating system ergonomics, for better or for worse.</p> <p>But OS-level guidelines or ARIA Authoring Practices (APG) aren't the best place for web developers to look for implementation guidance. OS-level guidelines are for OS-es, APG is to demo how to use ARIA (not how well it is supported).</p> <p>For clarity, throughout this post, I will refer to the concepts of dialog, modality and popovers as they exist on the web, in languages like HTML, CSS and ARIA (note: popovers don't exist yet, just as a proposal). My definitions are meant to align with the relevant web specifications, they may be slightly different from what is used in other places and in individual teams.</p> <p>Below, we'll start with characteristics that components can have, like modality, light dismiss, top layer presence and backdrops. Then we'll talk about what we get when these characteristics are used together in a website or web app: dialogs, popovers, overlays and disclosures. Hopefully, when we discuss the characteristics in detail first, it is easier to distinguish the components themselves.</p> <h2>The characteristics</h2> <h3>Modality / inertness</h3> <p>Some design systems have a component named “modal”, but modality is more of a characteristic than a component itself.</p> <p>So what does it mean for an element to be <em>modal</em>? Basically, when a modal component is open, it is the only thing that is <em>not</em> inert. Only the modal content can be interacted with, the <em>rest of the page</em> or application is made inert. Inert content is content that users cannot interact with. It is only really there visually, but you cannot Tab to it, click it, scroll it or access the content via assistive technologies.</p> <p>Elements that are not modal are called <em>non-modal</em> or <em>modeless</em>.</p> <p><img src="https://hidde.blog/_images/patagonia-cookie-consent.png" alt="patagonia homepage that is dimmed with a not dimmed cookie consent form laying on the top, with choice between accept all cookies and cookie settings" loading="lazy" /><em>In this example, the dimmed background suggests a choice between accepting and refusing cookies has to be made before any other interaction can happen. (Note: on actual website, scrolling the background still works, it shouldn't)</em></p> <p><a href="https://modalzmodalzmodalz.com/">Not everyone likes modality</a>—as a UI concept, they are very disruptive. Use the pattern sparsely, only when disrupting is very much necessary. If you want to ask the user “Are you sure you want to delete all that?”, go ahead and make it disruptive. If you want to promote your newsletter sign-up or advertising, the disruption is unlikely to be appreciated.</p> <p>In terms of implementation, you will need to make everything except your modal element inert. The <code>&lt;dialog&gt;</code> element (used with <code>showModal()</code>) does this for and would be the best to use.</p> <p>If you cannot use <code>&lt;dialog&gt;</code> or are looking at an older code base that doesn't, here's an example of distinguishing between modal and inert content:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>body</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>modal<span class="token punctuation">"</span></span> <span class="token attr-name">role</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>dialog<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token comment">&lt;!-- modal content --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>everything-else<span class="token punctuation">"</span></span> <span class="token attr-name">inert</span><span class="token punctuation">></span></span> <span class="token comment">&lt;!-- everything else --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>body</span><span class="token punctuation">></span></span></code></pre> <p>The gist of it is that one element is modal and everything else inert: unavailable to any user or technology. As today, not all users will be on a browser that supports <code>inert</code>, best use <a href="https://github.com/WICG/inert">the <code>inert</code> polyfill</a>. Without <code>inert</code> or its polyfill, you would need to add <code>aria-hidden=&quot;true&quot;</code> to the content outside of the modal (to make it unavailable for assistive technologies) and <code>tabindex=&quot;-1&quot;</code> to any interactive elements that are not in the modal.</p> <p>Just trapping focus in an element or adding a backdrop does not make it truly modal. With a focus trap, you only make the rest of the content unavailable via a keyboard. With a backdrop, you only make it unavailable visually.</p> <h3>Light vs explicit dismiss</h3> <p>Another aspect to consider is how users dismiss a component and whether that is affected by other elements: this can be via explicit dismiss or light dismiss.</p> <p>With ‘explicit dismiss’, a component allows a user to dismiss it, for instance via a close button and the Escape key (when in doubt, best add both).</p> <p><img style="border: 1px solid #ccc" src="https://hidde.blog/_images/explicit-dismiss.png" alt="Screenshot of compose tweet screen that has draft tweet with text: explicit dismiss example" loading="lazy" /> <em>Explicit dismiss: if I don't want to send this tweet, I can press the close button or Escape to dismiss the dialog I'm presented with</em></p> <p>With ‘light dismiss’, a component disappears automatically on certain conditions, like when users scroll, interact with something else or click outside of the component. Light dismiss doesn't happen when the user <code>Tab</code>s out of the element by default (but developers can add it if needed, see <a href="https://github.com/openui/open-ui/issues/415#issuecomment-1261460981">the discussion in openui/open-ui#415</a> for more details).</p> <p><img style="border: 1px solid #ccc" src="https://hidde.blog/_images/lightdismiss.gif" alt="Repeating animation of Google docs screen with fonts chooser open, a click outside happens and then it closes" loading="lazy" /> <em>Light dismiss: if the font picker is open and I click in the text that I'm editing, the font picker will close automatically</em></p> <p>Light dismiss is something we can already build in JavaScript today, a lot of websites have components that light dismiss. But with the <code>popover</code> attribute, the browser would do it for you (if you use <code>popover=&quot;auto&quot;</code>).</p> <h3>Top layer presence</h3> <p>By default, if multiple elements are positioned in the same location, they are painted by the browser in DOM order. The element that is first in the DOM is painted first, each subsequent element on top of the previous and the last one in the DOM is painted last, at the top. With the <code>z-index</code> property in CSS you can deviate from the default on a case by case basis. You basically decide your own layer order. This feature is defined in an appendix to CSS 2.1 called the <a href="https://www.w3.org/TR/CSS2/zindex.html">Elaborate description of Stacking Contexts</a>.</p> <p>The <a href="https://drafts.csswg.org/css-position-4/#document-top-layer">top layer</a> (as of July 2023, part of CSS's Positioned Layout Module, Level 4) is painted after the painting process described above, and the stuff within it is therefore on top of everything else. The top layer is not new in the web platform, but the ability for developers to promote elements to it is. Web pages have just one top layer. Within the top layer, elements are painted in the order they are <em>added</em> to the top layer (so shuffling them around involves adding/readding them).</p> <p>Sometimes, developers add components just before the closing <code>&lt;/body&gt;</code> tag to try and ensure that they are painted above other things (given nothing has a <code>z-index</code> &gt; 0). The top layer introduces a new way to allow elements to be on top of everything else, regardless of where they are in the DOM or their <code>z-index</code>.</p> <p>Another benefit of the top layer has to do with overflow. If your popup is in an element with <code>overflow: hidden</code>, that will cut it off. If it is promoted to the top layer, no cutting off will take place.</p> <p>A downside of an element being in the top layer, is that it can't be positioned relative to things in the main document. I believe this is something modal dialogs usually don't need, but popovers would need a lot of the time. See also: <a href="https://hidde.blog/positioning-anchored-popovers/">Positioning anchored popovers</a>.</p> <h3>Backdrop</h3> <p>In some cases, it makes sense for elements to have a backdrop. A backdrop usually serves as a visual cue that conveys content behind it is unavailable for interactions. Sometimes, it can be used as a way to help the user focus.</p> <p>The <a href="https://fullscreen.spec.whatwg.org/#css-pe-backdrop"><code>::backdrop</code></a> pseudo element can be applied to top layer elements. It allows you to style the backdrop in any way you want.</p> <h3>Constrained focus</h3> <p>Sometimes focus is constrained to (or trapped in) a specific element, meaning that if focus is in this element and you press <code>Tab</code> or <code>Shift + Tab</code>, you will never go to elements outside of the element. This characteristic is also known as a “keyboard focus trap”. It is a side-effect of making everything else inert (which <code>&lt;dialog&gt;</code> does for you). (Note: trapping focus in an element does not make that element modal, but if it is truly modal, focus cannot be moved outside of it, because nothing outside of it is focusable).</p> <p>Focus traps should be temporary until the element it applies to is closed or dismissed (they would fail <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1#no-keyboard-trap">WCAG 2.1.2</a> if it is not temporary and has no way to escape with a keyboard).</p> <h3>Keyboard dismissable/collapsible</h3> <p>If content can be dismissed or collapsed, users should also be able to dismiss or collapse it with just a keyboard.</p> <p>When content can be dismissed, a common pattern is that pressing the <code>Escape</code> key dismisses the content. Usually dismissal is restricted to happen only when the user is focused on something inside of the component to close. If there are multiple things to close, like with nested components, you would press <code>Escape</code> multiple times and closing would happen component by component from most inner to most outer element.</p> <p>When content can be collapsed, keyboard users should be able to use the same button that mouse users click to collapse content.</p> <h2>The main patterns</h2> <p>Let's look at some common patterns and how to distinguish between them.</p> <h3>Dialogs</h3> <h4>What is it</h4> <p>A dialog is a component in a web page or app that usually contains an action or some task to perform (see: <a href="https://html.spec.whatwg.org/dev/interactive-elements.html#the-dialog-element"><code>&lt;dialog&gt;</code> in HTML specification</a>). It is usually not part of the natural flow of other content, for that reason it can (and usually does) cover other content. MDN describes it as a “subwindow”, ARIA Authoring Practices defines it as a “window overlaid on either the primary window or another dialog window”.</p> <p>A dialog is often displayed when users need to be made aware of something or when they need to choose. Do you want to continue, yes or no? If you want to open a new file, what shall we do with your current file, save or delete? How do you want to crop this image, where is the hot spot?</p> <dialog role="dialog"></dialog> <p><img style="border: 1px solid #ccc" src="https://hidde.blog/_images/confirm.png" alt="dialog that says Would you like to use a dialog? with cancel and ok button" loading="lazy" /> <em>Browser dialogs / <code>confirm()</code></em></p> <p>Canonically, dialogs are a lot like <code>window.confirm()</code>, <code>window.alert()</code> and <code>window.prompt()</code>, which the HTML specification lists under ‘<a href="https://html.spec.whatwg.org/dev/timers-and-user-prompts.html#simple-dialogs">simple dialogs</a>’. But unlike these browser built-in dialogs, custom dialogs offer more flexibility—you get to put whichever content and styling you want inside of them.</p> <p>Dialogs have a role of <code>dialog</code>, which the browser will assign automatically for you when you use the <code>&lt;dialog&gt;</code> element.</p> <div style="padding: 0.015em 1em; background-color: var(--homepage-background-color); color: var(--darker-text-color); border: 1px solid #ccc;"> <p>You can also create dialogs with ARIA: apply <code>role=&quot;dialog&quot;</code> to an element (like <code>&lt;div&gt;</code>). If it is a modal dialog, add <code>aria-modal=&quot;true&quot;</code> when it shows, and remove it when it is dismissed. You will need to do all the modality work yourself (focus trap, making rest of content inert, etc). Note: <code>aria-modal</code> is not supported in IE11 (which <a href="https://webaim.org/projects/screenreadersurvey9/#browsers">may still be in use among your assistive technology users</a>), there are <a href="https://bugs.webkit.org/show_bug.cgi?id=174667">issues with <code>aria-modal</code> in VoiceOver</a> and it seems <a href="https://a11ysupport.io/tech/aria/aria-modal_attribute">unsupported in Narrator</a>.</p> </div> <p>You can put a form with <code>method=&quot;dialog&quot;</code> in a dialog. This form will close its dialog when submitted.</p> <h4>Examples</h4> <p><img style="border: 1px solid #ccc" src="https://hidde.blog/_images/add-link.png" alt="Insert link dialog with behind it a dimmed background. It has fields for Link Text and URL, buttons to close the dialog or add the link" loading="lazy" /> <em>Modal dialog: add a link; nothing behind it can be interacted with while this modal dialog is open.</em></p> <p><img style="border: 1px solid #ccc" src="https://hidde.blog/_images/how-are-you-today.png" alt="travel booking site with in the left bottom corner a chat widget with a chatbot that says Hi Hidde How are you today." loading="lazy" /> <em>Non modal dialog: while this chat widget is open, I can still access the forms and content underneath. </em></p> <h4>Characteristics</h4> <p>Dialogs can be modal (<code>&lt;dialog&gt;</code> when shown with <code>dialog.showModal()</code>) or non modal (<code>&lt;dialog&gt;</code> when shown with <code>dialog.show()</code>). To avoid quirks, you will want to choose which of the two your dialog is, and only call one of these methods per dialog.</p> <p>When <code>&lt;dialog&gt;</code>s are modal, the browser will treat the content outside of the dialog as inert, and prevent keyboard focus from reaching web content outside of the dialog (if you use <code>role=&quot;dialog&quot;</code>, you have to do this yourself). If a <code>&lt;dialog&gt;</code> is not modal, the other content is not treated as inert. This makes modal dialogs a lot more disruptive, so use them only when you have to. You usually don't want to interrupt or disrupt a user's flow.</p> <p>Dialogs are in the top layer only if they are modal (and only if the <code>&lt;dialog&gt;</code> element is used; other elements with <code>role=&quot;dialog&quot;</code> will not go to the top layer).</p> <p>Dialogs must have an accessible name (see <a href="https://www.w3.org/TR/wai-aria-1.2/#dialog">WAI-ARIA 1.2, <code>dialog</code> role</a>). Associate your dialog with the visible heading or message (if brief) using <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby"><code>aria-labelledby</code></a> on the <code>&lt;dialog&gt;</code> / <code>&lt;div role=&quot;dialog&quot;&gt;</code>. You could also use <code>aria-label</code>, but associating with visible text is ideal, because it creates parity between what folks see and what assistive tech call stuff.</p> <p><a href="https://www.w3.org/TR/wai-aria-1.2/#dialog">WAI-ARIA</a> specifies that when you're using <code>role=&quot;dialog&quot;</code>, you should include at least one focusable element and move focus to one of the focusable elements when it opens.</p> <p>Browsers will close modal dialogs when users press <code>Escape</code>. Non-modal dialogs don't get this default behaviour, developers can add it where it makes sense.</p> <h3>Alert dialogs</h3> <p>WAI-ARIA defines a specific type of dialog, which is called “alert dialog”. It is meant for dialogs that contain a brief, important message. Their function is to alert the user—the browser will do that by firing a system alert event to accessibility APIs. They are the ARIA-equivalent of the browser <code>alert()</code> dialogs we discussed above.</p> <h4>Examples</h4> <ul> <li>After you didn't interact with your online banking environment for 10 minutes, an alert dialog shows and says you will log out in 5 minutes, unless you press “Continue my session”</li> <li>You're editing some important content and accidentally press <code>Command + W</code>, the shortcut to close the current tab. An alert dialog appears to ask if you really want to “Leave” now or perhaps “Save your changes” first.</li> </ul> <h4>Characteristics</h4> <p>Alert dialogs are <strong>always modal</strong> and have their <strong>focus trapped</strong>. They also require an <strong>accessible name</strong>. Like with dialogs, if there is a visible title, associate the title's <code>id</code> with the alert dialog's <code>aria-labelledby</code> attribute. If not, <code>aria-label</code> can also be added to an alert dialog.</p> <h3>Popovers</h3> <h4>What is it</h4> <p>Popover is a set of behaviors that can be added to any element through the <code>popover</code> attribute (like <code>tabindex</code> or <code>contenteditable</code>). It is <a href="https://html.spec.whatwg.org/dev/popover.html#the-popover-attribute">specified in HTML</a> and there is a <a href="https://github.com/oddbird/popup-polyfill">polyfill</a> (<a href="https://open-ui.org/components/popup.research.explainer#alternatives-considered">why is it an attribute and not an element?</a>).</p> <p>The <code>popover</code> attribute is meant for UI components that are:</p> <ul> <li>on top of other page content</li> <li>not always visible (eg just when they are relevant), also described as “short lived” or “ephemeral”</li> <li>usually displayed one at the time</li> </ul> <p>As opposed to <code>&lt;dialog&gt;</code>s, a <code>popover</code> doesn't come with a built-in role (this is partly why it is an attribute and not an element), you <a href="https://hidde.blog/popover-semantics/">pick your own role</a>. It can take on any role that makes sense, or none at all. Sometimes popovers could be (modeless) dialogs, in that case you could use <code>&lt;dialog popover&gt;</code>.</p> <p>The popover attribute is planned to allow for two values, each of which give a slightly different set of characteristics:</p> <ul> <li><code>popover=auto</code>: light dismisses; when it opens, it force-closes other popovers and hints (except its anchestors); it or its anchestor would usually receive focus</li> <li><code>popover=manual</code>: explicit dismiss (via timer, close button or some other script); when it opens, it does not force close anything</li> </ul> <p>(More types may follow)</p> <p>Full screen content also forces popovers of the “auto” type to close.</p> <h4>Examples</h4> <p>An example of a popover is the listbox that shows when a select is opened (conceptually for <code>&lt;select&gt;</code> and literally for <code>&lt;selectmenu&gt;</code> as it is currently implemented in Chromium).</p> <p>These are some common examples of components with popover behaviours:</p> <ul> <li>Datepickers / calendar widgets</li> <li>Tooltips and toggletips</li> <li>Teaching UI (e.g. to point out parts of your interface when it is first shown)</li> <li>Action menus (see example below), using <code>role=&quot;menu&quot;</code></li> </ul> <p>There are also popovers that users need to dismiss or that automatically dismiss (like toasts).</p> <p>So yes, there are lots of different UI patterns that can have “popover” behaviour as a requirement. This is why popover is proposed not as one HTML element, but as an attribute that is meant to be used with an HTML and/or <code>role</code> that is most suitable for that pattern. For an action menu, that's a <code>&lt;div role=&quot;menu&quot; popover&gt;</code>. A tooltip could be <code>&lt;div role=&quot;tooltip&quot; popover&gt;</code> (depending on context and what it is). In any case: each of these patterns has its own UX expectations.</p> <p><img style="border: 1px solid #ccc" src="https://hidde.blog/_images/change-image.png" alt="CMS image component with preview of an image and its alternative text. Next to the image is a kebab button from which a menu called Replace is expanded, with actions Upload, Browse, Download, Copy original files, Copy URL, Clear field, the last one is red" loading="lazy" /> <em>This menu with image options is a popover. It disappears when you click outside of it.</em></p> <p><img style="border: 1px solid #ccc" src="https://hidde.blog/_images/fritz.png" alt="image with bottles of fritz kola on Twitter, in the left bottom corner is an ALT badge from which a popover is expanded that says Image Description, describes the bottles and then has a large Dismiss button" loading="lazy" /> <em><br /> Twitter's alternative text feature is another example of a popover (<a href="https://adrianroselli.com/2022/04/keyboard-challenges-for-twitters-new-alt-badge.html">implementation has accessibility issues</a>)</em></p> <h4>Characteristics</h4> <p>Popovers are <strong>not modal</strong>. This is another major difference between popovers and dialogs. For this reason, it will be rare (but not impossible) for them to have a backdrop or focus trap.</p> <p>Popovers can have ‘light dismiss’ behaviour, meaning they close by themselves, except when they are of the “manual” type. Manual popovers could be things like a “toast” notification that is dismissed via a timer or manual button.</p> <p>Popovers, even if rare, <em>can</em> have a backdrop, which obscures content outside of it. This does not make the popover modal—as mentioned, popovers are non-modal. My recommendation is that if you're considering adding a backdrop to your popover, to also consider ”oh wait, maybe this <em>is</em> a modal dialog instead”. It might well be. Having said that, there is a handful of use cases for popovers with backdrops that are not modal.</p> <p>Popovers can have focus trapped in them, for instance in complex widgets where you want to avoid that people accidentally tab out of the widget. A focus trap does not make a popover modal, as users can still access everything else on the page, it is just something that can improve usability in certain cases.</p> <p><img style="border: 1px solid #ccc" src="https://hidde.blog/_images/toast.png" alt="CMS interface with dimmed out publish button and in the right bottom corner a green box that says 'the document was published', the box has a button with a close icon on the right" /> <em>A “toast” notification that dismisses automatically after a couple of seconds and also has a close button in case you want it to go away now (most toasts just disappear, that's also fine; in either case their contents <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1#status-messages">should be conveyed to assistive tech</a>).</em></p> <p>Popovers also can be opened, closed and toggled without JavaScript: with a <code>&lt;button&gt;</code> in HTML and the <code>popovertarget</code> attribute that points to the popover's ID, the browser can take care of showing, hiding and toggling.</p> <p>An example:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>button<span class="token punctuation">"</span></span> <span class="token attr-name">popovertarget</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>datepicker<span class="token punctuation">"</span></span> <span class="token punctuation">></span></span>Pick date<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dialog</span> <span class="token attr-name">popover</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>datepicker<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dialog</span><span class="token punctuation">></span></span></code></pre> <p>In this case, the dialog is turned into a popover with the <code>popover</code> attribute, which adds the popover behaviours. The button will toggle the popover, because the popover's ID matches the button's <code>popovertarget</code> attribute.</p> <p>The button can also be set op to just show or just hide, in this case use <code>popovertargetaction</code> with <code>show</code> or <code>hide</code> (the <code>toggle</code> value exists too, and is the default).</p> <p>To open the popover when the page loads, set <code>defaultopen</code> on the popover. This is useful for teaching UI.</p> <p>To move focus to a popover when it opens, set the <code>autofocus</code> attribute on the popover itself, or an element within it. Normally, this attribute sets focus on page load. But if it is used on or within popovers, it only sets focus when the popover is shown (this can be on page load if <code>defaultopen</code> is used).</p> <p>To position a popover, a very exciting proposal called <a href="https://tabatkins.github.io/specs/css-anchor-position/">CSS Anchor Positioning</a> is in the works. As far as I understand it today, it would allow us popovers that automagically position in the most suitable place, avoiding collisions with the edge of the window. A bit like the <a href="https://popper.js.org/">Popper</a> library does today, but built into the browser.</p> <p>If focus management, positioning, JavaScript-less toggling and light dismiss weren't enough, there is also a proposal for popovers to be transitionable using CSS, between <code>[popover]</code> and <code>[popover]:popover-open</code> (of course, you'll want to adhere to your users' motion settings using <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion">prefers-reduced-motion</a>).</p> <h3>Overlays</h3> <p>Overlays are more of a characteristic than a component on their own. Often, when developers talk about overlays, they mean dialogs that are modal. In a literal sense, overlays are things that lay on top of other things. Popovers and dialogs can both overlay other things.</p> <h3>Disclosure widgets</h3> <h4>What are they</h4> <p>Elements that show and hide things are often called ‘disclosure widget’, as Adrian Roselli describes in <a href="https://adrianroselli.com/2021/07/stop-using-pop-up.html">his post about various kinds popover-like controls</a>. Almost everything in this post is a subset of disclosure widgets… as in, they are pretty much all things that can be shown and hidden. Adrian describes disclosure widgets in more detail in his post <a href="https://adrianroselli.com/2020/05/disclosure-widgets.html">Disclosure widgets</a>.</p> <p>Disclosure widgets exist in HTML as <code>&lt;details&gt;</code>/<code>&lt;summary&gt;</code>, but can also be built with <code>&lt;div&gt;</code> and the appropriate ARIA attributes. This isn't entirely the same. In <a href="https://www.scottohara.me//blog/2022/09/12/details-summary.html">Details/summary, again</a>, Scott O'Hara suggests that this is more consistent:</p> <blockquote> <p>If your goal is to create an absolutely consistent disclosure widget behavior across browsers, i.e., ensuring that all <code>&lt;summary&gt;</code>s are exposed as expand/collapse buttons, then you’d be better off creating your own using JavaScript and the necessary ARIA attributes.</p> </blockquote> <p>But, he adds, your ARIA disclosure widget won't have some of the features <code>&lt;details&gt;</code>/<code>&lt;summary&gt;</code> brings, like in-page search (Chromium triggers a <code>&lt;details&gt;</code>'s element <code>open</code> state when an in-page search query is found in its content).</p> <p>There isn't a specific <code>role</code> for disclosure widgets, but there is the <code>aria-expanded</code> attribute for triggers and <code>aria-controls</code> to connect triggers with the element they trigger. When using <code>&lt;details</code>/<code>summary</code>, <code>&lt;dialog&gt;</code> and (in the future) <code>popover</code>, browsers take care of setting up these kinds of accessibility properties for you.</p> <h4>Examples</h4> <ul> <li>a Frequently Asked Questions section where the answers are collapsed and you can expand them from the questions</li> <li>tables in which individual rows can be expanded (See Adrian Roselli's <a href="https://adrianroselli.com/2019/09/table-with-expando-rows.html">Table with Expando Rows</a>)</li> <li>“Toggle tips”, like an “info” button that displays next to complex terminology to open a tooltip that explains the word</li> <li>“meganav” style navigation where the main navigation items open more navigations</li> </ul> <p><img style="border: 1px solid #ccc" src="https://hidde.blog/_images/wiki-disclosure.png" alt="wikipedia content with on the right hand side a box called Disability, under which all sections have show buttons, except the first two, which are expanded and have hide buttons next to them" loading="lazy" /> <em>The show/hide functionality of sections within a category (displayed on the right) are a disclosure widget</em></p> <h4>Characteristics</h4> <p>There are a lot of different things that qualify as disclosure widgets. What they have in common is that they consist of two parts: one is a <em>triggering</em> element, the other is the <em>triggered</em> element.</p> <p>Disclosure widgets do not trap focus, have no backdrops and are not modal. They are usually dismissed or collapsed with their trigger or a close-specific button.</p> <h2>FAQs</h2> <h3>Where should focus move?</h3> <p>When a modal dialog <strong>opens</strong>, keyboard focus should move to the default action. If there's a form, it is probably the first form field. If there is multiple buttons, it could be the one that is least destructive, like if there's “Cancel” and “Confirm” button, a sensible default would be “Cancel”.</p> <p>When a modal dialog <strong>closes</strong>: if the user triggered it, move focus back to the trigger. The browser does this automatically for <code>&lt;dialog&gt;</code>s. For popovers, it only does in cases “where it makes sense” (see the <a href="https://open-ui.org/components/popover.research.explainer/#focus-management">Popover Explainer</a>). If the user did not trigger it, move it to an appropriate position earlier in the DOM.</p> <p>For all other components (non-modal dialogs, popovers or disclosures), expected focus management differs case by case. The <a href="https://open-ui.org/components/popover.research.explainer/#focus-management">Popover Explainer's section on focus</a> describes some of such cases.</p> <h3>Are all popovers dialogs?</h3> <p>Let's distinguish between three things we could mean by “dialog”:</p> <ul> <li>the <code>&lt;dialog&gt;</code> element, an element with a built-in dialog role and dialog behaviours and possiblities (like, you can run <code>show()</code> and <code>showModal()</code> methods on it)</li> <li>elements with <code>role=&quot;dialog&quot;</code>: the <code>role</code> attribute with the <code>dialog</code> value gives this a dialog role, but other than that, it comes with nothing, you would have to add your own behaviours to it</li> <li>the word “dialog”: in your design system documentation, or in any casual conversation about components, you could be referring to dialogs and they could be none or one of the above</li> </ul> <p>Sometimes, popovers use the <code>&lt;dialog&gt;</code> element or elements with a <code>role=&quot;dialog&quot;</code>. But not all of them. For instance, listboxes, menus, tooltips, grids, lists of links could all be components that require popover behaviours, but not the <code>dialog</code> role or the <code>&lt;dialog&gt;</code> element.</p> <h3>Are all dialogs popovers?</h3> <p>No, only <em>non-modal</em> dialogs are conceptually popovers (you can implement them with <code>&lt;dialog&gt;</code>/<code>role=&quot;dialog&quot;</code> today). When the popover feature is stable and well-supported in browsers, it makes sense to use <code>&lt;dialog popover&gt;</code>, and would be <em>the</em> way to go if you want your non-modal dialog to appear in the top layer and leverage browser-provided light dismiss. In contrast, <em>modal</em> dialogs don't share the set of characteristics popovers have.</p> <h3>I'm building an X, should it be modal?</h3> <p>It depends. The question to ask is: is this component something that is the only thing your user may pay attention when it is open?</p> <h4>Country selector</h4> <p>You are building a check-out form for your online shop. In one of the fields, the user need to select a country. They eventually have to, because it is a required field. Still, while they select the country, they may scroll to something else, or decide to pop to the credit card stuff first. Maybe they need to read the label to check if you need country of birth or residence. This is best <strong>non-modal</strong>, because the user may want to look at other things.</p> <h4>Definition popover</h4> <p>You are building a toggle tip that can show definitions for complex words in your content. When the definition icon is clicked, it opens. Your user may want to scroll away or read other content or do other stuff. It is best to keep this <strong>non-modal</strong>.</p> <h4>Game over</h4> <p>The user has played some levels of your game, but they've lost and are now “game over”. They can't continue. It's really over and there's a dialog to tell them. There's no other thing they can interact with than this dialog. <strong>Modal</strong> it is.</p> <h4>Tracking consent</h4> <p>You are building a dialog that asks users if they want to agree that you track them. Your visitor is in an area where the law makes it illegal for you to do so without permission. In this case, there is no point in interacting with anything but the permission screen, so it would make sense to make it <strong>modal</strong>.</p> <h4>Fly-out navigation</h4> <p>You are building a “fly-out navigation”. It opens on the side of the viewport and is positioned on top of other content while it is open. When the user opens it, is this the only thing they want to see? This one is tricky, I feel <strong>modal</strong> could work, <strong>non-modal</strong> could work too.</p> <h2>Summing up / conclusions</h2> <p>OK, so, in summary: <em>modality</em> of a component is a state in which only that component can be used. When something is modal, everything else is <em>inert</em>: blocked from access in any way, unfocusable and usually obscured with a backdrop. Making something modal is a substantial decision, it should be used sparingly. <em>Dialogs</em> can be modal or non-modal (also called modeless). <code>popover</code>s are being proposed by Open UI as a new way to build non-modal dialogs with a specific set of behaviours and characteristics, like top layer presence, JS-less toggleability and browser-provided light dismiss. Unlike <code>&lt;dialog&gt;</code>, a <code>popover</code> does not have a built-in role: as a developer, you can add the <code>popover</code> attribute to the semantically most relevant element (see my other post on <a href="https://hidde.blog/popover-semantics/">which role to use with your popover</a>).</p> <p>Most of the UI patterns that are mentioned in this post fall under the definition of overlays: content that can lay on top of other content (all dialogs and popovers). A lot also fall under the definition of disclosures, when they are patterns where one thing opens another thing.</p> <p>That's all! Yes, I wrote this whole long post about definitions, only to conclude a lot of these are indeed different words for the same patterns. But there's nuance. Hopefully this post has helped you more clearly distinguish some of these patterns.</p> <!-- https://github.com/whatwg/html/wiki/dialog--initial-focus,-a-proposal --> <!-- https://www.scottohara.me/blog/2019/03/05/open-dialog.html --> <h2>Further reading</h2> <ul> <li><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog">MDN - <code>&lt;dialog&gt;</code></a></li> <li><a href="https://www.w3.org/TR/wai-aria-1.2/#dialog">WAI-ARIA: role=dialog</a></li> <li><a href="https://www.scottohara.me/blog/2023/01/26/use-the-dialog-element.html">Use the dialog element (reasonably)</a> and <a href="https://www.scottohara.me/blog/2019/03/05/open-dialog.html">Having an open dialog</a> by Scott O'Hara on using <code>&lt;dialog&gt;</code></li> <li><a href="https://adrianroselli.com/2021/07/stop-using-pop-up.html">Stop using “pop-up”</a> by Adrian Roselli, which offers clear distinction between various popup-like patterns</li> <li><a href="https://github.com/openui/open-ui/issues/581">Open UI issue 581: [popup] Add further clarity that popup is not (presently?) for modal dialogs</a></li> <li><a href="https://www.youtube.com/watch?v=-gBv12xu4Yo">Inert | The CSS Podcast</a> with Una Kravets and Adam Argyle</li> </ul> <hr/> <p>Originally posted as <a href="https://hidde.blog/dialog-modal-popover-differences/">Dialogs and popovers seem similar. How are they different?</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Dialogs and popovers seem similar. How are they different?">Reply via email</a></p> My experience at Modern Frontends Live 2022-11-19T00:00:00Z https://hidde.blog/modern-frontends-live/ <p>This isn't a post I wanted to write, but alas, sometimes not staying silent matters. This week I spoke at <a href="https://modernfrontends.live/">Modern Frontends Live</a> in London. I was disappointed to see the organiser lied and misrepresented what they offered, as it impacted attendees, speakers and sponsors that were involved (financially and mentally).</p> <p>I didn't want to name names either, but my judgment after interacting with her and a number of people I trust, I fear <strong>Gen Ashley</strong>, the organiser, might try it again, potentially under a different event name and/or try to hide what happened. To inform other attendees, sponsors and speakers, I want to be sure to share my experience.</p> <p>Below I'll list the misrepresentations that I found specifically problematic. Other writeups are available from <a href="https://dev.to/thisisjofrank/my-experience-of-modern-frontends-conference-1cgg">Jo Franchetti</a>, <a href="https://www.cassie.codes/posts/modern-frontends/">Cassie Evans</a>, <a href="https://kentcdodds.com/blog/my-modern-frontends-live-experience">Kent C. Dodds</a>, <a href="https://toddl.dev/posts/modern-frontends/">Todd Libby</a>, <a href="https://christopherallanperry.github.io/blog/2022/11/20/modern_frontends-an_attendees_perspective.html">Chris Perry</a>, <a href="https://mhartington.io/post/modern-frontends-live/">Mike Hartington</a>, <a href="https://jdhillen.com/blog/my-experience-at-modern-frontends-live/">JD Hillen</a>, <a href="https://dylanbeattie.net/2022/11/22/modern-frontends-2022.html">Dylan Beattie</a>, <a href="https://dev.to/niamhmccoo/my-experience-at-modern-frontends-live-1lcn">Niamh McCooey</a> and <a href="https://kilianvalkhof.com/2022/web/my-experience-at-modern-frontends/">Kilian Valkhof</a>. There is also a video reflection from <a href="https://www.youtube.com/watch?v=vKnCQxt19e8">Tejas Kumar</a>. Again, I don't think any of us intend to “pile on”, but speaking out matters, it shows that the issues aren't just one person's perspective.</p> <p>First, some context (that shaped my thoughts on conferencing). I have been involved with Fronteers Conference for 5 years (until 2013), anything from sitting at registration and holding mics to curation, team chairing and organiser handbook author (writing down what <a href="https://quirksmode.org/">PPK</a> and <a href="https://krijnhoetmer.nl/">Krijn</a> largely shaped). I was also involved with CSS Day and Performance Now to help out with practical stuff like registration. I've also given over 50 talks. Long story short, I do notice stuff at events sometimes.</p> <p>Second, not everything about the event was bad. I'm grateful the organisers put me in a decent hotel, served a tasty speaker's dinner and were friendly and treated me mostly with respect (but, for completeness, also broke promises to me, and treated others badly). I actually had a good time meeting friends, some for the first time. As a lot of my work is virtual, it was great to have lots of interesting conversations and relating to developers (my job is in developer relations), and to finally meet some of the Open UI and other W3C groups in person.</p> <h2>Wildly exaggerated attendee numbers</h2> <p>The conference website showed (and therefore <em>promised</em>) '3000+' attendees. There were a few hundred, to my best estimation. I asked Gen and the people manning the registration desk various times what the number of actual attendees was. She tried to dodge this question, said there were about 1000 tickets of which a number was free tickets, but she didn't know how many were attending as not everyone showed up.</p> <p><img src="https://hidde.blog/_images/mfl-site.png" alt="screenshot of modernfrontends.live, displaying 100+ speakers announced, 2 workshop days, 2 conference days, 100+ speakers, 3000+ developers" /> <em>Screenshot of the homepage taken on 19 November 2022, the day after the conference</em></p> <p>Conference registration systems show numbers and these badges are sent to a printing company. Health and safety people and catering need to know these numbers too. It seems nearly impossible to not know how many badges or you have.</p> <p>Either way, a few hundred is not a little bit less than 3000, it is 5-10% of what was promised.</p> <p>It's okay if ticket sales don't go as expected. It's not okay to stay silent about it and have everyone only find out on the event day. A few hundred is a small-ish event, 3000 is a huge event. Sponsors count on numbers to make their spend worthwhile, attendees count on numbers to estimate with how many people they could network. As a speaker, I need correct numbers to decide too, as there are a lot of events and me and my employer (if it's for work) are mindful about where we go. I don't mind speaking to 10 or 1000 people, but the number is one of the things I use to decide, especially when considerable travel time is involved.</p> <h2>Payment taken for a non-existent livestream</h2> <p>Livestream tickets were sold, but there were not cameras. These tickets (£42) were still on sale during the event, while there were no cameras. It was framed as ‘technical issues’. I've seen a lot of livestream-related technical issues, but they usually involve at least the presence of cameras.</p> <p>I found out while attending a session and accidentally scrolling my Twitter timeline, as one does. People had paid for a stream, got no information regarding how to access it. Friends wondered if there were even cameras. I looked around in the room, noticed none. Asked the technician, confirmed there were none in that room. I felt a little sick, assuming there must be a misunderstanding, left the room (sorry speaker) and went to check all other rooms. No cameras.</p> <p>Then I confronted Gen. She laughed at the idea that people had assumed cameras were needed for a livestream. Why did we assume such a thing, she wondered, and said they had planned to livestream with Streamyard. Maybe a possibility in theory, but it was halfway the first day and it hadn't happened yet, nor did I as a speaker receive instructions around setting that up (and anyone I checked with had not either).</p> <p>It's ok if the livestream you planned fails or even if the camera team you hired all got covid on the day. It's not okay to not communicate about that, or promise videos, as this tweet suggests they did:</p> <blockquote> <p>Just got an email. “Due to technical issues, we will not be streaming live, unless it gets fixed soon.”</p> <p>If not resolved, We will share recordings at a later date”</p> </blockquote> <p>Posted by <a href="https://twitter.com/ukF1dev/status/1593169409333694465">@ukF1dev on November 17 2022</a></p> <p>To my knowledge, after a lot of pressure the organiser have promised the people who bought a ticket a refund and a free ticket to “next year's event”.</p> <h2>Broken travel arrangement promises</h2> <p>Some speakers were not paid for travel, others were promised. Some paid thousands from their own pockets. I can personally say two hotel nights were covered for me by the conference. Travel reimbursement was promised to be paid before the event, after many reminders I am still waiting for that.</p> <p><em>Update (23 November 2023): it's a week after the event started and I've received reimbursement for my travel costs.</em></p> <p>I firmly believe an event should pay speakers' travel expenses as a minimum. Getting there and staying there should be paid from the conference budget, because speakers are an essential part of the event. They attract attendees and spend a lot of time to prepare, speak and attend. Exceptions could include events that are free to attend or that are (actually, like, really) community driven. I love those events and am usually happy to make time for them. Exceptions should not include events that charge attendees in the hundreds and sponsors in the thousands.</p> <p>Somewhat controversially and socialistically, I feel this should apply equally between speakers, and also apply to speakers who work for very rich employers. This helps avoid power imbalance in a couple of ways. I know some organisers take speakers whose employer pays the travel and it helps with the budget, and I get that, events can be very costly.</p> <p>It's okay if you don't want to pay any of the speaker's travel expenses, but do it fairly. It's also okay if you get so much email that you miss one of a speaker's three reminders, but communication is important. In my case they kept sending me emails and DMs to ask me to boost their event, but meanwhile ignored my requests to pay what they promised to pay.</p> <h2>Venue represented wrongly</h2> <p>Under a “The venue” heading, the website showed an enormous wall to wall screen and a very large audience. This isn't what the venue looked like. I understand a marketing website wants to persuade, but the gap between what this photo shows and the actual main room is too large. Was I naive to assume this reflected reality? I don't know, the screens at View Source (2019) in Amsterdam or JSConfEU (2019) in Berlin were a bit like the one shown on this photo. It's quite large for a developer conference, but it happens.</p> <p><img src="https://hidde.blog/_images/mfl-venue.jpg" alt="heading “the venue”, picture of enormous wall to wall screen with very large audience" /> <em>Another screenshot of the homepage taken on 19 November 2022, the day after the conference</em></p> <p>In <a href="https://dev.to/thisisjofrank/my-experience-of-modern-frontends-conference-1cgg">her post</a>, Jo Franchetti describes the venue in more detail.</p> <h2>Conclusion</h2> <p>Organising events is hard, lonely and stressful. I have a lot of respect for conference organisers, I have done it myself (not without many mistakes, believe me) and have friends who do still do it. So, by default, I cut organisers a lot of slack and have a lot of understanding for the many ways it could go wrong in. I believe in good intentions, generally anyway. I am also grateful for the things the conference did do right, thanks for that.</p> <p>There were red flags from the start (from the accessibility and front-end of the website to the lack of communication), but those did not stop me from going. The issues that emerged during the event did make me regret somewhat, but all I could do then is still try to enjoy it and deliver interesting content for the attendees that paid to come.</p> <p>The specific issues I've put in this post cross the line between honest mistakes and bad behaviour. They cross the line, because they consistute fraud (the livestream) and because they impact attendees, sponsors and speakers. The front-end community doesn't deserve this, and I'm worried for people new to the industry, who get may assume this is normal or ok. It's not normal. In the last year I've spoken at a number of events that had a very high bar to make it great for attendees, sponsors and speakers (shoutout to Beyond Tellerrand, JSConf Budapest and State of the Browser).</p> <p>In any case, if you were at the event, I encourage you to speak up, too.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/modern-frontends-live/">My experience at Modern Frontends Live</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20My experience at Modern Frontends Live">Reply via email</a></p> ACT Rules CG published implementations 2022-12-05T00:00:00Z https://hidde.blog/act-rules/ <p>The ACT Rules Community Group (CG) writes testing rules for accessibility standards conformance. In the process, they find consensus in interpretation issues. This week, the CG published <a href="https://www.w3.org/WAI/standards-guidelines/act/implementations/">an “Implementations” page</a> that shows these rules are not used in just one place, but in many: from manual methodologies to semi-automated (axe DevTools) and automated (axe-core, Alfa, Qualweb and more) tools.</p> <p>Before going into why this is great, I will give some context. Accessibility standards like <a href="https://www.w3.org/TR/WCAG21/">WCAG</a> define criteria to conform with, they help makers of websites understand what a web without barriers means in practice. For instance, in WCAG, it means colours have sufficient contrast, pages have titles, buttons have names, and so on. In <a href="https://www.w3.org/TR/wai-aria-1.2/">WAI-ARIA</a>, it means elements with a <code>cell</code> role must be contained in or owned by an element with the <code>row</code> role, to name just one example. These, and all other requirements (“<a href="https://www.rfc-editor.org/rfc/rfc2119">MUST</a>”s) in standards, are testable requirements. This makes testing basically the process of finding out if you meet the standards (you, a product, a browser, a tool, an assistive technology, etc). It is a great lens to view accessibility through. and definitely a lens I use a lot when teaching.</p> <p>But if you ever speak about the same issue with multiple accessibility specialists, you'll find that there can be differences in interpretation of these standards (see also: <a href="https://www.deque.com/blog/the-web-accessibility-interpretation-problem/">The Accessibility Interpretation Problem</a> by Glenda Sims and Wilco Fiers). One way to avoid interpretation issues would probably be to have thousands of success criteria WCAG that allow for zero interpretation, but that imaginary world would be a much worse world. Instead, agreeing on how to test might be the best option we have.</p> <p>The <a href="https://www.w3.org/groups/cg/act-r">ACT Rules Community Group</a> brings together makers of tools and other stakeholders to make testing accessibility standards more consistent, by finding agreement. They then write rules according to a <a href="https://www.w3.org/TR/act-rules-format/">format they specified</a>. The rules that apply specifically to WCAG are also reviewed by <a href="https://www.w3.org/WAI/GL/">AGWG</a>, the group that produces WCAG.</p> <p>This is tedious work and I, for one, am very pleased to see these rules now have implementations across different methodologies and tools. We'll probably see them more and more in the wild (I know I will in some tools I use). Congrats, Community Group, and keep up the great work!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/act-rules/">ACT Rules CG published implementations</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20ACT Rules CG published implementations">Reply via email</a></p> Mostly on Mastodon 2022-12-12T00:00:00Z https://hidde.blog/mostly-on-mastodon/ <p>I'm mostly on Mastodon now (I'm <a href="https://front-end.social/@hdv">@hdv</a>). What I mean by that I try and keep up with what people share on their Mastodon timeline and no longer do so on Twitter.</p> <p>In the past weeks, I've gone to “mostly Mastodon” from “<a href="https://hidde.blog/twitter-exodus/">partially Mastodon and partially Twitter</a>”. I did join a Twitter Space and still post every now and then, but it feels increasingly uncomfortable. I also monitor DMs, but will give out iMessage/LINE/Signal info to any mutual who wants a better way to contact me.</p> <p>I wrote about <a href="https://hidde.blog/twitter-exodus/">reasons to leave Twitter earlier</a>, new reasons pile up:</p> <ul> <li>a lot of the people I care about are now on Mastodon or stopped posting on Twitter (yay)</li> <li>quality matters more than quantity</li> <li>Mastodon has open ways to syndicate your content (it's been long since Twitter had open APIs)</li> <li>Twitter is mostly ChatGPT screenshots these days anyway (only partially kidding)</li> <li>the new owner tweets a lot about “woke” as if it is a bad thing</li> <li>the new owner doesn't seem to understand basic concepts like truth and free speech, but, and this is my main issue, continues to make bold claims about them, while running and making decisions about Twitter</li> <li>the new owner spreads misinformation including about public health, again, while running and making decisions about Twitter</li> </ul> <p>So, I'm mostly not spending time on Twitter.</p> <p>I'm mostly on Mastodon, instead. What does that mean? I post there primarily and only occassionally (and manually) cross-post to Twitter. I consciously choose Mastodon when engaging with cross-posted tweets, sometimes this means looking up a toot-version of a tweet, which is a bit of a nuisance, but fine. I've put my Mastodon presence on slide decks instead or in addition to Twitter, and added it to the footer of posts.</p> <p>Maybe you wonder why I don't just go, why I share all this? Touché. Well, it's been a non trivial decision for me, after decades on Twitter and making lots of connections there, the start of many professional and not-so-professional relationships and friendships. I can imagine it's the same for you. If you're reading this and are still mostly on Twitter, may I ask you to consider spending more time on Mastodon? It isn't as hard to use as sceptics make it out to be. Together we impact which place is more worthwhile.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/mostly-on-mastodon/">Mostly on Mastodon</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Mostly on Mastodon">Reply via email</a></p> 2022 in review 2022-12-26T00:00:00Z https://hidde.blog/2022-review/ <p>With only a few days left 2022, I wanted to review some of my 2022, including speaking, reading, music, writing and travel. Let's go!</p> <p>Note: like in <a href="https://hidde.blog/2021-in-review/">2021</a>, <a href="https://hiddedevries.nl/en/blog/2020-12-17-2020-in-review">2020</a>, <a href="https://hiddedevries.nl/en/blog/2019-12-20-2019-in-review">2019</a>, <a href="https://hiddedevries.nl/en/blog/2018-12-26-2018-in-review">2018</a> and <a href="https://hiddedevries.nl/en/blog/2017-12-29-2017-in-review">2017</a>, in this public post I mostly sum up “highlights“, stuff I <em>liked</em> about the year etc. Of course, life is more complex and less structured than posts like this make it out to be.</p> <h2>Work</h2> <p>From February, I started working full time at <a href="http://sanity.io/">Sanity.io</a>, we focus on making content management pleasant for everyone involved. I'm in the developer relations team, with a focus on things like documentation, starters, videos and workshops. The problems are intriguing, they are both technical (like real time multiplayer content editing) and organisational (like cross functional collaboration). I'm enjoying being in a place where I can learn a lot and contribute a lot of my experience at the same time. I feel lucky with great colleagues. Some things we released this year: <a href="https://www.sanity.io/studio">Sanity Studio v3</a> (customisable SPA to edit content), <a href="https://sanity-io.github.io/GROQ/">GROQ 1.0</a> (language to query content) and an <a href="https://sanity.io/accessibility">/accessibility</a> page following an accessibility review of Sanity Studio.</p> <p>This year I did only minimal accessibility consulting. including reviews and presentations for UWV, a Dutch governmental organisation focused on employment and unemployment, DigiD, the Dutch digital government identity and MDN/Mozilla.</p> <p>I am also still involved in <a href="https://open-ui.org/">Open UI CG</a>, where I try to learn and contribute: I scribe sometimes, join discussions where I can and talk about the work at events. This year, we got a lot done on <code>&lt;selectmenu&gt;</code> and <code>popover</code>. See my posts <a href="https://www.htmhell.dev/adventcalendar/2022/13/">on customisable selects</a> and <a href="https://hidde.blog/dialog-modal-popover-differences/">dialogs vs popovers</a>.</p> <h2>Speaking</h2> <p>This year had many more in person events, and I have loved speaking in person at JSConf in Budapest, EuroIA in Marseille and State of the Browser in London. Most talks were about accessibility, some about CSS, HTML and content.</p> <p>In 2023 I want to talk about the <a href="https://hidde.blog/dialog-modal-popover-differences/">nitty gritty of building popovers</a> and the power of systems that use composability as design principle (see <a href="https://hidde.blog/speaking">the Speaking page</a>).</p> <p>These are the talks I did in 2022:</p> <ul> <li><a href="https://talks.hiddedevries.nl/ZFXKzD/the-next-web">The Next Web</a> on why that's not “Web3” for SendCloud (remote)</li> <li><a href="https://talks.hiddedevries.nl/jgkk7W/a-toolkit-for-web-accessibility">A toolkit for web accessibility</a> on the “toolkit” edition of Beyond Tellerrand's Stay Curious event (where Stephanie presented her awesome toolkit for CSS) (remote)</li> <li><a href="https://talks.hiddedevries.nl/P1Kpon/its-the-markup-that-matters">It's the markup that matters</a> at JSConf Budapest and Modern Front-ends Live</li> <li><a href="https://talks.hiddedevries.nl/7336XA/shifting-left-or-making-accessibility-easier-by-doing-it-earlier">Shifting left, or: making accessibility easier by doing it earlier</a> at DevOps Amsterdam (remote), the Sanity July meetup (remote) and State of the Browser</li> <li><a href="https://talks.hiddedevries.nl/mhc1wO/editing-experiences-your-team-will-love">Editor experiences that your team will love</a>, a workshop, at React India (remote) and React Summit Amsterdam (remote)</li> <li><a href="https://talks.hiddedevries.nl/4WmKq3/more-to-give-than-just-the-div-semantics-and-how-to-get-them-right">More to give than just the div: semantics and how to get them right</a> at Frontmania</li> <li><a href="https://talks.hiddedevries.nl/tGzZs2/your-cms-is-an-accessibility-assistant">Your CMS is an accessibility assistant</a> at IAAP-EU (remote)</li> <li><a href="https://talks.hiddedevries.nl/PpuBeV/cross-functional-collaboration-for-structured-content">Cross-functional collaboration for structured content</a>, a workshop at EuroIA and Structured Content Conference, developed by my colleague Carrie Hane, co-facilitated by my colleague Simeon Griggs</li> <li><a href="https://talks.hiddedevries.nl/iohQPm/styling-selects-youve-got-options">Styling selects? You've got options!</a>, a lightning talk at CSS Day + CSS Café</li> </ul> <h2>Reading</h2> <p>In total, I read about 30 books this year, still a mix of physical, ebooks and audiobooks.</p> <p>On technology, I loved <a href="https://www.xiaoweiwang.com/writing"><em>Blockchain chicken farm</em></a> by Xiaowei Wang. “Hustle culture” isn't just a Silicon Valley thing, it's there in rural China. From “e-commerce villages” that solely focus on producing for Taobao to free range chicken on the blockchain (of course it added no value). Awesome mix of technology, travels, encounters, food and how the world and life works from an original thinker. Original thinking was also in <a href="https://www.jamesbridle.com/books/ways-of-being"><em>Ways of being</em></a> by James Bridle, about artificial intelligence, ecology and the relationship between the humans and the ‘more than human’ world. He critiques the idea that the world, all of the world, can be computed and represented in data points. He shows why that would be a limited way of thinking. It's a little vague sometimes, according to Cory Doctorow that's because <a href="https://doctorow.medium.com/james-bridles-ways-of-being-e1a43bf6d013">the book argues against crisp articulations themselves</a>.</p> <p>Two books I liked about identity and cultures were <em>Takeaway</em> and <em>If I surivive you</em>. <a href="https://www.angelahui.co.uk/takeaway"><em>Takeaway</em></a> by Angela Hui is about what it's like to grow up in rural Wales when your parents run a takeaway. Often entertaining, often touching tale of family relationships, finding identy and racial abuse. Food is a central theme too, the recipe each chapter ends with was a nice touch. I found <a href="https://jonathanescoffery.com/"><em>If I survive you</em></a>, by James Escoffery, a very well written collection of short stories about a Jamaican family in America, about existing between two cultures, capitalism and being black in America.</p> <p>I also thoroughly enjoyed <a href="https://www.debezigebij.nl/boek/erasmus-dwarsdenker/"><em>Erasmus: dwarsdenker</em></a> a biography of the philosopher/theologician Erasmus (in Dutch). Didn't know Erasmus spent lots of time begging patrons to fund him, so that he could write, travelled a <em>lot</em> (UK, Germany, Belgium and France, by horse and ship), got ‘jobs’ in the church that came with a livelong salary without requiring him to actually do the job (this was a thing at the time, Erasmus had his in Aldington, UK and Kortrijk, Belgium) and Erasmus had criticasters who published their criticisms anonymously and circulated lists of criticisms on his New Testament, mixed with gossip about his life and history. Glad we don't do any of that anymore. Oh wait…</p> <h2>Music</h2> <p>This year I listened a lot to:</p> <ul> <li>Kendrick Lamar's new album Mr Morale and the Big Steppers, which was my first introduction to his music and got me ready to explore all the earlier albums that everyone had been raving about. A colleague recommended the Dissect podcast, which explains <em>To Pimp a Butterfly</em> track by track in hour long episodes.</li> <li>Nubya Garcia's <a href="https://pitchfork.com/reviews/albums/nubya-garcia-source-we-move/">Source remix album</a>: saw her live in Rotterdam and have had her <a href="https://www.youtube.com/watch?v=DTIZikaOTDE">Tiny Desk</a> and <a href="https://www.youtube.com/watch?v=WdaJm6QPiIE">BBC Proms</a> (posted last month) gigs on repeat</li> <li>WIES, Froukje, Joost Klein and Hang Youth: there has been a resurge in Dutch artists performing in Dutch (English has been more common), loved the <a href="https://youtu.be/iOUtHCozs88">Bandje</a> pun on the Dutch Prime Minister's dismissive attitude towards the performing arts and ‘<a href="https://youtu.be/ImBZLKB9faE">Met je Ako ideologie</a>’ on getting one's world view from the train station's best selling non fiction (not making this up)</li> <li>Robert Glasper's <a href="https://www.robertglasper.com/">Black Radio 3</a> was my favourite album, where jazz and hiphop meet. Beautiful spoken word on a Radiohead-esque melody in the opening track and lots of collaborations with people like Esparanza Spalding and A Tribe Called Quest's Q-Tip (on one track) throughout.</li> </ul> <h2>Writing</h2> <p>I finally added some more useful categories to this blog, moved to a veey short domain (it's just hidde.blog) and published about 30 posts this year. I'm most happy with:</p> <ul> <li><a href="https://hidde.blog/dialog-modal-popover-differences/">Dialogs, modals and popovers seem different: how are they different</a>: a deep dive into these common patterns, with many thanks to Adrian Roselli and Scott O'Hara for their review help</li> <li><a href="https://hidde.blog/accessibility-objectivity/">“That's not accessible!” and other statements about accessibility</a></li> <li><a href="https://hidde.blog/content-creation-accessibility/">ATAG: the standard for the accessibility of content creation</a>, I learned a lot about ATAG while I was at W3C and this was my personal plain language version</li> <li><a href="https://hidde.blog/the-web-doesnt-have-version-numbers/">The web doesn't have version numbers</a>, the industry continued to surprise me with its dreams of making everything about money and ‘on’ an inefficient database (I'm also feel the <a href="https://hidde.blog/the-better-version-of-digital-life-is-real-life-not-the-metaverse/">‘metaverse’ is a non-sensical investment</a>)</li> </ul> <h2>Cities</h2> <p>San Francisco, Budapest, Düsseldorf, Cologne, Oslo, Paris, Marseille, London (5 times), Brighton, Antwerp, Lille, various towns in Normandy and Taipei.</p> <p>It's especially been nice to meet international internet friends in person, many for the first time, like Nicole, Tantek, Yulia, Vadim, HJ, Adam, Una, Gift, Adrian, Manjula, Ana, Jeremy, Michelle, Mu-An, Bruce, Andy, Sophie, Léonie, Anuradha, Jhey and Patrick. Plus almost all of my colleagues.</p> <h2>Conclusion</h2> <p>That's all for this year, thanks all for reading my posts, liking subcribing, disagreeing via email, everything! If you've posted a year in review, let me know, I'd love to read it!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/2022-review/">2022 in review</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%202022 in review">Reply via email</a></p> Data-informed flex-grow for illustration purposes 2023-01-13T00:00:00Z https://hidde.blog/flex-grow-illustration/ <p>I have this <a href="https://hidde.blog/books">web page to display the books I've read</a>. Book covers often bring back memories and it's been great to scroll past them on my own page. It's also an opportunity to play around with book data. This week, I added a bit of page count-based visualisation for fun.</p> <p>This is what it looks like: rectangles with colours based on book covers. Each relates to a specific book, and its size is based on that book's page count.</p> <img src="https://hidde.blog/_images/illustration-flex-grow.jpg" alt="heading 2022 with 7 books displayed. underneath the books are tens of rectangles that each have a different size and background color" /> <h2>What's flex-grow?</h2> <p>Flex grow is part of the CSS's <em>flex</em> layout mode. When you add <code>display: flex</code> to a HTML element, it becomes a <em>flex container</em>, and with that, its direct children become <em>flex items</em>. Flex items behave differently from block or inline level children. The difference is that flex items can be layed out in a specific direction (horizontal or vertical) and sized flexibly. This system is called “flexible layout box model” or simply flexbox. It comes with sensible defaults as well as full control via a range of properties.</p> <p>One of those properties is <code>flex-grow</code>. This is what it does:</p> <blockquote> <p>[flex-grow] specifies the <em><strong>flex grow factor</strong></em>, which determines how much the flex item will grow relative to the rest of the flex items in the flex container when positive free space is distributed</p> </blockquote> <p>(from: <a href="https://www.w3.org/TR/css-flexbox-1">CSS Flexible Box Layout Module Level 1</a>)</p> <p>So let's say you have ten <code>span</code>s in <code>div</code>, where the <code>div</code> is a flex container and the <code>span</code>s flex items:</p> <img src="https://hidde.blog/_images/flex10boxes-1.png" alt="10 numbered yellow rectangles on a gray background" /> <p>If you want one to proportionally take up <em>double</em> the space and another to take up <em>triple</em> the space, you'll give them a <code>flex-grow</code> value of <code>2</code> or <code>3</code>, respectively:</p> <pre class="language-css"><code class="language-css"><span class="token comment">/* item 2 */</span> <span class="token selector">span:nth-child(2)</span> <span class="token punctuation">{</span> <span class="token property">flex-grow</span><span class="token punctuation">:</span> 2<span class="token punctuation">;</span> <span class="token comment">/* takes up double */</span> <span class="token property">background</span><span class="token punctuation">:</span> crimson<span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token comment">/* item 6 */</span> <span class="token selector">span:nth-child(6)</span> <span class="token punctuation">{</span> <span class="token property">flex-grow</span><span class="token punctuation">:</span> 3<span class="token punctuation">;</span> <span class="token comment">/* takes up triple */</span> <span class="token property">background</span><span class="token punctuation">:</span> cornflowerblue<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>The others will then each take up one part of the remaining space (as if set to <code>1</code>):</p> <img src="https://hidde.blog/_images/flex10boxes-2.png" alt="same 10 numbered yellow rectangles, except number 2 and 6 have a red and blue background and slightly wider, 6 a little more than 2" /> <p>The <a href="https://www.w3.org/TR/css-flexbox-1/#propdef-flex-grow">specification</a> recommends generally using <code>flex</code> instead of <code>flex-grow</code>. This shorthand can take three numbers: a <code>flex-grow</code> factor (how much should it be able to grow), <code>flex-shrink</code> factor (how much should it be able to shrink) and a <code>flex-basis</code> factor (what size should we start with before applying grow or shrink factors.</p> <p>We can also give <code>flex</code> just one positive number, to use that number as <code>flex-grow</code>, and a default of “1” as <code>flex-shrink</code> and “0” as the basis (meaning no initial space is assigned, all of the size is a result from the grow or shrink factor). In our case, we'll use that <code>flex</code> shorthand, it's a sensible default.</p> <h2>Flex-grow for widths, aspect ratio for heights</h2> <p>My sites displays, like, 50 books for a given year. Each with a different amount of pages. Some are just over 100 pages, others are over 500. I wanted to use that number as the <code>flex-grow</code> factor. This means some books claim space of <code>113</code>, others claim <code>514</code>:</p> <pre class="language-css"><code class="language-css"><span class="token selector">[a-113-page-book]</span> <span class="token punctuation">{</span> <span class="token property">flex</span><span class="token punctuation">:</span> 113<span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token selector">[a-514-page-book]</span> <span class="token punctuation">{</span> <span class="token property">flex</span><span class="token punctuation">:</span> 514<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <p>So that will claim 113 worth of space for the one book and 514 worth of space for the other. I used little magic for this, I just applied an inline <code>style</code> attribute to each book in my template (Nunjucks), setting <code>flex</code> dynamically. When they all have a number, they all take a proportion, and when all the numbers are similar amounts, you'll see that the size they take up is quite similar, except for a few outliers.</p> <img src="https://hidde.blog/_images/flexgrow-step1.jpg" alt="horizontal line divided into parts that have different colors" /> <p>As mentioned above, these numbers represent a proportion of the total available space. You might wonder: which space? Flexbox can work in horizontal and vertical direction. Or, really, in inline and block direction, where inline is the direction in which inline elements appear (like <code>em</code>, <code>strong</code>) and block the direction in which block-level elements appear (eg paragraphs and headings).</p> <p>Flexbox only takes space in one direction. For my illustration, I used the default, which is the inline direction or <code>flex-flow: row</code> (this is shorthand for a <code>flex-direction: row</code> and <code>flex-wrap: nowrap</code>). This means my <code>flex-grow</code> values are about a proportion of “inline” space, in my site's case, this means horizontal space.</p> <p>I also want each book to take up some vertical space, as with only a width, we would not actually see anything. I could set a fixed height (in fact, I did that for the screenshot above). But in this case, I want the height to have a fixed relationship to the width. The <code>aspect-ratio</code> property in CSS is made for that: if an item has a size in one dimension, the browser figures out what the other dimension's size needs to be to meet a ratio you provide. In this case, the browser finds a height based on the width that it calculated for our proportion.</p> <p>Ok, so let's add an aspect ratio:</p> <pre class="language-css"><code class="language-css"><span class="token selector">.book</span> <span class="token punctuation">{</span> <span class="token comment">/* flex: [set for this book as inline style] */</span> <span class="token property">aspect-ratio</span><span class="token punctuation">:</span> 1 / 4<span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <img src="https://hidde.blog/_images/flexgrow-step2.png" alt="slightly higher horizontal line divided into parts that have different colors" /> <p>I also added a background-color that I have available in my template (it's a piece of <a href="https://www.sanity.io/docs/image-metadata#5bb0c7e96f42">image metadata that I get for free from Sanity</a>).</p> <p>Oh, but wait… they still have the same height! That's because by default, items are aligned to ”stretch”, they take up all available space in the opposite direction (block if items flow in inline direction, inline if items flow in block direction). When items stretch, remaining space is assigned back to them. In this case, that means they'll get the same height. Often super useful and quite hard to do pre-flexbox. But in this case, we don't want that, so we'll use <code>align-items</code> to set our items to align at the “end” (also can be set to “start”, “center” and “baseline”):</p> <p><img src="https://hidde.blog/_images/alignitems.gif" alt="animated gif alternating between full height items, and items of their own size that are aligned with align-items set to start (aligned to top), center and end (aligned to bottom)" /><em>What the books looks like for different values of align-items</em></p> <p>In my case, I also added a max-width to avoid extreme outliers and I addded opposite <code>rotate</code> transforms to even and odd items for funs:</p> <pre class="language-css"><code class="language-css"><span class="token selector">.book</span> <span class="token punctuation">{</span> <span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">rotate</span><span class="token punctuation">(</span>-2deg<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token selector">.book:nth-child(odd)</span> <span class="token punctuation">{</span> <span class="token property">transform</span><span class="token punctuation">:</span> <span class="token function">rotate</span><span class="token punctuation">(</span>2deg<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span></code></pre> <h2>This works with grids too</h2> <p>When I shared this, Vasilis rightly noted you could <a href="https://social.vasilis.nl/@vasilis/109674830617288847">pull the same trick with grids</a>. If you add <code>display: grid</code> to an element it becomes a grid container and its children grid items. That sounds a lot like flexbox, but the main difference is that sizing isn't done from the items, it is done from the container. For a grid, you define columns (and/or rows) that have a size. The <code>fr</code> is one of the units you can use for this, it's short for “fraction”. Pretty much like proportions in flexbox, <code>fr</code> will let you set column/row size that is a proportion of the available space. If you set all your columns with <code>fr</code>, each one will be a proportion of all available space in the relevant direction.</p> <h2>Summing up</h2> <p>I usually use flexbox with much lower numbers, often under 10. But it turns out, it works fine with larger numbers, too. I have not done extensive performance testing with this though, there may be issues if used for larger sites with more complex data.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/flex-grow-illustration/">Data-informed flex-grow for illustration purposes</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Data-informed flex-grow for illustration purposes">Reply via email</a></p> Browser built-in search and ATAG A.3.5.1 2023-01-27T00:00:00Z https://hidde.blog/atag-a351-browser-built-in-search/ <p>The Authoring Tool Accessibility Guidelines (<a href="https://www.w3.org/TR/ATAG20">ATAG</a>) are <a href="https://hidde.blog/content-creation-accessibility/">guidelines for tools that create web content</a>. While reviewing this week, I wondered if the <a href="https://www.w3.org/TR/ATAG20/#sc_a351">Text Search criterion (A.3.5.1)</a> is met as soon as users can use browser built-in search. You know, <code>Ctrl/⌘ + F</code>. Turns out: yes, if the tool is browser-based and the UI contains all the necessary content in a way that CTRL+F can find it.</p> <p>Let's look into a bit more detail. The criterion requires that text content in editing views can be searched:</p> <blockquote> <p><strong>A.3.5.1 Text Search</strong>: If the authoring tool provides an editing-view of text-based content, then the editing-view enables text search, such that all of the following are true: (Level AA)</p> <p>(a) All Editable Text: Any text content that is editable by the editing-view is searchable (including alternative content); and<br /> (b) Match: Matching results can be presented to authors and given focus; and<br /> (c) No Match: Authors are informed when no results are found; and<br /> (d) Two-way: The search can be made forwards or backwards.</p> </blockquote> <p>(From: <a href="https://www.w3.org/TR/ATAG20/#sc_a351">ATAG 2.0</a>)</p> <p>True accessibility depends on a combination of factors: browsers, authoring tools, web developers and users—they can all affect how accessible something is. ATAG is about authoring tools specifically, so my initial thinking was that for an <em>authoring tool</em> to meet this criterion, it would need to build in a text search functionality.</p> <p>However, reading the clauses, it sounded a lot like what <code>Ctrl + F</code>/<code>Cmd + F</code> in browsers already facilitate. Great news for authoring tools that are browser-based (sorry for those that are not). Browser built-in search finds all visible text in a page (as well invisible text in details/summary browsers), matching results are presented, “no match” is indicated and search works two ways. It doesn't find alternative text of rendered images, but if you have text input for alternative text, it finds the contents of that.</p> <p><img src="https://hidde.blog/_images/detailssummary.gif" alt="page titled “Test: can I find text in text that is a non-open details/summary?”, user searches for the word banana, first find is in visible text, second find triggers details/summary to open" /> <em>In Chromium, when the “hidden” part of a <code>details</code>/<code>summary</code> contains the word you search for, it goes to open state (this is <a href="https://html.spec.whatwg.org/dev/interaction.html#interaction-with-details-and-hidden=until-found">per spec</a>, but Firefox and Safari don't do this yet)</em></p> <p>Note: in screenreaders, the experience of in page search is not ideal. I have not tested extensively and am not a screenreader user myself, but quick tests in VoiceOver + Safari and VoiceOver + Firefox indicated to me that one can't trivially move focus to a result that is found and “no match” is not announced, it needs cursor movement to find. This seems not ideal, but again, I am not a screenreader user and may be missing something.</p> <p>All in all, the in-browser seems to satisfy the requirements. Lack of matches is indicated (though not announced) and matches <em>can</em> be given focus (though the browser doesn't do it; not sure how that would work either as the matches will most likely not be focusable elements so that would be a bit hacky and it would not solely have advantages). These caveats are accessibility issues. I feel they'd be best addressed in browser code, not individual websites/apps, so that the solution is consistent.</p> <p>Ok, so if the browser built-in search meets the criteria, let's return to the question I started with: should an authoring tool merely make sure it works with built-in search, or should it implement its own in-page search?</p> <p>The unanimous answer I got from various experts: yes, in this case the browser built-in is sufficient to meet the criterion. It also seems reasonably user friendly and likely better than some tool-specific in-page search (but note the caveats in this post, especially that all alternative text would need to be there as visible text). Of course, most authoring tools have more search tools available, e.g. to let users search across all the content they can author. In today's world, they seem like an essential way to complement in-page search, especially as a lot of authoring tools aren't really page-based anymore.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/atag-a351-browser-built-in-search/">Browser built-in search and ATAG A.3.5.1</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Browser built-in search and ATAG A.3.5.1">Reply via email</a></p> 200 2023-02-14T00:00:00Z https://hidde.blog/200/ <p>It's meta blogging time, because this is my 200th post. Vanity metrics, I know, but sometimes you've got to celebrate milestones. Even the merely numerical ones. When I wrote my 150th post two years ago, I described <a href="https://hidde.blog/150/">why I blog and what about</a>. This time, I want to focus on how I do it and look at the subjects of the last 50.</p> <h2>A lot of posts start on my phone</h2> <p>There are plenty of tools for writing. Fancy physical notebooks, favourite text editors, and what not. I do use both, but usually I start a post on my phone. It somehow is my least distracting device, and very portable. My setup is that I have iA Writer, which I love for its radical simplicity and advanced typography, on my phone and computers. I've got a couple of folders that are synced through iCloud, including for posts and talk ideas. They are literally folders—iA Writer just picks them up and displays them as folders in their UI. When I start a post, I create a file. Sometimes it stays around for days, weeks or months, sometimes I finish a draft in half an hour.</p> <p>When the post is almost ready, I'll usually do another round on a computer. This is essential if the post needs images or code examples, sometimes I can skip it if a post is just text. This is usually also the time when I start adding it into my website and reach out to people for feedback, if it's the kind of post that very much needs review.</p> <p>Having my posts exist in a cloud service has been a game changer, because it means I can blog when inspiration strikes. When I used to go swimming, I would sometimes think up a blog post while in the water and write up a quick structure of first draft in the changing room or the cafe nearby. Sometimes I revise a draft when I sit on a tram or bus, or add some more examples when I arrived early for an appointment. Sometimes I return to it on a computer, then a phone, then a tablet.</p> <p>As for the format: I use Markdown processed by Eleventy. I am aware of the <a href="https://www.smashingmagazine.com/2022/02/thoughts-on-markdown/">disadvantages</a>, but this is a one-person-who is-a-developer-and-very-comfy-in-a-text-editor blog kind of use case. Still, I am pondering re-introducing a CMS so that it can manage images and history in a way that doesn't involve me committing into git (who needs commits for typos?) or compressing images by hand.</p> <h2>Getting the words flowing</h2> <p>A friend asked how I manage to write on this blog regularly, alongside other responsibilities. I don't know the secret, but I can offer two thoughts.</p> <p>Firstly, my writing is usually a way to clarify my thinking, it sort of defragments thoughts, if that makes sense. It doesn't really add much to the time I would need for defragmenting thoughts anyway, if anything it speeds that process up. If I spiral in circles about a subject, jotting my thoughts down helps me get out of that spiral. Sometimes the result is I find out I was very wrong, sometimes I get to a post I deem worthy of publishing and often I end up somewhere in between.</p> <p>Secondly, I try and add ideas to drafts when they come up. Like, I had a file with ‘200’ in it for a while that eventually got a few bullets and then became this post. When I feel like making a <em>thread</em> on social media, I force myself to make a draft post here instead. Occassionally, like when I haven't written for a while, I'll go through the drafts. There isn't really a magic trick here either, it's a habit if anything. And I guess it helps words come to me naturally, like numbers do for others.</p> <p>Thirdly, a bonus one: it helps me to keep things very simple and stay away from tweaking too many things (eg I only switched tech stack once in 15 years and kept the design roughly the same). I won't say I'm not tempted, I mean it is fun to try out new things and this blog is definitely a playground for me to test new Web Platform features, but I try and focus on the posts.</p> <h2>My 50 most recent posts</h2> <p>The cool thing about having your own blog is that it doesn't need to have a theme per se. Mine follows some of my interests and things I care about: the web, components and accessibility.</p> <p>On web platform features, I wrote about <a href="https://hidde.blog/trying-out-spicy-sections-on-here/">spicy sections</a> (out of date now as I updated my site and there are some <a href="https://bkardell.com/blog/SpicyUpdate.html">different ideas and solutions for tabs on the web</a>), <a href="https://hidde.blog/custom-select-with-selectmenu/">selectmenu</a> and <a href="https://hidde.blog/dialog-modal-popover-differences/">dialogs</a>.</p> <p>As I used Eleventy more, I wrote about using it for <a href="https://hidde.blog/introducing-an-eleventy-starter-project-for-wcag-reports/">WCAG reports</a> and for <a href="https://hidde.blog/photo-blogging-with-sanity-and-eleventy/">photo blogging</a>.</p> <p>A lot of my posts were also about web accessibility, like this <a href="https://hidde.blog/content-creation-accessibility/">primer on ATAG</a>, two posts about low-hanging fruit issues (<a href="https://hidde.blog/common-a11y-issues/">part 1</a>, <a href="https://hidde.blog/more-common-a11y-issues/">part 2</a>) , <a href="https://hidde.blog/new-in-wcag22/">what's new in WCAG 2.2</a> and the <a href="https://hidde.blog/better-accessible-names/">names section of ARIA</a>. These posts usually start because I had to give some advice in an accessibility audit report I wrote, or because I couldn't find a blog post sized answer to a question I personally had.</p> <p>I also covered some events, like <a href="https://hidde.blog/the-last-dconstruct/">dConstruct 2022</a>, <a href="https://hidde.blog/making-documentation/">documentation talks at JSConf and JSNation</a>, <a href="https://hidde.blog/in-person/">Beyond Tellerrand 2021</a> and an <a href="https://hidde.blog/patterns/">on-stage interview with Cecilia Kang on her fascinating book <em>An Ugly Truth</em></a>. These kinds of posts help me process what I learned at the event. While I write, I usually look up URLs speakers mentioned or try out features they discussed, so it's a bit of experiencing the whole thing twice.</p> <p>This year, I hope to write more about CSS and other UI features in the browser. I did one post about <a href="https://hidde.blog/flex-grow-illustration/">using flex-grow for my book site</a>, but want to dive deeper into subjects like scroll snapping, container queries and toggles. Even if Manuel has already covered <a href="https://www.matuzo.at/blog/2023/100daysof-day100/">every single CSS subject ever in the last few months</a> (congrats, my friend!). I also want to cover design systems and Web Components more. I have some other subjects in mind too, and am open to suggestions too, just leave a comment or slide in my DMs. Thanks for reading my blog!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/200/">200</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20200">Reply via email</a></p> My ideal accessible components resource is holistic, well tested and easy to use 2023-03-08T00:00:00Z https://hidde.blog/ideal-a11y-guidance/ <p>It would be easier to have an accessible web if all we did with it was publish documents. Blobs of text, images here and there. But modern sites (or “applications”) <em>do</em> a lot more than documents. Often for better, sometimes for worse. To improve accessibility of the web as it is today, I feel we dearly need accessibility guidance that is <strong>holistic</strong>, <strong>well tested</strong> and <strong>easy to use</strong>.</p> <p>Web sites or applications often come with menus, tooltips, dialogs, drag and drop, tabs and emoji pickers. Some say this is unnecessary and argue interfaces must be simpler. Sometimes they are right—a lot of interfaces can benefit from being simpler. Yet, complex UI components are often genuinely helpful to users. Like, it's good if not all information is always visible at the same time. Hiding less important stuff in less prominent places can help hierarchy. It can be good if, instead of selecting a city from a <code>&lt;select&gt;</code> of thousands, there's some comboboxing going on. ‘No that's an input!’, you say… yeah, maybe, but it could be important for the business to have a city chosen out of a predefined list of options. And that can give certainties that are beneficial to users too.</p> <p>So, complex UI patterns (widgets, components, etc) are sometimes needed. A lot of sites have them, for reasons ranging from good to bad. A lot of organisations hand-build these components as part of a design system effort, to make their investments reusable. Reusable components can have a huge impact on accessibilility. Because reuse means repetition: of good patterns, bad patterns, accessible patterns, inaccessible patterns… the stakes are high!</p> <p>Over the years I've seen and heard a lot of developers talk about building components. I heard them speak about the developer experience of building these components. When I was working on guidance at WAI, I listened extra carefully. From what I gathered, many actually want to truly invest in the quality of their components, including the accessibility of those components. But the official guidance they can find is lacking: WCAG's supporting documents are often unclear (with reading levels, for what they are worth, up to professor grade), unpractical (a lot more words than concrete advice) and outdated (eg still recommending the title attribute). WCAG still works best for the web as a series of documents.</p> <p>In other words, to better match the realities of people making websites, I feel the W3C's accessibility guidance should be more holistic, well-tested and easy to use.</p> <h2>Holistic</h2> <p>The closest to a guide on building accessible components is the <a href="https://www.w3.org/TR/wai-aria-practices/">ARIA Authoring Practices Guide</a> (“APG”). It's a super useful resource for finding how to build components with ARIA, but it isn't “holistic”.</p> <p>By holistic advice, I mean advice that considers the reader within their entire environment as a developer. Advice that builds on the best that can be done with HTML, CSS, JavaScript, WAI-ARIA and SVG (technologies websites commonly <a href="https://www.w3.org/TR/WCAG-EM/#step2d">rely upon</a>). The <a href="https://www.w3.org/TR/wai-aria-practices/">WAI-ARIA Authoring Practices Guide</a> isn't holistic in that sense: it focuses on patterns built with ARIA only. From developer-who-wants-advice or user-who-needs-a-good-experience perspectives, that's not ideal. As accessibility specialists learn again and again, WAI-ARIA isn't what makes components accessible, it's merely one of the languages (ok, an ontology) that can help us build accessibly (see also: <a href="https://www.w3.org/TR/using-aria/#rule1">the first rule of ARIA</a>). I don't mean to say any of these specificiations is inherently better, I mean the most accessible component is always <em>some</em> combination of these specs.</p> <p>If that's the case, you may wonder, why does APG focus on ARIA only? There's no bad intent here… I think it is simply because it is written by a subgroup of the ARIA Working Group. That Working Group specifies ARIA and it has a deliverable to show how to use it. This makes good sense. But again, it isn't ideal if the intention is guidance that helps developers build the very best for users with disabilities (which I think is the goal we should really want to optimise for). Nobody seems to have that as a deliverable.</p> <p>There is a W3C/WAI resource that is holistic in the way I described: <a href="https://www.w3.org/WAI/tutorials/">WAI Tutorials</a>. Shoutout to the great work of <a href="https://yatil.net/">Eric Eggert</a> and <a href="https://www.w3.org/WAI/about/groups/eowg/">EOWG</a>! It's a good resource, but it did not get expanded or updated much after the initial release.</p> <p>There are resources outside of W3C/WAI that I can recommend, such as:</p> <ul> <li>Sarah Higley's posts on <a href="https://sarahmhigley.com/writing/tooltips-in-wcag-21/">tooltips</a> and <a href="https://sarahmhigley.com/writing/select-your-poison/">custom selects</a></li> <li>Sara Soueidan on <a href="https://www.sarasoueidan.com/blog/accessible-icon-buttons/">icon buttons</a> and <a href="https://www.sarasoueidan.com/blog/inclusively-hiding-and-styling-checkboxes-and-radio-buttons/">custom checkboxes/radiobuttons</a></li> <li><a href="https://github.com/scottaohara/accessible_components">Accessible Components</a> by Scott O'Hara</li> <li>Adrian Roselli's <a href="https://adrianroselli.com/tag/pattern">“Under-Engineered” series</a></li> <li><a href="https://www.smashingmagazine.com/2021/03/complete-guide-accessible-front-end-components/">A complete guide to accessible front-end components</a> by Vitaly Friedman</li> </ul> <h2>Well tested</h2> <p>Web accessibility ultimately is about whether people can use a thing. Some friends in the accessibility community like to emphasise that it's about people, not meeting standards. I get that sentiment, but there's a false dichotomy at play: making the web more usable for people with disabilities is a central goal for accessibility standards at organisations like <a href="https://w3.org/WAI">W3C/WAI</a>) They are a means to the same end. Either way, web accessibility is all about people. So, yes, user testing matters. We've got to find out which specific patterns are mostly to work well for people.</p> <p>While it's essential and beneficial to involve people with disabilities in user tests, there can be challenges:</p> <ul> <li>just like one single user doesn't speak for all users, one person with a disability doesn't speak for everyone with that disability; you'll want larger samples;</li> <li>there are many disabilities; sometimes people with different disabilities could even have “competing” needs. For instance, high contrast benefits some, but could constitute a barrier to others;</li> <li>it may be more difficult to recruit users with disabilities and ensure the group you recruit for a given project is the right group in terms of what you want to test;</li> </ul> <p>My friend Peter has documented some of <a href="https://frozenrockets.nl/articles/en/user-testing-with-disabled-people">his approach to testing with disabled users</a> and WAI itself has a great page on <a href="https://www.w3.org/WAI/test-evaluate/involving-users/">involving users with disabilities</a> too. Others have blogged about their user testing efforts: <a href="https://makeitfable.com/article/building-and-testing-an-accessible-video-clipping-component-for-people-with-disabilities/">Fable tested Loom's video clipping functionality</a> and the <a href="http://gov.uk/">GOV.UK</a> Design System team documented what they found testing <a href="https://accessibility.blog.gov.uk/2021/09/21/an-update-on-the-accessibility-of-conditionally-revealed-questions/">conditionally revealing questions</a>. These posts show there is a lot of nuance in determining if a complex pattern is accessible. But they also show this nuance can be described and help inform people.</p> <p>As an aside: another aspect of testing guidance for accessible components is how well they perform across different browsers and assistive technologies. Bocoup, Meta and others are doing great work in this area in the <a href="https://aria-at.w3.org/">ARIA-AT</a> effort: they define tests (over a thousand drafted), but also <a href="https://w3c.github.io/aria-at-automation/">pioneer ways to test assistive technologies automatically</a>. I believe the plan is (was?) to show the results of this project next to code examples, which is great.</p> <h2>Easy to use</h2> <p>‘Developer experience’ is a phrase sometimes frowned upon, especially when contrasted with user experience. If we had to choose between them, of course, user experience would be the first choice. But the choice isn't binary like that. If the stars are aligned, one can lead to the other. Companies that make developer-focused products (like CMSes, versioning control, authentication, payment providers, databases etc) usually have a dedicated “developer experience” department that ensures developers can use the product well. Among other things, they try to <em>reduce friction</em>.</p> <p>Friction could result in income loss for these companies. If the tool constantly displays unhelpful error messages, has code examples that are tricky to follow or documentation that is out of date, developers might look for a different tool. And the opposite is true too: if this payment provider makes it super easy to implement secure payments, a developer will likely want to use it again.</p> <p>Friction could also cause a product to be “used wrong”. For instance, large groups of developers easily got started with this cool new authentication product, but the docs were so unclear that they missed important security steps? Or, in a CI/CD product, developers manage to get started quickly, but a majority does it in a way that uses way too many resources, because the example projects do? If the company charges overages unexpectedly, it may upset customers, if it doesn't, it could end up costing the company too much.</p> <p>I'll admit it is a bit of a stretch: what if both of these frictions are at play with accessibility standards? And instead of looking for different standards, developers choose the “easier” route of inaccessibility? This could happen in places where leadership or organisational procedures don't enforce accessibility. They'll get away with it. It could also happen in places that do have a mature accessibility program or even a handful of accessibility-minded individual developers. If the most accessible solution isn't easy to learn (e.g. they get lost between different kinds of guidance), it could still result in inaccessibility, even with the best intentions.</p> <p>I believe effective accessibility guidance answers “how easy will this make it for people to get it right”, and probably also ”how will this avoid that people take the wrong turn”.</p> <p>Some examples of what could constitute good developer experience (dreaming aloud here):</p> <ul> <li>easy to copy examples that closely match real-world components people are building, like privacy setting banners and comboboxes (just to name two examples of major barriers I saw blind users encounters in a user test)</li> <li>full example projects for some popular frameworks and languages, eg here's how to build an accessible blog with Next.js, or how to report errors in a form in vanilla JS + 5 popular frameworks</li> <li>a specific focus on eliminating inconsistencies in documentation (“boring” work, maybe, but inconsistencies inevitably creep into any set of content—the more inconsistencies are avoided, the more effective documentation is)</li> </ul> <p>While these examples are developer focused, the same kind of focus could be applied other roles like quality assurance and design (see also <a href="https://deploy-preview-3--wai-arrm.netlify.app/planning/arrm/roles/">Roles involved in accessibility</a>, which is a great document, though still in draft status).</p> <p>I suspect many people with disabilities among us have a mental list or accessibility barriere they encounter most often. Many who do regular accessibility audits will have a list of things they find often. Many developers will have a list of components they are unsure how to build accessibly. Et cetera, et cetera. If I had a magic wand, I would try and put all of these people in one room.</p> <h2>In summary</h2> <p>In this post, I've tried to lay out what my ideal accessibility guidance looks like. The gist of it is: make it easier for people to get accessibility right. And the opposite, too: make it harder to get it wrong. I feel the closer we can get to that, the more accessible interfaces can become. I think this is the way to go: guidance that is holistic, well-tested and optimised for developer experience (or, more broadly, the experience of anyone touching web projects in a way that can make or break accessibility).</p> <p>And to be clear, this is not an invite for people to care less or circumvent the responsibilities and duties they have. Accessibility needs to be <a href="https://adrianroselli.com/2022/11/accessibility-gaps-in-mvps.html">part of one's MVP</a>. But it is an invite for people to rethink our collective efforts in improving web accessibility: <a href="https://yatil.net/blog/fix-web-accessibility-systematically">WCAG 3.0 may not be it</a>, the world may benefit more from better guidance than from better testing methodologies.</p> <p>My expectations are probably a tad unrealistic. I probably missed my chance to try and materialise them more when I worked for WAI. Yet, I hope the perspective is helpful to some. Get in touch if you have thoughts!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/ideal-a11y-guidance/">My ideal accessible components resource is holistic, well tested and easy to use</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20My ideal accessible components resource is holistic, well tested and easy to use">Reply via email</a></p> Neither artificial, nor intelligent 2023-03-30T00:00:00Z https://hidde.blog/artificial-nor-intelligent/ <p>Large Language Models (LLMs) and tools based on them (like ChatGPT) are all some in tech talk about today. I struggle with the optimism I see from businesses, the haphazard deployment of these systems and the seemingly ever-expanding boundaries of what we are prepared to call “artificially intelligent”. I mean, they bring interesting capabilities, but arguably they are neither artificial, nor intelligent.</p> <p>Let me start with where I'm coming from. In 2008 I started studying for a degree called Cognitive Artificial Intelligence. Of a number of Dutch universities offering degrees in artificial intelligence, mine was the one most focused on psychology and philosophy. Others were more geared towards linguistics and/or computer science. We had courses all across these different fields, as well as mathematics. This made it super interesting. Case in point: I learned then that artificial intelligence, as a field, isn't easily defined. It comprises a lot of things. It attracts people with a wide range of interests. And it has all sorts of applications, from physical robots to neural networks and natural language processing. Towards the end of the first year, I realised I had different interests (primarily in philosophy) and skills (not a programmer by heart, or a mathematician, and my grades and a <a href="https://nl.m.wikipedia.org/wiki/Bindend_studieadvies">BSA</a> agreed). I ended up switching to philosophy full time, specialised in AI, language and ethics (of course, philosophy is great for generalists, too).</p> <p>Fast-forward almost 15 years… my knowledge at this point is a bit rusty, but I am not less interested in the subject. Today, there is a lot of hype around Language Models (LMs), a specific technique in the field of “artifical intelligence”, which Emily Bender and colleagues define as ‘systems trained on string prediction tasks’ in their paper ‘<a href="https://dl.acm.org/doi/10.1145/3442188.3445922">On the dangers of stochastic parrots: can language models be too big?</a>’ (one of the co-authors was <a href="https://dair-community.social/@timnitGebru">Timnit Gebru</a>, who had to <a href="https://www.wired.com/story/google-timnit-gebru-ai-what-really-happened/">leave her AI ethics position at Google over it</a>). <a href="https://www.economist.com/business/2023/03/02/the-uses-and-abuses-of-hype">Hype isn't new in tech</a>, and many recognise the patterns in vague and overly optimistic thoughtleadership (‘$thing is a bit like when the printing press was invented’, ‘if you don't pivot your business to $thing ASAP, you'll miss out’). Beyond the hype, it's essential to calm down and understand two things: do LLMs actually constitute AI and are what sort of downsides could they pose to people?</p> <p>Artificial intelligence, in one of its earliest definitions, is the study of things that are <em>in language</em> indistinguishable from humans. In 1950, Alan Turing famously proposed an <a href="https://academic.oup.com/mind/article/LIX/236/433/986238?login=false#164226500">imitation game</a> as a test for this indistinguishability. More generally, AIs are <a href="https://plato.stanford.edu/entries/artificial-intelligence/#WhatExacAI">systems that think or act <em>like humans</em>, or that think or act <em>rationally</em></a>. According to many, including OpenAI, the company behind ChatGPT and Whisper, large language models <em>are</em> AI. But that's a company: a <a href="https://en.wikipedia.org/wiki/OpenAI">non-profit with a for-profit subsidiary</a>—of course they would say that.</p> <h2>Not artificial</h2> <p>In one sense, “artificial” in “AI” means non-human. And yes, of course, LLMs are non-human. But they aren't artificial in the sense that their knowledge has clear, non-artificial origins: the input data that they are trained with.</p> <p>OpenAI stopped disclosing openly where they get their data since GPT-3 (how Orwellian). But it is clear that they gather data from all over the public web, places like Reddit and Wikipedia. Earlier they used filtered data<br /> from <a href="https://commoncrawl.org/big-picture/frequently-asked-questions/">Common Crawl</a>.</p> <p>First, there is the long term consequences for quality. If this tooling results in more <a href="https://maggieappleton.com/ai-dark-forest">large scale flooding the web with AI generated content</a>, and it uses the contents of that same web to continue training the models, it could result in a <a href="https://www.theverge.com/2023/3/22/23651564/google-microsoft-bard-bing-chatbots-misinformation">“misinformation shitshow”</a>. It also seems like a source that can dry up once people stop asking questions on the web to interact directly with ChatGPT.</p> <p>Second, it seems questionable to build off the fruits of other people's work. I don't mean off your employees, that's just capitalism—I mean other people that you scrape input data from without their permission. It was controversial when search engines took the work from journalists, this is that on steroids.</p> <h2>Not intelligent</h2> <p>What about intelligence? Does it make sense to call LLMs and the tools based on them intelligent?</p> <p><img src="https://hidde.blog/_images/Alan_Turing_Aged_16.jpg" alt="photo of young Alan Turing" style="border: 1px solid #ccc;" /> <em>Alan Turing</em></p> <p>Alan Turing <a href="https://academic.oup.com/mind/article/LIX/236/433/986238?login=false#164226550">suggested</a> (again, in 1950) that machines can be said to <em>think</em> if they manage to trick humans such that ‘an average interrogator will not have more than 70 per cent chance of making the right identification after five minutes of questioning’. So maybe he would have regarded ChatGPT as intelligent? I guess someone familiar with ChatGPT's weaknesses could easily ask the right questions and identify it as non-human within minutes. But maybe it's good enough already to fool average interrogators? And a web flooded with LLM-generated content would probably fool (and annoy) us all.</p> <p>Still, I don't think we can call bots that use LLMs intelligent, because they lack intentions, values and a sense of the world. The sentences systems like ChatGPT generate today merely do a very good job at pretending.</p> <p>The Stochastic Parrots paper (SP) explains why pretending works:</p> <blockquote> <p>our perception of natural language text, regardless of how it was generated, is mediated by our own linguistic competence</p> </blockquote> <p>(SP, 616)</p> <p>We merely interpret LLMs as coherent, meaningful and intentional, but it's really an illusion:</p> <blockquote> <p>an LM is a system for haphazardly stitching together sequences of linguistic forms it has observed in its vast training data, according to probabilistic information about how they combine, but without any reference to meaning: a stochastic parrot.</p> </blockquote> <p>(SP, 617)</p> <p>They can make it seem like you are in a discussion with an intelligent person, but let's be real, you aren't. The system's replies to your chat prompt aren't the result of understanding or learning (even if the technical term for the process of training these models is ‘deep learning’).</p> <p>But GPT-4 can <a href="https://cdn.openai.com/papers/gpt-4.pdf">pass standardised exams</a>! Isn't that intelligent? Arvind Narayanan and Sayash Kapoor explain <a href="https://aisnakeoil.substack.com/p/gpt-4-and-professional-benchmarks">the challenge of standardised exams happens to be one large language models are good at by nature</a>:</p> <blockquote> <p>professional exams, especially the bar exam, notoriously overemphasize subject-matter knowledge and underemphasize real-world skills, which are far harder to measure in a standardized, computer-administered way</p> </blockquote> <h2>Still great innovation?</h2> <p>I am not too sure. I don't want to spoil any party or take away useful tools from people, but I am pretty worried about large scale <em>commercial</em> adoption of LLMs for content creation. It's not just that people can now more easily flood the web with content they don't care about just to increase their own search engine positions. Or that the biases in the real world can now propagate and replicate faster with less scrutiny (see <a href="https://dl.acm.org/doi/pdf/10.1145/3442188.3445922">SP 613</a>, which shows how this works and suggests more investment in curating and documenting training data). Or that criminals <a href="https://www.theregister.com/2023/03/28/chatgpt_europol_crime_report/">use LLMs to commit crimes</a>. Or that people may <a href="https://twitter.com/random_walker/status/1640069366514606080">use it for medical advice and the advice is incorrect</a>. In <a href="https://dl.acm.org/doi/pdf/10.1145/3531146.3533088">Taxonomy of Risks Posed by Language Models</a>, 21 risks are identified. It's lots of things like that, where the balance is off between what's useful, meaningful, sensible and ethical for all on the one hand, and what can generate money for the few on the other. Yes, both sides of that balance can exist at the same time, but money often impacts decisions.</p> <p>And that, lastly, can lead to increased inequity. Monetarily, e.g. what if your doctor's clinic offers consults with an AI by default, but you can <a href="https://www.volkskrant.nl/nieuws-achtergrond/hoogleraar-computerwetenschappen-vreest-opmars-ai-wilt-u-50-euro-extra-betalen-voor-een-mens-toets-1~b5a92a0d/">press 1 to pay €50 to speak to a human</a> (as Felienne Hermans warned Volkskrant readers last week)? And also in terms of the effect of computing on climate change: most large language models benefit those who have the most, while their effect (on climate change) threatens marginalised communities (see <a href="https://dl.acm.org/doi/pdf/10.1145/3442188.3445922">SP 612</a>).</p> <h2>Wrapping up</h2> <p>I am generally very excited about applications of AI at large, like in cancer diagnosis, machine translation, maps and accessibility. And even of capabilities that LLMs and tools based on them bring. This is a field that can genuinely make the world better in many ways. But it's super important to look beyond the hype and into the pitfalls. As a lot of my feed naturally have optimist technologists, I have consciously added many more critical journalists, scientists and thinkers to my social feeds. If this piques your interest, one place to start could be the <a href="https://dair-community.social/explore">Distributed AI Research Institute (DAIR) on Mastodon</a>. I also recommend the Stochastic Parrots paper (and/or the <a href="https://nymag.com/intelligencer/article/ai-artificial-intelligence-chatbots-emily-m-bender.html">NYMag feature on Emily Bender's work</a>). If you have any recommend reading or watching, please do <a href="https://front-end.social/@hdv/">toot</a> or email.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/artificial-nor-intelligent/">Neither artificial, nor intelligent</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Neither artificial, nor intelligent">Reply via email</a></p> Back to freelance 2023-05-10T00:00:00Z https://hidde.blog/back-to-freelance/ <p>I have returned to working as an independent front-end / accessibility / devrel person. My first project will be at the Dutch government's NL Design System team.</p> <h2>Leaving Sanity</h2> <p>I recently left <a href="https://www.sanity.io/">Sanity</a>, where I worked in the developer relations team. After doing some “developer relations”-like work at the <a href="https://w3.org/WAI/">W3C/WAI</a>, this was my first full-time role in the space. I loved the variety: I could create tutorial videos, improve onboarding, facilitate content design workshops, help with meetups, inspire people to structure their content (more abstract than HTML) and just generally try to make complex stuff easier to understand. Among people I liked and bonded well with… how lucky I got!</p> <p>It was also an opportunity for me to leave accessibility as my primary focus, at least for a while, and broaden my horizons. Well, <em>leave</em> accessibility as my primary focus… though my manager at WAI had warned me about this, calling it a bit of a <em>Hotel California</em> situation. He was, of course, correct. At Sanity, I did spend more time in the React community, learned lots about modern tooling and challenges like real-time content management. But I also ended up as the resident accessibility go-to person and did a preliminary accessibility conformance evaluation of the core product. It was appreciated, and I, in turn, appreciated having curious and dedicated colleagues to work with.</p> <h2>New beginnings</h2> <p>Having said that, my job at Sanity stopped existing. After some explorations, I'm going back to be a freelancer / independent. I've worked in that capacity for about 15 years, it feels like a comfort zone. I also have a very exciting project to start with, that manages to combine a number of my previous interests: developer relations, web accessibility and designs systems.</p> <h3>NL Design System</h3> <p>This month, I'm joining the <a href="https://nldesignsystem.nl/">NL Design System</a> core team. This project doesn't just create a design system for use by Dutch government, it creates a space for collaboration on front-end components in the open. This is the sensible thing to do, because there are a lot of Dutch government websites and services (in the tens of thousands). Many of those have their own design systems, suppliers and ways of working. But they all need to meet the same accessibility standards and there is a lot of overlap in user experience needs. Collaboration in these areas should be super beneficial. Of course, it comes with challenges, too, and the team is <em>ready</em>… well, as far as one can be.</p> <p><a href="https://nldesignsystem.nl/"><img src="https://hidde.blog/_images/nldesignsystem.png" alt="screenshot of nldesignsystem.nl" /></a> <em>The NL Design System website</em></p> <p>I'm looking forward to help with:</p> <ol> <li>accessibility: of components, in documentation (I have <a href="https://hidde.blog/ideal-a11y-guidance/">opinions</a>) and in applying standards well</li> <li>developer relations: technical writing, outreach between the core team and collaborating teams (current or future), improving the product based on developer feedback</li> </ol> <p>This is a team that people have wanted for a long time serving needs that have gone unserved for a long time, too. There's a lot of realism to be had, because, of course, one design system or team cannot magically make all the websites better, but I strongly believe in design systems (and specifically this project) as a multiplier for accessibility efforts. I am, in other words, thrilled to become part of this particular team.</p> <h3>Workshops / talks</h3> <p>In addition, I will continue to do full day workshops and other public speaking about the web and web accessibility. Two things in particular:</p> <ul> <li>a full-day workshop called “Accessibility for design system teams”, which I've started to deliver to in-house teams that are keen to use their design system as a way to increase accessibility in their product(s) and want to understand what that means in theory and practice</li> <li>a talk on popovers and dialogs that I'll present at <a href="https://talks.hiddedevries.nl/#upcoming">various conferences this year</a>, the first one at <a href="https://cssday.nl/2023">CSS Day</a> in Amsterdam, which is pretty much my favourite front-end event</li> </ul> <p><img src="https://hidde.blog/_images/1679646521994.jpg" alt="me in front of a slide that says accessibility and design systems" /><em>Workshopping at Sanoma Learning</em></p> <h3>Audits</h3> <p>Lastly, I also plan to do a small amount of accessibility conformance audits, focused on helping teams figure out which accessibility barriers their site has and how to fix them (I call this <a href="https://hidde.blog/introducing-an-eleventy-starter-project-for-wcag-reports/#heading-1">issue oriented reporting</a>) (and sorry, that also means I will probably say no to teams whose only goal is a report).</p> <h2>Wrapping up</h2> <p>That's all. I hope my new freelance life will also allow me to do some more blogging on this website. The drafts folder isn't the issue, I guess 😁. For now, thanks for reading!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/back-to-freelance/">Back to freelance</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Back to freelance">Reply via email</a></p> Semantics and the popover attribute: which role to use when? 2023-05-16T00:00:00Z https://hidde.blog/popover-semantics/ <p>With the new <a href="https://html.spec.whatwg.org/dev/popover.html#the-popover-attribute"><code>popover</code> attribute in HTML</a>, we can put elements in the top layer and allow them to disappear with ‘light dismiss’. This attribute adds <em>behaviour</em>, not semantics: you're <a href="https://open-ui.org/components/popover.research.explainer/#accessibility--semantics">supposed to add your own role</a> when it makes sense. In this post, we'll look at different roles that could make sense for your popover-behaved elements.</p> <h2>Semantics?</h2> <p>Accessibility semantics are roles, states and properties that are exposed by by browsers for many HTML features, and then passed on to assistive technologies.</p> <p>The ‘role’ of an element establishes what kind of element it is. Roles are built-in (‘implicit’) to some elements: a <code>h1</code> has the <code>heading</code> role, an <code>a</code> has the <code>link</code> role and so forth. Roles can also be added with a <code>role</code> attribute explicitly. For some roles, that is the only way: there exists no corresponding element. If there's an element and a value for ‘role’, it doesn't really matter for end users which you use, but generally you don't want to overwrite implicit role. As mentioned, your user's browser or assistive technology may use the role to provide a UI. For instance, a screenreader may generate a list of links or headings, a reader mode may render list items with bullets.</p> <h2>Popovers have no default role</h2> <p>Whenever we add the <code>popover</code> attribute to an element, it continues to be that element semantically, just with some specific behaviours. Menus remain menus, dialogs remain dialogs, and so on. The popover attribute does not change an element's role. It's a bit like the <a href="https://html.spec.whatwg.org/dev/interaction.html#contenteditable"><code>contenteditable</code></a> attribute in that sense. In addition to choosing that you want the popover behaviour, you need to decide if you add a role and, if so, which role.</p> <p>The most basic example of a popover:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>button<span class="token punctuation">"</span></span> <span class="token attr-name">popovertarget</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>my-popover<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> Toggle popover <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">popover</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>my-popover<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> ... <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span></code></pre> <p>This is how it works:</p> <ul> <li>the <code>div</code> will be invisible on page load, because it has a <code>popover</code> attribute and popovers are closed on page load by default</li> <li>the <code>div</code> will also be toggleable via the button, as the button points to the <code>div</code>'s ID in its <code>popovertarget</code> attribute</li> </ul> <h2>Potential roles for your popover</h2> <p>Let's now look at common roles for popovers: menu, dialog and listbox, and consider what to do about tooltips.</p> <h3>Menus: the <code>menu</code> role</h3> <p>Let's start with menus. The <code>menu</code> role is what you'd use when your component <a href="https://www.w3.org/TR/wai-aria-1.2#menu">offers a list of choices to the user</a>, specifically choices that are actions. (Note: <code>menu</code> is not for a list of links, like a navigation, it is only for a list of actions).</p> <p>A menu with popover behaviour can be built with a <code>menu</code> role:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>button<span class="token punctuation">"</span></span> <span class="token attr-name">popovertarget</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>my-menu<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> Toggle menu <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">role</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>menu<span class="token punctuation">"</span></span> <span class="token attr-name">popover</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>my-menu<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token special-attr"><span class="token attr-name">onclick</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token value javascript language-javascript"><span class="token function">doThing</span><span class="token punctuation">(</span><span class="token punctuation">)</span></span><span class="token punctuation">"</span></span></span> <span class="token attr-name">role</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>menuitem<span class="token punctuation">"</span></span> <span class="token attr-name">tabindex</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>-1<span class="token punctuation">"</span></span> <span class="token attr-name">autofocus</span><span class="token punctuation">></span></span>Do thing<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token special-attr"><span class="token attr-name">onclick</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token value javascript language-javascript"><span class="token function">doAnotherThing</span><span class="token punctuation">(</span><span class="token punctuation">)</span></span><span class="token punctuation">"</span></span></span> <span class="token attr-name">role</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>menuitem<span class="token punctuation">"</span></span> <span class="token attr-name">tabindex</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>-1<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Do another thing<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span> … <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span></code></pre> <p>In a menu widget, there are also some keyboard and focus expectations. For instance, that users can use their arrow keys to cycle through the different buttons. As a developer, this is something you'd add with JavaScript yourself. The first button is focused when it opens (hence <code>autofocus</code>), the second and after would get focused moved to them when they're the next one and an arrow key is pressed (hence <code>tabindex=&quot;-1&quot;</code>: this takes the buttons out of tab order, because you make them reachable with arrow keys instead).</p> <p>(Note: The <code>menu</code> role is not to be confused with the <code>menu</code> element, which has a <code>list</code> role and is “<a href="https://www.w3.org/TR/html-aam-1.0/#el-menu">a semantic alternative to <code>&lt;ul&gt;</code></a>”)</p> <p>Examples of when you would use <code>role=&quot;menu&quot;</code>:</p> <p><img src="https://hidde.blog/_images/list-of-authors.jpg" alt="CMS screenshot with a field called authors that shows one author and an opened menu with options for Remove, Duplicate, Add item before, Add item after" /> <em>Your CMS manages a list of authors. The user can open a <code>menu</code> for each author with some actions (each action has a <code>menuitem</code> role)</em></p> <p><img src="https://hidde.blog/_images/doc-menu.jpg" alt="CMS screenshot with a field called authors that shows one author and an opened menu with options for Remove, Duplicate, Add item before, Add item after" /> <em>You're building a word processor. The “File” menu is a menu, the options (New, Open, etc) are <code>menuitem</code>s._</em></p> <p>See also: <a href="https://www.marcozehe.de/wai-aria-menus-use-with-care/">Marco Zehe on the <code>menu</code> role</a> and <a href="https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-supportmenucontroltype">“Menu control type” in Windows Accessibility Features documentation</a></p> <h3>Dialogs: the <code>dialog</code> role</h3> <p>A dialog role is what you add when an element is like a smaller window on top of the main web page. It can block interaction with the rest of the page or leave the rest of the page as it is, either way it is somewhat separate from the page, both in purpose and visually.</p> <p>The <code>&lt;dialog&gt;</code> element implicitly has a <code>dialog</code> role, and comes with dialog methods and behaviours (like you can run <code>element.showModal()</code> to show it as a modal). You can also add the dialog role manually with <code>role=&quot;dialog&quot;</code>, but then you have to add the behaviours manually too.</p> <p>A dialog with popover behaviour can be built like this:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>button<span class="token punctuation">"</span></span> <span class="token attr-name">popovertarget</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>my-dialog<span class="token punctuation">"</span></span><span class="token punctuation">></span></span> Toggle dialog <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dialog</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>my-dialog<span class="token punctuation">"</span></span> <span class="token attr-name">popover</span><span class="token punctuation">></span></span> ... <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dialog</span><span class="token punctuation">></span></span></code></pre> <p>You see, there's no explicit role attribute, because the <code>dialog</code> role comes with the <code>&lt;dialog&gt;</code> element.</p> <p>If not using a button with <code>popovertarget</code>, you could open this dialog with script using the <code>showPopover()</code> method that works on any element that is a popover (by having a <code>popover</code> attribute present).</p> <p>Note: because this specific popover example uses the <code>&lt;dialog&gt;</code> element, two other methods are also available (through the <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/">HTMLDialogElement</a>): <code>show()</code> and <code>showModal()</code>. They have slightly different behaviours than <code>showPopover()</code> would. I recommend against using these two methods on dialogs that are popovers. In other words, if you're inclined to use them, you probably don't want the <code>popover</code> attribute, as that attribute's purpose would basically be defeated by <code>show()</code>/<code>showModal()</code> (also, in some cases you might get a console error if you try to run <code>showModal()</code> on a popover). Popover is really for non-modal dialogs; see also <a href="https://hidde.blog/dialog-modal-popover-differences/">my post on dialogs vs popovers</a>).</p> <p>Other examples of elements that could have popover behaviour and a <code>dialog</code> role are:</p> <ul> <li>teaching UI</li> <li>pickers, like for a date, multiple dates, prices</li> <li>“mega navs” and other large navigational structures that cover a lot of the page (note: these should not use <code>role=&quot;menu&quot;</code>, a navigation with links is semantically different from a menu with buttons)</li> </ul> <p><img src="https://hidde.blog/_images/booktrain.png" alt="booking form that shows train selected from bologna to berlin, with passengers dialog opened that allows selection of how many adults and how many bicycles and includes a Done button" /> <em>A dialog that allows the user to specify their travel group and amount of bicycles</em></p> <p><img src="https://hidde.blog/_images/teaching.png" alt="paragraph of text, in the middle is an audio player with heading “listen to this story”; overlaid is a dialog that says Listen to this story; Save time by listening to our audio articles as you multitask with an OK button underneath and a button with a close icon in the top right corner" /> <em>A dialog that teaches what the audio player is for</em></p> <p><img src="https://hidde.blog/_images/meganav.gif" alt="travel website with three nav items: discover, travel infromation and customer service; on hover of the nav items a dialog opens with headings and links over multiple columns opens" /> <em>A “meganav” that covers other content (note: this is a dialog, not a menu)</em></p> <h3>Listboxes / autocompletes: the <code>listbox</code> role</h3> <p>A listbox is for elements where the user gets to choose from one or more options, like a <code>&lt;select&gt;</code>. They can exist as single select (user can select one option) or multi select (user can select multiple options).</p> <p>Listboxes are often part of an autocomplete or combobox widget, they are the part that contains the actual options. Like in this example:</p> <p><img src="https://hidde.blog/_images/listbox2.gif" alt="a bank transfer screen where the cursor moves to select a currency from a list" /> <em>Select menus also use listboxes to allow users to pick an option from a list</em></p> <p>For instance, in the following example, there is a component that pops over the page's content. It contains filter and sorting buttons, as well as a listbox with actual options. The element with <code>popover</code> is probably a dialog (and you could give it a <code>dialog</code> role), while the element that contains options would need a role of <code>listbox</code>:</p> <p><img src="https://hidde.blog/_images/listbox.png" alt="search field as part of an interface's top bar, two characters are entered and a list of possible things to search for pops over in a box that also contains filters and sorting options" /> <em>A listbox as part of a combobox</em></p> <h3>Tooltips/toggletips: <code>tooltip</code> (with caveats) or <code>dialog</code></h3> <p>In their simplest form, tooltips are like the <code>title</code> element in HTML, that browers display on hover. These browser built-in tooltips are <a href="https://www.24a11y.com/2017/the-trials-and-tribulations-of-the-title-attribute/">problematic in many ways</a>, including that in most browsers, there is no way to get to the contents of <code>title</code> with just a keyboard. Let's call them “plain text tooltips”. They are often customised by developers, for instance to change their visual styles (currently from scratch, maybe <a href="https://github.com/openui/open-ui/issues/730">via CSS in the future</a>).</p> <p><img src="https://hidde.blog/_images/tooltips.png" alt="two screenshots of tooltips on the left a thumbs up reaction emoji with a tooltip that shows four people who left that reaction, on the right a tooltip in a wysiwyg-style editor that explains that the link icon is to add a link" /> <em>Plain text tooltips that display on hover or focus of a triggering element, which they describe</em></p> <p>Sometimes they are also found underneath input fields, to explain what that input does or what is expected, like some of Scott O'Hara's <a href="https://scottaohara.github.io/a11y_tooltips/">custom tooltips examples</a>.</p> <p>These custom “plain text tooltips” are what the <code>tooltip</code> role seems to be meant for. Note that <code>role=&quot;tooltip&quot;</code> doesn't <em>do</em> much in terms of screen reader announcements as Sarah Higley explains in <a href="https://sarahmhigley.com/writing/tooltips-in-wcag-21/">Tooltips in the time of WCAG 2.1</a>, though there are cases where <a href="https://www.tpgi.com/short-note-on-aria-label-aria-labelledby-and-aria-describedby/">ARIA-provided labels and descriptions don't work across browsers and assistive technologies without the role</a> (if they aren't interactive, <code>iframe</code> or <code>img</code> elements and also don't have a landmark or widget role). What <em>is</em> useful for accessibility of that kind of tooltip, going beyond roles for a moment: use <code>aria-describedby</code> to link up a tooltip that describes a thing with that thing, and never place essential content in them. Also ensure that the tooltip (1) stays visible when its content is hovered, (2) is dismissable (with Escape) and (3) persists until hover/focus removed, dismissed or irrelevant (all required to meet <a href="https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1&amp;showtechniques=1413#content-on-hover-or-focus">WCAG 1.4.13</a>).</p> <p>My advice would be that whenever tooltips contain more than just plain text, a non-modal <code>dialog</code> would be more appropriate (even if elements with <code>tooltip</code> role were apparently meant to <a href="https://github.com/w3c/aria/issues/979#issuecomment-1131900402">also allow for interactive elements</a>). Non-modal dialog tooltips could contain semantic elements (like a heading) or interactive elements (like a link or a button). In most cases it would be best to display them on click instead of hover + focus, in which case they are really “toggletips”. Of course, if there is interactive content, that also means you'll want to consider focus order.</p> <h2>Conclusion</h2> <p>In this post, we've covered some of the most common semantics you could choose to use with the <code>popover</code> behaviour: <code>menu</code>, <code>dialog</code> and <code>listbox</code>, plus looked at using <code>tooltip</code> for plain text tooltips or <code>dialog</code> for tooltips that contain anything more than plain text. Are you building components that don't really fall into any of these categories? I'm curious to learn more, slide in my DMs or email!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/popover-semantics/">Semantics and the popover attribute: which role to use when?</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Semantics and the popover attribute: which role to use when?">Reply via email</a></p> Positioning anchored popovers 2023-06-12T00:00:00Z https://hidde.blog/positioning-anchored-popovers/ <p>Popovers are commonly positioned relative to their invoker (if they have one). When we use <a href="https://html.spec.whatwg.org/dev/popover.html#the-popover-attribute">the popover attribute</a>, anchoring is tricky, as these popovers are in the top layer, away from the context of their invoker. What options do we have?</p> <p>Basically, there are two ways to position popovers: one you can use today and one that will be available in the future. I'll detail them below, but first, let's look at why we can't use absolute positioning relative to a container shared by the invoker and the popover.</p> <p>Not all popovers are anchored, but I expect anchored popovers to be among the most common ones. For popovers that are not anchored, such as toast-like elements, “bottom sheets” or keyboard-triggered command palettes, these positioning constraints do not apply.</p> <p><img src="https://hidde.blog/_images/anchored-popovers.png" alt="" /> <em>Examples of anchored popovers: map toggletip (Extinction Rebellion), date picker (European Sleeper), colour picker (Microsoft Word web app)</em></p> <p>See also my other posts on popovers:</p> <ul> <li><a href="https://hidde.blog/dialog-modal-popover-differences/">Dialogs and popovers seem similar. How are they different</a></li> <li><a href="https://hidde.blog/popover-semantics/">Semantics and the popover attribute: what to use when?</a></li> <li><a href="https://hidde.blog/popover-accessibility/">On popover accessibility: what the browser does and doesn't do</a> (with Scott O'Hara)</li> </ul> <h2>Top layer elements lose their positioning context</h2> <p>One of the unique characteristics of popovers (again, the ones made with <a href="https://html.spec.whatwg.org/dev/popover.html#the-popover-attribute">the popover attribute</a>, not just any popover from a design system), is that they get upgraded to the <em>top layer</em>. The top layer is a feature drafted in <a href="https://drafts.csswg.org/css-position-4/#top-layer">CSS Positioning, Level 4</a>. The top layer is a layer adjacent to the main document, basically like a bit like a sibling of <code>&lt;html&gt;</code>.</p> <p>Some specifics on the top layer:</p> <ul> <li>It's above all <code>z-index</code>es in your document, top layer elements can't use <code>z-index</code>. Instead, elements are stacked in the order they are added to the top layer.</li> <li>As developers, we can't put elements in the top layer directly, as it is browser controlled. We can only use certain elements and APIs that then trigger the browser to move an element to the top layer: the Full Screen API, <code>&lt;dialog&gt;</code>s with <code>showModal()</code> and <code>popover</code>'ed elements, currently.</li> <li>Top layer elements, quoting the specification, “don't lay out normally based on their position in the document”.</li> </ul> <p>When I positioned my first popover, I tried (and failed): I put both the popover and its invoking element in one element with <code>position: relative</code>. Then I applied <code>position: absolute</code> to the popover, which I <em>hoped</em> would let me position relative to the container. It didn't, and I think the last item above explains why.</p> <p>In summary, elements lose their position context when they are upgraded to the top layer. And that's okay, we have other options.</p> <h2>Option 1: position yourself (manually or with a library)</h2> <p>The first option is to position the popover yourself, with script. Because the fact that the top layer element doesn't know about the non-top layer element's position in CSS, doesn't mean you can't store the invoker's position and calculate a position for the popover itself.</p> <p>There are some specifics to keep in mind, just like with popovers that are built without the <code>popover</code> attribute: what happens when there's no space or when the popover is near the window? Numerous libraries can help with this, such as <a href="https://floating-ui.com/">Floating UI</a>, an evolution of the infamous <a href="https://popper.js.org/">Popper</a> library.</p> <p>Let's look at a minimal example using Floating UI. It assumes you have a popover in your HTML that is connected to a button using <code>popovertarget</code>:</p> <pre class="language-markup"><code class="language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">popovertarget</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Toggle popover<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p<span class="token punctuation">"</span></span> <span class="token attr-name">popover</span><span class="token punctuation">></span></span>… popover contents go here<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span></code></pre> <p>By default, browsers show the open popover in the center of the viewport:</p> <p><img src="https://hidde.blog/_images/popover-centered.png" alt="dev tools colors marking space surrounding popover" /> <em>The popover is centered</em></p> <p>The reason that this happens is that the <a href="https://meiert.com/en/blog/user-agent-style-sheets/">UA stylesheet</a> applies <code>margin: auto</code> to popovers. This will reassign any whitespace around the popover equally to all sides as margins. That checks out: if there's the same amount of whitespace left and right, it element will effectively be in the center horizontally (same for top and bottom, but vertically).</p> <p>For anchored popovers, we want the popover to be near the button that invoked it, not in the center. Let's look at a minimal code example.</p> <p>In your JavaScript, first import the <code>computePosition</code> function from <code>@floating-ui</code>:</p> <pre class="language-javascript"><code class="language-javascript"><span class="token keyword">import</span> <span class="token punctuation">{</span> computePosition <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@floating-ui/dom'</span><span class="token punctuation">;</span></code></pre> <p>Then, find the popover:</p> <pre class="language-javascript"><code class="language-javascript"><span class="token keyword">const</span> popover <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">querySelector</span><span class="token punctuation">(</span><span class="token string">'[popover]'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> <p>Popovers have a <a href="https://html.spec.whatwg.org/multipage/indices.html#event-toggle"><code>toggle</code> event, just like the <code>&lt;details&gt;</code> element</a>, which we'll listen to:</p> <pre class="language-javascript"><code class="language-javascript">popover<span class="token punctuation">.</span><span class="token function">addEventListener</span><span class="token punctuation">(</span><span class="token string">'toggle'</span><span class="token punctuation">,</span> positionPopover<span class="token punctuation">)</span><span class="token punctuation">;</span> </code></pre> <p>In our <code>positionPopover</code> function, we'll find the invoker, and then, if the <code>newState</code> property of the event is <code>open</code>, we'll run the <code>computePosition</code> function and set the results of its computation as inline styles.</p> <pre class="language-javascript"><code class="language-javascript"><span class="token keyword">function</span> <span class="token function">positionPopover</span><span class="token punctuation">(</span><span class="token parameter">event</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token keyword">const</span> invoker <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">querySelector</span><span class="token punctuation">(</span><span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">[popovertarget="</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>popover<span class="token punctuation">.</span><span class="token function">getAttribute</span><span class="token punctuation">(</span><span class="token string">'id'</span><span class="token punctuation">)</span><span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">"</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>event<span class="token punctuation">.</span>newState <span class="token operator">===</span> <span class="token string">'open'</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token function">computePosition</span><span class="token punctuation">(</span>invoker<span class="token punctuation">,</span> popover<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">then</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter"><span class="token punctuation">{</span>x<span class="token punctuation">,</span> y<span class="token punctuation">}</span></span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span> Object<span class="token punctuation">.</span><span class="token function">assign</span><span class="token punctuation">(</span>popover<span class="token punctuation">.</span>style<span class="token punctuation">,</span> <span class="token punctuation">{</span> <span class="token literal-property property">left</span><span class="token operator">:</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>x<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">px</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">,</span> <span class="token literal-property property">top</span><span class="token operator">:</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>y<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">px</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">,</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span></code></pre> <p>To make this work, I also applied these two style declarations to the popover:</p> <ul> <li><code>margin: 0</code>, because the <a href="https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3">UA's auto margin</a>'s whitespace gets included in the calculation, with <code>0</code> we remove that whitespace</li> <li><code>position: absolute</code>, because popovers get <code>position: fixed</code> from the user agent stylesheet and I don't want that on popovers that are anchored to a button</li> </ul> <p>It then looks something like this:</p> <img src="https://hidde.blog/_images/basic-popover.png" alt="popover displays underneath button, it is centered relative to the button" /> <p>See it in action: <a href="https://codepen.io/hidde/pen/wvQaRJy/fc4f308d20a3a3118ead55e6553a7d66?editors=1011">Codepen: Positioning a popover with Floating UI</a>.</p> <p>In the Codepen, I also use some Floating UI config to position the popover from the left. In reality, you probably want to use more of Floating UI's features, to deal with things like resizing (see <a href="https://floating-ui.com/docs/tutorial">their tutorial</a>).</p> <h2>Option 2: with Anchor Positioning</h2> <p>To make all of this a whole lot easier (and leave the maths to the browser), a new CSS specification is on the way: <a href="https://drafts.csswg.org/css-anchor-position-1">Anchor Positioning, Level 1</a>. It exists so that:</p> <blockquote> <p>a positioned element can size and position itself relative to one or more &quot;anchor elements&quot; elsewhere on the page</p> </blockquote> <p>This, as they say, is <em>rad</em>, because it will let the browser do your sizing and positioning maths (<s>even <a href="https://drafts.csswg.org/css-anchor-position-1/#anchor-auto">automatically</a></s>- update 4 May 2024: looks like automatic anchoring was removed). It is also exciting, because it doesn't care where your elements are. They can be anywhere in your DOM. And, important for popovers, it also works across the top layer and root element.</p> <p>Though popovers would get <a href="https://drafts.csswg.org/css-anchor-position-1/#implicit-anchor-element">implicit anchoring</a>, you can connect a popover with its invoker via CSS. To find out how all of this works in practice, I recommend Jhey Tompkins's <a href="https://developer.chrome.com/blog/tether-elements-to-each-other-with-css-anchor-positioning/">great explainer on Chrome Developers</a> (but note it's currently somewhat outdated, the editor's draft spec changed since that post, and has new editors). Roman Komarov covers his experiments and some interesting use cases in <a href="https://kizu.dev/anchor-positioning-experiments/">Future CSS: Anchor Positioning</a>, and also wrote <a href="https://12daysofweb.dev/2023/anchor-positioning">Anchor Positioning on 12 days of web</a>.</p> <p>The Anchor Positioning spec was recently updated, and is currently in the process of being implemented in browsers, hence the Option 1 in this article. But, excitingly, it is in the works. Chromium has already issued an <a href="https://groups.google.com/a/chromium.org/g/blink-dev/c/jGTYNuidPRs/m/-jB4agJ7AAAJ?pli=1">intent to ship anchor positioning</a>, and <a href="https://groups.google.com/a/mozilla.org/g/dev-platform/c/4cbytMKbHtg">so did Mozilla/Gecko</a>. The recent updates are still <a href="https://github.com/w3ctag/design-reviews/issues/848#issuecomment-2053319901">pending TAG review</a>.</p> <h2>Wrapping up</h2> <p>So, in summary: if your popover needs to be anchored to something, like a button or a form field, you can't “just” use absolute positioning. Instead, you can use JavaScript (today), or, excitingly, <em>anchor positioning</em> (in the near-ish future, an Editor's Draft in CSS was published last year and a new version of that with new editors was released in April 2024.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/positioning-anchored-popovers/">Positioning anchored popovers</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Positioning anchored popovers">Reply via email</a></p> Joining CSSWG 2023-07-21T00:00:00Z https://hidde.blog/joining-csswg/ <p>This week I joined the CSS Working Group (CSSWG) as an <a href="https://www.w3.org/invited-experts/">Invited Expert</a>. I'm super grateful for this chance to try and make myself useful in a group whose outputs shaped so much of my professional interests (they make <em><a href="https://en.m.wikipedia.org/wiki/CSS">CSS</a></em>!).</p> <p>I'm somewhat nervous about this, but also not completely new to CSS or web standards. My background with CSS is that I've been a long time <a href="https://www.youtube.com/watch?v=JjbeOvVFAdg">fanboy</a> of the language, and a keen follower of new developments through events (9 times <a href="https://cssday.nl/">CSS Day</a> attendee of which 2 as a speaker). The CSSWG folks I've met so far are very friendly, no exceptions. My background with standards is that I've participated in the Open UI Community Group for just over two years, and worked as <a href="https://w3.org/People/hidde">W3C Staff</a> to promote accessibility standards, help simplify developer documentation and build standard-related tooling like the ATAG and WCAG-EM Report Tools. As such, I am experienced with some of the W3C process.</p> <p>Despite not being <em>completely</em> new, I've yet to figure out my focus and where I could help. The CSSWG does a daunting amount of work (see the <a href="https://www.w3.org/2020/12/css-wg-charter.html">charter</a>), and there are certain specs and features I'm especially interested in, like the ones close to Open UI. I think I will start with attending the telecons, listen and learn. Ultimately, I hope to make myself actually useful, maybe help with demos and content (like explainers or explanatory blog posts or talks), or by sharing a web developer's perspective. And opinions, maybe!</p> <p>I'm excited for this opportunity, many thanks to <a href="http://tantek.com/">Tantek</a>, <a href="https://www.miriamsuzanne.com/">Miriam</a> and others for their encouragement. I look forward to involve in standards outside accessibility and, yeah, try and make myself useful 🙃</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/joining-csswg/">Joining CSSWG</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Joining CSSWG">Reply via email</a></p> “AI” content and user centered design 2023-07-28T00:00:00Z https://hidde.blog/llms-user-centered/ <p>Large language models (LLMs), like ChatGPT and Bard, can be used to generate sentences based on statistical likeliness. While the results of these tools can look very impressive (they're designed to), I can't think of cases where the use of LLM-generated content actually improves an end user's experience. Even if not all of the time, LLM output is often nonsensical, false, unclear and boring. Hence, when organisations force LLM-output on users instead of paying people to create their content, they don't center users.</p> <p>User centered design means we make <strong>the user</strong> our main concern when we design. When I recently told a friend about this concept, explaining my new job is at a <a href="https://www.gebruikercentraal.nl/">government department focused on centering users</a>, they laughed in surprise. “This is a thing?”, they asked. “What else would you make the main concern when you design?” It made little sense to them that users had to be specifically centered.</p> <p>If you work in tech, you probably saw projects center other things than users. Business needs, the profit margin, search engines, that one designer's personal preference, the desire to look as cool as a tech brand you love… and so on. Sadly, projects center them instead of users all the time. Most arguments I heard for using LLMs in the content production process quoted at least one of these non-user-centric reasons.</p> <p>Organisations are starting to use or at least experiment with LLMs to create content for web projects. The hype is real and I worry that, by increasing nonsense, falsehoods and boredom, LLM-generated content is going to worsen user experiences across the board. Why force this content on users? And what about the impact of LLM-generated content beyond individual websites and user experiences: it's also going to <a href="https://www.wsj.com/articles/chatgpt-already-floods-some-corners-of-the-internet-with-spam-its-just-the-beginning-9c86ea25">pollute the web as a whole</a> and make search worse (<a href="https://arxiv.org/pdf/2307.09009.pdf">as well as itself</a>).</p> <p>None of this is new, we've had robot-like interactions way before LLMs. When the tax office sends a letter that means you need to pay or receive money, that information is often buried in civil servant speak. When Silicon Valley startup founders announce they were bought, they will mention their “<a href="https://ourincrediblejourney.tumblr.com/">incredible journey</a>”. When lawyers describe employment, customer service phone lines pronounce “<a href="https://www.penguinrandomhouse.com/books/129409/your-call-is-important-to-us-by-laura-penny/">your call is important to us</a>” (a great read, BTW)… this is all to say that, even without LLMs, we're used to people that sound more robotic and less human. They speak a lingo.</p> <p>Lingo gets in the way of clarity. Not just because it feels impersonal and boring, it is also made-up, however brilliantly our prompts will be ‘engineered’. Yes, even if it's sourced—or stolen, in many cases—from original content. That makes it like the lingo humans produce, but much worse. Sure, LLM-generated content could give users clarity, except in a way that's only helpful if the user already knows a lot about the thing that is clarified (so that they can spot falsehoods). This is the crux and why the practical applicability of LLMs isn't nearly as wide as their makers claim.</p> <p>I can see how a doctor's practice / government department / bank / school could save money and time by putting a chatbot between themselves and the people. There are benefits to one-click-content-creation for organisations. But I don't see how end users could benefit, at all. Who would prefer reading convincing-but-potentially-false chatbot-advice to a conversation with their doctor (or <a href="https://en.wikipedia.org/wiki/Golden_Rule">force the bot on others</a>). Zooming out from specific use cases to the wider ecosystem… aren't even those who shrug at ideals like centering humans worried that LLMs-generated content wipes out the very “value” capitalists wants to extract from the web (by <a href="https://pluralistic.net/2023/01/21/potemkin-ai/">enshittification</a>)? I certainly hope so.</p> <p><a id="addendum"></a></p> <p><em>Addendum</em>: I didn't know writing this post that OpenAI's CEO Sam Altman literally wrote he looked forward to “AI medical advisors for people who can't afford care”. From his <a href="https://twitter.com/sama/status/1627110889508978688?s=20">thread on 19 February 2023</a>:</p> <blockquote> <p>the adaptation to a world deeply integrated with AI tools is probably going to happen pretty quickly; the benefits (and fun!) have too much upside.</p> <p>these tools will help us be more productive (can't wait to spend less time doing email!), healthier (AI medical advisors for people who can’t afford care), smarter (students using ChatGPT to learn), and more entertained (AI memes lolol).</p> </blockquote> <p>(…)</p> <blockquote> <p>we think showing these tools to the world early, while still somewhat broken, is critical if we are going to have sufficient input and repeated efforts to get it right. the level of individual empowerment coming is wonderful, but not without serious challenges.</p> </blockquote> <p>He talks about “individual empowerment [that] is wonderful”, I think it's incredibly dystopian.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/llms-user-centered/">“AI” content and user centered design</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20“AI” content and user centered design">Reply via email</a></p> It's pretty rude of OpenAI to make their use of your content opt-out 2023-08-14T00:00:00Z https://hidde.blog/llm-theft-opt-out/ <p>OpenAI, the company that makes ChatGPT, now offers <a href="https://platform.openai.com/docs/gptbot">a way for websites to opt out of its crawler</a>. By default, it will just use web content as it sees fit. How rude!</p> <p>The opt-out works by adding a <code>Disallow</code> directive for the <code>GPTBot</code> User Agent in your <code>robots.txt</code>. The <a href="https://platform.openai.com/docs/gptbot">GPTBot docs</a> say:</p> <blockquote> <p>Allowing GPTBot to access your site can help AI models become more accurate and improve their general capabilities and safety.</p> </blockquote> <p>I get the goal of optimising AI models for accuracy and capabilities, but I don't see why it would be ok for these “AI” companies to just take whatever content they want. Maybe your local bakery's goal is to sell tastier croissants. Reasonable goal. Now, can they steal croissants from other companies that make tasty croissants, unless those companies opt out? I guess few people would answer ‘yes’?</p> <p>Google previously got into <a href="https://www.cnet.com/home/smart-home/google-scrubs-belgian-newspapers-from-search/">legal trouble</a> for their somewhat dubious practice of displaying headlines and snippers from newspaper's articles. It seems reasonable to reuse content when referring to it, at least headlines, most websites do that. Google does it with sources displayed and has links to the original. ChatGPT has neither, which makes their stealing (or reusing) especially problematic.</p> <p>Taking other people's writing should be an opt-in and probably paid for (<a href="https://www.theguardian.com/technology/2023/aug/09/google-says-ai-systems-should-be-able-to-mine-publishers-work-unless-companies-opt-out">even if makers of AI don't think so</a>). The fact that this needs to be said and isn't, say, the status quo, tells me that companies like OpenAI don't see much value in writing or writers. To deploy this software in the way they have, shows a fundamental misunderstanding of the value of arts. As someone who loves reading and writing, that concerns me. OpenAI have enormous funds that they choose to spend on things and not other things.</p> <p>It is in the very nature of LLMs that very large amounts of content are needed for them to be trained. Opt-in makes that difficult, because it would mean not having a lot of the training content required for the product's functioning. Payment makes that expensive, because if it's lots of content, that means it would cost lots of money. But hey, such difficulties and costs aren't the problem of content writers. OpenAI's use of opt-out instead of opt-in unjustifyably makes it their problem.</p> <p>For that reason alone, I think the only fair LLMs would the ones trained on ‘own’ content, like a documentation site that offers a chatbot-route into its content in addition to the main affair (an approach that is still <a href="https://illusion.baldurbjarnason.com/">risky for numerous other reasons</a>).</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/llm-theft-opt-out/">It's pretty rude of OpenAI to make their use of your content opt-out</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20It's pretty rude of OpenAI to make their use of your content opt-out">Reply via email</a></p> Co-organising Design Systems Week 2023 2023-08-25T00:00:00Z https://hidde.blog/design-system-promises/ <p>For the Dutch government, I'm co-organising the third edition of a <a href="https://www.gebruikercentraal.nl/design-systems-week/">virtual week-long design systems event</a>, as part of my role in the <a href="https://nldesignsystem.nl/">NL Design System</a> core team. Will it be interesting? Yes!</p> <p>At NL Design System, we work with a lot of government teams to ultimately try and make a “greatest hits” of their components. Heavily simplified: we want to find the best front-end components/guidelines/examples in use across government, test them (for accessibility and usability) and then publish them for wide reuse. That's a long, but (hopefully) very fruitful journey, that can result in widely-agreed upon solutions and avoidance of some common design system pitfalls.</p> <p>That's not really how design systems used to work. Design systems came a long way from pattern libraries for developers who need to copy/paste HTML to much better thought-out systems with communication and support protocols, advanced theming, versioning and solid accessibility guidelines. Over time, the promises we make have probably also evolved.</p> <h2>Promises vs reality</h2> <p>My favourite promise of design systems is the opportunity to try and do high quality front-end work and then spread the result across lots of projects. So, like, you could get the component right and build it accessibly, with a usable API, excellent guidance, and so fort. Good things you could then spread around. Other promises of design systems include cost savings through efficiency and improved user experience through consistency. But realistically, promises remain promises until they are realised (as those who work on design system teams will probably be well familiar with).</p> <p>That's not to say designs system promises are too good to be true. They do often come true. Just look at what some teams out there are doing! But there's a lot to say about approaches, benefits and potential pitfalls for design systems teams. How does everyone do it? Because while the work could be made to sound easy, it often isn't. This is partly why we're organising Design Systems Week (the third edition this year): we want to hear from others about their successes, learnings and challenges. Or… peak inside other teams, basically. And when I say “we”… I should say the team already ran two editions, I'm just helping out with the third.</p> <h2>Design Systems Week</h2> <p>So, Design Systems Week 2023 is coming, in the first week of October! The program is starting to shape up nicely. We'll have speakers from across the Dutch government, such as the Chamber of Commerce and various city governments. New in this year's edition is that we also wanted to hear from people from outside the Netherlands, in government and private sector.</p> <p>So far, we've announced (among <a href="https://www.gebruikercentraal.nl/design-systems-week/">others</a>):</p> <ul> <li><a href="https://www.gebruikercentraal.nl/agenda/designops-designing-the-api-of-design-teams#english">Inayaili León from GitHub</a> on DesignOps</li> <li><a href="https://www.gebruikercentraal.nl/agenda/the-gov-uk-prototype-kit#english">Joe Lanman from GOV.UK</a> on their Prototype Kit</li> <li><a href="https://www.gebruikercentraal.nl/agenda/betere-toegankelijkheid-met-een-design-system/">Daniëlle Rameau from Sanoma Learning</a> on Design Systems as a way to get accessibility right (in Dutch)</li> <li><a href="https://www.gebruikercentraal.nl/agenda/design-systems-web-components-what-works-what-doesnt#english">David Darnes from NordHealth</a> on Web Components (what works and what doesn't)</li> <li><a href="https://www.gebruikercentraal.nl/agenda/design-systems-as-public-infrastructure#english">Mu-An Chiou from Taiwan Design System</a> on design systems as public infrastructure</li> <li><a href="https://www.gebruikercentraal.nl/agenda/estland-design-system#english">Aleksandr Beliaev from Estonia Design System</a> on the design system of the first digital society</li> </ul> <p>And there's a few more coming that I can't wait for the team to announce.</p> <p>We know people are busy and don't necessarily have time to watch virtual events all day, so we've designed the sessions to be 20-25 minute “snacks” that you can catch between meetings (live via Teams (government), or watch via the published records afterwards).</p> <p>I'm really looking forward to this. If you want to join us, you can <a href="https://www.gebruikercentraal.nl/design-systems-week/">sign up for individual sessions</a> or check out the <a href="https://www.gebruikercentraal.nl/agenda/design-systems-week-2023/#english">main event page</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/design-system-promises/">Co-organising Design Systems Week 2023</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Co-organising Design Systems Week 2023">Reply via email</a></p> Ableist interactions 2023-09-16T00:00:00Z https://hidde.blog/interactions-about-accessibility/ <p>This week, a product launched and claimed to generate “production ready” code. But it also generates code with accessibility problems, which contradicts “production ready”. When someone called this out publicly, a community showed itself from its worst side. What can we learn?</p> <p>I'll state again, I wrote this to share learnings around community respondes to a concern about accessibility issues. Because these kinds of replies are common and it's useful to have context. I don't want to add fuel to the issue, which is why I left out links to individual tweets and people.</p> <p><em>I do want to call out Vercel, a business with a large voice in the developer community, which I do at the end of the post.</em></p> <h2>The “production ready” claim</h2> <p>I’ll start by elaborating on my first point. “Has accessibility issues” contradicts “production ready”, for three reasons:</p> <ol> <li>equal access to information is a human right</li> <li>most organisations have legal requirements to make accessible products</li> <li>it can cost companies money if people can’t use their products (you wouldn’t stop every fifth customer from entering your shop).</li> </ol> <p>I will note it was an “alpha” launch, but the words “production ready” were used and not nuanced (not in marketing and not in the actual tool; a warning banner could go a long way). Fair enough, maybe they want to look at accessibility later (a personal pet peeve though: I recommend <a href="https://talks.hiddedevries.nl/7336XA/shifting-left-or-making-accessibility-easier-by-doing-it-earlier">shifting left</a> instead, doing accessibility earlier is easier).</p> <p>The company could have made different choices. If it is known that accessibility is problematic, maybe the product could have come with a checklist that helps people avoid some of the most common issues? Or some kind of warning or banner that explains nuances the “production ready” line? These are choices to be made, to balance between what makes the product look less good and what harms end users.</p> <h2>Ableism</h2> <p>Many of the responses were <em>ableist</em>: they <a href="https://en.wikipedia.org/wiki/Ableism">discriminate or contain social prejudice against people with physical or mental disabilities</a>. A key point to make here is: don't feel offended if you or your comment is called ableist. Instead, listen and learn (seriously, it's an opportunity). <a href="https://www.un.org/africarenewal/magazine/august-2021/%E2%80%98-biggest-challenge-ableism-not-my-disability%E2%80%99">The system is ableist</a>, on top of which individuals make comments that can be called ableist. We (as a people) need to identify and break down that system, but also, people can individually learn: everyone has a degree of ableism (like they have some degree sexism and racism). I know I do. I've been learning about accessibility for about 15 years and still learn new things all the time (same for sexism, or racism, etc, these are all things need regular introspection; and they are related, see also <a href="https://en.wikipedia.org/wiki/Intersectionality">intersectionality</a>).</p> <h2>Learning from the responses</h2> <p>Below, I'll list some responses I found problematic, and try and explain why. I'm hoping this is helpful for people who want to understand better why accessibility is critical, and why accessibility specialists point this out.</p> <ul> <li>“can’t expect them to make everything perfect, especially in the alpha release” - I think it's fair to have expectations from a company that is a large voice in the web development community</li> <li>“Here's a better framing”, “Why the agressive tone?”, “Why are these people so insufferable? (…)” - this shifts the question about accessibility to one about how the person asking for equality phrases their feedback (this is <a href="https://geekfeminism.fandom.com/wiki/Tone_argument">tone policing, a common derailment tactic</a>)</li> <li>“🤮 being an insufferable dick to well-meaning, well-intentioned people is not going to work for your cause, no matter how good of a cause it is” - this seems to suggest that inaccessibility is ok as long as the intentions are good (that is ableist; equal access cannot be bought off by good intentions only. It is actual equality that is required)</li> <li>“Paying a six figure engineer to add features only 1% of your user base needs only makes profit sense after, idk, 100K active users? [screenshot of ChatGPT to prove the number]” - it’s not only about profit sense, it’s also about ethical sense and legal sense. If you want to focus on profit only: about <a href="https://hidde.blog/how-many-people-with-disabilities-use-our-site/">20% of people has a disability</a> (says WHO). Also, almost all people will develop disabilities in some form throughout their life while they age.</li> <li>‘You are complaining about a WYSIWYG editor not being accessible to the blind---do you make similar complains about sunsets and VR headsets?’ and ‘I don't think anyone using this site needs accessibility’- this is a fundamental misunderstanding of how people with disabilities use the web. Yes, blind people use WYSIWYG editors (and so do people with other disabilities, which is why creators of these tools care, see the accessibility initiatives for tools like <a href="https://www.tiny.cloud/docs/advanced/accessibility/">TinyMCE</a>). See also Apple's videos on <a href="https://www.youtube.com/watch?v=SL7YSqlEd8k">Sady Paulson, who uses Switch Control to edit videos</a> or on <a href="https://www.youtube.com/watch?v=8sX9IEHWRJ8&amp;t=7s">how people use tools like Door Detection and Voice Control</a>.</li> <li>‘Then what is the argument for accessibility, if not screen readers or search engine crawlers?’ - again, there are many more <a href="https://www.w3.org/WAI/people-use-web/">ways people with disabilities use the web</a>, and beyond permanent disabilities (as mentioned, about 20% of people), there are people with temporary impairments (from broken arms to word) and situational impairments</li> </ul> <p>Some responses were particularly hostile and personal. “I'm shocked that you're unemployed ..🤯🤯😅”, “Okay, Karen”, “(…) She wants attention”, “No matter how much you shame Vercel, they don't want you. They never will”, “Go accessibility pimp else where (sic) and pretend that others give a shit”, “[you are] being an insufferable dick”. These are all unacceptable personal attacks.</p> <p><em>If you work at Vercel (this was relating <a href="https://v0.dev/">the v0 product</a>), please consider speaking up (silence speaks too) and/or talking with your community about how accessibility is viewed and how people in the community interact. The quotes in this post are all real quotes, from people defending Vercel. To his credit, the CEO gave the right example with his response (”Thanks for the feedback”)</em></p> <h2>Wrapping up</h2> <p>So, in summary: the “production ready” claim and lack of nuance about what that means is problematic. Pointing it out got responses I'd call ableist, plus a few responses that were plain hostile. All of this reflects badly on the community.</p> <p>It's not new that accessibility advocates get hostile responses to reasonable requests (or when doing their job). But it's been a while since I've seen so many of those responses, so I wanted to take the opportunity to write down some common misunderstandings.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/interactions-about-accessibility/">Ableist interactions</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Ableist interactions">Reply via email</a></p> Answers to common (web) accessibility questions 2023-11-02T00:00:00Z https://hidde.blog/a11y-faq/ <p>Inspired by Chris Coyier' <a href="https://chriscoyier.net/2023/10/31/answers-to-common-web-design-questions/">Answers to common (web) design questions</a>, which was inspired by <a href="https://chriscoyier.net/2023/10/02/dan-mall-answers-to-common-design-questions/">Dan Mall's earlier post</a>, here's list of common accessibility questions.</p> <h2>Should I use links or buttons?</h2> <p>Yes.</p> <p>Links if it takes the user somewhere, buttons if it performs an action. Also buttons if the action is submitting a form (even if the user is then taken somewhere). Trying to avoid nuance in this post, but here's some <a href="https://github.com/alphagov/govuk_elements/pull/272">nuance around buttons and links</a>.</p> <h2>Do we have users with disabilities?</h2> <p>Yes.</p> <p><em>It's unlikely you know every single one of your users and exactly how they use the web. It's even more unlikely that the the group and the people within it stays exactly the same forever.</em></p> <h2>What's an accessibility conformance audit?</h2> <p>Someone will find out for every of the <a href="https://www.w3.org/TR/WCAG22/#non-text-content">56 Success Criteria in WCAG</a> whether your site meets it or not (counting version 2.2, Level A + AA). Ideally, they also explain what the issues are and how to fix them (so that you can do it). This is also called a <a href="https://www.w3.org/WAI/test-evaluate/conformance/">conformance evaluation</a>.</p> <h2>Who should “do” accessibility in our team?</h2> <p>Everyone. Content folks, developers, designers and product managers all have accessibility tasks to do.</p> <h2>What are some quick tests I can do?</h2> <p>Use your UI with Tab / Shift Tab on a keyboard (<a href="https://www.a11yproject.com/posts/macos-browser-keyboard-navigation/">check settings</a> if on a Mac), can you reach everything without a mouse? Does the order make sense?</p> <p>Click on labels for form fields, they should focus the field they are a label of.</p> <p>Check if your videos and audio (podcasts?) have captions / transcripts.</p> <h2>Is accessibility ever done?</h2> <p>No. It's a continuous process, even if your audit says you meet all Success Criteria today, it's common to stop meeting it. Websites change. You'll want to continuously monitor accessibility, just like with security and privacy.</p> <h2>Do we have legal obligations to make our products accessible?</h2> <p>Very likely. Also if you're not government (for instance, see <a href="https://business.gov.nl/amendment/european-accessibility-act-products-services/">European Accessibility Act</a>).</p> <p>There are <a href="https://www.lflegal.com/global-law-and-policy/">policies and laws all around the world</a>.</p> <h2>Is it all my website's fault?</h2> <p>No, some problems can be <a href="https://talks.hiddedevries.nl/IEwNvG/could-browsers-fix-more-accessibility-problems-automatically">solved by browsers</a>, assistive technologies and/or <a href="https://talks.hiddedevries.nl/tGzZs2/your-cms-is-an-accessibility-assistant">authoring tools</a>.</p> <h2>WCAG 3.0 will be released soon, right?</h2> <p>Not likely. The goals are good and I've long supported them (still do), but it will be many years for this to be a real thing, WCAG 3.0 is still in a very early phase. The <a href="https://www.myndex.com/BPCA/">colour algorithm</a> that's being considered for it is interesting to already try and meet as it better meets user needs than current WCAG algo.</p> <h2>Will “AI” improve accessibility?</h2> <p>Machine learning can be a great tool for automating part of the captioning process in lots of languages, and various other things.</p> <p>But it's unlikely LLMs, often called “AI”, will output accessible code. To train such an LLM, an enormous set of very accessible code would need to exist (it doesn't). Component-building and accessibility semantics also require <em>intentionality</em>, which these systems specifically aren't good at.</p> <h2>Is the Axe / Page Insights score all that matters? Or the WCAG audit result?</h2> <p>No. Any system that scores your site and returns some number (including WCAG audits) does not fully describe your accessibility situation. Accessibility is, ultimately, about people and whether they can use your site. It's about recognising, then removing barriers. Metrics can help in various ways, but they are not the end goal. And the most easily measureable is not necessarily the most impactful.</p> <p>More detailed accessibility posts can be found elsewhere on <a href="https://hidde.blog/blog">this blog</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/a11y-faq/">Answers to common (web) accessibility questions</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Answers to common (web) accessibility questions">Reply via email</a></p> 2023 in review 2023-12-24T00:00:00Z https://hidde.blog/2023-review/ <p>Wait, what, it's only a week until 2024? Time for what has become a yearly tradition… in this post, I'll review some of my 2023 in work, conferences, reading, writing, listening, music and learnings.</p> <p><em>Note: like my posts about <a href="https://hidde.blog/2022-review">2022</a>, <a href="https://hidde.blog/2021-in-review/">2021</a>, <a href="https://hiddedevries.nl/en/blog/2020-12-17-2020-in-review">2020</a>, <a href="https://hiddedevries.nl/en/blog/2019-12-20-2019-in-review">2019</a>, <a href="https://hiddedevries.nl/en/blog/2018-12-26-2018-in-review">2018</a> and <a href="https://hiddedevries.nl/en/blog/2017-12-29-2017-in-review">2017</a>, this post is mostly ‘highlights’, lowlights left out intentionally.</em></p> <h2>Work</h2> <p>The work year was different than usual: my full time job (first in 10 years or so) ceased to exist and I switched back to freelancing.</p> <h3>Freelancing</h3> <p>In July I joined the NL Design System team (almost) full time. We support a community of web specialists from across the Dutch government to create open-source components and guidelines for all. I joined as an accessibility and developer relations specialist. Now I'm PR/communications lead, with still some time for accessibility (but none for devrel). The project is very much up my ally. I really like the colleagues. I also feel fortunate to bring my experience into this team. And, of course, just as fortunate to have made it once again into a team where I get to learn lots from the others (and all of the design system, government, accessibility and development experience between them).</p> <p>Outside of NL Design System, I did some in-house workshops, talks about the web and web accessibility, and the occasional WCAG audit.</p> <h3>Volunteering</h3> <p>I continued in <a href="https://open-ui.org/">Open UI CG</a>, mostly scribing, learning and then conveying some of the work to developer audiences in blog posts and talks. It's still one of my favourite meetings of the week.</p> <p>Other volunteering didn't work so well. I joined the marketing team of my local solar energy community, made plans but found no time to properly work on them and left. I also <a href="https://hidde.blog/joining-csswg">joined the CSS WG</a> as an Invited Expert, a long time dream come true. But so far, I only managed to join one meeting and only marginally kept up with emails and issues. Let's say between when I said yes and when it was official, a lot changed at work and I wanted to spend more time with family. I hope they don't revoke my status just yet and hope to start prioritising my WG involvement sometime in 2024.</p> <h2>Conferences</h2> <p>Last year, as the <a href="https://html.spec.whatwg.org/dev/popover.html#the-popover-attribute">popover attribute</a> started to make its way into browsers, I hoped I would do a talk about the nitty gritty of building popovers (repeating the phrasing I used last year). That happened. I wrote that talk and took it to a number of events. In addition, I made a new talk called “ARIA, The Good Parts” and did a 10 minute rant for the IAAP-EU called “Will tools save us?”.</p> <p><img src="https://hidde.blog/_images/hotelcat.jpg" alt="screen recording of dev tools and the toggle, in the dev tools the code is as described, with a form, fieldset, legend, options and svgs" /> <em>At CSS Day, I met the hotel cat once again</em></p> <p>All my talks in 2023:</p> <ul> <li><a href="https://talks.hiddedevries.nl/gyxKUM/shifting-left-or-making-accessibility-easier-by-doing-it-earlier">Shifting left: making accessibility easier, by doing it earlier</a> at a11yTalks (online)</li> <li>“Dialog dilemmas and modal mischief: a deep dive into popovers and how to build them”, I like long names, what can I say? This popover talk happened at JSNation (Amsterdam) (<a href="https://talks.hiddedevries.nl/G9mATs/dialog-dilemmas-and-modal-mischief-7-mins-edition-w-transcript">7 minute edition, with transcript</a>), CSS Day (Amsterdam), Front Conference (Zurich), HalfStack (Vienna), Covent of Wisdom (Eindhoven) and React Advanced (London)</li> <li>“ARIA: the good parts” at Paris Web (Paris, obvs), NDC (Porto) and WeAreDevelopers (online)</li> <li>“<a href="https://talks.hiddedevries.nl/Voo22H/will-tools-save-us">Will tools save us</a>” - introduction to a panel for IAAP-EU's celebration of the 3rd anniversary of the Web Accessibility Directive (Brussels)</li> </ul> <p>I also attended Beyond Tellerrand in Düsseldorf and State of the Browser in London.</p> <h2>Reading</h2> <p>I read a bit less than in the last year, most of them while on holiday or travel (see: <a href="https://log.hidde.blog/books/">full reading list</a> if you like book covers). These are some books I can recommend:</p> <ul> <li><em>Just Human</em> by Arielle Silverman (auto biography), in which she shares her own experience being blind within the context of society, from the moment she was born to the age of 36. Learned a few things about the workings of ableism.</li> <li><em>Make me one dimensional</em> by Sang Young Park (novel). Murder mystery, friendships and growing up.</li> <li><em>Doe zelf normaal</em> by Maxim Februari (non-fiction), on the role of “datafication” in society. Original, clear, funny at times, witty.</li> <li><em>Le Perfezioni</em> (De perfecties) by Vincenzo Latronico (novel). On gentrification, Berlin, millenials.</li> <li><em>Tomorrow and tomorrow and tomorrow</em> by Gabrielle Zevin (novel). The videogame industry, sudden success, weird relationships. Was told this is ‘a TikTok sensation’, but won't let that ruin my feelings about the book or my liking it. Consumed this as an audiobook on a few long drives.</li> <li><em>Binge</em> by Douglas Coupland (short stories), 60 (!) stories, loved most of them, easy to read in between other tasks.</li> </ul> <h2>Music</h2> <p>Saw more live music than in the year before (yay, thanks to babysitters and being more ready for their help as a family). I got lucky that the artists I listened to also toured near me on the right dates, so I got to see:</p> <ul> <li>Little Simz, at North Sea Jazz. Was spectacular. Would have loved a full band, vocals etc, but even without that it was great. I was introduced to her No Thank You album, worked my way back through Sometimes I Might Be An Introvert and Grey Area, and now I'm all in Stillness in Wonderland, it was a fantastic musical rabbit hole.</li> <li>James Blake, at 070. I don't understand <em>how</em> he makes music (how do synthesisers work?), but the new album is great and sounded excellent live. Some fans knew it was birthday, so we all sang.</li> <li>Esperanza Spalding, also at North Sea Jazz. I'd not heard of the fairly sexist song ‘Girl Talk’, but the way she performed it with Fred Hersch was awesome (see <a href="https://youtu.be/wMNPaQL1RbE?si=L4a0H1PalaoBhttD">Girl Talk on YouTube</a>).</li> </ul> <p>I also listened a lot to De Jeugd van Tegenwoordig, Sault, Sef, WIES, Massive Attack and Typhoon.</p> <p>I made a <a href="https://log.hidde.blog/live-music/">live music log</a> to track concerts publicly (inspired by Vasilis).</p> <h2>Writing</h2> <p>Including this one, I wrote 15 posts this year, some lengthier than others. Less than usual. There's a bunch of drafts that I'm looking forward to finish!<br /> Of this year's posts, most shared were an <a href="https://hidde.blog/a11y-faq/">FAQ on accessibility</a> and one on <a href="https://hidde.blog/interactions-about-accessibility/">ableism in the Vercel community</a>.</p> <p>Most sceptical were a few posts I wrote about ‘AI’, where I said that <a href="https://hidde.blog/llm-theft-opt-out/">opt-out is rude</a>, <a href="https://hidde.blog/llms-user-centered/">‘AI’ content isn't user centered</a> and LLMs are <a href="https://hidde.blog/artificial-nor-intelligent/">not artificial, nor intelligent</a>.</p> <h2>Cities</h2> <p>I stayed in Taipei, Kaohsiung, Düsseldorf, Porto (2x), Berlin, Zurich, Vienna, Paris, Brussels, London (3x), Bristol and Porto.</p> <p>I wanted and was able to do a lot of this year's conference travel by trains, twice by night train. The latter aren't cheap if you want some comfort (I went for beds), but very pleasant and lower in emissions than flights would have been.</p> <p><img src="https://hidde.blog/_images/bristol-balloons.jpg" alt="houses in various bright colors like yellow, blue and red, with a blue sky that contains 5 hot air balloons" /> <em>Saw hot air balloons in Bristol</em></p> <h2>Learnings</h2> <p>Some random things I learned this year, in no particular order.</p> <ul> <li>Social media doesn't need algorithms for that real community feel. I still like it on Mastodon and still mostly left Twitter and Bluesky. I still use Instagram (to follow artists) and LinkedIn (to follow a random mix of people that never came to Mastodon).</li> <li>A lot about electric cars (and probably still too little). Quite the rabbit hole, but I bought one, so that I can stop buying petrol. I didn't want to buy one without researching some ins and outs.</li> <li>In git: to fix commits further back than the very last one, by doing <a href="https://thoughtbot.com/blog/autosquashing-git-commits">fixup commits and autosquashing them</a>. I hope I won't forget.</li> <li>Lots of words in Mandarin (~1000). I had some formal courses, but midway this year I started Duolingo (add me!). It uses simplified Chinese characters (not traditional) and Taiwanese friends and family scold me for that. But honestly, the upsides outweigh the downsides for me.</li> <li>Fresh YouTube accounts (I set one up for work) recommend even more extreme-right content than my many-years-old one does. I wish I could turn recommendations off altogether.</li> <li>Conference speakers are actually just humans.</li> <li>Lots of things about government departments and how they work together and the meanings of very specific acronyms.</li> </ul> <h2>Wrapping up</h2> <p>Thanks for reading, hope there's useful recommendations in this post. If you're still reading let me end with my best wishes to you for the new year, see you in the next!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/2023-review/">2023 in review</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%202023 in review">Reply via email</a></p> Clippy returned (as an unnecessary “AI”) 2024-01-06T00:00:00Z https://hidde.blog/redundant-ai/ <p>In the nineties, Clippy lived inside the Microsoft Office suite. It was an avatar of an actual paperclip that would interrupt your writing with tips. Did it provide lots of value? I can't remember. I recall there were good easter eggs. But I don't think it really fixed our productivity in some groundbreaking way. A cute relic of the past, in a time where a lot less people were using computers daily.</p> <p>Fast forward to this week. I used the current version of Microsoft Word, on the web, to write a thing for work. I wrote a headline. Let's say it was “Marketing 2024”. <em>You won't believe what happened next</em>. A blue circle appeared next to the headline. When I hovered over it, it asked me if I wanted it to insert an image. “An image?”, I thought, somewhat surprised. Was this what the future looked like? Did Clippy return? It certainly got in the way of my writing. When I obliged, it put in a random image that felt very marketing-plan-y. It also showed me a gallery of other images for me to pick instead.</p> <video controls=""> <source src="https://hidde.blog/_images/ai-suggestion.mp4" /> </video> <em>A blue dot appears. When clicked, it inserts an image into the writing flow</em> <p>It left me with lots of feelings, the main one being how <em>unnecessary</em> all of this was. All that computing power!</p> <p>The “AI” feature I described assists with images, but Microsoft are rolling out <a href="https://en.wikipedia.org/wiki/Microsoft_Copilot">Copilot</a> across many of their products. It can also write new text, or improve existing text in ways you specify, the kinds of features we've seen large language models provide. Copilot is a clever name, and a clever framing of what these chatbots can do: they're not the main driver, that's you as a user, but they can be there alongside you.</p> <p>And yet, I'm not convinced these features are helpful. They interrupt a flow, the actual content production. And they're actively pushed onto users, from in-software notifications to promotional webinars. If that push is successful, everyone in the world will have to put up with the fruits of these features. It's to be seen what those fruits are: content that is better, content that is more superfluous or a bit of both?</p> <h2>User need?</h2> <p>Do these features empower users? They appear to, from the onset. Of course, a lot of the world's marketing plans look very similar, people probably already copy pasted them from one another or used boilerplates. This just makes recycling old ideas available through a different interface. It makes it easier to make something to that seems ok.</p> <p>But ultimately, is it the right kind of support? Personally, I want software to push me not towards reusing what exists, but away from that (and that's harder). Whether I'm producing a plan or hefty biography, push me towards thinking critically about the work, rather than offering a quick way out.</p> <p>To be fair, Word has some features today that help you improve content, but mostly to correct style, grammar and punctuation (nice!). Well, and, I'm not making this up, to help remove “sensitive geopolitical references”.</p> <p><img src="https://hidde.blog/_images/geopolitical.png" alt="list of checks that have a checkmark next to them, 4 items, formality, inclusiveness, punctuation conventions, sensitive geopolitical references" /> <em>I did ok on formality and sensitive political references</em></p> <h2>Writing as trying to discover something new</h2> <p>When I write or (publicly) talk, I hope to write or say something that is relatively unique. Obviously, I don't have the illusion I actually do, unique things are rare, everyone's always iterating upon the work of others. But to at least <em>try</em> to find a new perspective is the point of most writing (if it's meant for reading or convincing). That's what we're all trying to do, right?</p> <p>Whether it's marketing copy, a techy blog post, a stage play or a philosophical treaty, would anyone set out to produce something similar to what already exists? Would the stage play sell tickets if it sounded like the same old? Would your product sell if you use the same copy as your competitor? (Ok, that last one happens all the time)</p> <p>Discovering new ways is central to creativity. When Miles Davis recorded his groundbreaking album <em>Kind of blue</em>, he gave musicians scales and melody lines, and asked them to improvise. They hardly practiced and did not know the music inside out before they started. Herbie Hancock explains this made the whole album a lot more spontaneous:</p> <blockquote> <p>Miles' idea was that… he wanted to capture the spirit of discovery in the music. (…) He wants to capture discovering the music on the record.</p> </blockquote> <p>(in: <a href="https://youtu.be/m1MzAGjcktI?si=4loHqSkRbUi6eHRg&amp;t=382">The making of Kind of Blue</a>, 6:22)</p> <p>I recommend that video, it's full of people who understand music and this music in particular. They try and explain some of the creativity of this particular piece.</p> <p>Of course, most writing doesn't have to yield a creative masterpiece. But it's probably that sense of <em>discovery</em> where, like making music, writing gets most interesting. For writers and for readers. More than recycling old and making grammatical and stylistic improvements (quite useful), writing assistants could drive us in the direction of discovery more.</p> <h2>Unnecessary “AI”</h2> <p>It's not just for fun that I'm calling “unnecessary” on this feature (and who am I to judge, or, frankly, who do I think I am?). This is feature that people probably worked on hard and that some users may find very useful. But still, it's worth considering the need. Large language models, that most “AI” features are based on, cost a lot of computing power, both training them and running them. The training also involves a lot of (underpaid) labour of people, who classify content to make the magic work. And then there's all the knock-on effects on society of having harms perpetuated and being stuck with lots of content that nobody thought was worth writing in the first place.</p> <p>We've got to think about whether or not the features we build with this are actually useful, actually unnecessary or somewhere in between. We don't have to add “AI” to every product, even in an industry where we see investors push for that, we can choose to do otherwise. (<code>&lt;/man-yelling-at-cloud&gt;</code>). One company stood out thinking about this especially carefully in the last while: iA wrote <a href="https://ia.net/topics/writing-with-ai">Writing with AI</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/redundant-ai/">Clippy returned (as an unnecessary “AI”)</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Clippy returned (as an unnecessary “AI”)">Reply via email</a></p> Sharing links 2024-01-12T00:00:00Z https://hidde.blog/sharing-links/ <p>The amount of content on the web is so large, that it's tricky to find the stuff worth reading. One of my strategies is to follow people I trust and read what they share. For anyone with interests similar to mine, I've opened a <a href="https://hidde.blog/links">Links</a> section on this website, too (with it's own RSS feed).</p> <p>My plan is to publish no more than a couple of links per day (if any). They will mostly be related to technology and/or ethics. I have taken inspiration from many others, like <a href="https://adactio.com/links">Jeremy's Links section</a>. <a href="https://muan.co/">Mu-An</a> inspired me to use Shortcuts as a tool to create links and notes.</p> <h2>Why?</h2> <p>The reason I want to publish links on this site is mostly for selfish reasons. I've posted links on social media for a long time, but in the black box of algorithms, it's hard to recover them after time passes. I want to at least try and have some sort of system for organising and archive my interests (tags… I'm adding tags).</p> <p>I also want to try and experiment with shorter, quicker posts.</p> <h2>How: low treshold publishing with a Shortcut</h2> <p>I read mostly on the go, when on public transport or waiting for an appointment. This means I usually am not logged into a CMS or near a computer where I can do version control. This site doesn't use a CMS, but I have (Markdown) files in version control that I populate a static site from. To appear on my site, links shared would ultimately need to exist as Markdown files in a specific folder.</p> <p>This is what I wanted for my link sharing system:</p> <ul> <li>Very minimal effort</li> <li>Should work on all devices</li> <li>Should draft a note with both currently selected text and a link to the page, named after that page</li> <li>Should also include the current date in the draft and let me title the note</li> <li>Should place my draft somewhere that I can move to my site quickly</li> </ul> <p>What I ended up with is an Apple Shortcut that takes the current text selection, page name and page URL on a given page in Safari and creates a blob of text with current date, selection and link prefilled. When I run it while in Safari, a popup opens with something like this prefilled:</p> <pre class="language-bash"><code class="language-bash">--- tags: <span class="token punctuation">[</span><span class="token punctuation">]</span> date: <span class="token number">2024</span>-01-10 --- <span class="token operator">></span> // Selected text <span class="token punctuation">(</span>From: <span class="token punctuation">[</span>Name of the page<span class="token punctuation">]</span><span class="token punctuation">(</span>link to the page<span class="token punctuation">))</span></code></pre> <p>I can then write some context around the link, optionally add a comma-separated list of tags and then save the file. The filename becomes <code>YYYY-MM-DD-.md</code>, where I can write a title for the post after the date. My site generator grabs that title from the file name.</p> <p>At the time of writing, I haven't figured out how to then get this file in git, so I save it in a specific folder, requiring me to manually drag it into my site whenever I do reach a computer. That works fine for now, I don't write that many anyway.</p> <h2>Summing up</h2> <p>I'm looking forward to continue doing this for a while, and hope the low treshold publishing will make it so easy that I actually will. Check out <a href="https://hidde.blog/links">/links</a> to find out what I've posted so far.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/sharing-links/">Sharing links</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Sharing links">Reply via email</a></p> “AI” and accessible front-end components: is the nuance generatable? 2024-03-01T00:00:00Z https://hidde.blog/ai-for-accessible-components/ <p>Companies are rushing to add generated AI capabilities to their products. Some promise to produce front-end components for you. Is that even possible, given the nature of accessibility and the nature of generative AI? And is it desirable?</p> <p>The short answer is no, to both questions. The risk: that our rush to technlogical solutions comes at the expense of users.</p> <p>To find out why, let's consider: how is the process of building an accessible component different between humans and machines? And what are the ethics of our tendency to reach for technological solutions?</p> <h2>The human approach</h2> <p>Let's look at the differences in process first. A human who writes accessible front-end code, writes (mostly) HTML elements and attributes based on:</p> <ul> <li>their understanding of specs and how they work together (including HTML and WAI-ARIA)</li> <li>what they intend to convey</li> <li>what they know about how assistive technologies interpet the code they write</li> <li>knowledge of browser and assistive technology support</li> <li>looking up the syntax and applying it correctly</li> </ul> <p>(Leaving aside all the useful templating languages and orchestration libraries)</p> <p>So they translate what they or their designer counterparts want to exist into something that works according to those intentions in a browser. Intentions are a key word here. Conveying author intentions accurately and understanding user needs is essential to accessibility.</p> <p>They are likely also involved in writing CSS for things like colours, typography and spacing, which can all affect whether websites have barriers for users. And add JS for interactive stuff, managing state(s) and more.</p> <h2>The machine approach</h2> <p>A tool that generates code using language models basically predicts lines of code based on statistical likelihood, a bit like an autocomplete. If the output happens to be high quality, that's, in principal, coincidental. A systems' success rate can be (and is usually) increased by training models specifically with very good examples. In some cases, systems get very close to high quality, because they have enormous amounts of training data. For accessibility, this data is hard to get by—most of the web has accessibility problems: what we can see in the automated tests of the <a href="https://webaim.org/projects/million/">WebAIM Million</a> is just the tip of the proverbial iceberg.</p> <p>While humans map <strong>intentions</strong> to <strong>interactive content</strong> and apply their <strong>understanding</strong> in the process, LLMs don't have intentions or understanding. They just output blobs of text that matches some input best. I think this is fascinating, impressive and often akin to magic. And the output can look (and sometimes be) production ready and high quality. But it's unsurprising that the output can also contain problems. And as reasonable web developers, we've got to look at the problems we create.</p> <p>To make this more concrete, let's look at v0, Vercel's LLM-based code generator product that the Vercel CEO announced as:</p> <blockquote> <p>v0.dev produces the kind of production-grade code that we'd want to ship in our own @vercel products.</p> </blockquote> <p>(From: <a href="https://twitter.com/rauchg/status/1702355455362912595">tweet by Guillermo Rauch, 12:15 AM · Sep 15, 2023</a>)</p> <p>I mention this specifically, because I think claims like “production-ready” are an overestimation of the technology and an undervaluation of the need for humans. Which has real-world effects on people.</p> <p>When I read “production-grade”, I read “accessible”. I had a brief look at the first six components in the ”featured“ section of v0, I found WCAG violations and accessibility barriers in each.</p> <details> <summary>Examples of barriers in each</summary> <ul> <li>in <a href="https://v0.dev/t/9tk0WDvMrYm">math learning app example</a>: buttons marked up as links, progress indication that was only visual with no text alternative, heading marked up as div</li> <li>In <a href="https://v0.dev/t/btero0aK9VK">kanban board example</a>: list of items not marked up as list, column headers with low contrast, overlapping text on zoom</li> <li>in <a href="https://v0.dev/t/QDqTPtDgtLk">accessibility helper example</a>: overrides existing shortcuts, icons not marked as decorative</li> <li>in <a href="https://v0.dev/t/xiSjIAI">terminal UI</a>: buttons not marked up as buttons </li> <li>in <a href="https://v0.dev/t/rRBlufM">pricing table</a>: icons not marked up as decorative, button with insufficient contrast</li> <li>in <a href="https://v0.dev/t/x4SRZe6">music player example</a>: various buttons not marked up as buttons, some buttons not available with just keyboard, buttons without accessible names</li> </ul> </details> <p>This isn't a full conformance audit, I just listed the first few things that stood out. I don't mean this as an attack, I just want to show exactly how common accessibility issues in LLM output are.</p> <p>You might say it's not all terrible, and that's true. I <em>also</em> found lots of markup that makes things accessible, for instance headings that are useful to navigate in various tools, good contrasts and useful + valid ARIA. But that same level of accessibility often exists on websites that didn't involve LLMs. Lots of websites have fairly useful headings, good contrast on many elements and valid ARIA. It's the bits where those things aren't in place where web UIs create barriers for people with disabilities. It's the nuance that matters.</p> <h2>The self-confidence issue</h2> <p>In <a href="https://tetralogical.com/blog/2024/02/12/can-generative-ai-help-write-accessible-code/">Can generative AI help write accessible code?</a>, Léonie Watson looks at the output of three other generative AI tools (ChatGPT, Bard and Fix My Code). Like me, she found things that weren't terrible, things that were actually helpful and things that constituted accessibility issues. But Léonie points out a different problem: these tools thend to present themselves as authoritative. Regardless of whether they are. She explains:</p> <blockquote> <p>Other than the generic statements about the need to check its responses, none of these generative AI tools gives any hint that their answers may not be correct or provides any recommended resources for checking&quot;.</p> </blockquote> <p>In contrast, most good blog posts and resources about accessible coding have a lot of <em>nuance</em> in them. They usually can't recommend one authoritative solution that is guaranteed to work at all times (what definition of “work” would they use?). And that reflects making accessible interfaces in general. It involves rabbit holes. There are generally multiple ways and multiple least bad outcomes to balance between.</p> <h2>Ok, but can LLMs at least be partially useful?</h2> <p>Maybe the problem of authoritativeness could be solved. We could tune these tools to output responses that don't present as mansplainy know-alls. But that still leaves us with other problems: inaccessible suggestions, lack of intention and understanding and lack of innovation.</p> <h3>Falsehoods and hallucinations</h3> <p>LLMs give inaccessible suggestions, as demonstrated in the examples I shared above and in the examples in Léonie's post. If these falsehoods are a consequence of training data, that could be improved with different training data (emphasis on “in theory”). But it's also due to “hallucinations”, a problem inherent to the tech that <a href="https://arxiv.org/abs/2401.11817">research shows is inevitable</a>. They make wrong stuff up. Output may be nonsensical. At the expense of users. That can't possibly be an improvement to the status quo: even without “AI” there are plenty of accessibility tips on the web with specific bugs or issues, automating the addition of falsehoods and hallucinations to the mix seems absurd.</p> <h3>Lack of intentions</h3> <p>LLM tools don't have intentions, and intentions are necessary for (most) “accessible coding”. In his post <a href="https://alastairc.uk/2023/11/why-doesnt-ai-work-for-producing-accessible-code/">Why doesn't AI work for producing accessible code</a>, Alastair Campbell explains accessibility is not an average. That makes it incompatible with statistical methods to make suggestions.</p> <h3>Lack of innovation</h3> <p>While there are lots of open source component libraries, many UI patterns and their implications haven't been invented yet. Their assumptions dearly need testing. Relying on LLMs for suggestions means relying on (remixed) existing knowledge, so it's unsuitable for making new patterns accessible.</p> <p>These three reasons make me wonder: are LLMs useful at all in assisting us in building accessible front-end components? If there is a use, it's probably in helping developers discover resources that do contain nuance, not in code suggestions. Maybe there are also uses outside of component code, but that's for another post (see also Aaron Gustafson's <a href="https://alistapart.com/article/opportunities-for-ai-in-accessibility/">Opportunities for AI in Accessibility</a>).</p> <h2>The focus</h2> <p>Probably something for a post on its own, but I feel I should mention here: a focus on trying to find a “fix” or “solution” for accessibility constitutes a misunderstanding of what accessibility is about. When we make websites, the onus is on us to make them accessible. If we want to try and outsource that work to a tool (that we can't trust), we put the onus on disabled users (see also: <a href="https://www.vox.com/first-person/2019/4/30/18523006/disabled-wheelchair-access-ramps-stair-climbing">disability dongles</a>).</p> <p>As Adrian Rosellli wrote in <a href="https://adrianroselli.com/2023/06/no-ai-will-not-fix-accessibility.html">AI will not fix accessibility</a>, accessibility is about outcomes, not outputs:</p> <blockquote> <p>Accessibility is about people. (…) When we target output versus outcomes, we are failing our friends, our family, our community, and our future selves. We are excluding fellow humans while we try to absolve ourselves of responsibility. (…)</p> </blockquote> <p><a href="https://social.ericwbailey.website/@eric/111172321131231311">Eric Bailey posted</a>:</p> <blockquote> <p>Thinking AI will &quot;solve&quot; accessibility is a bad frame stemming from a technoableist mindset.</p> <p>The industry seems to me hoping for a magic, binary solution (…) Personally, I'd look to the social model of disability for guidance here: what exactly are we looking to &quot;fix&quot; and why?</p> </blockquote> <h2>In summary</h2> <p>Is the nuance that accessibility usually needs generatable? I think not. Not reliably, anyway. If you take away one thing from this post, I hope it's this warning: LLM-based tools can't be the magic bullet for writing accessible component code that they promise to be. Because nuance, understanding and conveying intent are inherent to accessibility, LLMs cannot be of great help with the accessibility of component code. In addition, they <a href="https://arxiv.org/abs/2401.11817">hallucinate inevitably</a> and tend to pose as authoritative while outputting (occassional, but real) falsehoods. The latter can be dangerous and is likely to come at the expense of users.</p> <p>My suggestion to developers who want help building accessible components? Use a design system that's well tested with people, that is well documented, and that (at least) attempts to capture the nuance. Or get involved in building one. Not everyone wants to do this nuanced and precise work, not every organisation has the budget. That's fine, but let's not <a href="https://bradfrost.com/blog/post/ai-and-design-systems/">suggest it can be automated away, magically</a>. Let's value the human effort that can make web products actually great.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/ai-for-accessible-components/">“AI” and accessible front-end components: is the nuance generatable?</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20“AI” and accessible front-end components: is the nuance generatable?">Reply via email</a></p> Breadcrumbs, buttons and buy-in: Patterns Day 3 2024-03-08T00:00:00Z https://hidde.blog/patterns-day-3/ <p>Yesterday I spent all day in a cinema full of design system nerds. Why? To attend <a href="https://patternsday.com/">Patterns Day 3</a>. Eight speakers shared their knowledge: some zoomed out to see the bigger picture, others zoomed in on the nitty-gritty.</p> <p>It was nice to be at another Patterns Day, after I <a href="https://hidde.blog/coherence-lego-and-how-naming-things-is-hard-patterns-day-2017/">attended the first</a> and missed the second. Thanks Clearleft and especially Jeremy Keith for putting it together. In this post, I'll share my takeaways from the talks, in four themes: the design system practice, accessibility, the technical nitty-gritty, and communication.</p> <p><img src="https://hidde.blog/_images/duke.jpg" alt="building that says Duke of Yorks est 1910, on the top in the middle is a clock, on the left two legs wearing high heels" /> <em>The day's venue: the Duke of York's cinema</em></p> <h2>The design system practice</h2> <p>Design system veteran <strong>Jina Anne</strong>, inventor of <a href="https://www.smashingmagazine.com/2019/11/smashing-podcast-episode-3/">design tokens</a>, opened the day with a reflection on over a decade of design systems (“how many times can I design a button in my career?”) and a look at the future. She proposed we find a balance between standardisation and what she called “intelligent personalisation”.</p> <p>On the other hand, we aren't really done yet. There are so many complex UX patterns that can be solved more elegantly, as <strong>Vitaly Friedman</strong> showed. His hobbies include browsing postal office, governmental and e-commerce websites. He looks at the UIs they invent (so that we don't have to). Vitaly showed us more breadcrumbs than was necessary, including some that, interestingly, have feature-parity with meganavs.</p> <p><strong>Yolijn van der Kolk</strong>, product manager (and my colleague) at NL Design System, presented a unique way of approaching the design system practice: the “relay model”. It assigns four statuses to components and guidelines, which change over time on their road to standardisation. It allows innovation and collaboration from teams with wildly different needs in wildly different organisations. The statuses go from sharing a need (“Help Wanted”), to materialising it with a common architecture and guidelines (“Community”), to proposing it for real-life feedback (“Candidate”), to ultimately standardising an uncontroversial and well-tested version of it (”Hall of Fame”).</p> <p><img src="https://hidde.blog/_images/jeremy.jpg" alt="Jeremy presenting in front of the patterns day logo on screen" /> <em>Jeremy Keith hosted the event</em></p> <h2>The technical nitty gritty</h2> <p>Two talks focused on design problems that can be solved with clever technical solutions: theming (through design tokens) and typography (through modular scales with modern CSS).</p> <p><strong>Débora Ornellas</strong>, who worked at Lego (haven't we all used the analogy?), shared a number of great recommendations around using design tokens: to use readily available open source products instead of inventing your own, publish tokens as packages and version them and avoid migration fatigue by reducing breaking changes.</p> <p><strong>Richard Rutter</strong> of Clearleft introduced us to typographic scales, which, he explained, are like musical scales. I liked how, after he talked about jazz for a bit, the venue played jazz in the break after his talk. He showed that contrast (eg in size) between elements is essential for good typography: it helps readers understand information hierarchy. How much depends on various factors, like screen size, but to avoid having to maintain many different scales, he proposed a typographic scale that avoids breakpoints, by using modern CSS features like <code>clamp()</code> (or a CSS locks based alternative if you don't want to risk failing <a href="http://www.w3.org/WAI/WCAG22/quickref/#resize-text">WCAG 1.4.4</a>). I suggest checking out <a href="https://utopia.fyi/">Utopia</a> to see both strategies in action.</p> <h2>Accessibility, magic and the design system</h2> <p>The power of design systems is that they can make it easier to repeat good things, such as well-engineered components. And they can repeat accessibility, but there is a lot of nuance, because that won't work magically.</p> <p><strong>Geri Reid</strong> (seriously, more conference organisers should invite Geri!) warned us about the notion that a design system will “fix” the accessibility of whichever system consumes it. Sounds like magic, and too good to be true? Yup, because what will inevitably happen, Geri explained, is that teams start using the “accessible” components to make inaccessible things. Yup, I have definitely seen this over and over.</p> <p>To mitigate this risk of “wrong usage”, she explained, we need design systems to not just deliver components, but set standards and do education, too. At which point the design system <em>can</em> actually help build more accessible sites. For instance, if components contain ARIA, it's essential that the consumers of those components know how to configure that ARIA. In other words, design systems need very good documentation. Which brings me to the last theme: common understanding and why it matters.</p> <h2>Mitigating misunderstandings with better communication</h2> <p>The theme that stood out to me on the day: <em>design system teams commonly have to deal with misunderstandings</em>. Good communication is important. What a cliché, you might say, that's like anyone in any job. Yes, but it's specifically true for our field: design systems force collaboration between such a broad range of people. That includes similar-discipline-collaboration, like between designer and developer. Débora explained what can happen if they don't work together closely, or if breaking changes aren't communicated timely.</p> <p>But it's also about wider collaboration: a design system team also needs to make sense to other departments, that have specific requirements and norms. Including those that don't really grasp all the technical details of front-end componentisation, like marketing or (non-web) brand teams, or the people who can help sponsor or promote the project. <strong>Samantha Fanning</strong> from UCL focused on this in her talk on “design system buy-in”, which she had a lot of useful tips about. She recommended to involve other departments early to do “co-design” rather than presenting (and surprising) them with a finished product. She also shared how it helped her to add design system work as extra scope onto existing projects, rather than setting up a design system specific project.</p> <p>In her talk, <strong>Mary Goldservant</strong> of the Financial Times, also touched on the importance of communication. She shared how they got feedback from stakeholders and manage expectations, while working on a large update to Origami, the Financial Times' brilliantly named design system, that includes lots of changes, like multi-brand and multi-platform support.</p> <h2>Wrapping up</h2> <p>It was nice to hang out with so many like-minded folks and learn from them. A lot of the challenges, tools and ideas resonated. Once again, I've realised our problems aren't unique and many of us are in similar struggles, just in slightly different ways.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/patterns-day-3/">Breadcrumbs, buttons and buy-in: Patterns Day 3</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Breadcrumbs, buttons and buy-in: Patterns Day 3">Reply via email</a></p> On popover accessibility: what the browser does and doesn’t do 2024-03-21T00:00:00Z https://hidde.blog/popover-accessibility/ <p>One of the premises of the new <a href="https://html.spec.whatwg.org/multipage/popover.html#the-popover-attribute">popover attribute</a> is that it comes with general accessibility considerations “built in”. What does “built in accessibility” actually mean for browsers that support popover?</p> <p><em><strong>NOTE</strong>: except for this note, this whole post was co-written with <a href="https://www.scottohara.me/">Scott O’Hara</a> (thanks Scott!). See also Scott's post, <a href="https://www.scottohara.me/blog/2024/03/22/popover-a11y.html">popover accessibility</a>. Whether you're a developer, designer or accessibility specialist, hearing “accessibility is built in” probably makes you want to know what exactly is built-in. For popover, this actually changed quite a bit over time, after discussions at Open UI and with WHATWG. At first, the plan was to</em> <a href="https://www.w3.org/2021/04/08-openui-minutes.html"><em>introduce a <code>popup</code> element</em></a> <em>with built-in roles. Later, an attribute ended up making more sense (more on that in the post). For that attribute, and thanks to the great effort of Scott and others, some “accessibility guardrails” have now emerged. And they shipped in most browsers. I hope this post helps you understand better what accessibility is “built-in” when you use popover, and what is not.</em></p> <div class="toc" style="padding-left: 1em; border-left: .75em solid var(--comments-border-color);"> <style>.toc a { color: var(--text-color); font-weight: bold; } .toc li { margin-left: 0; }</style> <h2 style="font-size: 1em; margin-top: 0; text-transform: uppercase; letter-spacing: 2px;display: inline-block;">In this post</h2> <ol style="list-style: none; margin-left: 1em;"> <li><a href="https://hidde.blog/popover-accessibility/#heading-2">Accessibility semantics</a></li> <li><a href="https://hidde.blog/popover-accessibility/#heading-3">What browsers do</a> (aria-expanded, aria-details, group, keyboard accessibility)</li> <li><a href="https://hidde.blog/popover-accessibility/#heading-4">What browsers don't do</a></li> <li><a href="https://hidde.blog/popover-accessibility/#heading-5">Conclusion</a></li> </ol> </div> <h2><strong>Accessibility semantics</strong></h2> <p>The “built-in” accessibility of popover is in the addition of <em>guardrails</em>: browsers try to improve accessibility where they can. These guardrails exist mostly in the form of browsers augmenting <em>accessibility semantics</em>. Before we get into what those guardrails are, let's clarify what that term means.</p> <p>Many features of HTML have some amount of <a href="https://www.w3.org/TR/wai-aria-1.2/#at_support">accessibility semantics</a> associated with them - e.g., roles, states and properties. This is information that a web page exposes, which browsers then pass on to platform accessibility APIs. They do this, so that assistive technologies can build UIs around them (see: <a href="https://hidde.blog/how-accessibility-trees-inform-assistive-tech/">How accessibility trees inform assistive tech</a>). These semantics are sometimes baked into native HTML elements. For instance, headings and lists have implicit roles (heading and list, respectively). Other elements, like the checkbox input type, have an implicit role as well as additional states and properties. Developers can use HTML elements with such “built-in” semantics. But they can also set, overwrite and augment accessibility semantics more directly in their HTML structure, using <a href="https://www.w3.org/TR/wai-aria-1.2/">WAI-ARIA</a>.</p> <p>The thing with the popover attribute is that it doesn’t have a built-in role. After all, it’s not an element. Its purpose is to only add “popover behaviour”, as discussed in <a href="https://hidde.blog/popover-semantics/">Popover semantics</a>. In that sense, <code>popover</code> is a bit like <a href="https://html.spec.whatwg.org/dev/interaction.html#the-tabindex-attribute">tabindex</a> or <a href="https://html.spec.whatwg.org/dev/interaction.html#contenteditable">contenteditable</a>. These attributes also add behaviour: tabability and editability behaviours, respectively.</p> <p>A major reason for this choice is that there are a number of components that exhibit popover behaviours. Examples include menus, “toast” messages, sub-navigation lists of links and tooltips. You can use popover on a specific element, then it will get that element's role. Or you can use it with a generic element, and add a <code>role</code> that best matches what you are building.</p> <p>So, while the default role is ‘generally’ not handled by the attribute (more on that later), there are other semantics (properties and states) that the attribute will expose. Browsers can take care of those with some degree of confidence.</p> <h2>What browsers do</h2> <p>There are two semantics that the browser should take care of when you use <code>popover</code>, and its associated <code>popovertarget</code> attribute. Additionally, there is some keyboard focus behaviour that may also be handled automatically, depending on the type of popover you are using.</p> <h3>The <code>aria-expanded</code> state</h3> <p>First, <code>aria-expanded</code>. This state is exposed on the element that invokes the popover, currently limited to buttons (for a variety of reasons that would require a whole other article to talk about - so this is all you get right now). When a popover is invoked by / associated with a button with the popovertarget attribute, the browser will automatically convey whether the popover is in the expanded (rendered) state, or if it is in the collapsed (hidden) state. This is implemented in Edge, Chrome, Firefox and Safari.</p> <p>For the following example, the ‘heyo’ button will automatically convey whether its associated popover list is in the expanded or collapsed state, based on whether the popover list is invoked as a popover.</p> <pre class="language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">popovertarget</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>p</span><span class="token punctuation">></span></span> Heyo <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span> … <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>ul</span> <span class="token attr-name">aria-label</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Heyo subpages<span class="token punctuation">"</span></span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>p</span> <span class="token attr-name">popover</span> <span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>ul</span><span class="token punctuation">></span></span></code></pre> <p><em>Note: the state won’t be applied if script, rather than the declarative attribute, does the opening on click of any button (or any other element). Needless to say: it also doesn’t work if there isn’t an invoking button, for instance, and script invokes this popover (because in that case, there isn’t any expanding going on). Additionally, if you force open your popover using CSS display block, then it will not be rendered as a popover - and thus the button will still communicate that the “popover” is in the collapsed state. Also, if you’re doing that - forcing your popover open with CSS - maybe you have some things you need to reconsider with your UI.</em></p> <h3>The <code>aria-details</code> relationship</h3> <p>When the popover doesn’t immediately follow its invoking button in the accessibility tree, browsers are supposed to create an <a href="https://w3c.github.io/aria/#aria-details"><code>aria-details</code></a> relationship on the popover’s invoking button with its associated popover. At the time of writing, this is implemented in Chrome, Edge and Firefox.</p> <p>For instance, in the following markup snippet an implicit <code>aria-details</code> relationship will be made with the button that invokes the popover, because the button and the popover are not immediate siblings in the accessibility tree.</p> <pre class="language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">popovertarget</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>foo</span><span class="token punctuation">></span></span>something<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">></span></span>...<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">role</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>whatever</span> <span class="token attr-name">popover</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>foo</span><span class="token punctuation">></span></span>...<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span> </code></pre> <p>Similarly, an <code>aria-details</code> relationship will be made with the next markup snippet too, because even though the popover and its invoking button are siblings, the popover is a <em>previous</em> sibling to the invoking element, and it might not be understood <em>which</em> element is the popover, because it doesn’t immediately follow the element that invoked it.</p> <pre class="language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">role</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>whatever</span> <span class="token attr-name">popover</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>foo</span><span class="token punctuation">></span></span>...<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">popovertarget</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>foo</span><span class="token punctuation">></span></span>something<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span></code></pre> <p>In contrast, the next two examples have no aria-details association because that would be unnecessary. For the first, the popover is the immediate next sibling in the accessibility tree (note divs are generic and often ignored when they do not provide information important to accessibility). For the second, the button is a descendant of the popover, so browsers do not need to tell users that the button they are interacting with is about the context they are within. That’d be silly.</p> <pre class="language-html"><code class="language-html"><span class="token comment">&lt;!-- example 1: popover immediate sibling in acc tree --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">popovertarget</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>m</span><span class="token punctuation">></span></span>something<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>presentational-styles-only</span><span class="token punctuation">></span></span> … <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">role</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>menu</span> <span class="token attr-name">popover</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>m</span><span class="token punctuation">></span></span>...<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span> <span class="token comment">&lt;!-- example 2: button descendant of popoover --></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dialog</span> <span class="token attr-name">popover</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>d</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">popovertarget</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>d</span><span class="token punctuation">></span></span>close<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span> … <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dialog</span><span class="token punctuation">></span></span> </code></pre> <p>For more information on how <code>aria-details</code> works, check out the <a href="https://w3c.github.io/aria/#aria-details">details in the ARIA spec</a>.</p> <p>Note: <code>aria-details</code> is often confused with <code>aria-describedby</code>. That makes sense, “details” and “descriptions” are very similar. However, these two properties expose different information. <code>aria-describedby</code> takes the associated element’s content, flattens it into a single text string, and exposes that as the ‘description’ or ‘hint’ of the element which the attribute is specified. In contrast, <code>aria-details</code> only <em>informs</em> a user that there is additional information about the current element. That might not seem useful, until you know that screen readers largely provide quick-keys to navigate to and from that associated element which provides the details.</p> <p>At the time of writing, navigating into the referenced content using quick-keys is supported by JAWS and NVDA (<a href="https://github.com/nvaccess/addonFiles/pull/392">release notes</a>), but not VoiceOver.</p> <p>Here’s a quick demo of that with JAWS 2023 in Edge 124. JAWS lets us jump to the details content if we press <code>Alt + Ins + D</code>:</p> <iframe width="100%" height="315" style="max-width: 100%; aspect-ratio: 16 / 9" src="https://www.youtube-nocookie.com/embed/CTD0deXgfK8?si=MrjoOe7w6PDk2fIS&amp;&disablekb=1" title="JAWS demo of aria-details on YouTube" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen=""></iframe> <p>In NVDA (2023.3.4), tested with Edge 124, it works slightly differently: when you press the shortcut (<code>NVDA + D</code>), we don't jump to the details content, but it is read out after the shortcut is pressed:</p> <iframe width="100%" height="315" style="max-width: 100%; aspect-ratio: 16 / 9" src="https://www.youtube-nocookie.com/embed/lE1D1Jnmv6E?si=yDRylZaGCfgooX1E&&disablekb=1" title="NVDA demo of aria-details on YouTube" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen=""></iframe> <p>(see <a href="https://codepen.io/hidde/pen/abxZVLX/">demo on CodePen</a>; note: announcements and shortcuts depend on the user's settings, versions, etc)</p> <p>In the following demo, you can see how the <code>aria-details</code> relationship works between popovers and their invokers (in JAWS 2023 with Edge 124):</p> <iframe width="100%" height="315" style="max-width: 100%; aspect-ratio: 16 / 9" src="https://www.youtube-nocookie.com/embed/8sbF3_KNzUc?si=l5g3vbxdwdKO76IE&disablekb=1" title="An example of the aria-details relationship in JAWS in Edge on YouTube" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen=""></iframe> <p>(video contains screenshot of code, see <a href="https://codepen.io/scottohara/pen/vYQqjbZ?editors=1000">demo on CodePen</a>)</p> <p>In summary: the <code>aria-details</code> association is not announced by JAWS when we focus the invoking button for the first time. This is because the corresponding popover is hidden, so the association isn't made yet. After we open the popover, JAWS announces the button's “has details” association while it is open, to hear it we navigate away and back. This is also how it works in NVDA, which, in addition, also requires you to switch to forms mode to actually hear the relationship announced.</p> <p>Warning: even if the <code>aria-details</code> association is implemented, it may not be completely ironed out in how the UX behaves for people. For instance, there isn't currently a way for users to find out about the details relationship once it is established, like when the popover opened. It requires for the user to move away from the button and return to it, at which point the relationship is announced. Maybe it would be helpful if the browser would fire some kind of event, to let AT like JAWS know that an element representing details has appeared.</p> <p>We mention this not to deter you from using popover or to indicate that anyone is doing something “wrong” here. Rather, this is a relatively new feature that people still need to figure out some of the UX kinks around. Feedback is welcome, and to help ensure the best UX is provided, please reach out to the necessary browsers / AT with your thoughts.</p> <h3>The <code>group</code> role</h3> <p>As mentioned above, popover can be used on any element, including elements that don’t have a built-in role, like <code>div</code>. But even without a role, it’s likely that the contents of a popover form some kind of meaningful whole. This is why in Chrome, Edge and Firefox, a role of <code>group</code> is automatically added to popovers if they would otherwise have no role, or a role of <code>generic</code> (for instance, divs and spans).</p> <p>The <code>group</code> role is added, so that assistive technology can have the option to expose the boundaries of the popover that is being displayed. This can be important to users, because a popover is a behavior and visual treatment of its content. How is one to know where such content begins or ends if it doesn’t have boundaries to expose?</p> <p>It’s important to know that an unnamed group is often ignored by screen readers. This is because otherwise the Internet would be riddled with unhelpful “group” announcements. (See also why Webkit made the decision to remove list semantics from lists that have been styled to <em>not look like lists</em>. These topics are related). Here though, it again comes down to what assistive technology wants to do. By exposing the group role for the popover, now the element can be named by authors, which will force the group role to be exposed in most cases. Then, if AT decided they want to do something special for popover groups, they now have the opportunity to do so.</p> <h3>Keyboard accessibility</h3> <p>One more aspect of “built-in accessibility” that browsers do for your popover, is take care of some keyboard behaviors.</p> <h4>Moving focus back to invoking element</h4> <p>Edge/Chrome, Firefox and Safari will all return focus to the invoking element when you close the popover (only if you are inside of it). This is useful, because if focus was on an element inside the popover, the default would be to return focus to the start of the document. Various groups of users would get lost, increasingly so on pages with a lot of content. Moving focus back to the invoking element helps ensure people can quickly return to what they were doing, rather than spending time having to re-navigate to where they think they were last.</p> <h4>Popover content in tab order</h4> <p>Desktop browsers also do something else: they add the popover content into the tab order just after the invoking button. Even if that’s not where the popover is in the DOM.</p> <p>Imagine this DOM structure:</p> <pre class="language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">popovertarget</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>p</span><span class="token punctuation">></span></span>Open popover<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">></span></span>content… content… <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>#<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>link 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">></span></span>content… content… <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>#<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>link 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">></span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">popover</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>#<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>link 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span></code></pre> <p>When the popover opens, and you press <code>Tab</code>, you might think you’d jump to “link 1”, the next interactive element in the DOM. Except, in desktop browsers, you will jump to “link 3” instead. The browser basically moves the popover content’s position in tab order to just after its invoking button. This takes it out of its expected position in the tab order. That improves the user experience, because it is likely that upon opening the popover, users will want to interact with its contents.</p> <p>Keep in mind: browsers adjust the Tab order for instances like this, but they don't adjust the placement of the content in the accessibility tree. This is why the <code>aria-details</code> association was implemented. This special Tab order behavior helps ensure logical focus order for keyboard accessibility. However, we should still strive to make sure our popovers come <em>after</em> the invoking element in the DOM.</p> <p>But since there will be times where the exact location of the popover in the DOM may be out of one’s control, this behavior is still quite welcome. For instance, if the popover happens to be far away in the DOM, having to go through the rest of the document before reaching the popover would be a nuisance. It would be highly unexpected and unwanted to have to navigate through all other focusable elements in the DOM, prior to the popover one just opened. WCAG <a href="https://www.w3.org/TR/WCAG22/#focus-order">2.4.3 Focus Order</a> requires focusable elements to receive focus in an order that “preserves meaning and operability”. This special browser Tab restructuring helps ensure that requirement can be met.</p> <h2>What browsers don’t do</h2> <p>We can keep this one short: the browser will not do <em>anything</em> apart from the behaviours listed above. Browsers will not add behaviors based on which elements you use or which role you add to them. The <code>popover</code> attribute is merely a first step for us to build new components.</p> <h2>Conclusion</h2> <p>The <code>popover</code> attribute provides a starting point for building popover-like interactions on the web. Browsers don't magically make your components accessible, that's not a thing. But there are some specific keyboard behaviours included with popover, as well as these semantics:</p> <ul> <li>In specific cases, browsers set the <code>aria-expanded</code> state and/or set the <code>aria-details</code> relationship on the invoker.</li> <li>Browsers apply the <code>group</code> role to the <code>popover</code> content if it doesn’t have a role of its own, so that assistive technologies can expose their boundaries.</li> </ul> <p><em>Browser support note: at the time of writing, Safari only sets <code>aria-expanded</code>, not <code>aria-details</code>. It also doesn't add a <code>group</code> role fallback.</em></p> <hr/> <p>Originally posted as <a href="https://hidde.blog/popover-accessibility/">On popover accessibility: what the browser does and doesn’t do</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20On popover accessibility: what the browser does and doesn’t do">Reply via email</a></p> On authoring tools in EN 301 549 2024-04-10T00:00:00Z https://hidde.blog/authoring-tools-in-en-301-549/ <p>Today I was at the <a href="https://www.accessibilityassociation.org/s/iaap-eu-event-2024">IAAP-EU event</a> in Paris, where we spent a morning workshopping and clarifying parts of <a href="https://en.wikipedia.org/wiki/EN_301_549">EN 301 549</a>, the procurement standard that is used in the <a href="https://en.wikipedia.org/wiki/Web_Accessibility_Directive">Web Accessibility Directive</a>.</p> <p>I managed to get a spot in the group that focused on 11.8, the part of EN 301 549 that focuses on authoring tools. In this post, I'll share some insights from that session.</p> <p><em>This post was written, as always, in personal capacity. And sorry, I don't have an HTML link for EN 301 549 (there isn't one currently, but there is a <a href="https://www.etsi.org/deliver/etsi_en/301500_301599/301549/03.02.01_60/en_301549v030201p.pdf">PDF</a>).</em></p> <h2>What actually are authoring tools?</h2> <p>When my job was to promote the use of <a href="https://www.w3.org/WAI/standards-guidelines/atag/">ATAG</a>, I used to say authoring tools are “tools that create web content”. In EN 301 549, they are defined more broadly, beyond web:</p> <blockquote> <p>software that can be used to create or modify content</p> </blockquote> <p>(from EN 301 549, chapter 3: Definition of terms, symbols and abbreviations)</p> <p>In other words, this definition includes web content as well as non-web content. The EN defines “non-web content” as “not a web page, not embedded in any web pages or used in the rendering or functioning of the page”. Examples of such content includes PDFs, Word documents and EPUB files. There's also a W3C document specifically about accessibility of “non-web content”, <a href="https://www.w3.org/WAI/standards-guidelines/wcag/non-web-ict/">WCAG2ICT</a> (which is informative, not <a href="https://hidde.blog/whats-normative-in-wcag/">normative</a>) .</p> <p>EN 301 549's authoring tool definition is followed by three notes, that all demonstrate the extent to which these tools exist:</p> <ul> <li>authoring tools can have multiple users collaborating on content (this makes me think of tools like <a href="https://www.sanity.io/studio">Sanity Studio</a> or Google Docs where lots of people can edit content at the same time)</li> <li>authoring tools could be a collection of multiple applications. For instance, some content goes through multiple applications before end-users access it</li> <li>authoring tools could produce content that's used or modified later</li> </ul> <p>In our group we quickly realised that there are indeed a lot of different authoring tools. The most obvious one is Content Management Systems (CMSes). Others that people mentioned are social media, online forums, video editing tools, WYSIWYG editors, and email clients. <a href="https://www.w3.org/WAI/standards-guidelines/atag/#authoring-tools-and-atag">ATAG at a glance</a> also mentions Learning Management Systems, blogs and wikis. It's a broad category, there are a lot of tools that can make (web) content.</p> <h2>The ATAG reference</h2> <p>ATAG, the Authoring Tool Accessibility Guidelines, is the standard that provides recommendations for both making authoring tools themselves accessible (part A), as well as the content they produce (part B). See my earlier post <a href="https://hidde.blog/content-creation-accessibility/">ATAG: the standard for content creation</a> for an overview.</p> <p>Conforming with EN 301 549 requires that all of our web pages meet all of WCAG (up to Level AA, see EN 301 549, clause 9.6). But it doesn't require ATAG. ATAG is merely mentioned as something that is worth reading for “those […] who want to go beyond [EN 301 549]” (in 11.8.0). In other words, there is no normative requirement to read it, let alone to apply it.</p> <p>Still, some CMSes do. For instance, <a href="https://www.drupal.org/about/features/accessibility">Drupal supports ATAG</a> (part A and B) from version 8. Joomla, Wagtail and Craft CMS also have done a lot of work towards improving accessibility, see the W3C's <a href="https://www.w3.org/WAI/tools-list/authoring/">List of authoring tools that support accessibility</a>.</p> <p>However, that doesn't mean ATAG isn't an incredibly useful standard for people who make and use authoring tools. In fact, it is. In 11.8.2 to 11.8.5, some ATAG requirements are explicitly added. These clauses are requirements, because they use “shall”, which in ETSI standards implies a “mandatory requirement” (say their <a href="https://portal.etsi.org/Services/editHelp/How-to-start/ETSI-Drafting-Rules">drafting rules</a>).</p> <p>Note: that EN 301 549 requires these things, doesn't mean the law in European countries does. These laws often refer to specific parts of the EN, or refer to EN 301 549 specifically in relation to web content.</p> <p>Note 2: <a href="https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX%3A32016L2102#rct_48">clause 48</a> of the Web Accessibility Directive is interesting. It includes various points I'd love to see member states adopt:</p> <ul> <li>“EU member states should promote the use of authoring tools that allow better implementation of the accessibility requirements set out in this Directive”</li> <li>recommendation to “[publish] a list of compatible authoring tools” (as suggestions, so not requiring them specifically)</li> <li>recommendation to “fund their development”</li> </ul> <h2>11.8.2: “enable” and “guide”</h2> <p>Out of the authoring tool requirements, we talked most about 11.8.2. It says:</p> <blockquote> <p>Authoring tools shall enable and guide the production of content that conforms to clauses 9 (Web content) or 10 (Non-Web content) as applicable.</p> </blockquote> <p>The key words to me are <em>enable</em> and <em>guide</em>. My personal interpretation of what that means, and maybe partially what I want it to mean:</p> <ul> <li><strong>enable</strong>: that tools have, for all types of content they can produce, functionality to create any necessary accessibility aspects for that type of content. For instance, if they let you add an image, they need to let you add a text alternative. There's a lot of grey area, because some very complex images might require linked descriptions that don't fit as alternative text. And what about types of content that the tool creator users aren't supposed to create? LinkedIn might say it only lets users create plain text with links, not headings. Is the fact that users will try and add faux bold text and whitespace instead of headings LinkedIn's fault or the user's?</li> <li><strong>guide</strong>: that tools tell authors about accessibility issues and help them get it right. I would love for more authoring tools to do this (see also my pledge in <a href="https://talks.hiddedevries.nl/tGzZs2/your-cms-is-an-accessibility-assistant">Your CMS is an accessibility assistant</a>). Let authoring tools guide authors to more accessible content, this should have a large multiplier with fewer barriers across the web as a result.</li> </ul> <p>What I like about the “guide” part especially: it addresses problems where they surface first. It lets authors fix accessibility problems before they ship to production, if the authoring tool guides them.</p> <h2>Other requirements</h2> <p>We didn't get to the other clauses, but they are interesting too:</p> <ul> <li><strong>preservation of accessibility information in transformation</strong>: a real example I dealt with: if you turn HTML into PDFs with PrinceXML, it's tricky to get it to take the text alternatives from your images and embed them correctly into the PDF.</li> <li><strong>repair assistance</strong>: there are CMSes already that tell authors when they're about to choose a new colour that would cause contrast issues (like WordPress' editor). Again, this lets authors fix problems before they exist in the produced content. Drupal has a <a href="https://www.drupal.org/docs/getting-started/accessibility/contributed-modules-for-extending-accessibility-in-drupal">list of modules that may improve accessibility</a>.</li> <li><strong>templates</strong>: when templates are available, accessible ones should be available. Again, a focus on making accessible templates could have a huge multiplier effect, as they could be reused in many different places. WordPress has a <a href="https://wordpress.com/themes/filter/accessibility-ready">list of accessibility themes</a></li> </ul> <h2>Summing up</h2> <p>It was fun to dive into one of the requirements specifically, and my hope is for two things. First, I'd find it useful for there to be more extended guidance on these clauses. They are fairly minimal and more concrete examples would help. Second, the testability could improve. What makes a template an accessible template (one that meets WCAG?), what sort of assistance is sufficient, and what sort of “guiding the author” is? And then my last open question would be: when does an authoring tool fall into or outside of the scope of the organisation trying to comply with EN 301 549? Is this when they use an authoring tool or only when they create one? To be continued!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/authoring-tools-in-en-301-549/">On authoring tools in EN 301 549</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20On authoring tools in EN 301 549">Reply via email</a></p> Comparing design systems to find the best qualities 2024-08-10T00:00:00Z https://hidde.blog/re-global-design-system/ <p>It's not easy to build very good UI components. A global effort to try and find the best qualities of components would be a great opportunity to improve components everywhere.</p> <p>Aren't design systems ultimately a quest to collect the best UI practices across an organisation? Or across multiple organisations, or for anyone in general. This kind of work brings excellent opportunities to improve quality across <em>some</em> scope, organisationally or more widely. And if we do that, why not try and aim for the widest possible scope and go global? In <a href="https://bradfrost.com/blog/post/a-global-design-system/">A Global Design System</a>, Brad Frost suggests this:</p> <blockquote> <p>let’s redirect that rallying cry outside of any individual organizations’ walls and apply it to the world at large.</p> </blockquote> <p>I can only agree with that. With so many design systems out there, it makes a lot of sense to look at the commonalities between them.</p> <p>As Brad mentions, we've been doing this at <a href="https://open-ui.org/">Open UI</a>. The <a href="https://open-ui.org/charter/">goal</a> of this group is to make it easier for developers to build and style UI controls on the web, by improving the web technologies and standards that they are built with. So far, this lead to features like popover (<a href="https://developer.mozilla.org/en-US/docs/Web/API/Popover_API">in Baseline</a> today) and styleable selects (in active development).</p> <h2>How a global design system might work</h2> <p>Brad suggested in his post that we could work towards “common library containing common UI components”, with code and designs and documentation. In his follow up, Greg Whitworth <a href="https://www.gwhitworth.com/">suggests to create a test suite</a>. I like how concrete these ideas are, and I am sure they will help tonnes of developers make better components. But what if we look at this idea more a more abstract way?</p> <p>There are clearly teams who just want to use concrete components, as-is. But in my work and conversations, I hear demand for something else: to have a way to validate <em>what is good</em>. A lot of teams want to build their own components and systems. Or they <em>have</em> to, because of their organisation's specific constraints.</p> <h3>Finding qualities</h3> <p>To me, it seems a lot of developers want acceptance criteria and <a href="https://hidde.blog/ideal-a11y-guidance/">holistic guidance</a>, rather than built components. There's a lot of example components already, why not try and collect what's already built and seek consensus about what qualities components need?</p> <p>I'm thinking things like:</p> <ul> <li>this is how an autocomplete-y combobox should convey new results were filtered</li> <li>this is the most user friendly keyboard behavior for switching between tabs</li> <li>this type of buttons needs an active verb as the name</li> </ul> <p>This is information that is relatively hard to find, especially for more rare components, and especially in a format that developers can trust to base their decision making on.</p> <p>In my ideal world, a global design system isn't primarily concerned with <em>making</em> a set of <em>components</em>. Instead, it would focus on <em>finding</em> the best <em>qualities</em> of components. What are the qualities they must have, in order to be solid, accessible, internationalisable, privacy-friendly, secure component?</p> <h3>Benefits</h3> <p>With this approach, these qualities can become checks for everyone who wants to make these components themselves. And at the same time, they can be checks for everyone who wants to quality-assure or accessibility-assess websites that use these patterns. (Plus, folks could still build an example library of components that adhere to the qualities; but I think there are always going to be multiple ways).</p> <p>Defining qualities rather than concrete components also helps with another problem we've seen at Open UI a lot: that there are many ways that lead to Rome. For example, there are <a href="https://open-ui.org/components/tabs.research.parts/">many ways to build a tab</a>. With qualities, we would avoid the search for the true one way to do something. Instead, we could deem multiple implementations of tabs “ok”. The <em>Org X</em> tab is cool, the <em>Org Y</em> is wildly different, but it is also cool, the Org Z tab is… hm, not great, because it lacks a, b and c.</p> <p>Lastly, it would help with the myth of the accessible component. There is only so much we can build in, there will always be acccessibility considerations that depend on usage (see my talk on <a href="https://talks.hiddedevries.nl/5nWzFR/built-in-accessibility-blessing-or-curse">built-in accessibility</a>). Both how you use of the component and the context you use it in determine whether the experience is accessible or not. There's no “use this component and your thing will be accessible“. Paraphrasing <a href="https://www.scottohara.me/">Scott O'Hara</a>: a component is accessible until you use it somewhere.</p> <h2>What global comparisons unlock</h2> <p>Aren't we lucky that we're now in a phase of design systems that there are a lot to compare between? Comparing different design systems can unlock a number of things, but these are some things I find particularly interesting:</p> <ul> <li>finding components based on real use cases: if we look at components that already exist, we know someone had a use for them</li> <li>finding the best names: naming things is hard, and bringing many design systems together bubbles up which names resonate best with people (see the <a href="https://open-ui.org/research/component-matrix/">component matrix</a> and <a href="https://component.gallery/">component.gallery</a>)</li> <li>getting closer to ‘accessible patterns’: there are lots of things that can make a given pattern more or less accessible; if we bring together patterns from many places, we can document more use cases, more ways people (end users) might use this pattern (accessibility is largely about how <a href="https://www.w3.org/WAI/people-use-web/">people use the web</a>), and more aspects their accessibility specialists have talked about</li> </ul> <p>Each of these is, in its own way, a benefit of including diverse perspectives. Which is what the W3C has been doing for almost (this year!) 30 years.</p> <h2>A national global design system</h2> <p>Brian Kardell shared <a href="https://bkardell.com/blog/927.html">his idea for moving components through stages</a>. In it, he says:</p> <blockquote> <p>[a component] would undergo wide review and get some kind of 'verification stamps' for each kind (a11y, i18n, etc).</p> </blockquote> <p>He suggests folks submit components, that then get reviewed, which will lead to a catalog of components that have been checked and for which everyone can publicly see how many of the checks they meet.</p> <p>I liked a lot about this proposal and feel it will be fruitful to primarily focus on checks. I also noticed some similarities to what we're doing at <a href="https://nldesignsystem.nl/">NL Design System</a>, a project I'm involved in for the Dutch government, so I wanted to end this post with describing a bit about our process.</p> <p>At NL Design System, different governmental organisations collaborate on defining the best components, patterns and guidelines. The core team, that I'm a part of, facilitates this collaboration. It may end up being a kind of national global design system, a standard for building good digital government services.</p> <h3>Relay Model</h3> <p>So how do we work? Each organisation in our community has their own design system. In principle, they use a shared architecture, build components that meet their own needs and open source them under the <a href="https://eupl.eu/">same license</a>. Components that seem suitable for standardisation are put on a track that we call “Relay Model” (see also this <a href="https://www.youtube.com/watch?v=kjmAMBtsfTw">excellent presentation on the Relay Model</a> (Dutch, English subtitles available) by my colleague Yolijn van der Kolk).</p> <p>In relay racing competitions, runners take a <a href="https://en.wikipedia.org/wiki/Relay_race">baton</a> and hand it over to the next person. With our Relay Model for components, different people can take a component to different stages.</p> <p><em>(Note: there are patterns and guidelines too, but here I'll focus on components specifically.)</em></p> <p>In this process, components (their <a href="https://en.wikipedia.org/wiki/Theory_of_forms">“blueprint”</a>, eg “Button”) can have one of four statuses:</p> <ul> <li>“Help Wanted“: there is agreement on the rationale for the component, organisation(s) that need this can build it.</li> <li>“Community”: the component exists in one or more organisations, meets a set of acceptance criteria and uses the shared architecture. Each organisation can build it with the bells and whistles they need.</li> <li>“Candidate”: the component meets more acceptance criteria, including strict accessibility and usability tests, and is deemed ready to become the standard, we solicit real-life feedback in a request for comments period. It is stripped of elements that are too organisation-specific.</li> <li>“Hall of Fame”: the component is stable, not controversial, and has “guarantees” around reusability, accessibility, usability and stability. This is where a “button” becomes “nl-button”.</li> </ul> <p>There's also two more informal statuses: components that are likely to have just the one use case for one organisation, one-offs, are deemed “Snowflake”, and components that are unlikely to result in accessible, user-friendly components are deemed “Discouraged”.</p> <p>During any time, components can exist in multiple organisations, so <em>City X</em>, <em>Government Agency Y</em> and <em>Province Z</em> could all have a Button that meet their needs. The “Hall of Fame” Button is the common denominator version of it, where we've tried to remove all the org-specific stuff and stick with features that multiple organisations need. User research is an essential part of all this and we encourage organisations to <a href="https://gebruikersonderzoeken.nl/">share theirs as open source Markdown</a>.</p> <p>Benefits we see include:</p> <ul> <li>legitimacy: based on the needs of specific organisations and their use cases</li> <li>credibility: the components aren't the result of one person or team's opinions; a combination of wide feedback, user research and collaboration are essential in the journey; “blessing a component” is a largely shared responsibility</li> <li>open approval process: the criteria and process for moving to the next stage are open (see <a href="https://github.com/orgs/nl-design-system/projects/27">the GitHub project board for Help Wanted</a>), anyone can steward a component to the next stage, then pass on they if they wanted to</li> <li>living standard: teams should always be able to innovate. If they need an extra component or variation, they can always make it available as “Community” even when a similar component already exists in the current “Hall of Fame” standard</li> </ul> <p>We're currently stewarding components through the first stages, and don't have a “Hall of Fame” yet. But the process already demonstrates value today, for everyone involved: teams are using one another's components and are benefiting from each other's perspectives, accessibility knowledge and user research.</p> <h2>Summing up</h2> <p>In conclusion: I think there's a lot of value in trying to find which qualities make for very good components, using a standardisation-like process that involves a broad range of stakeholders and avoids blessing-by-a-few. In my ideal world, this can bring us to a place where web developers can get more confidence in how to make their components very good. Recent conversations within Open UI make me hopeful we'll get closer to that.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/re-global-design-system/">Comparing design systems to find the best qualities</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Comparing design systems to find the best qualities">Reply via email</a></p> The open web, MIDI and assistive tech: State of the Browser 2024 2024-09-15T00:00:00Z https://hidde.blog/sotb-2024/ <p>Yesterday, I was at <a href="https://2024.stateofthebrowser.com/">State of the Browser</a> in London. It was great to catch up with friends and make new ones, and the talks were once again very well curated. In this post, I'll share some notes from the day and the takeaways that stood out to me the most.</p> <p><img src="https://hidde.blog/_images/barbican.jpg" alt="iconic london metro sign for barbican station with a tube on the left" /> <em>The Barbican tube station</em></p> <h2>Think about funding the web ecosystem</h2> <p><strong>Stephanie Stimac</strong> kicked us off with a brilliant talk on how to fund the critical infrastructure that is the web ecosystem. We couldn't browse the web without browsers, and they wouldn't exist without engines, that are hard to make, and to fund. In the current model, browsers get large amounts of money from search deals. For instance, in 2021, Google paid almost 20 billion (not a typo) to Apple to make its search engine the default (but a US federal judge <a href="https://www.theregister.com/2024/08/05/google_default_search_deals_violate/">ruled</a> that such payments unlawfully limit competition). It's a lot of money, but as that money goes primarily to the browser companies, not the engines, and may go away if search deals are deemed illegal, we need to think about new ways to fund browser engines, Stephanie urged us. They could include donation based systems, tax breaks or a Web Levy. For more context, see <a href="https://webengineshackfest.org/2024/slides/sustainable_futures_funding_the_web_ecosystem_by_stephanie_stimac.pdf">Stephanie's slides</a> and in the comments of <a href="https://github.com/w3c/breakouts-day-2024/issues/20">w3c/breakouts-day-2024#20</a>.</p> <h2>Participate in accessibility standards</h2> <p>Next up was <a href="https://www.etsy.com/shop/HTMLZ">fashion designer</a> and web accessibility advocate <strong>Steve Faulkner</strong>. He shared some of his own web standards stories and gave practical tips around how to participate. Without naming (many) names, Steve very accurately explained some of the different types you'll find in standards meetings: there are well-meaning, argumentative, axe to grind, practical, clueless, old school, helpful, true-believing, revisionist and lurking type of people. There are a number of ways people do participate: you can file issues (like in <a href="https://github.com/w3c/wcag/issues/">w3c/wcag</a>), comment on issues, file PRs, comment on PRs, join a Community Group or join a Working Group. Only for that very last one, you actually need to represent a W3C Member. What you do need to do, Steve warned, is to know when you don't know. It's fine to just listen before having strong opinions. Now, starting to participate can be hard and/or daunting, so to anyone reading this: feel free to slide in my DM/email, we can (always) use more perspectives.</p> <p><img src="https://hidde.blog/_images/steve.jpg" alt="steve with a slide that shows the different types of people mentioned above" /> <em>Different types</em></p> <h2>Advocate for the open web</h2> <p><strong>Stuart Langridge</strong> shared the story of how he and others at <a href="https://open-web-advocacy.org/">Open Web Advocacy</a> ended up talking to regulators about anti-competitive behaviour in our industry, including the fact that iOS doesn't allow for other browsers than Safari. Their work has had an enormous impact, as it helped regulators understand the nitty gritty details of what they were regulators. “The web is ours”, Stuart said and anyone who believes the same can join and help out at <a href="https://open-web-advocacy.org/">Open Web Advocacy</a>, or do their own advocacy for an open web. Amen to that!</p> <h2>Make impact</h2> <p><strong>Gayle Ngozi</strong> shared how the non-profit <a href="https://codeyourfuture.io/">Code your Future</a> works with refugees and disadvantaged people to get skills in software engineering to close the gap between them and the job market, specifically in the tech industry. She said we can all make impact by contributing stuff like laptops, time by teaching and/or opportunities by working together to launch new tech careers.</p> <h2>Make little web components</h2> <p>Personal website innovator <strong>David Darnes</strong> finally explained the inner workings of that cool button on <a href="https://darn.es/">his site</a> that announces his name spoken by different people every time you press it. He didn't cover why it has a bias towards his father's recording, but it was very interesting nonetheless. There's one component that upgrades the standard <code>&lt;audio&gt;</code> element to be a fancy button, another that randomises the source used and one more that makes the playing state available as an attribute so that it can be used in styles. Are Web Components just for little bits? No, Dave showed that it's also used in fairly complex applications he worked on, including at Nordhealth, that has both Nuxt and Django apps using the same components. The technology, Dave said, works so well because is versatile and forgiving.</p> <h2>Make standards open</h2> <p><strong>Katie Fenn</strong> is a huge Daft Punk fan, so she used her talk slot to play their “<a href="https://www.youtube.com/watch?v=K0HSD_i2DvA">Around the world</a>” with web technologies: the <a href="https://www.w3.org/TR/webmidi/">WebMIDI</a> and <a href="https://www.w3.org/TR/webaudio/">WebAudio</a> APIs specifically. <a href="https://en.wikipedia.org/wiki/MIDI">MIDI</a> is a technology and technical standard specced in the 80s that allows you to pass messages and information between musical instruments, like notes and special effects. Because it was, just like the W3C's web standards, completely open and <a href="https://en.wikipedia.org/wiki/Royalty-free">royalty-free</a>, it's changed music production forever, especially electronic music: yay open standards. You should watch this talk when it comes out. I can't wait to go play with the MIDI-enabled devices in my home.</p> <p><img src="https://hidde.blog/_images/katie.jpg" alt="Katie behind a desk full of music tech, on the screen a video that shows cables on a synthesiser" /> <em>Synthesisers!</em></p> <h2>Automate more of assistive technology support testing</h2> <p><strong>Lola Odelola</strong> showed how web standards work happens by using the <a href="https://aria-at.w3.org/">ARIA-AT</a> program (and ghost detection 👻) as an example. Many developers will be familiar with the <a href="https://www.w3.org/WAI/ARIA/apg/">ARIA Authoring Practices Guide</a>. I am very happy for this to exist, but also <a href="https://hidde.blog/ideal-a11y-guidance/">see gaps</a> in user testing (do real users actually; understand how to use the patterns?) and AT testing (do the patterns work in AT and is that consistent?). ARIA-AT, Lola showed, addresses the latter, and does so really well: there is a Selenium-like protocol called <a href="https://github.com/w3c/at-driver">AT Driver</a> to automatically test how the ARIA patterns work in different assistive technologies, with <a href="https://aria-at.w3.org/reports">lots of reports</a> as a result. Loved hearing Lola talk about this important project, that I hope can be built out further.</p> <h2>Use fluid scales</h2> <p><strong>Richard Ruttter</strong> showed us how to use fluid scales for typography and spacing, I feel inspired to go and try that out on this website when I get a chance. See also what I wrote <a href="https://hidde.blog/patterns-day-3/#heading-2">about that talk at Patterns Day</a>.</p> <h2>Summing up</h2> <p>It was a lovely day, with great talks and conversations. One of the recurring themes was how much extreme capitalism affects the ecosystem we all clearly share a love for, we learned about various concrete ways in which this is at play. At the same time, we shouldn't forget to focus on what is valuable in and of itself: making music, fun buttons and UIs that include everyone. Priorities matter!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/sotb-2024/">The open web, MIDI and assistive tech: State of the Browser 2024</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20The open web, MIDI and assistive tech: State of the Browser 2024">Reply via email</a></p> Trains are offices 2024-11-29T00:00:00Z https://hidde.blog/trains-are-offices/ <p>Taking the train for work travel can cost more time than going by car or plane. But it's one of the most energy efficient ways to travel, and I get this weird productivity boost from them.</p> <p>Note that you can absolutely also chill out, read, sleep or listen to music on trains. I like that too, sometimes. But this post is about when I use train time to work. In Europe.</p> <h2>Enjoy the benefits</h2> <p>As mentioned in the intro, a major reason for my traveling by train is the low environmental impact (relatively, and apart from not traveling). I travel a lot for work, so my impact is relatively high, especially when I don't manage to avoid planes. Despite <a href="https://www.greenpeace.org.uk/news/the-biggest-problem-with-carbon-offsetting-is-that-it-doesnt-really-work/">doubts about effectiveness of compensation</a>, I do compensate in various ways, but it still doesn't feel great, avoiding is ideal.</p> <p>Trains also offer a productivity boost. If you're forced to be in a seat, on a connection too unstable to take work calls, this presents an opportunity. An opportunity to get things done (no I am not for hire as a productivity coach).</p> <p>gitI don't know what it is about trains, but I really find the time flies when I have something specific to write, code, or design. Trains have proven themselves as great offices to me. I don't know if I can convince my bookkeeper that train tickets are in fact office rental costs, but do you see how they can feel like that?</p> <p>There are some more benefits to trains:</p> <ul> <li>good views. Depending on your route and time of travel, there's always plenty to see outside. Sunrise and sunset are particularly nice.</li> <li>arrival in central locations. European train stations are usually close to where the fun happens.</li> <li>less checks. Within Schengen, international trains usually don't have border checks or luggage checks, so there's a lot less hassle and queuing, you can show up and go.</li> </ul> <h2>Embrace the caveats</h2> <p>Things can go wrong, too. Like with any kind of travel.</p> <h3>Delays</h3> <p>If your international train has stopovers, delays can be a headache. Especially between train companies. Plan for stopover time and consider flexible tickets for onward journeys. And stay calm: it happens. Also, in Europe, you have <a href="https://europa.eu/youreurope/citizens/travel/passenger-rights/rail/index_en.htm">lots of rights re train delays</a> and will have travelled partially for free when delays happen.</p> <h3>Data</h3> <p>Large parts of Europe don't have stable mobile data, especially outside cities. Or, depending on your plan, you don't get a great connection roaming. Have some of your work available offline so that poor connection doesn't interrupt you. Know which web apps to trust (the progressively enhanced parts of GitHub are the best).</p> <h3>Power</h3> <p>Not all power outlets will work, so I follow the ‘ABC’ rule: Always be charging when you have the opportunity, so that batteries are full and ready to go when you don't.</p> <h2>In conclusion</h2> <p>Trains are nice, and their benefits outweigh the caveats, especially if you anticipate those in advance. I'm curious if people have found other benefits or caveats regarding taking the train for work. What's exciting you or holding you back? Feel feel to reply by email or via <a href="https://elk.zone/front-end.social/@hdv/113566394289736008">Mastodon</a> or <a href="https://bsky.app/profile/hidde.blog/post/3lc3ngnetmk2o">Bluesky</a>.</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/trains-are-offices/">Trains are offices</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Trains are offices">Reply via email</a></p> Turn off AI features by default (to reduce their climate impact) 2024-11-30T00:00:00Z https://hidde.blog/please-make-ai-opt-in/ <p>Generative AI features have a <a href="https://arxiv.org/abs/2311.16863">large climate impact</a> and <a href="https://www.thetimes.com/uk/technology-uk/article/thirsty-chatgpt-uses-four-times-more-water-than-previously-thought-bc0pqswdr">water consumption</a>. We can weigh that impact against those features' benefits, but what if they are left unused? If lots of people don't in fact use the thing? That seems like lots of avoidable waste. Which matters, we're in a climate emergency and <a href="https://news.un.org/en/story/2022/04/1115452">we're dangerously far from that 1.5 degrees target</a>.</p> <p>I know, we all want people to use features we build, but it is safe to assume they often don't. For my business, I use a lot of very beautiful self service portals that I only ever log in to, to download a PDF that my accountant needs. The beautifully considered UI, fancy spinners and clever copywriting are there, but if I'm honest, I mostly ignore them (sorry).</p> <p>Is that ok? A button in your app that your user doesn't press, wastes little energy. But if your app automatically generates summaries, captions or suggestions, and the user didn't want or use that functionality, a lot of energy and water was wasted. While serving no purpose. It's that combo of waste and purposelessness that we should avoid at all times.</p> <p>Wait, that's absurd, you say. Does this really happen? Yeah, I come across it all the time, and it's not just because I'm somewhat of a luddite myself.</p> <h2>Features I didn't use</h2> <p>Some examples of AI features that ran on my behalf just in the past week, but that I didn't use:</p> <ul> <li>Loom's transcripts and automated titles and descriptions. They show up almost instantly after upload. I always remove them, they fail to get the point across, which I want to do pointedly to save colleagues reviewing a video time.</li> <li>Parabol's automated summary of team retrospectives: it emailed us key points, some incorrect. While we had written them down correctly already.</li> <li>Notion's AI assistance that shows up whenever you press ‘Space’. Ok, granted, it only runs once you've actually typed a prompt, but it's a good example for this post, as it's one of those I hear many people want to turn off, and you can only do that “on Enterprise“, according to <a href="https://www.reddit.com/r/Notion/comments/112pzlq/how_to_turn_off_ai_in_notion/">this Reddit topic dedicated to turning that feature off</a>.</li> </ul> <p>Of course, these features are not redundant if users benefit from them. But let's be real, oftentimes users didn't want to generate anything. It happened anyway, and was unsolicited. They will probably discard of the output. In those cases, the energy-intensive feature <em>was</em> redundant. And that's an issue, as we don't have redundant energy.</p> <p>Meanwhile, most major tech companies announced they are letting go of their net-zero goals. Some have bought nuclear power plants to cater for their energy needs (see <a href="https://techcrunch.com/2024/09/20/microsoft-taps-three-mile-island-nuclear-plant-to-power-ai/">Microsoft's plans with the Three Mile Island plant</a>). This confirms to me that we don't have abundant energy. Maybe one day, but not today.</p> <h2>An ethical web</h2> <p>Is this ethical? The W3C's <a href="https://www.w3.org/TR/ethical-web-principles/#sustainable">Ethical Web Principles</a> have a specific principle that applies here: <a href="https://www.w3.org/TR/ethical-web-principles/#sustainable">2.9 The web is an environmentally sustainable platform</a>.</p> <p>It suggests new technologies should not harm the environment:</p> <blockquote> <p>We will endeavor not to do further harm to the environment when we introduce new technologies to the web (…)</p> </blockquote> <p>and recognises people who benefit are not always those who are harmed:</p> <blockquote> <p>and keep in mind that people most affected by the environmental consequences of new technologies may not be those who benefit from the features introduced.</p> </blockquote> <p>If a feature is useful for some, but indirectly causes the energy or water bills <a href="https://www.washingtonpost.com/business/2024/11/01/ai-data-centers-electricity-bills-google-amazon/">to go up for others</a>, we're breaking this Ethical Web Principle.</p> <h2>Conclusion</h2> <p>So, I'm just a guy sitting behind a keyboard, begging anyone including generative AI features: only put them to work when users indicate they want that to happen. That's also going to turn out cheaper when OpenAI increase their rates, which is likely as investors are going to want returns. Why not consider leaving out that new LLM-powered feature in the first place: not everything needs to be “artificially intelligent”, sometimes a bunch of if statements make a killer feature (dude, that's so paternalistic and you're oversimplifying the realities of software engineering, you say… yeah, sorry, I'm trying to react to the overcomplexification that also happens).</p> <p>Do you have other examples of software that forced LLM generated content on you? Let me know and I'll add them to the post.</p> <h2>Further reading</h2> <ul> <li><a href="https://www.thegreenwebfoundation.org/publications/report-ai-environmental-impact/">Thinking about using AI? Here’s what you can and (probably) can’t change about its environmental impact</a> by the Green Web Foundation</li> <li><a href="https://news.climate.columbia.edu/2023/06/09/ais-growing-carbon-footprint/">AI’s Growing Carbon Footprint</a> (cites data centres account for 2.5-3.7% of global greenhouse gas emissions, exceeding aviation)</li> <li><a href="https://www.technologyreview.com/2022/11/14/1063192/were-getting-a-better-idea-of-ais-true-carbon-footprint/">We’re getting a better idea of AI’s true carbon footprint</a></li> <li><a href="https://theconversation.com/is-generative-ai-bad-for-the-environment-a-computer-scientist-explains-the-carbon-footprint-of-chatgpt-and-its-cousins-204096">Is generative AI bad for the environment? A computer scientist explains the carbon footprint of ChatGPT and its cousins</a></li> </ul> <hr/> <p>Originally posted as <a href="https://hidde.blog/please-make-ai-opt-in/">Turn off AI features by default (to reduce their climate impact)</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20Turn off AI features by default (to reduce their climate impact)">Reply via email</a></p> What I got up to in 2024 2024-12-29T00:00:00Z https://hidde.blog/2024-review/ <p>It's only a few days until 2025. That means one thing: it is time for my yearly tradition of reviewing… <em>some of my year</em>. I'll cover work, conferences, reading, writing and music.</p> <p>This will inevitably sound cheesy, but I am once again genuinely grateful for the opportunities I got… there were fun projects at work, I got to see some of my dearest artists live and I got to share knowledge and opinions at events among some of my favourite peers. At the same time, the last few months have, honestly, been intense, and I am looking forward to take a few breaks in January.</p> <p>I also can't not mention politics. I saw a number of sad elections results. I saw people chose to vote, basically, against other people. It was heartbreaking to see people vote against women, against trans people, against people who crossed borders, and also against the odds for humans to inhabit this planet… and some major tech leaders chose to embrace, encourage or cheerlead <em>that</em>. Booh.</p> <p>Some say one should focus on things one can impact. I'm not always good at that, but I'll do it now, by sharing a bit more about my year in terms of projects, conferences, reading and listening.</p> <h2>Projects</h2> <p>I spent most of my time on two projects for the Dutch government: NL Design System and the digital accessibility (standards) team at Logius.</p> <p>At NL Design System, I got to organise another <a href="https://nldesignsystem.nl/events/design-systems-week-2024">Design Systems Week</a>, and worked on accessibility testing, guidance for <a href="https://nldesignsystem.nl/richtlijnen/formulieren">forms</a> and <a href="https://nldesignsystem.nl/wcag/">WCAG</a> (both in Dutch), communication strategy, events and our website. At Logius, I worked on growing our participation in international standards discussions, specifically accessibility standards like WCAG and EN 301 539, at W3C and ETSI. It's been really cool to get back into familiar groups and join new ones (like the TC and JTB; yes I learned new abbreviations why).</p> <p>Next year I'm increasing my time for standards at Logius, which, sadly, also means I'm leaving the NL Design System team.</p> <p>From February, I'll have some availability for new projects, too: ~2 days/week to work on accessibility, frontend and/or design systems, do get in touch if you can use help.</p> <h2>Conferences</h2> <p>It's been a very busy and very fun year in conferences (I recommend going to conferences, for all reasons Sophie outlines in her post <a href="https://localghost.dev/blog/you-should-go-to-conferences/">You should go to conferences</a>).</p> <p>Some talks I liked:</p> <ul> <li><a href="https://www.youtube.com/watch?v=Lmq1MSCSA88"><em>The art of reflection</em></a> by Imran Afzal at All Day Hey</li> <li><a href="https://youtu.be/TFw3zPqlQjA?si=KxjZeebZ7f-bCFU9&amp;t=1250"><em>Feminism in programming language design</em></a> (start at 20:50) by Felienne Hermans at Joy of Coding</li> <li><em>The many lives of a notification</em> by Sarah Highley at Accessibility Toronto</li> </ul> <p>I loved speaking at a number of them, too. I got to meet new people in the industry and hang out with friends. Even if it is nerve wracking at times, it gives me a lot of energy.</p> <h3>Creativity, art and AI</h3> <p>In October, I presented a new talk called <em>Creativity cannot be computed</em> at Beyond Tellerrand in Berlin. I talked about what's great about arts and creativity, in the context of our industry's tendency to leave stuff to computers. I love computers and art both, but we've got to prioritise. Some of this has been in my head for the last decade, and I loved to hear how it resonated with people in conversations after (maybe partially because I can't seem to shut up about it, sorry to all affected). I plan to write more about art and AI on my blog, but you can already <a href="https://talks.hiddedevries.nl/dFZf3b/slides">read along with the slides</a> or <a href="https://www.youtube.com/watch?v=WqNgGmmwj7U">watch the video</a>.</p> <h3>Acccessibility</h3> <p>Another new talk was <em>Built-in accessibility: blessing or curse</em>, which combined some of my earlier talks on <a href="https://talks.hiddedevries.nl/Voo22H/will-tools-save-us">tooling</a>, <a href="https://talks.hiddedevries.nl/IEwNvG/could-browsers-fix-more-accessibility-problems-automatically">browsers</a> and <a href="https://talks.hiddedevries.nl/WOsDsG/your-cms-is-an-accessibility-assistant">CMSes</a> with what I learned about design systems at NL Design System, all to uncover a general theme: that building in accessibility is not a one size fits all solution, but when done right, can be a sound part of your accessibility strategy. I gave this talk at A11y Club Amsterdam and at Accessibility Toronto.</p> <h3>Popovers</h3> <p>Earlier in the year, I did the most northern iteration of <a href="https://youtu.be/uZRp7yY8SS0?si=SJpNzbYUIEwnuUZZ">my popover talk (video)</a> at All Day Hey in Leeds. I was very happy how it turned out and it was great to visit this city and this event that I had heard so many good things about.</p> <p>My shortest talks were at Joy of Coding in my home town of Rotterdam, where I spent <a href="https://talks.hiddedevries.nl/deWifQ/more-software-should-have-accessibility-built-in">5 minutes rambling about software and accessibility</a>, and Mozilla's performance.sync() meetup in Amsterdam, where I talked about <a href="https://talks.hiddedevries.nl/lRQg2b/new-web-platform-features-that-help-you-save">Open UI and reducing bundle size</a>.</p> <p>In the next year, I'd like to talk about web sustainability more, and continue to cover accessibility, design systems and AI/art.</p> <h2>Reading</h2> <p>I read <a href="https://log.hidde.blog/books/">some books this year</a>, two of my favourites were:</p> <ul> <li><a href="https://www.penguin.co.uk/books/457928/character-limit-by-mac-kate-conger-and-ryan/9781529914696">Character limit: how Elon Musk destroyed Twitter</a>; a lot of the shocking facts in this book were public knowledge already, but Ryan Mac and Kate Conger did a wonderful job telling how the events unfolded, the details make one fear a world in which Elon Musk has any influence.</li> <li><a href="https://wwnorton.com/books/9781324036661">Against technoableism: </a>: seeing people with disabilities as an “inspiration” or needy of technological “fixes” is problematic, this book explains why.</li> </ul> <p>These blog posts from others are among favourites this year:</p> <ul> <li><a href="https://aworkinglibrary.com/writing/coming-home">Coming Home</a> by Mandy Brown</li> <li><a href="https://rachsmith.com/ai-is-for-the-idea-guys/">Generative AI is for the idea guys</a> by Rach Smith</li> <li><a href="https://github.com/andrico1234/the-dilemmas-youll-face">The Dilemmas You'll Face When Creating a Component Library</a> by Andrico Karoulla</li> <li><a href="https://coryd.dev/posts/2024/we-have-a-content-quality-problem-not-a-content-quantity-problem.html">We have a content quality problem, not a content quantity problem</a> by Cory Dransfeldt</li> </ul> <h2>Music</h2> <p>Three albums that came out in 2024 that I liked:</p> <ul> <li>Odyssey by Nubya Garcia (jazz saxophone with orchestral arrangements, vocals and more).</li> <li>Lives Outgrown by Beth Gibbons (of Portishead fame, it grew on me).</li> <li>Drop 7 by Little Simz (hip hop, it feels more free and experimental than her previous work).</li> <li>IJsland by Abel &amp; Sef (Dutch punk hip hop that I loved almost instantly).</li> </ul> <p>In live music, it was a <a href="https://log.hidde.blog/live-music">good year</a>… I stayed on top of who's touring and ticket acquisition, and managed to see many faves. Most liked: IJSLAND, Massive Attack and Robert Glasper. I also made a point of going to see stuff when traveling, a tradition I hope to keep, though it gets expensive when traveling outside of Europe and its subsidised cultural venues.</p> <p>In music making: I am picking up playing piano again and have joined a choir, which has been on of my best decisions, it is so much fun. As usual, I should have listened to a friend's advice earlier.</p> <h2>Writing</h2> <p>With 10 posts in total, I didn't write as much on this blog in 2024. I don't know which were most read, but these got some good feedback:</p> <ul> <li><a href="https://hidde.blog/popover-accessibility/">On popover accessibility: what the browser does and doesn't do</a> (co-written with Scott O'Hara)</li> <li><a href="https://hidde.blog/ai-for-accessible-components/">“AI” and accessible front-end components: is the nuance generatable?</a></li> </ul> <h2>Cities</h2> <p>Outside The Netherlands, I spent time in Duisburg, Berlin, Taipei, Tainan, Kaohsiung, Brighton, Antwerp, Paris, Leeds, London, Bad Schandau, Brussels, Los Angeles, Toronto, Liverpool, Vienna.</p> <h2>Self study</h2> <p>I did a bunch of self-study:</p> <ul> <li>Josh Comeau's <a href="https://www.joyofreact.com/">The Joy of React</a>. It was indeed joyful, and the most down to earth overview of React I've seen so far.</li> <li>the <a href="https://www.accessibilityassociation.org/s/certification">IAAP certification</a> exams. I'm now a <a href="https://www.accessibilityassociation.org/s/certified-professional-web-accessibility">CPWA</a>, which is both WAS and CPACC. I have more to say about this, maybe some other time or 1:1.</li> <li>I worked with <a href="https://www.seckington.com/">Melinda</a> on specific parts of my public speaking, I would absolutely recommend her to anyone looking to learn.</li> </ul> <h2>Wrapping up</h2> <p>I wanted to write up some resolutions for the next year, but I ran out of time. I guess I'll leave it, as a resolution itself, for the next year. If you're reading this, I wish you all the best for the new year!</p> <hr/> <p>Originally posted as <a href="https://hidde.blog/2024-review/">What I got up to in 2024</a> on <a href="https://hidde.blog">Hidde's blog</a>.</p> <p><a href="mailto:[email protected]?subject=Reply%20to:%20What I got up to in 2024">Reply via email</a></p>