feat: added unit conversion buttons

This commit is contained in:
Leyla Becker 2026-02-22 13:51:09 -06:00
parent 12df111c5e
commit a96734c394
10 changed files with 2624 additions and 1 deletions

View file

@ -120,6 +120,37 @@
<link rel="preload" href="{{ 'prism.css' | fileHash }}" as="style">
<link rel="stylesheet" href="{{ 'prism.css' | fileHash }}" media="print" onload="this.media='all'">
<noscript><link rel="stylesheet" href="{{ 'prism.css' | fileHash }}"></noscript>
{% if pageType == 'recipe' %}
<style>
.measurement-toggles {
display: none;
flex-wrap: wrap;
gap: var(--space-tight);
padding: var(--space-tight) 0;
margin-bottom: var(--space-element);
}
.measurement-toggle-btn {
font-size: var(--font-size-small);
padding: 4px 12px;
border: 1px solid var(--color-border-default);
border-radius: var(--radius-inline);
background: var(--color-bg-surface);
color: var(--color-text-primary);
cursor: pointer;
transition: background-color 0.15s, border-color 0.15s;
}
.measurement-toggle-btn:hover {
border-color: var(--color-border-focus);
background: var(--color-text-link);
color: var(--color-bg-page);
}
.measurement {
border-bottom: 1px dotted var(--color-text-muted);
cursor: default;
}
</style>
{% endif %}
</head>
<body>
<header>
@ -137,6 +168,10 @@
{{ content | safe }}
</main>
{% if pageType == 'recipe' %}
<script src="/js/measurements.js" defer></script>
{% endif %}
{% if mermaid %}
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';

View file

@ -27,6 +27,8 @@ pageType: recipe
{% endif %}
</header>
<div class="measurement-toggles" style="display: none;"></div>
<div class="recipe-content">
{{ content | safe }}
</div>