Created
June 27, 2026 12:57
-
-
Save nbogie/133702ed703abc8d226ffd3a616c077f to your computer and use it in GitHub Desktop.
make gousto recipe printable by using 2 columns for ingredients section
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // load the recipe | |
| // paste this into the dev tools | |
| // when you print, you should see ingredients is two-column, saving space. | |
| // author: claude opus | |
| (() => { | |
| const list = document.querySelector('ul[data-test="ingredients-list"]'); | |
| if (!list) { alert('Ingredients list not found — is the page loaded?'); return; } | |
| const css = ` | |
| ul[data-test="ingredients-list"] { | |
| column-count: 2 !important; | |
| column-gap: 32px !important; | |
| } | |
| ul[data-test="ingredients-list"] > li { | |
| break-inside: avoid !important; | |
| page-break-inside: avoid !important; | |
| -webkit-column-break-inside: avoid !important; | |
| } | |
| @media print { | |
| ul[data-test="ingredients-list"] { column-count: 2 !important; } | |
| }`; | |
| let style = document.getElementById('twocol-ingredients-style'); | |
| if (!style) { | |
| style = document.createElement('style'); | |
| style.id = 'twocol-ingredients-style'; | |
| document.head.appendChild(style); | |
| } | |
| style.textContent = css; | |
| list.scrollIntoView({ behavior: 'smooth', block: 'center' }); | |
| console.log('Two-column ingredients applied.'); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment