<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><description>Personal blog. Mostly photos.</description><title>Daniel Pietzsch</title><generator>Tumblr (3.0; @danielpietzsch)</generator><link>https://blog.danielpietzsch.com/</link><item><title>Merging two Git repos</title><description>&lt;p&gt;Today I learned, &lt;a href="https://stackoverflow.com/a/10548919/210307"&gt;you can indeed merge two Git repositories and keep the history intact&lt;/a&gt;. Not quite sure, if I will need this ever again, but it’s good to know I could. Here’s the code snippet of &lt;a href="https://stackoverflow.com/users/532495/andresch-serj"&gt;Andresch Serj’&lt;/a&gt;s answer on Stack Overflow:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;If you want to merge &lt;code&gt;project-a&lt;/code&gt; into &lt;code&gt;project-b&lt;/code&gt;:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;pre&gt;&lt;code class="bash"&gt;cd path/to/project-b
git remote add project-a path/to/project-a
git fetch project-a --tags
git merge --allow-unrelated-histories project-a/master # or whichever branch you want to merge
git remote remove project-a
&lt;/code&gt;&lt;/pre&gt;</description><link>https://blog.danielpietzsch.com/post/185184001763</link><guid>https://blog.danielpietzsch.com/post/185184001763</guid><pubDate>Mon, 27 May 2019 22:45:16 +0200</pubDate><category>365writings</category><category>journal</category><category>software development</category></item><item><title>Inspired</title><description>&lt;p&gt;&lt;a href="https://blog.danielpietzsch.com/post/184834528223/indiewebcamp-recap"&gt;IndieWebCamp&lt;/a&gt; keeps inspiring me. Having had so much interesting conversations with interesting people that care about similar things, motivates me to work on my own homepage, blog and other web projects.&lt;/p&gt;

&lt;p&gt;And so I&amp;rsquo;m currently still excited about &lt;a href="https://indieweb.org"&gt;IndieWeb&lt;/a&gt; stuff and am researching potential tools, hosting options and workflows for my personal sites.&lt;/p&gt;

&lt;p&gt;And I&amp;rsquo;m still fancying going static with my blog, too. Most of my other projects are static already. It&amp;rsquo;s either indeed a plain hand-written static site, or generated via &lt;a href="https://jekyllrb.com"&gt;Jekyll&lt;/a&gt;, my &lt;abbr title="Static Site Generator"&gt;SSG&lt;/abbr&gt; of choice (so far).&lt;/p&gt;

&lt;p&gt;While researching, I found the following (somewhat random) articles and resources interesting and helpful so far.&lt;/p&gt;

&lt;p&gt;By &lt;a href="https://www.aaron-gustafson.com"&gt;Aaron Gustafson&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="https://www.aaron-gustafson.com/colophon/"&gt;How this site was built&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.aaron-gustafson.com/notebook/enabling-webmentions-in-jekyll/"&gt;Enabling Webmentions in Jekyll&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/aarongustafson?utf8=%E2%9C%93&amp;amp;tab=repositories&amp;amp;q=jekyll&amp;amp;type=public&amp;amp;language=ruby"&gt;Jekyll repositories on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;By &lt;a href="https://www.ummels.de"&gt;Michael Ummels&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="https://www.ummels.de/2016/01/31/going-static/"&gt;Going Static&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.ummels.de/2018/09/03/gitlab-lets-encrypt/"&gt;Secure Hosting with GitLab Pages and Let’s Encrypt&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;By Christopher Kirk-Nielsen for Smashing Magazine:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="https://www.smashingmagazine.com/2019/05/switch-wordpress-hugo/"&gt;Switching From WordPress To Hugo&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;a href="https://gomakethings.com"&gt;Chris Ferdinandi’s whole website&lt;/a&gt; seems to be a treasure trove in this regard. So far I&amp;rsquo;ve read:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="https://gomakethings.com/static-websites/"&gt;Static Websites&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gomakethings.com/static-sites-and-cmss/"&gt;Static sites and CMS&amp;rsquo;s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gomakethings.com/automating-the-deployment-of-your-static-site-with-hugo-and-github/"&gt;Automating the deployment of your static site with Hugo and GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gomakethings.com/how-to-schedule-posts-with-a-static-website/"&gt;How to schedule posts with a static website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gomakethings.com/how-to-create-a-vanilla-js-search-page-for-a-static-website/"&gt;How to create a vanilla JS search page for a static website&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;I think as a first step, I might neglect the &amp;ldquo;hosting&amp;rdquo; part of my upcoming solutions a little bit. I want the hosting and deployment to be as simple as possible. And so I might sacrifice &lt;a href="https://blog.danielpietzsch.com/post/184880662688/tooling-and-hosting-options-research"&gt;my other principles about server location and using renewable energy sources&lt;/a&gt; in the short term. I&amp;rsquo;m currently looking into these hosting options:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="https://pages.github.com"&gt;Github Pages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://about.gitlab.com/product/pages/"&gt;Gitlab Pages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://about.gitlab.com/product/pages/"&gt;Netlify&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Keeping &lt;a href="https://www.hosteurope.de/WebHosting/"&gt;my shared webspace&lt;/a&gt; and use FTP.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The good thing about static sites is, that they are very easy to move and host somewhere else, should I decide to do so.&lt;/p&gt;</description><link>https://blog.danielpietzsch.com/post/185130023923</link><guid>https://blog.danielpietzsch.com/post/185130023923</guid><pubDate>Sat, 25 May 2019 16:08:30 +0200</pubDate><category>365writings</category><category>writings</category><category>indieweb</category><category>indiewebcamp</category><category>software development</category><category>journal</category></item><item><title>Tonight, I decided to host my Focal Length Equivalent tool on Github Pages using a custom subdomain:...</title><description>&lt;p&gt;Tonight, I decided to host &lt;a href="https://blog.danielpietzsch.com/post/181709432848/focal-length-equivalents"&gt;my Focal Length Equivalent tool&lt;/a&gt; on &lt;a href="https://pages.github.com"&gt;Github Pages&lt;/a&gt; using a custom subdomain:&lt;a href="https://fl.danielpietzsch.com"&gt; fl.danielpietzsch.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I’ll probably start using Github Pages more for these kind of static, simple, open-source sites. I really like the simplicity of the whole workflow and that you can easily get going with a custom domain and – crucially – a free, auto-renewing SSL certificate to serve it over HTTPS.&lt;/p&gt;

&lt;p&gt;So, &lt;a href="https://blog.danielpietzsch.com/post/184834528223/indiewebcamp-recap"&gt;it’s still a &lt;abbr title="Progressive Web App"&gt;PWA&lt;/abbr&gt;&lt;/a&gt;, which means it can be added to the home screen on a mobile device and will also be available offline.&lt;/p&gt;</description><link>https://blog.danielpietzsch.com/post/185093724413</link><guid>https://blog.danielpietzsch.com/post/185093724413</guid><pubDate>Thu, 23 May 2019 23:29:25 +0200</pubDate><category>365writings</category><category>journal</category><category>software development</category></item><item><title>Nifty text highlight styling</title><description>&lt;p&gt;Wanted to jot down this nice text highlighting CSS snippet I just discovered on &lt;a href="https://basecamp.com"&gt;basecamp.com&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;img src="https://64.media.tumblr.com/190e3bce51935fdbeb24b56930064475/tumblr_inline_prnajjNZNh1qzm9x2_540.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;With its varying opacity, it&amp;rsquo;s simulating a person&amp;rsquo;s variable pressure when marking text on an actual piece of paper. I like!&lt;/p&gt;

&lt;p&gt;Here&amp;rsquo;s the CSS:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;border-radius: 1em 0 1em 0;
background-image: linear-gradient(-100deg, rgba(250,247,133,0.3), rgba(250,247,133,0.7) 95%, rgba(250,247,133,0.1));
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Instead of using &lt;code&gt;&amp;lt;span class="highlight"&amp;gt;&lt;/code&gt;, though, you should probably rather simply use the &lt;code&gt;&amp;lt;mark&amp;gt;&lt;/code&gt; tag, which is more semantically correct.&lt;/p&gt;</description><link>https://blog.danielpietzsch.com/post/185045401263</link><guid>https://blog.danielpietzsch.com/post/185045401263</guid><pubDate>Tue, 21 May 2019 23:00:15 +0200</pubDate><category>365writings</category><category>css</category><category>software development</category><category>writings</category></item><item><title>PWA notes</title><description>&lt;p&gt;&lt;a href="https://blog.danielpietzsch.com/post/184834528223/indiewebcamp-recap"&gt;Making my Focal Length Equivalent utility a &lt;abbr title="Progressive Web App"&gt;PWA&lt;/abbr&gt; at IndieWebCamp last weekend&lt;/a&gt; I made a few notes, which I thought I&amp;rsquo;d share:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;While iOS 12.2 does use the manifest.json file for most configuration options, it does not use the &lt;code&gt;icons&lt;/code&gt; declaration. The icons are still specified via the &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt; tag in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;And to make an icon actual appear on the home screen of iOS devices I found the &lt;code&gt;rel&lt;/code&gt;-attribute&amp;rsquo;s value &lt;em&gt;must only&lt;/em&gt; contain &lt;code&gt;apple-touch-icon&lt;/code&gt;. With any other additional value – like &lt;code&gt;icon&lt;/code&gt;, for example, which is used for on Android non PWA-sites – it would not show it. It would always render the standard screenshot-icon.&lt;/li&gt;
&lt;li&gt;Having said that, I&amp;rsquo;m not 100% certain about this. Because I also found that even when changes were deployed, iOS would sometimes still use some cached setting from a previous &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; oder manifest.json configuration. Even after multiple refreshes of the page. So that was a bit tedious to debug.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.danielpietzsch.com/post/183073736328/noscript-in-head"&gt;As I found out you can have a &lt;code&gt;&amp;lt;noscript&amp;gt;&lt;/code&gt; tag in your &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; to only load certain (fallback) resources when JavaScript is disabled&lt;/a&gt;. Now, I wonder how this works in conjunction with a service worker and offline functionality. Because when no network request is made, my service worker will not cache them. Would it then make sense to manually cache them the first time the SW runs? Hm… haven&amp;rsquo;t done any testing around this. But I assume the SW doesn&amp;rsquo;t even kick in when JS is disabled, and therefor caching these resources is pointless, since a network request has to be made anyway. Actually, that&amp;rsquo;s probably the case and I have hereby answered my own question. Anyhow, I leave this rambling here, because that was something I wondered about.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;More useful links&lt;/h3&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html"&gt;Configuring Web Applications&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@firt/whats-new-on-ios-12-2-for-progressive-web-apps-75c348f8e945"&gt;What’s new on iOS 12.2 for Progressive Web Apps&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description><link>https://blog.danielpietzsch.com/post/184847240258</link><guid>https://blog.danielpietzsch.com/post/184847240258</guid><pubDate>Mon, 13 May 2019 14:00:01 +0200</pubDate><category>365writings</category><category>writings</category><category>javascript</category><category>html</category><category>software development</category><category>pwa</category><category>serviceworker</category></item><item><title>IndieWebCamp Recap</title><description>&lt;p&gt;It&amp;rsquo;s Sunday evening, and I&amp;rsquo;m back home from two very enjoyable days (&lt;a href="https://blog.danielpietzsch.com/post/184811603798/originally-i-thought-i-could-easily-write-up-my"&gt;and one night, too&lt;/a&gt;) at &lt;a href="https://indieweb.org/2019/D%C3%BCsseldorf"&gt;IndieWebCamp Düsseldorf 2019&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I met lots of friendly and interesting new people, had interesting discussion and conversations, learned new things and was also productive implementing new technologies on one of my projects.&lt;/p&gt;

