Responsive design and cross-device testing
Tags: webdev, a11y, productivity, sustainability
Published: 2024-02-27 18:03:49

## Best viewed with an open mind...

The so-called ["browser wars"](https://en.wikipedia.org/wiki/Browser_wars) long before current web standards like HTML 5 made some web developers add badges like "best viewed with Netscape" or "best viewed with Internet Explorer". An alternative badge stating "best viewed with an open mind" was a statement for cross-browser functionality and progressive enhancement.

![Historic badge images: best viewed with Netscape or Internet Explorer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3xes4urbghsvkqy856sj.png)

## ... or best viewed in Safari 16?

We might be lucky that there is no "best viewed in Safari 16" sticker, but some websites feel like they need one.

Old Apple devices don't get the latest Apple browsers, and there are still people using old Apple devices for various reasons, including sustainability. Their high-end hardware still works well ten years later, but their software doesn't, and I suspect they're doing that on purpose to give people a reason to buy the latest iPhone. I've got an iPhone 6+ that I use for device testing only, and a classic MacBook that has been used for browsing, development, and testing for more than ten years.

## Same site, different devices

Here is one of my recent projects, [kleiderordnung.berlin](https://kleiderordnung.berlin/) on different devices:

![Desktop with several laptops and phones testing the same website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/03s5cgem59f236ucfyoj.png)

This is a nice picture, and I occasionally test websites on real devices to get a better feeling. But any number of specific devices is just a small selection that does not reflect every real user. That's why I use services like BrowserStack to remote-control a much greater number of different devices.

## Advertising my services

I must admit, this post is kind of a recap of things that I wrote before and writing it feels a bit like those listicles that make me feel cringe about DEV.to sometimes. But then again, some things can't be repeated often enough. Why can't developers add some simple improvements to their default workflow, when things have got so easy thanks to automation?

I must also admit that I don't do much test automation or test-driven development yet, and that I tend to procrastinate and write posts like ["Emotion-driven development"](https://dev.to/ingosteinke/emotion-driven-development-4ai1) instead.

But if you need help with responsive design, CSS, accessibility and client-side performance optimization, call me! I am happy to improve your storefront, working with CSS, HTML, and just as much JavaScript and PHP code as necessary.

I am also happy when I can put things into practice and find pragmatic solutions quickly, without denying the need for testing, documentation, and maintainable clean code but without striving for perfection without impact or business value either.

## Audits and automation

We have emulation, automation and remote control to improve our insights. We can [compare full page screenshots cross-device](https://dev.to/ingosteinke/comparing-full-page-screenshots-cross-device-5ahc), use cypress or [CodeceptJS and Testomat.io](https://dev.to/ingosteinke/automating-tests-using-codeceptjs-and-testomatio-first-steps-3b2e) for automating tests, including hover states and dynamic behavior, and we can [use BrowserStack to test WordPress and other local projects](https://dev.to/ingosteinke/testing-a-local-wordpress-instance-on-browserstack-n4l) before deploying anything.

Pro tip for Linux users: we can use [a "Secret" Linux Browser](https://dev.to/ingosteinke/fixing-apple-bugs-with-a-secret-linux-browser-4cp3) to reproduce some Safari bugs in a local browser.

So far, so good – but what about accessibility and sustainability?

## Sustainability

Sustainability includes different aspects:

- **energy efficiency**, estimated by page load metrics, green hosting list, and [CO2e carbon dioxide equivalent](https://ec.europa.eu/eurostat/statistics-explained/index.php?title=Glossary:Carbon_dioxide_equivalent),
- **maintainability**, facilitated by using open-source software and increasing code quality,
- **privacy and usability**

Web performance tools like [WebPageTest](https://www.webpagetest.org) and [PageSpeed Insights](https://pagespeed.web.dev) have added ecological aspects, and there are specific tools like [WebsiteCarbon](https://www.websitecarbon.com) and [Ecograder](https://ecograder.com) as well.

Putting the users' needs before our customers and their companies can be an effective strategy to improve usability. In the long run, companies will also profit by retaining their users as happy customers.

Usability also implies accessibility.

## Accessibility

Although there are diverse disabilities and challenges to website users, there are a few proven ways to facilitate any kind of assistive technology. [Progressive enhancement](https://en.wikipedia.org/wiki/Progressive_enhancement) is a strategy starting with simple, text-based content and the most important functionality and the most robust and compatible implementation, adding optional design and comfort functions on top for those devices and users that can and want to use it.

Feature queries and [media queries for accessibility](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries_for_accessibility) like `prefers-reduced-motion`, `prefers-reduced-transparency` or `prefers-contrast` are easy ways to customize the page experience for different target groups with only a few lines of additional CSS code.

To measure or rather estimate accessibility, we can use automated audits like [WAVE](https://wave.webaim.org/), [axe](https://www.deque.com/axe/) and the accessibility report in [Lighthouse](https://developer.chrome.com/docs/lighthouse/overview/) or [PageSpeed Insights](https://pagespeed.web.dev) to ensure that we don't violate essential [Web Content Accessibility Guidelines (WCAG)](https://www.w3.org/TR/WCAG21/#:~:text=Web%20Content%20Accessibility%20Guidelines%20(WCAG)%202.1%20defines%20how%20to%20make,%2C%20learning%2C%20and%20neurological%20disabilities.)

## Further reading

European legislation are planning to enforce stricter rules concerning websites' accessibility and sustainability with the reformed [European Accessibility Act (EAA)](https://ec.europa.eu/social/main.jsp?catId=1202) and they also planned a strict [Supply Chain Due Diligence Act (Lieferkettengesetz)](https://www.bundesregierung.de/breg-de/suche/act-on-corporate-due-diligence-obligations-in-supply-chains-2063270) which has been blocked by the smallest party in Germany's government coalition: https://www.reuters.com/world/europe/eu-envoys-fail-back-supply-chain-checks-law-2024-02-28/ 

{% post https://dev.to/ingosteinke/accessibility-sustyweb-sdgs-and-upcoming-european-legislation-in-20242025-1m03 %}

I have also added special pages detailing [sustainable and accessible web development]((https://www.ingo-steinke.com/services/accessible-climate-website-optimization.html)) and how to [develop](https://www.ingo-steinke.com/services/web-development.html), [check](https://www.ingo-steinke.com/services/website-check.html) and [optimize](https://www.ingo-steinke.com/services/optimization.html) web pages to make them more sustainable on my portfolio website.