{# stylesheet(filename) — emit the page's CSS so it cannot fail to load. Two strategies, chosen by deployment: * Dev server (``dev_server`` is True — set by minimost.__main__): inline the stylesheet's bytes straight into the document with ``inline_static``. The built-in Werkzeug server sends ``Connection: close`` on every response and cannot keep connections alive (it is hard-coded, no public switch), so under heavy refresh Chrome can still lose a *separate* asset request to a connection reset. A separate request is the only thing that can be lost — the HTML document request is the one the navigation already rode in on and always succeeds, so CSS carried inside it can never fail. This makes the unstyled-page bug impossible even under brute-force refresh stress. * Gunicorn / any real WSGI server (``dev_server`` is False): keep a normal cacheable . Production servers keep connections alive and never hit the reset race, so there is no reason to give up HTTP caching by inlining. The link still self-heals (``onerror`` re-requests on a fresh connection, with a window-load sweep for silent failures) as cheap insurance against a flaky proxy or transient blip. ``dev_server`` and ``inline_static`` are environment globals (registered in minimost.create_app), so this macro works even though it is imported without context. #} {% macro stylesheet(filename) -%} {%- if dev_server() -%} {%- else -%} {%- endif -%} {%- endmacro %}