&lt;h3&gt;Saturday&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://indieweb.org/2019/D%C3%BCsseldorf/Schedule#Saturday"&gt;Day one of the camp was the &amp;ldquo;Discussions&amp;rdquo; day&lt;/a&gt;: after the introduction round, everyone gathered to suggest discussions on IndieWeb-related topics. I spent my time at &amp;ldquo;&lt;a href="https://indieweb.org/2019/D%C3%BCsseldorf/urls"&gt;URLs: How?&lt;/a&gt;&amp;rdquo;, &amp;ldquo;&lt;a href="https://indieweb.org/2019/D%C3%BCsseldorf/offline"&gt;Offline Strategies&lt;/a&gt;&amp;rdquo;, &amp;ldquo;&lt;a href="https://indieweb.org/2019/D%C3%BCsseldorf/ssgcms"&gt;Hosting, SSG vs CMS vs Custom&lt;/a&gt;&amp;rdquo;, &amp;ldquo;&lt;a href="https://indieweb.org/2019/D%C3%BCsseldorf/comefly"&gt;Travel Data &amp;amp; Posts&lt;/a&gt;&amp;rdquo; and &amp;ldquo;&lt;a href="https://indieweb.org/2019/D%C3%BCsseldorf/safety"&gt;Safety&lt;/a&gt;&amp;rdquo;. I learned something new in every one of them and/or contributed, too.&lt;/p&gt;

&lt;p&gt;&amp;ldquo;Hosting, SSG vs CMS vs Custom&amp;rdquo; was maybe the most immediately interesting to me, since &lt;a href="https://blog.danielpietzsch.com/post/184650717053/indiewebcamp-d%C3%BCsseldorf"&gt;I&amp;rsquo;m keen to move my blog&lt;/a&gt;, and so I suggested this session myself. I was interested in how other folks publish to, host and deploy their own site. &lt;a href="https://indieweb.org/2019/D%C3%BCsseldorf/ssgcms"&gt;Everyone in the room shared their setup&lt;/a&gt;, which was absolutely fantastic! Now, I need to take some time, take those notes and research how I want to &lt;a href="https://blog.danielpietzsch.com/post/184650717053/indiewebcamp-d%C3%BCsseldorf"&gt;continue publishing this blog&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Sunday&lt;/h3&gt;

