<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude"
     ipr="trust200902"
     docName="draft-hackett-ures-00"
     category="std"
     submissionType="IETF"
     consensus="true"
     tocInclude="true"
     sortRefs="true"
     symRefs="true"
     version="3">

  <front>
    <title abbrev="URES">Unified Rendering of Email Standard (URES)</title>
    <seriesInfo name="Internet-Draft" value="draft-hackett-ures-00"/>

    <author initials="W." surname="Hackett" fullname="Will Hackett">
      <organization/>
      <address>
        <postal>
          <city>London</city>
          <country>United Kingdom</country>
        </postal>
        <email>will@willhackett.uk</email>
        <uri>https://willhackett.uk</uri>
      </address>
    </author>

    <date year="2026" month="January"/>

    <area>Applications</area>
    <workgroup>Independent Submission</workgroup>

    <keyword>email</keyword>
    <keyword>HTML</keyword>
    <keyword>CSS</keyword>
    <keyword>rendering</keyword>
    <keyword>MUA</keyword>

    <abstract>
      <t>This document specifies requirements for the uniform rendering of
      HTML email content across mail user agents (MUAs). It addresses
      critical inconsistencies in how email clients interpret HTML and
      CSS, including dark mode adaptation, embedded asset handling,
      positioning constraints, and secure SVG rendering. The specification
      aims to eliminate the current fragmentation in email rendering while
      maintaining backwards compatibility with existing MIME standards
      (RFCs 2045-2049) and the Internet Message Format (RFC 5322).</t>
    </abstract>
  </front>

  <middle>
    <section anchor="introduction">
      <name>Introduction</name>

      <section anchor="background">
        <name>Background</name>
        <t>Email remains one of the most critical communication channels for
        both personal and business communications. Despite decades of
        development, the rendering of HTML email content remains
        frustratingly inconsistent across mail user agents (MUAs).</t>

        <t>The current standards landscape is fragmented:</t>
        <ul>
          <li>RFC 5322 <xref target="RFC5322"/> defines the Internet Message Format, specifying
          header fields and basic body structure.</li>
          <li>RFCs 2045-2049 <xref target="RFC2045"/> define MIME, enabling multi-part messages
          with various content types including text/html.</li>
          <li>The W3C maintains HTML and CSS specifications, but these are
          designed for web browsers, not email clients.</li>
          <li>No RFC or standard body governs how email clients SHOULD or MUST
          render HTML and CSS content.</li>
        </ul>

        <t>This gap has resulted in a situation where email developers must
        maintain extensive compatibility matrices, use archaic techniques
        such as table-based layouts, and accept that their carefully crafted
        emails will appear differently—or broken—across different clients.</t>
      </section>

      <section anchor="problem-statement">
        <name>Problem Statement</name>
        <t>The following critical issues plague current email rendering:</t>
        <ol>
          <li><strong>CSS Support Inconsistency:</strong> Properties universally supported in
          browsers (flexbox, grid, CSS variables) have zero or partial
          support in major email clients. Gmail strips style tags in
          non-AMP contexts. Outlook uses Microsoft Word's rendering engine.</li>
          <li><strong>Dark Mode Chaos:</strong> Email clients implement dark mode adaptation
          differently. Some invert all colours, some honour author
          preferences, some do nothing. Text becomes illegible when
          foreground colours are inverted but backgrounds are not.</li>
          <li><strong>Image Handling:</strong> Base64 inline images are blocked by many clients
          citing size concerns. CID attachments render inconsistently.
          Remote images enable tracking and are blocked by default.</li>
          <li><strong>SVG Non-Support:</strong> Most email clients strip or fail to render SVG
          entirely, despite it being a W3C standard since 2001. Executives
          receive emails with missing logos and charts.</li>
          <li><strong>Positioning Attacks:</strong> In web-based clients (Gmail, Outlook.com),
          malicious use of position:fixed or high z-index values could
          overlay phishing content atop the webmail UI.</li>
          <li><strong>Layout Primitives:</strong> Modern CSS layout (flexbox, grid) is
          unsupported in Outlook desktop, forcing continued use of nested
          HTML tables—a technique deprecated in web development since 2010.</li>
          <li><strong>Font Rendering:</strong> @font-face and web fonts work in approximately
          40% of email clients, with no fallback standardisation.</li>
          <li><strong>Media Queries:</strong> Support for responsive design via @media queries
          is inconsistent, with Gmail notably stripping them entirely.</li>
        </ol>
      </section>

      <section anchor="requirements-language">
        <name>Requirements Language</name>
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
        "OPTIONAL" in this document are to be interpreted as described in
        BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all
        capitals, as shown here.</t>
      </section>
    </section>

    <section anchor="terminology">
      <name>Terminology</name>
      <dl>
        <dt>Mail User Agent (MUA)</dt>
        <dd>An application that accesses email on behalf of a user. This
        includes desktop applications (Apple Mail, Outlook, Thunderbird),
        web-based clients (Gmail, Outlook.com, Yahoo Mail), and mobile
        applications (iOS Mail, Gmail app).</dd>

        <dt>Rendering Engine</dt>
        <dd>The component of an MUA responsible for interpreting and
        displaying HTML/CSS content. Some MUAs use web browser engines
        (WebKit, Blink), others use proprietary engines (Microsoft Word
        in Outlook desktop).</dd>

        <dt>Dark Mode</dt>
        <dd>A display preference where the UI uses a dark background with
        light text. Email clients may automatically adapt email content
        to match this preference.</dd>

        <dt>Colour Scheme</dt>
        <dd>The light or dark preference indicated by the email author or
        inferred by the email client.</dd>

        <dt>Inline Image</dt>
        <dd>An image embedded directly in the HTML using a data: URI with
        base64 encoding, or referenced via Content-ID (CID).</dd>

        <dt>Executive-Safe</dt>
        <dd>Content that renders correctly in email clients commonly used by
        business executives, particularly Outlook desktop, Apple Mail,
        and Gmail.</dd>

        <dt>Stacking Context</dt>
        <dd>A three-dimensional conceptualisation of HTML elements along an
        imaginary z-axis relative to the user. Elements with z-index
        values form stacking contexts.</dd>

        <dt>Content Isolation</dt>
        <dd>The practice of preventing email content from affecting or
        overlaying the host application's user interface.</dd>
      </dl>
    </section>

    <section anchor="document-structure">
      <name>Document Structure Requirements</name>

      <section anchor="html-version">
        <name>HTML Version</name>
        <t>Conforming MUAs MUST support HTML5 document structure as defined in
        <xref target="HTML5"/>. The following DOCTYPE declaration MUST be recognised:</t>
        <sourcecode type="html">&lt;!DOCTYPE html&gt;</sourcecode>
        <t>MUAs MUST also accept and render documents using XHTML and HTML4
        doctypes for backwards compatibility. However, email authors SHOULD
        use HTML5.</t>
        <t>MUAs MUST NOT require an XML declaration for HTML email content.</t>
      </section>

      <section anchor="required-structure">
        <name>Required Document Structure</name>
        <t>MUAs MUST correctly parse and render the following minimal document
        structure:</t>
        <sourcecode type="html"><![CDATA[<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <meta name="color-scheme" content="light dark">
  <meta name="supported-color-schemes" content="light dark">
  <title>Email Subject</title>
  <!--[if mso]>
  <noscript>
    <xml>
      <o:OfficeDocumentSettings>
        <o:PixelsPerInch>96</o:PixelsPerInch>
      </o:OfficeDocumentSettings>
    </xml>
  </noscript>
  <![endif]-->
  <style>
    /* Author styles */
  </style>
</head>
<body>
  <!-- Content -->
</body>
</html>]]></sourcecode>
        <t>MUAs MUST preserve the html element's lang attribute and make it
        available to accessibility tools.</t>
        <t>MUAs MUST parse and apply the viewport meta tag for responsive
        rendering on mobile devices.</t>
        <t>MUAs supporting Microsoft Office conditional comments SHOULD
        interpret &lt;!--[if mso]&gt; blocks appropriately.</t>
      </section>

      <section anchor="style-placement">
        <name>Style Placement</name>
        <t>MUAs MUST support CSS styles in ALL of the following locations:</t>
        <ol>
          <li>Inline styles via the style attribute on any HTML element</li>
          <li>Embedded styles via style elements in the head</li>
          <li>Embedded styles via style elements in the body</li>
        </ol>
        <t>MUAs MUST NOT strip or ignore style elements based on their
        placement in the document.</t>
        <t>MUAs MUST process multiple style elements in document order,
        applying standard CSS cascade rules.</t>
        <t>MUAs SHOULD support link rel="stylesheet" elements referencing
        external stylesheets, subject to security controls defined in
        <xref target="security"/>.</t>
        <t>When an MUA chooses not to load external stylesheets for security
        reasons, it MUST still apply all inline and embedded styles.</t>
      </section>
    </section>

    <section anchor="css-support">
      <name>CSS Support Requirements</name>

      <section anchor="must-support-properties">
        <name>MUST Support Properties</name>
        <t>Conforming MUAs MUST support the following CSS properties with full
        specification compliance:</t>

        <section anchor="box-model-properties">
          <name>Box Model Properties</name>
          <t>margin, margin-top, margin-right, margin-bottom, margin-left,
          padding, padding-top, padding-right, padding-bottom, padding-left,
          border, border-width, border-style, border-color,
          border-top, border-right, border-bottom, border-left,
          border-radius, border-top-left-radius, border-top-right-radius,
          border-bottom-left-radius, border-bottom-right-radius,
          width, min-width, max-width,
          height, min-height, max-height,
          box-sizing</t>
        </section>

        <section anchor="typography-properties">
          <name>Typography Properties</name>
          <t>font-family, font-size, font-weight, font-style, line-height,
          text-align, text-decoration, text-decoration-line, text-decoration-color,
          text-decoration-style, text-transform, letter-spacing, word-spacing,
          white-space, vertical-align</t>
        </section>

        <section anchor="colour-background-properties">
          <name>Colour and Background Properties</name>
          <t>color, background-color, background-image (for gradients and data: URIs),
          background-position, background-repeat, background-size,
          background (shorthand), opacity</t>
        </section>

        <section anchor="layout-properties">
          <name>Layout Properties</name>
          <t>display (block, inline, inline-block, none, table,
          table-row, table-cell, flex, inline-flex),
          position (static, relative), float, clear,
          overflow, overflow-x, overflow-y</t>
        </section>

        <section anchor="css-selectors">
          <name>CSS Selectors</name>
          <t>MUAs MUST support the following CSS selectors:</t>
          <t>Type selectors (p, div, table), Class selectors (.classname),
          ID selectors (#idname), Descendant combinator (div p),
          Child combinator (div > p), Adjacent sibling combinator (h1 + p),
          Attribute selectors ([attr], [attr=value], [attr~=value],
          [attr|=value], [attr^=value], [attr$=value], [attr*=value]),
          Pseudo-classes (:first-child, :last-child, :nth-child(),
          :hover, :active, :focus, :visited, :link),
          Pseudo-elements (::before, ::after, ::first-line, ::first-letter)</t>
        </section>
      </section>

      <section anchor="positioning-constraints">
        <name>Positioning Constraints</name>
        <t>For security reasons detailed in <xref target="positioning-attack-prevention"/>, MUAs MUST constrain
        the position property as follows:</t>

        <section anchor="permitted-values">
          <name>Permitted Values</name>
          <t>MUAs MUST support:</t>
          <ul>
            <li>position: static (default, normal flow)</li>
            <li>position: relative (offset from normal position)</li>
          </ul>
        </section>

        <section anchor="prohibited-values">
          <name>Prohibited Values in Web Clients</name>
          <t>Web-based MUAs (those running within a web browser context) MUST
          treat the following values as position: static:</t>
          <ul>
            <li>position: fixed</li>
            <li>position: absolute</li>
            <li>position: sticky</li>
          </ul>
          <t>When an email contains these prohibited position values, the MUA
          MUST either:</t>
          <ol type="a">
            <li>Render the element as position: static, OR</li>
            <li>Render the element as position: relative with top, left, right,
            and bottom values clamped to values that cannot cause the
            element to escape its container.</li>
          </ol>
        </section>
      </section>

      <section anchor="z-index-handling">
        <name>z-index Handling</name>
        <t>The z-index property controls stacking order within a stacking
        context. MUAs MUST implement z-index handling that prevents
        malicious overlay attacks.</t>

        <section anchor="stacking-context-isolation">
          <name>Stacking Context Isolation</name>
          <t>MUAs MUST create a new stacking context for email content that is
          isolated from the host application. This means:</t>
          <ul>
            <li>z-index values within email content MUST NOT affect elements
            outside the email content container.</li>
            <li>The email content container MUST have a z-index lower than any
            application UI that could be targeted for spoofing.</li>
          </ul>
        </section>

        <section anchor="maximum-z-index">
          <name>Maximum z-index</name>
          <t>MUAs SHOULD normalise z-index values within email content. If an
          email specifies z-index: 2147483647 (the maximum 32-bit signed
          integer), this MUST still be rendered below application UI.</t>
          <t>Implementation approaches:</t>
          <ol type="a">
            <li>Contain email content in an iframe with srcdoc</li>
            <li>Apply CSS containment (contain: strict)</li>
            <li>Clamp z-index values to a maximum safe value</li>
            <li>Render email in a separate compositing layer</li>
          </ol>
        </section>
      </section>

      <section anchor="flexbox">
        <name>Flexbox</name>
        <t>MUAs MUST support CSS Flexible Box Layout <xref target="CSS-FLEXBOX-1"/> including:</t>
        <t>display: flex, display: inline-flex, flex-direction, flex-wrap,
        flex-flow, justify-content, align-items, align-content, order,
        flex-grow, flex-shrink, flex-basis, flex, align-self</t>
      </section>

      <section anchor="css-grid">
        <name>CSS Grid (SHOULD Support)</name>
        <t>MUAs SHOULD support CSS Grid Layout <xref target="CSS-GRID-1"/>. Where supported,
        MUAs MUST implement:</t>
        <t>display: grid, display: inline-grid, grid-template-columns,
        grid-template-rows, grid-template-areas, grid-gap, gap, row-gap,
        column-gap, grid-column, grid-row, grid-area</t>
      </section>
    </section>

    <section anchor="dark-mode">
      <name>Dark Mode Adaptation</name>
      <t>Dark mode support is critical for email legibility. This section
      defines requirements for consistent dark mode behaviour.</t>

      <section anchor="colour-scheme-meta">
        <name>Colour Scheme Meta Tag</name>
        <t>MUAs MUST recognise and honour the color-scheme meta tag:</t>
        <sourcecode type="html">&lt;meta name="color-scheme" content="light dark"&gt;</sourcecode>
        <t>Valid values:</t>
        <ul>
          <li>"light" - Email is designed for light mode only</li>
          <li>"dark" - Email is designed for dark mode only</li>
          <li>"light dark" - Email supports both modes</li>
          <li>"only light" - Email MUST NOT be adapted for dark mode</li>
          <li>"only dark" - Email MUST NOT be adapted for light mode</li>
        </ul>
        <t>When color-scheme is set to "only light", MUAs MUST NOT invert,
        adjust, or otherwise modify the colours specified by the email
        author, even when the MUA or operating system is in dark mode.</t>
      </section>

      <section anchor="media-query-support">
        <name>Media Query Support</name>
        <t>MUAs MUST support the prefers-color-scheme media query:</t>
        <sourcecode type="css"><![CDATA[@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a1a;
    color: #ffffff;
  }
}

@media (prefers-color-scheme: light) {
  body {
    background-color: #ffffff;
    color: #1a1a1a;
  }
}]]></sourcecode>
        <t>When the user has selected dark mode in their MUA or operating
        system, prefers-color-scheme: dark MUST match.</t>
        <t>MUAs MUST NOT strip or ignore @media rules, including @media
        (prefers-color-scheme: ...) rules.</t>
      </section>

      <section anchor="colour-inversion-rules">
        <name>Colour Inversion Rules</name>
        <t>When an MUA applies automatic dark mode adaptation to an email that
        has not opted out, the following rules MUST be followed:</t>

        <section anchor="inversion-pairing">
          <name>Inversion Pairing</name>
          <t>MUAs MUST NOT invert foreground colours without also inverting the
          corresponding background colour. Specifically:</t>
          <ul>
            <li>If text colour is inverted from dark to light, the background
            behind that text MUST also be inverted from light to dark.</li>
            <li>If a background is inverted, all foreground elements (text,
            borders) on that background MUST be correspondingly adjusted.</li>
          </ul>
        </section>

        <section anchor="contrast-preservation">
          <name>Contrast Preservation</name>
          <t>When inverting colours, MUAs MUST maintain a minimum contrast ratio
          of 4.5:1 for normal text and 3:1 for large text, as defined in
          WCAG 2.1 <xref target="WCAG21"/>.</t>
        </section>
      </section>
    </section>

    <section anchor="image-handling">
      <name>Image and Asset Handling</name>

      <section anchor="inline-base64-images">
        <name>Inline Base64 Images</name>
        <t>Inline images using data: URIs provide a tracking-free method for
        including images directly in email content. MUAs MUST support this
        mechanism.</t>

        <section anchor="base64-syntax">
          <name>Syntax</name>
          <sourcecode type="html"><![CDATA[<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot">]]></sourcecode>
        </section>

        <section anchor="required-support">
          <name>Required Support</name>
          <t>MUAs MUST render inline base64 images for the following MIME types:</t>
          <ul>
            <li>image/png</li>
            <li>image/jpeg (including image/jpg as an alias)</li>
            <li>image/gif</li>
            <li>image/webp</li>
            <li>image/svg+xml (subject to security restrictions in <xref target="svg-rendering"/>)</li>
          </ul>
        </section>

        <section anchor="size-limits">
          <name>Size Limits</name>
          <t>MUAs MUST support inline images with encoded sizes of at least:</t>
          <ul>
            <li>Individual image: 1 MB (after base64 encoding)</li>
            <li>Total per email: 10 MB (cumulative across all inline images)</li>
          </ul>
          <t>MUAs MAY support larger sizes but MUST NOT fail to render images
          below these thresholds.</t>
        </section>

        <section anchor="rendering-behaviour">
          <name>Rendering Behaviour</name>
          <t>MUAs MUST render inline base64 images:</t>
          <ul>
            <li>Without requiring user interaction to "load images"</li>
            <li>Without displaying tracking/privacy warnings for these images</li>
            <li>Immediately upon email open (no lazy-load deferral)</li>
          </ul>
          <t>This behaviour is REQUIRED because inline images:</t>
          <ul>
            <li>Cannot be used for tracking (no external request is made)</li>
            <li>Are already fully downloaded as part of the email content</li>
            <li>Provide a privacy-preserving alternative to remote images</li>
          </ul>
        </section>
      </section>

      <section anchor="cid-images">
        <name>CID (Content-ID) Images</name>
        <t>Content-ID references allow images attached to the email to be
        displayed inline. MUAs MUST support this mechanism as defined in
        RFC 2392 <xref target="RFC2392"/>.</t>

        <section anchor="cid-syntax">
          <name>Syntax</name>
          <t>In the HTML body:</t>
          <sourcecode type="html">&lt;img src="cid:image001@example.com" alt="Inline image"&gt;</sourcecode>
        </section>

        <section anchor="cid-required-behaviour">
          <name>Required Behaviour</name>
          <t>MUAs MUST:</t>
          <ul>
            <li>Resolve cid: URLs to the corresponding MIME part</li>
            <li>Render the image inline at the point of reference</li>
            <li>Support CID references in both img elements and CSS
            background-image properties</li>
            <li>Render CID images without requiring "load images" interaction</li>
          </ul>
        </section>
      </section>
    </section>

    <section anchor="svg-rendering">
      <name>SVG Rendering</name>
      <t>Scalable Vector Graphics provide resolution-independent images
      essential for logos, icons, charts and diagrams. This section
      defines an "Executive-Safe" SVG profile that balances functionality
      with security.</t>

      <section anchor="executive-safe-svg">
        <name>Executive-Safe SVG Profile</name>
        <t>The Executive-Safe SVG Profile defines a restricted subset of SVG
        that MUST be supported by conforming MUAs. This profile is named
        to emphasise that SVG content—particularly logos and charts—must
        render correctly in email clients commonly used by business
        executives.</t>
        <t>The Executive-Safe profile includes:</t>
        <ul>
          <li>All SVG 1.1 shape elements</li>
          <li>Text elements</li>
          <li>Gradients and patterns</li>
          <li>Basic filters (subset)</li>
          <li>Symbols and use references (internal only)</li>
          <li>Styling via presentation attributes and internal stylesheets</li>
        </ul>
        <t>The Executive-Safe profile excludes:</t>
        <ul>
          <li>Script elements and event handlers</li>
          <li>External references</li>
          <li>Animation elements (use CSS animation instead)</li>
          <li>ForeignObject element</li>
          <li>Certain filter primitives</li>
        </ul>
      </section>

      <section anchor="prohibited-svg-elements">
        <name>Prohibited SVG Elements</name>
        <t>MUAs MUST strip or neutralise the following SVG elements:</t>

        <section anchor="script-and-event-handlers">
          <name>Script and Event Handlers</name>
          <t>The script element and any element with on* attributes (onclick,
          onload, onerror, etc.) MUST be stripped.</t>
        </section>

        <section anchor="external-references">
          <name>External References</name>
          <t>The following MUST NOT be resolved:</t>
          <ul>
            <li>use href="external.svg#symbol"</li>
            <li>image href="external.png"</li>
            <li>a href="javascript:..."</li>
            <li>feImage xlink:href="external.svg"</li>
          </ul>
          <t>Note: Internal references within the same SVG document ARE permitted:</t>
          <sourcecode type="html">&lt;use href="#internal-symbol"&gt;   &lt;!-- OK --&gt;</sourcecode>
        </section>
      </section>
    </section>

    <section anchor="security">
      <name>Security Considerations</name>
      <t>Email is a primary vector for phishing, malware distribution and
      social engineering attacks. MUAs MUST implement robust security
      measures while rendering HTML content.</t>

      <section anchor="script-execution">
        <name>Script Execution</name>
        <t>MUAs MUST NOT execute JavaScript or any other scripting language
        in email content.</t>

        <section anchor="prohibited-elements">
          <name>Prohibited Elements</name>
          <t>The following elements MUST be stripped or rendered inert:</t>
          <ul>
            <li>script element</li>
            <li>noscript element (SHOULD be displayed)</li>
          </ul>
        </section>

        <section anchor="prohibited-attributes">
          <name>Prohibited Attributes</name>
          <t>The following attributes MUST be stripped from all elements:</t>
          <t>All on* event handlers: onclick, onload, onerror, onmouseover,
          onfocus, onblur, onsubmit, etc.</t>
        </section>

        <section anchor="javascript-urls">
          <name>JavaScript URLs</name>
          <t>The following URL schemes MUST NOT be executable:</t>
          <ul>
            <li>javascript:</li>
            <li>vbscript:</li>
            <li>data:text/html (when containing script)</li>
          </ul>
          <t>MUAs MUST either:</t>
          <ol type="a">
            <li>Strip href/src attributes containing these schemes, OR</li>
            <li>Replace them with safe values (e.g., href="#")</li>
          </ol>
        </section>
      </section>

      <section anchor="positioning-attack-prevention">
        <name>Positioning Attack Prevention</name>
        <t>In web-based MUAs, malicious use of CSS positioning could overlay
        deceptive content atop the webmail UI.</t>

        <section anchor="fixed-position-blocking">
          <name>Fixed Position Blocking</name>
          <t>MUAs MUST NOT render position: fixed as specified. Such elements:</t>
          <ul>
            <li>MUST be rendered as position: static or position: relative</li>
            <li>MUST remain within the email content area</li>
            <li>MUST NOT overlay any part of the MUA interface</li>
          </ul>
        </section>

        <section anchor="z-index-sandboxing">
          <name>z-index Sandboxing</name>
          <t>MUAs MUST ensure that email content z-index values cannot cause
          elements to render above the MUA interface.</t>
          <t>Implementation: Create a new stacking context for email content
          that is positioned below all MUA UI elements.</t>
        </section>
      </section>

      <section anchor="tracking-prevention">
        <name>Tracking Prevention</name>

        <section anchor="pixel-tracking">
          <name>Pixel Tracking</name>
          <t>Remote images are commonly used as tracking pixels. MUAs SHOULD:</t>
          <ul>
            <li>Block remote images by default</li>
            <li>Provide clear UI indication when images are blocked</li>
            <li>Allow users to load images per-email or per-sender</li>
          </ul>
        </section>

        <section anchor="inline-content-alternative">
          <name>Inline Content as Alternative</name>
          <t>The mandatory support for base64 inline images (<xref target="inline-base64-images"/>) and
          CID images (<xref target="cid-images"/>) provides senders with tracking-free
          alternatives for embedding images.</t>
        </section>
      </section>
    </section>

    <section anchor="accessibility">
      <name>Accessibility</name>
      <t>Email content MUST be accessible to users with disabilities.
      MUAs MUST NOT strip or alter HTML that supports accessibility.</t>

      <section anchor="semantic-html">
        <name>Semantic HTML</name>
        <t>MUAs MUST correctly interpret and render semantic HTML elements:</t>
        <t>header, footer, nav, main, article, section, aside,
        h1 through h6, p, ul, ol, li, dl, dt, dd,
        table, th, td (with scope attributes),
        figure, figcaption, blockquote, cite, strong, em</t>
        <t>MUAs MUST NOT flatten semantic structure (e.g., converting all
        elements to div or span).</t>
      </section>

      <section anchor="alternative-text">
        <name>Alternative Text</name>
        <t>MUAs MUST:</t>
        <ul>
          <li>Display alt attribute text when images are not loaded</li>
          <li>Expose alt text to assistive technologies</li>
          <li>Support role and aria-* attributes</li>
        </ul>
        <t>MUAs MUST NOT strip:</t>
        <t>alt, title, role, aria-label, aria-labelledby, aria-describedby,
        aria-hidden, aria-live, aria-atomic, aria-relevant</t>
      </section>

      <section anchor="colour-contrast">
        <name>Colour Contrast</name>
        <t>When MUAs apply automatic dark mode adaptation (<xref target="colour-inversion-rules"/>), the
        resulting colour combinations MUST maintain WCAG 2.1 AA contrast
        ratios:</t>
        <ul>
          <li>Normal text: 4.5:1</li>
          <li>Large text: 3:1</li>
          <li>UI components and graphics: 3:1</li>
        </ul>
      </section>
    </section>

    <section anchor="conformance-levels">
      <name>Conformance Levels</name>
      <t>To facilitate gradual adoption, this specification defines three
      conformance levels.</t>

      <section anchor="ures-level-1">
        <name>URES Level 1 (Baseline)</name>
        <t>An MUA conforming to URES Level 1 MUST:</t>
        <ul>
          <li>Support all properties in <xref target="must-support-properties"/></li>
          <li>Support inline base64 images (<xref target="inline-base64-images"/>)</li>
          <li>Support CID images (<xref target="cid-images"/>)</li>
          <li>Strip all JavaScript (<xref target="script-execution"/>)</li>
          <li>Implement positioning constraints (<xref target="positioning-constraints"/>)</li>
          <li>Support prefers-color-scheme media query (<xref target="media-query-support"/>)</li>
          <li>Preserve semantic HTML (<xref target="semantic-html"/>)</li>
        </ul>
      </section>

      <section anchor="ures-level-2">
        <name>URES Level 2 (Enhanced)</name>
        <t>An MUA conforming to URES Level 2 MUST:</t>
        <ul>
          <li>Meet all Level 1 requirements</li>
          <li>Support the Executive-Safe SVG Profile (<xref target="svg-rendering"/>)</li>
          <li>Support CSS Flexbox (<xref target="flexbox"/>)</li>
          <li>Implement dark mode adaptation rules (<xref target="colour-inversion-rules"/>)</li>
          <li>Support picture element</li>
          <li>Support CSS custom properties (variables)</li>
        </ul>
      </section>

      <section anchor="ures-level-3">
        <name>URES Level 3 (Full)</name>
        <t>An MUA conforming to URES Level 3 MUST:</t>
        <ul>
          <li>Meet all Level 2 requirements</li>
          <li>Support CSS Grid (<xref target="css-grid"/>)</li>
          <li>Support @font-face</li>
          <li>Support CSS animations (with user preference for reduced motion)</li>
          <li>Implement full CSP</li>
          <li>Provide tracking prevention (<xref target="tracking-prevention"/>)</li>
        </ul>
      </section>
    </section>

    <section anchor="adoption-considerations">
      <name>Adoption Considerations</name>
      <t>This section addresses practical considerations for adoption of this
      specification by email client vendors.</t>

      <section anchor="open-source-implementations">
        <name>Open Source Reference Implementations</name>
        <t>The authors recognise that some email client vendors have
        historically been reluctant to invest in standards-compliant
        rendering engines, preferring instead to repurpose existing
        technologies (such as word processing engines) that were never
        designed for standards-compliant HTML/CSS rendering.</t>
        <t>To address this, the community intends to develop and maintain
        open source reference implementations of URES-compliant rendering
        components. These implementations will be:</t>
        <ul>
          <li>Licensed under permissive terms (MIT, Apache 2.0, or similar)</li>
          <li>Designed for embedding in both native and web-based clients</li>
          <li>Maintained by the community with regular security updates</li>
          <li>Tested against the URES conformance test suite</li>
        </ul>
        <t>Vendors who have historically chosen not to invest in standards-
        compliant rendering may simply adopt these community-maintained
        implementations when ready, rather than continuing to maintain
        proprietary solutions that diverge from industry consensus.</t>
      </section>

      <section anchor="precedent-adoption">
        <name>Precedent for Community-Driven Adoption</name>
        <t>This approach mirrors successful adoption patterns across the
        software industry, where vendors have benefited from community-
        developed standards and implementations rather than maintaining
        proprietary alternatives:</t>
        <ul>
          <li>React (Meta): Now embedded across enterprise applications,
          including those from vendors who initially resisted component-
          based UI architectures.</li>
          <li>GraphQL (Meta): Adopted by major cloud platforms after community
          momentum demonstrated clear benefits over proprietary query
          languages.</li>
          <li>OpenTelemetry (CNCF): Observability standard now integrated
          across all major cloud providers, replacing fragmented
          proprietary instrumentation.</li>
          <li>Chromium (Google): The rendering engine now powers multiple
          browsers from vendors who previously maintained independent
          engines, including Microsoft Edge.</li>
          <li>VS Code / Monaco Editor (Microsoft): An acknowledgement that
          community-driven tooling often surpasses proprietary alternatives.</li>
        </ul>
        <t>Vendors currently maintaining non-compliant rendering engines face
        an ongoing maintenance burden for technology that provides no
        competitive advantage. The availability of URES-compliant open
        source alternatives offers a path to reduced maintenance costs
        while improving interoperability for their users.</t>
      </section>

      <section anchor="incremental-adoption">
        <name>Incremental Adoption Path</name>
        <t>Vendors need not adopt all conformance levels simultaneously.
        The three-tier conformance structure (<xref target="conformance-levels"/>) enables:</t>
        <ol>
          <li>Level 1 adoption with minimal investment, addressing the most
          critical rendering inconsistencies.</li>
          <li>Level 2 adoption as community implementations mature, adding
          modern layout and dark mode support.</li>
          <li>Level 3 adoption for full feature parity with web browsers,
          enabled by proven, stable open source components.</li>
        </ol>
        <t>This graduated approach ensures that even conservative vendors
        can adopt URES without significant risk, leveraging battle-tested
        implementations developed and maintained by the broader community.</t>
      </section>
    </section>

    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>This document registers a new media feature for the
      prefers-color-scheme-only media query:</t>
      <dl>
        <dt>Name:</dt><dd>prefers-color-scheme-only</dd>
        <dt>Values:</dt><dd>light | dark</dd>
        <dt>Applies to:</dt><dd>visual media</dd>
        <dt>Description:</dt><dd>Indicates that the email author has requested no
        automatic colour scheme adaptation.</dd>
      </dl>
      <t>This document requests registration of the following HTTP header
      for use in email content negotiation:</t>
      <dl>
        <dt>Header field name:</dt><dd>X-Email-Renderer-Level</dd>
        <dt>Applicable protocol:</dt><dd>HTTP (for web-based MUAs)</dd>
        <dt>Status:</dt><dd>Informational</dd>
        <dt>Author/Change controller:</dt><dd>IETF</dd>
        <dt>Specification document(s):</dt><dd>This document</dd>
        <dt>Values:</dt><dd>1 | 2 | 3</dd>
        <dt>Example:</dt><dd>X-Email-Renderer-Level: 2</dd>
      </dl>
    </section>
  </middle>

  <back>
    <references>
      <name>References</name>

      <references>
        <name>Normative References</name>

        <reference anchor="RFC2045" target="https://www.rfc-editor.org/info/rfc2045">
          <front>
            <title>Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</title>
            <author initials="N." surname="Freed" fullname="N. Freed"/>
            <author initials="N." surname="Borenstein" fullname="N. Borenstein"/>
            <date year="1996" month="November"/>
          </front>
          <seriesInfo name="RFC" value="2045"/>
        </reference>

        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author initials="S." surname="Bradner" fullname="S. Bradner"/>
            <date year="1997" month="March"/>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
        </reference>

        <reference anchor="RFC2392" target="https://www.rfc-editor.org/info/rfc2392">
          <front>
            <title>Content-ID and Message-ID Uniform Resource Locators</title>
            <author initials="E." surname="Levinson" fullname="E. Levinson"/>
            <date year="1998" month="August"/>
          </front>
          <seriesInfo name="RFC" value="2392"/>
        </reference>

        <reference anchor="RFC5322" target="https://www.rfc-editor.org/info/rfc5322">
          <front>
            <title>Internet Message Format</title>
            <author initials="P." surname="Resnick" fullname="P. Resnick" role="editor"/>
            <date year="2008" month="October"/>
          </front>
          <seriesInfo name="RFC" value="5322"/>
        </reference>

        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author initials="B." surname="Leiba" fullname="B. Leiba"/>
            <date year="2017" month="May"/>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
        </reference>

        <reference anchor="HTML5" target="https://html.spec.whatwg.org/">
          <front>
            <title>HTML Living Standard</title>
            <author><organization>WHATWG</organization></author>
            <date/>
          </front>
        </reference>

        <reference anchor="CSS-FLEXBOX-1" target="https://www.w3.org/TR/css-flexbox-1/">
          <front>
            <title>CSS Flexible Box Layout Module Level 1</title>
            <author initials="T." surname="Atkins Jr." fullname="Tab Atkins Jr."/>
            <author initials="E." surname="Etemad" fullname="Elika Etemad"/>
            <author initials="R." surname="Atanassov" fullname="Rossen Atanassov"/>
            <date year="2018" month="November"/>
          </front>
          <seriesInfo name="W3C" value="Candidate Recommendation"/>
        </reference>

        <reference anchor="CSS-GRID-1" target="https://www.w3.org/TR/css-grid-1/">
          <front>
            <title>CSS Grid Layout Module Level 1</title>
            <author initials="T." surname="Atkins Jr." fullname="Tab Atkins Jr."/>
            <author initials="E." surname="Etemad" fullname="Elika Etemad"/>
            <author initials="R." surname="Atanassov" fullname="Rossen Atanassov"/>
            <date year="2020" month="December"/>
          </front>
          <seriesInfo name="W3C" value="Candidate Recommendation"/>
        </reference>
      </references>

      <references>
        <name>Informative References</name>

        <reference anchor="WCAG21" target="https://www.w3.org/TR/WCAG21/">
          <front>
            <title>Web Content Accessibility Guidelines (WCAG) 2.1</title>
            <author><organization>W3C</organization></author>
            <date year="2018" month="June"/>
          </front>
          <seriesInfo name="W3C" value="Recommendation"/>
        </reference>

        <reference anchor="CANIEMAIL" target="https://www.caniemail.com/">
          <front>
            <title>Can I email... Support tables for HTML and CSS in emails</title>
            <author><organization>Community project</organization></author>
            <date/>
          </front>
        </reference>
      </references>
    </references>

    <section anchor="known-inconsistencies">
      <name>Known Client Inconsistencies</name>
      <t>This appendix documents specific inconsistencies in current email
      clients that this RFC aims to address. Data sourced from caniemail
      project <xref target="CANIEMAIL"/> and direct testing as of January 2026.</t>

      <section anchor="css-support-matrix">
        <name>CSS Support Matrix (Selected Properties)</name>
        <table>
          <thead>
            <tr>
              <th>Property</th>
              <th>Gmail</th>
              <th>O.com</th>
              <th>O.app</th>
              <th>Apple</th>
              <th>Yahoo</th>
              <th>T-bird</th>
            </tr>
          </thead>
          <tbody>
            <tr><td>style in head</td><td>Partial</td><td>Yes</td><td>Yes</td><td>Yes</td><td>Yes</td><td>Yes</td></tr>
            <tr><td>display: flex</td><td>Yes</td><td>Yes</td><td>No</td><td>Yes</td><td>Yes</td><td>Yes</td></tr>
            <tr><td>display: grid</td><td>Yes</td><td>Yes</td><td>No</td><td>Yes</td><td>Yes</td><td>Yes</td></tr>
            <tr><td>position: fixed</td><td>No</td><td>No</td><td>No</td><td>No</td><td>No</td><td>Yes</td></tr>
            <tr><td>position: absolute</td><td>No</td><td>No</td><td>Yes</td><td>Yes</td><td>No</td><td>Yes</td></tr>
            <tr><td>background-image</td><td>Yes</td><td>Yes</td><td>No</td><td>Yes</td><td>Yes</td><td>Yes</td></tr>
            <tr><td>border-radius</td><td>Yes</td><td>Yes</td><td>Partial</td><td>Yes</td><td>Yes</td><td>Yes</td></tr>
            <tr><td>@media queries</td><td>No</td><td>Yes</td><td>Yes</td><td>Yes</td><td>Yes</td><td>Yes</td></tr>
            <tr><td>CSS variables</td><td>Yes</td><td>Yes</td><td>No</td><td>Yes</td><td>Yes</td><td>Yes</td></tr>
            <tr><td>@font-face</td><td>No</td><td>Yes</td><td>No</td><td>Yes</td><td>No</td><td>Yes</td></tr>
            <tr><td>::before/::after</td><td>No</td><td>Yes</td><td>No</td><td>Yes</td><td>Yes</td><td>Yes</td></tr>
          </tbody>
        </table>
        <t>Legend: Gmail (web), O.com (Outlook.com), O.app (Outlook desktop),
        Apple (Apple Mail), Yahoo (Yahoo Mail), T-bird (Thunderbird)</t>
      </section>
    </section>

    <section anchor="acknowledgements" numbered="false">
      <name>Acknowledgements</name>
      <t>The author wishes to acknowledge the work of the Email Standards
      Project (2007-2011), the W3C HTML for Email Community Group (2014-2023),
      and the caniemail.com project for documenting the inconsistencies
      that this specification aims to address.</t>
    </section>
  </back>
</rfc>
