dadjoke.day

by Jesse Johnson

HTML

<link itemprop="url" href="https://dadjoke.day/" />
<meta itemprop="name" content="Dad Joke a Day · dadjoke.day" />
<meta itemprop="description" content="A new dad joke every day. One per day, picked just for you. Quietly elegant. Wholly unnecessary." />
<main class="stage" itemprop="mainContentOfPage">
  <div class="joke-wrap">
    <article itemscope itemtype="https://schema.org/Joke" itemprop="mainEntity">
      <meta itemprop="datePublished" content="2026-05-29" />
      <meta itemprop="text" content="What&#39;s a programmer&#39;s favorite hangout? The Foo Bar."/>
      <p class="joke" id="joke" data-tz="America/Los_Angeles" aria-live="polite">
        <span class="setup" id="setup">What&#39;s a programmer&#39;s favorite hangout?</span>
        <span class="punch" id="punch"> The Foo Bar.</span>
      </p>
    </article>
  </div>
  <footer class="footer">
    <span class="rule" aria-hidden="true"></span>
    <time class="date" id="date" itemprop="dateModified" datetime="2026-05-29">Friday, May 29, 2026 · PDT</time>
    <span class="rule" aria-hidden="true"></span>
  </footer>
</main>
<div itemscope itemtype="https://schema.org/WebSite" itemprop="isPartOf" hidden>
  <meta itemprop="name" content="dadjoke.day" />
  <link itemprop="url" href="https://dadjoke.day/" />
</div>

CSS

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --bg: #f4f4f4;
  --ink: #2c2c2c;
  --muted: #757575;
  --rule: rgba(44, 44, 44, 0.12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #2b303b;
    --ink: #fff;
    --muted: #929aac;
    --rule: rgba(255, 255, 255, 0.14);
  }
}
html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern', 'liga', 'calt', 'onum';
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@media (prefers-color-scheme: dark) {
  body::before {
    mix-blend-mode: screen;
    opacity: 0.4;
  }
}
.stage {
  position: relative;
  z-index: 1;
  height: 100dvh;
  width: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: clamp(1.25rem, 5vw, 3.5rem) clamp(1.25rem, 6vw, 5rem);
}
.joke-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}
.joke {
  max-width: min(22ch, 92vw);
  width: 100%;
  text-align: center;
  font-weight: 380;
  font-variation-settings:
    'opsz' 144,
    'SOFT' 50;
  line-height: 1.15;
  letter-spacing: -0.018em;
  color: var(--ink);
  text-wrap: balance;
  hyphens: manual;
  font-size: clamp(1.5rem, min(6vw, 8.5vh),...

JavaScript

(function () {
  'use strict';
  var jokeEl = document.getElementById('joke');
  var serverTz = jokeEl ? jokeEl.getAttribute('data-tz') : '';
  try {
    var localTz = Intl.DateTimeFormat().resolvedOptions().timeZone;
    if (localTz && localTz !== serverTz) {
      var c = '; path=/; max-age=31536000; samesite=lax';
      if (location.protocol === 'https:') c += '; secure';
      document.cookie = 'tz=' + encodeURIComponent(localTz) + c;
      location.replace(location.pathname + (location.hash || ''));
      return;
    }
  } catch (e) {}
  var loadedDay = new Date().toDateString();
  document.addEventListener('visibilitychange', function () {
    if (
      document.visibilityState === 'visible' &&
      new Date().toDateString() !== loadedDay
    ) {
      location.reload();
    }
  });
})();