&lt;p&gt;Sunday was &lt;a href="https://indieweb.org/2019/D%C3%BCsseldorf/Schedule#Sunday"&gt;Hacking Day&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That means, whatever you fancied to work on, you simply did – either on your own or with (the help of) others.&lt;/p&gt;

&lt;p&gt;I myself added a &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API"&gt;Service Worker&lt;/a&gt; to &lt;a href="https://blog.danielpietzsch.com/post/181709432848/focal-length-equivalents"&gt;my &amp;ldquo;Focal Length Equivalents&amp;rdquo; site&lt;/a&gt; and also made this a &amp;ldquo;&lt;a href="https://developers.google.com/web/progressive-web-apps/"&gt;Progressive Web App (PWA)&lt;/a&gt;&amp;rdquo;. A topic I wanted to start with for a long time and now I finally did.&lt;/p&gt;

&lt;p&gt;I used Jeremy&amp;rsquo;s &lt;a href="https://adactio.com/journal/13540"&gt;Minimal viable service worker script&lt;/a&gt;, and modified it a little to suit this page&amp;rsquo;s needs even better. Following  &lt;a href="https://danielehniss.de"&gt;Daniel&amp;rsquo;s&lt;/a&gt; suggestion, I deployed this via GitHub Pages; I needed to switch hosts, because I needed a (free) SSL certificate. Because serving your site over HTTPS is a prerequisite for using a service worker (and thus making the site available offline). Then I created a quick icon and followed &lt;a href="https://developers.google.com/web/fundamentals/app-install-banners/#criteria"&gt;the &amp;ldquo;Add to Home Screen&amp;rdquo; guide&lt;/a&gt; to turn the site into a PWA.&lt;/p&gt;

&lt;p&gt;So, when you now go to &lt;a href="https://danielpietzsch.github.io/fl/"&gt;https://danielpietzsch.github.io/fl/&lt;/a&gt;, it&amp;rsquo;ll be available offline (after that first visit of course), and you can also add it to your home screen on iOS or Android, and it&amp;rsquo;ll behave very similar to a native app.&lt;/p&gt;

&lt;p&gt;The final step would be to actually use &lt;a href="http://utilities.danielpietzsch.com/fl/"&gt;my custom subdomain again&lt;/a&gt;, which so far hasn&amp;rsquo;t worked, unfortunately.&lt;/p&gt;

&lt;p&gt;At the end of the day, everyone demoed what they&amp;rsquo;ve worked on. I was super impressed by all the things that got done.&lt;/p&gt;

&lt;p&gt;A big thanks to &lt;a href="https://marcthiele.com"&gt;Marc&lt;/a&gt;, &lt;a href="https://tantek.com"&gt;Tantek&lt;/a&gt;, &lt;a href="http://aaronparecki.com"&gt;Aaron&lt;/a&gt;, &lt;a href="https://adactio.com"&gt;Jeremy&lt;/a&gt; and &lt;a href="https://jkphl.is"&gt;Joschi&lt;/a&gt; for making all this happen! 
This will not have been my last IndieWebCamp for sure!&lt;/p&gt;

&lt;p&gt;Here are the photos: &lt;a href="https://www.flickr.com/photos/tollwerk/sets/72157691376106913"&gt;Day 1&lt;/a&gt;, &lt;a href="https://www.flickr.com/photos/tollwerk/albums/72157708390735855"&gt;Day 2&lt;/a&gt;.&lt;/p&gt;</description><link>https://blog.danielpietzsch.com/post/184834528223</link><guid>https://blog.danielpietzsch.com/post/184834528223</guid><pubDate>Sun, 12 May 2019 23:59:14 +0200</pubDate><category>365writings</category><category>writings</category><category>journal</category><category>indiewebcamp</category><category>indieweb</category><category>software development</category><category>pwa</category><category>serviceworker</category></item><item><title>Super simple Dark Mode</title><description>&lt;p&gt;I just read the article &lt;a href="https://webkit.org/blog/8840/dark-mode-support-in-webkit/"&gt;“Dark Mode Support in Webkit” on the Webkit blog&lt;/a&gt;. Among other things, it describes how you can opt-in to have your website auto-darkened by Webkit (which means Safari in this case):&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Not all web content is simple. For this reason Safari and WebKit do not auto-darken web content — documents will need to opt-in to dark mode. The main way to signal that your content supports dark mode it to adopt the new &lt;code&gt;color-scheme&lt;/code&gt; style property [&amp;hellip;].&lt;/p&gt;
  
  &lt;p&gt;Specifying the values &lt;code&gt;light&lt;/code&gt; and &lt;code&gt;dark&lt;/code&gt; on the root element lets the engine know both modes are supported by the document. This changes the default text and background colors of the page to match the current system appearance. Also standard form controls, scrollbars, and other named system colors change their look automatically.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, to opt-in, you add this bit of CSS:&lt;/p&gt;

&lt;pre&gt;&lt;code class="css"&gt;:root {
  supported-color-schemes: light dark; /* For current Safari versions */
  color-scheme: light dark; /* Available with Safari TP 81 */
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will tell the browser that your website supports both light and dark modes, and will automatically darken your website &lt;a href="https://blog.danielpietzsch.com/post/183572983263/dark-mode-based-on-os-preference"&gt;when dark mode is selected in the OS preferences&lt;/a&gt;. Without any additional CSS (via &lt;code&gt;@media (prefers-color-scheme: dark)&lt;/code&gt;). That&amp;rsquo;s a super simple and convenient way to have a dark theme.&lt;/p&gt;

&lt;h3&gt;Existing issues&lt;/h3&gt;

&lt;p&gt;[UPDATE 28.05.2019]&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/xeenon/status/1131925519006519296"&gt;Got some feedback from the original article&amp;rsquo;s author&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;However, it is not an auto-dark mode. That property gives you dark mode ready defaults for the body background and base text color, along with form controls. Any custom colors will need handled with the &lt;code&gt;prefers-color-scheme&lt;/code&gt; media query.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And I also re-read the article and the &lt;a href="https://drafts.csswg.org/css-color-adjust-1/"&gt;spec regarding this topic&lt;/a&gt;. And the issues listed below are no bugs. According to the spec, the user agent should indeed only change the background and text colour plus form elements, and not much more.&lt;/p&gt;

&lt;p&gt;So, I think the below still applies. &lt;em&gt;But&lt;/em&gt;, that it&amp;rsquo;s not &amp;ldquo;perfect&amp;rdquo; is intentional and merely gives you a mechanism to opt-in to support a very basic version and is expected to be further extended and adjusted via custom CSS statements inside a &lt;code&gt;prefers-color-scheme&lt;/code&gt; block.&lt;/p&gt;

&lt;p&gt;[UPDATE END]&lt;/p&gt;

&lt;p&gt;This automatic dark mode is not perfect. While updating my &lt;a href="https://fl.danielpietzsch.com/"&gt;Focal Length Equivalent&lt;/a&gt; page to use it (&lt;a href="https://blog.danielpietzsch.com/post/183732341578/automatic-dark-mode-for-focal-length-equivalents"&gt;which previously had a complete custom – but very similar – dark theme already&lt;/a&gt;), I noticed a few things:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;code&gt;:hover&lt;/code&gt; and other pseudo-classes are not darkened.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;border-color&lt;/code&gt; and &lt;code&gt;outline-color&lt;/code&gt; are not darkened.&lt;/li&gt;
&lt;li&gt;Link colour don&amp;rsquo;t seem to get adjusted.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;For &lt;code&gt;border-color&lt;/code&gt; and &lt;code&gt;outline-color&lt;/code&gt;, I could remove those statements from the standard (light mode) CSS to rely on the page&amp;rsquo;s standard colours. Then, the borders got auto-darkened, too. For the &lt;code&gt;:hover&lt;/code&gt;-issues, I kept my custom CSS rules around.&lt;/p&gt;

&lt;h3&gt;Verdict&lt;/h3&gt;

&lt;p&gt;Relying on this auto-dark mode reduced the number of CSS statements I had to overwrite in the &lt;code&gt;@media (prefers-color-scheme: dark)&lt;/code&gt; section of my stylesheet and made it much simpler.&lt;/p&gt;

&lt;p&gt;Generally, for simple sites likes this one, I think it&amp;rsquo;s very handy to be able to rely on Webkit to do most of the dark-mode work for you. And then only adjust things where you see the need for.&lt;/p&gt;

&lt;p&gt;I am definitely going to experiment with this some more.&lt;/p&gt;</description><link>https://blog.danielpietzsch.com/post/184782093393</link><guid>https://blog.danielpietzsch.com/post/184782093393</guid><pubDate>Fri, 10 May 2019 16:13:11 +0200</pubDate><category>365writings</category><category>writings</category><category>css</category><category>software development</category></item><item><title>clamp()</title><description>&lt;p&gt;Just learned about the CSS &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/clamp"&gt;clamp()&lt;/a&gt; function. This would actually be really handy for specifying &lt;a href="https://blog.danielpietzsch.com/post/182034125803/css-width-based-font-size"&gt;a width based font size&lt;/a&gt;, without the need for an extra media-query.&lt;/p&gt;&lt;p&gt;Unfortunately, &lt;a href="https://caniuse.com/#feat=css-math-functions"&gt;this does not have any browser support right now&lt;/a&gt;.&lt;/p&gt;</description><link>https://blog.danielpietzsch.com/post/184768012718</link><guid>https://blog.danielpietzsch.com/post/184768012718</guid><pubDate>Fri, 10 May 2019 00:02:24 +0200</pubDate><category>365writings</category><category>journal</category><category>css</category><category>software development</category></item><item><title>I amended my photo journal’s design once again. I wanted to make all images fit completely on...</title><description>&lt;p&gt;I amended my &lt;a href="http://photojournal.danielpietzsch.com"&gt;photo journal’s&lt;/a&gt; design once again. I wanted to make all images fit completely on screen, no matter what the actual dimensions of the image are.&lt;/p&gt;&lt;p&gt;That images wouldn’t fit was mainly an issue with photos shot in portrait orientation or in square format. If a screen was wider than it’s tall – typical for most non-mobile devices – and you had less than 960px available vertical space, those images would be cropped. That’s no longer the case. And I find it much more enjoyable when the whole picture fits on screen.&lt;/p&gt;&lt;p&gt;As a minor downside, this update also decreases the size of landscape-oriented images, which would still have fitted previously. But this way, everything’s aligning well and portrait and landscape images still have the same size.&lt;/p&gt;</description><link>https://blog.danielpietzsch.com/post/184744811653</link><guid>https://blog.danielpietzsch.com/post/184744811653</guid><pubDate>Wed, 08 May 2019 23:59:46 +0200</pubDate><category>365writings</category><category>writings</category><category>journal</category><category>software development</category><category>css</category></item><item><title>Go &lt;figure&gt;?</title><description>&lt;p&gt;For &lt;a href="http://photojournal.danielpietzsch.com/"&gt;my photo journal&lt;/a&gt;, I wasn&amp;rsquo;t sure how to mark up the piece of HTML that makes up a photo element. And re-reading the spec now, I am &lt;em&gt;still&lt;/em&gt; not quite sure.&lt;/p&gt;

&lt;p&gt;The site features monthly entries with all the selected photos from that month. Each photo element on a page contains the image itself, plus an optional caption. So I thought it makes sense to group them inside a parent tag (for grouping and styling reasons, as well as semantically). And kind of knowing about the &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; element, it seemed obvious at first to use exactly that, together with &lt;code&gt;&amp;lt;figcaption&amp;gt;&lt;/code&gt;. Like so:&lt;/p&gt;

&lt;pre&gt;&lt;code class="html"&gt;&amp;lt;figure&amp;gt;
  &amp;lt;img src="photo.jpg"&amp;gt;
  &amp;lt;figcaption&amp;gt;My Caption&amp;lt;/figcaption&amp;gt;
&amp;lt;/figure&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But after some research, I decided against this. The page currently marks them up using a less semantic &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; with a &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; for the caption:&lt;/p&gt;

&lt;pre&gt;&lt;code class="html"&gt;&amp;lt;div class="photo"&amp;gt;
  &amp;lt;img src="photo.jpg"&amp;gt;
  &amp;lt;p class="caption"&amp;gt;My Caption&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And the reasons are the following excerpts from &lt;a href="https://www.w3.org/TR/html52/grouping-content.html#the-figure-element"&gt;the official spec on the &amp;ldquo;figure&amp;rdquo; element&lt;/a&gt; (emphasis mine):&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The figure element represents some flow content, optionally with a caption, &lt;strong&gt;that is self-contained&lt;/strong&gt; (like a complete sentence) &lt;strong&gt;and is typically referenced as a single unit from the main flow of the document&lt;/strong&gt;.&lt;/p&gt;
  
  &lt;p&gt;[&amp;hellip;]&lt;/p&gt;
  
  &lt;p&gt;A figure element’s contents are part of the surrounding flow. &lt;strong&gt;If the purpose of the page is to display the figure, for example a photograph on an image sharing site, the figure and figcaption elements can be used to explicitly provide a caption for that figure&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As far as my site is concerned, the photos &lt;em&gt;themselves&lt;/em&gt; are the main content or flow. I&amp;rsquo;m not illustrating an article. I&amp;rsquo;m not &lt;em&gt;referencing&lt;/em&gt; images. The &lt;em&gt;images&lt;/em&gt; are the article.&lt;/p&gt;

&lt;p&gt;And the second quote even speaks specifically of &amp;ldquo;an image sharing site&amp;rdquo; – which my photo journal is. But that reads as if the spec speaks about a web page that hosts &lt;em&gt;a single&lt;/em&gt; figure – i.e. one that can be &lt;em&gt;referenced&lt;/em&gt; from somewhere else.&lt;/p&gt;

&lt;p&gt;And that&amp;rsquo;s why I think &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; is not the appropriate HTML tag for my use case.&lt;/p&gt;

&lt;p&gt;Am I interpreting this incorrectly? Is this nitpicky nonsense? I don&amp;rsquo;t know. But for now, I decided against &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt;.&lt;/p&gt;</description><link>https://blog.danielpietzsch.com/post/184504856693</link><guid>https://blog.danielpietzsch.com/post/184504856693</guid><pubDate>Sun, 28 Apr 2019 17:11:16 +0200</pubDate><category>365writings</category><category>writings</category><category>software development</category><category>html</category></item><item><title>German keyboard layout and programming</title><description>&lt;p&gt;I’m more and more getting used to a German keyboard layout again. But muscle memory really takes a while to re-adjust after around eight years on an English layout. And I remain sceptical I can ever be as efficient on a German layout when programming. There are just too many common characters “hidden” behind a “shift”-, “option”- or even “shift-option”-shortcut. Symbols like semicolon, brackets, curly braces or backticks are all more cumbersome to type on a German keyboard. And on the Mac terminal I no longer like to set the “Use Option as Meta key”-option – like I used to, to get word-deletion and -skipping – because the pipe (”|”) character is “option-7″ and a backslash is fuckin’ “shift-option-7″. And neither works when that option takes over “option”.&lt;/p&gt;&lt;p&gt;The upside is, I can type German umlauts again easily. Hüürääy!&lt;/p&gt;</description><link>https://blog.danielpietzsch.com/post/184398054418</link><guid>https://blog.danielpietzsch.com/post/184398054418</guid><pubDate>Tue, 23 Apr 2019 23:55:38 +0200</pubDate><category>365writings</category><category>writings</category><category>software development</category></item><item><title>Automatic dark mode for focal length equivalents</title><description>&lt;p&gt;&lt;a href="http://utilities.danielpietzsch.com/fl/"&gt;My little Focal Length Equivalents tool&lt;/a&gt; now features “automatic dark mode” on supporting operating systems and browsers. Meaning, when you have your operating system set to prefer a “dark” styling – like macOS Mojave offers for example – and you are using a &lt;a href="https://caniuse.com/#feat=prefers-color-scheme"&gt;compatible browser&lt;/a&gt;, the page will show with a dark background and bright text. If your operating system is set to something else, it will show the default white background and black text.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blog.danielpietzsch.com/post/183572983263/dark-mode-based-on-os-preference"&gt;Unlike for my blog&lt;/a&gt;, this solution uses CSS only. I simply put the required media query at the end of the CSS file(s) and by doing so, overwriting existing default colours with the ones used for dark mode.&lt;/p&gt;

&lt;pre&gt;&lt;code class="css"&gt;/* AT THE END OF THE CSS FILE. DEFAULT STYLING ABOVE THIS MEDIA QUERY */
@media (prefers-color-scheme: dark) {
  body {
    color: #DDD;
    background-color: #222;
  }

  a { color: #88F; }
  a:visited { color: #AAF; }

  body &amp;gt; footer {
    border-top-color: white;
  }
  /* ETC ETC */
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Overwriting the colours like this could become unmaintainable in a more complex setup, but for this little page, this works just fine.&lt;/p&gt;</description><link>https://blog.danielpietzsch.com/post/183732341578</link><guid>https://blog.danielpietzsch.com/post/183732341578</guid><pubDate>Tue, 26 Mar 2019 23:57:21 +0100</pubDate><category>writings</category><category>365writings</category><category>software development</category><category>css</category></item><item><title>Dark Mode based on OS preference</title><description>&lt;p&gt;&lt;a href="http://blog.danielpietzsch.com/post/151876850458/dark-mode"&gt;This blog has had a dark mode for a while now&lt;/a&gt;. Toggling it on and off could be done manually, and the selected preference would be stored in your browser for the next time you return.&lt;/p&gt;

&lt;p&gt;I’ve now extended the script that handles the switching to respect your operating system’s preference for dark mode. This uses &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia"&gt;&lt;code&gt;matchMedia&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/addListener"&gt;&lt;code&gt;MediaQueryList.addListener&lt;/code&gt;&lt;/a&gt; to do so. &lt;a href="https://static.tumblr.com/ffyaisg/0C5pomvfb/stylesheetswitcher.js"&gt;Take a look at the whole script&lt;/a&gt;, if you like.&lt;/p&gt;

&lt;p&gt;I don&amp;rsquo;t know, if any other operating systems other than macOS Mojave have a &amp;ldquo;Dark Mode&amp;rdquo; preference. But, if you happen to run Mojave and use the Safari 12.1 Beta or Technology Preview, you can try this out yourself. But here&amp;rsquo;s a little GIF of what it looks like:&lt;/p&gt;

&lt;p&gt;&lt;img src="https://64.media.tumblr.com/07c6cd6571a2def610c633b5c7206063/tumblr_inline_pomxj5ZGd71qzm9x2_540.gif" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;The whole usability around this feature is not ideal currently. For example, I should probably have a 3-way switch – On, Off, Auto – instead of a simple checkbox toggle. And I should make an &amp;ldquo;Auto&amp;rdquo; setting work without JavaScript. But I didn&amp;rsquo;t have the time for this tonight, and so this will be a little project for another time.&lt;/p&gt;</description><link>https://blog.danielpietzsch.com/post/183572983263</link><guid>https://blog.danielpietzsch.com/post/183572983263</guid><pubDate>Tue, 19 Mar 2019 23:45:21 +0100</pubDate><category>writings</category><category>365writings</category><category>software development</category><category>javascript</category><category>css</category></item><item><title>next can return a value</title><description>&lt;aside&gt;How about a random Ruby tip? Don&amp;rsquo;t know if there will be any more of those. But I felt like writing this down right now.&lt;/aside&gt;&lt;p&gt;Iterating through an array, I found myself wanting to &lt;code&gt;collect&lt;/code&gt; an element &lt;em&gt;as-is&lt;/em&gt; most times, and only in certain conditions modify the original element and &lt;code&gt;collect&lt;/code&gt; the modification instead. So, I used &lt;code&gt;next&lt;/code&gt; &lt;em&gt;with a parameter&lt;/em&gt; to skip an element quickly and move on to the next one. And that &lt;em&gt;parameter&lt;/em&gt; will be returned and still be &lt;code&gt;collect&lt;/code&gt;ed.&lt;/p&gt;

&lt;p&gt;Much simplified example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[1,2,3,4,5,6].collect do |n|
  next n if n%2 == 1
  n*n
end  
#=&amp;gt; [1, 4, 3, 16, 5, 36]
&lt;/code&gt;&lt;/pre&gt;</description><link>https://blog.danielpietzsch.com/post/183390215323</link><guid>https://blog.danielpietzsch.com/post/183390215323</guid><pubDate>Mon, 11 Mar 2019 23:56:37 +0100</pubDate><category>365writings</category><category>software development</category><category>ruby</category></item><item><title>&lt;noscript&gt; in &lt;head&gt;</title><description>&lt;p&gt;If you didn&amp;rsquo;t know, &lt;a href="https://validator.w3.org"&gt;it&amp;rsquo;s perfectly valid&lt;/a&gt; to use the &lt;code&gt;&amp;lt;noscript&amp;gt;&lt;/code&gt; tag inside the &amp;ldquo; element of a HTML page. And &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript"&gt;you&amp;rsquo;re allowed to include &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; tags as its children&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I use this for &lt;a href="https://fl.danielpietzsch.com/"&gt;my little focal length equivalent utility&lt;/a&gt;, by loading an additional stylesheet via a &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt; tag: when a visitor has JavaScript disabled, it loads the style for &lt;a href="http://blog.danielpietzsch.com/post/182254338583/horizontally-scrolling-table-with-fixed-headings"&gt;the alternative &lt;code&gt;&amp;lt;table&amp;gt;&lt;/code&gt;&lt;/a&gt; that&amp;rsquo;s also wrapped in a &lt;code&gt;&amp;lt;noscript&amp;gt;&lt;/code&gt; element.&lt;/p&gt;</description><link>https://blog.danielpietzsch.com/post/183073736328</link><guid>https://blog.danielpietzsch.com/post/183073736328</guid><pubDate>Tue, 26 Feb 2019 17:55:11 +0100</pubDate><category>writings</category><category>365writings</category><category>css</category><category>html</category><category>software development</category></item></channel></rss>
