[{"data":1,"prerenderedAt":1004},["ShallowReactive",2],{"navigation_docs":3,"-rendering-layout-and-spacing":191,"-rendering-layout-and-spacing-surround":999},[4,31,67,103,129,155,175],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":30},"Getting started","i-lucide-rocket","\u002Fgetting-started","1.getting-started",[10,15,20,25],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-house",{"title":16,"path":17,"stem":18,"icon":19},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Quick start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start","i-lucide-play",{"title":26,"path":27,"stem":28,"icon":29},"Agent Skill","\u002Fgetting-started\u002Fagent-skill","1.getting-started\u002F4.agent-skill","i-lucide-sparkles",false,{"title":32,"icon":33,"path":34,"stem":35,"children":36,"page":30},"Authoring","i-lucide-pen-line","\u002Fauthoring","2.authoring",[37,42,47,52,57,62],{"title":38,"path":39,"stem":40,"icon":41},"Comark syntax","\u002Fauthoring\u002Fcomark-syntax","2.authoring\u002F1.comark-syntax","i-lucide-file-code",{"title":43,"path":44,"stem":45,"icon":46},"Frontmatter","\u002Fauthoring\u002Ffrontmatter","2.authoring\u002F2.frontmatter","i-lucide-heading",{"title":48,"path":49,"stem":50,"icon":51},"Modules","\u002Fauthoring\u002Fmodules","2.authoring\u002F3.modules","i-lucide-blocks",{"title":53,"path":54,"stem":55,"icon":56},"Merge tags and bindings","\u002Fauthoring\u002Fmerge-tags-and-bindings","2.authoring\u002F4.merge-tags-and-bindings","i-lucide-braces",{"title":58,"path":59,"stem":60,"icon":61},"Actions and spans","\u002Fauthoring\u002Factions-and-spans","2.authoring\u002F5.actions-and-spans","i-lucide-mouse-pointer-click",{"title":63,"path":64,"stem":65,"icon":66},"Compile errors","\u002Fauthoring\u002Fcompile-errors","2.authoring\u002F6.compile-errors","i-lucide-circle-alert",{"title":68,"icon":69,"path":70,"stem":71,"children":72,"page":30},"Rendering","i-lucide-layout-template","\u002Frendering","3.rendering",[73,78,83,88,93,98],{"title":74,"path":75,"stem":76,"icon":77},"Families and streams","\u002Frendering\u002Ffamilies-and-streams","3.rendering\u002F1.families-and-streams","i-lucide-users",{"title":79,"path":80,"stem":81,"icon":82},"Themes","\u002Frendering\u002Fthemes","3.rendering\u002F2.themes","i-lucide-palette",{"title":84,"path":85,"stem":86,"icon":87},"Config and the renderer","\u002Frendering\u002Fconfig-and-renderer","3.rendering\u002F3.config-and-renderer","i-lucide-settings",{"title":89,"path":90,"stem":91,"icon":92},"Layout and spacing","\u002Frendering\u002Flayout-and-spacing","3.rendering\u002F4.layout-and-spacing","i-lucide-ruler",{"title":94,"path":95,"stem":96,"icon":97},"HTML output","\u002Frendering\u002Fhtml-output","3.rendering\u002F5.html-output","i-lucide-code-xml",{"title":99,"path":100,"stem":101,"icon":102},"Plain text","\u002Frendering\u002Fplain-text","3.rendering\u002F6.plain-text","i-lucide-file-text",{"title":104,"icon":105,"path":106,"stem":107,"children":108,"page":30},"Sending","i-lucide-send","\u002Fsending","4.sending",[109,114,119,124],{"title":110,"path":111,"stem":112,"icon":113},"Message and MIME","\u002Fsending\u002Fmessage-and-mime","4.sending\u002F1.message-and-mime","i-lucide-mail",{"title":115,"path":116,"stem":117,"icon":118},"Router and streams","\u002Fsending\u002Frouter-and-streams","4.sending\u002F2.router-and-streams","i-lucide-route",{"title":120,"path":121,"stem":122,"icon":123},"SMTP","\u002Fsending\u002Fsmtp","4.sending\u002F3.smtp","i-lucide-server",{"title":125,"path":126,"stem":127,"icon":128},"Maps","\u002Fsending\u002Fmaps","4.sending\u002F4.maps","i-lucide-map",{"title":130,"icon":131,"path":132,"stem":133,"children":134,"page":30},"Tooling","i-lucide-wrench","\u002Ftooling","5.tooling",[135,140,145,150],{"title":136,"path":137,"stem":138,"icon":139},"The lttr CLI","\u002Ftooling\u002Fcli","5.tooling\u002F1.cli","i-lucide-terminal",{"title":141,"path":142,"stem":143,"icon":144},"Live preview","\u002Ftooling\u002Flive-preview","5.tooling\u002F2.live-preview","i-lucide-eye",{"title":146,"path":147,"stem":148,"icon":149},"Screenshots","\u002Ftooling\u002Fscreenshots","5.tooling\u002F3.screenshots","i-lucide-camera",{"title":151,"path":152,"stem":153,"icon":154},"Goldens and testing","\u002Ftooling\u002Fgoldens-and-testing","5.tooling\u002F4.goldens-and-testing","i-lucide-flask-conical",{"title":156,"icon":157,"path":158,"stem":159,"children":160,"page":30},"Guides","i-lucide-book-open","\u002Fguides","6.guides",[161,166,170],{"title":162,"path":163,"stem":164,"icon":165},"The Quiet example","\u002Fguides\u002Fthe-quiet-example","6.guides\u002F1.the-quiet-example","i-lucide-mail-open",{"title":167,"path":168,"stem":169,"icon":82},"Your own family and theme","\u002Fguides\u002Fyour-own-family-and-theme","6.guides\u002F2.your-own-family-and-theme",{"title":171,"path":172,"stem":173,"icon":174},"Releasing","\u002Fguides\u002Freleasing","6.guides\u002F3.releasing","i-lucide-tag",{"title":176,"icon":177,"path":178,"stem":179,"children":180,"page":30},"Reference","i-lucide-library","\u002Freference","7.reference",[181,186],{"title":182,"path":183,"stem":184,"icon":185},"API reference","\u002Freference\u002Fapi-reference","7.reference\u002F1.api-reference","i-lucide-list-tree",{"title":187,"path":188,"stem":189,"icon":190},"Gallery","\u002Freference\u002Fgallery","7.reference\u002F2.gallery","i-lucide-images",{"id":192,"title":89,"body":193,"description":992,"extension":993,"links":994,"meta":995,"navigation":996,"path":90,"seo":997,"stem":91,"__hash__":998},"docs\u002F3.rendering\u002F4.layout-and-spacing.md",{"type":194,"value":195,"toc":984},"minimark",[196,205,326,336,341,344,491,495,604,607,611,622,757,766,770,773,834,838,845,955,958,963,967,980],[197,198,199,200,204],"p",{},"You never set spacing in a template. Modules do not look at their neighbours, and there is no margin or padding prop. All vertical space between modules is decided in one place, ",[201,202,203],"code",{},"layout.Arrange",", from rules taken from the Quiet design's reference frames. The same template always gets the same spacing, and a new combination of modules still looks deliberate.",[206,207,213],"pre",{"className":208,"code":209,"filename":210,"language":211,"meta":212,"style":212},"language-go shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","func Arrange(mods []ir.Module, header HeaderVariant) []Section\n\ntype Section struct {\n    Module            ir.Module\n    PadTop, PadBottom int \u002F\u002F px\n}\n","package layout","go","",[201,214,215,265,272,287,301,320],{"__ignoreMap":212},[216,217,220,224,228,231,235,238,242,245,248,251,254,257,260,262],"span",{"class":218,"line":219},"line",1,[216,221,223],{"class":222},"sMK4o","func",[216,225,227],{"class":226},"s2Zo4"," Arrange",[216,229,230],{"class":222},"(",[216,232,234],{"class":233},"sHdIc","mods",[216,236,237],{"class":222}," []",[216,239,241],{"class":240},"sBMFI","ir",[216,243,244],{"class":222},".",[216,246,247],{"class":240},"Module",[216,249,250],{"class":222},",",[216,252,253],{"class":233}," header",[216,255,256],{"class":240}," HeaderVariant",[216,258,259],{"class":222},")",[216,261,237],{"class":222},[216,263,264],{"class":240},"Section\n",[216,266,268],{"class":218,"line":267},2,[216,269,271],{"emptyLinePlaceholder":270},true,"\n",[216,273,275,278,281,284],{"class":218,"line":274},3,[216,276,277],{"class":222},"type",[216,279,280],{"class":240}," Section",[216,282,283],{"class":222}," struct",[216,285,286],{"class":222}," {\n",[216,288,290,294,296,298],{"class":218,"line":289},4,[216,291,293],{"class":292},"sTEyZ","    Module            ",[216,295,241],{"class":240},[216,297,244],{"class":222},[216,299,300],{"class":240},"Module\n",[216,302,304,307,309,312,316],{"class":218,"line":303},5,[216,305,306],{"class":292},"    PadTop",[216,308,250],{"class":222},[216,310,311],{"class":292}," PadBottom ",[216,313,315],{"class":314},"spNyl","int",[216,317,319],{"class":318},"sHwdD"," \u002F\u002F px\n",[216,321,323],{"class":218,"line":322},6,[216,324,325],{"class":222},"}\n",[197,327,328,331,332,335],{},[201,329,330],{},"Arrange"," runs three passes over the template's modules: class defaults, then pair rules, then position rules. The HTML renderer writes each section as a table row, ",[201,333,334],{},"\u003Ctd class=\"px\" style=\"padding:{top}px 56px {bottom}px 56px;text-align:…\">",", so a section's padding is the space it adds above and below itself. Bands (images and maps) are full-bleed and ignore the side padding.",[337,338,340],"h2",{"id":339},"know-the-module-classes","Know the module classes",[197,342,343],{},"Every module belongs to one layout class:",[345,346,347,359],"table",{},[348,349,350],"thead",{},[351,352,353,357],"tr",{},[354,355,356],"th",{},"Class",[354,358,48],{},[360,361,362,380,393,414,430,440,455,468,481],"tbody",{},[351,363,364,368],{},[365,366,367],"td",{},"Hero",[365,369,370,373,374,373,377],{},[201,371,372],{},"statement",", ",[201,375,376],{},"figure",[201,378,379],{},"offer",[351,381,382,385],{},[365,383,384],{},"Band",[365,386,387,373,390],{},[201,388,389],{},"image",[201,391,392],{},"map",[351,394,395,398],{},[365,396,397],{},"Tabular",[365,399,400,373,403,373,406,373,409,373,411],{},[201,401,402],{},"receipt",[201,404,405],{},"breakdown",[201,407,408],{},"compare",[201,410,345],{},[201,412,413],{},"stock",[351,415,416,419],{},[365,417,418],{},"Body",[365,420,421,373,424,373,427],{},[201,422,423],{},"letter",[201,425,426],{},"meta",[201,428,429],{},"quote",[351,431,432,435],{},[365,433,434],{},"Notice",[365,436,437],{},[201,438,439],{},"notice",[351,441,442,445],{},[365,443,444],{},"Tail",[365,446,447,373,450,373,452],{},[201,448,449],{},"progress",[201,451,201],{},[201,453,454],{},"actions",[351,456,457,460],{},[365,458,459],{},"Editorial",[365,461,462,373,465],{},[201,463,464],{},"stories",[201,466,467],{},"products",[351,469,470,473],{},[365,471,472],{},"Signoff",[365,474,475,373,478],{},[201,476,477],{},"signature",[201,479,480],{},"signoff",[351,482,483,486],{},[365,484,485],{},"Rule",[365,487,488],{},[201,489,490],{},"divider",[337,492,494],{"id":493},"start-from-the-class-defaults","Start from the class defaults",[345,496,497,506],{},[348,498,499],{},[351,500,501,503],{},[354,502,356],{},[354,504,505],{},"Top \u002F bottom (px)",[360,507,508,515,522,529,539,548,557,563,573,584,591,598],{},[351,509,510,512],{},[365,511,367],{},[365,513,514],{},"40 \u002F 36",[351,516,517,519],{},[365,518,384],{},[365,520,521],{},"0 \u002F 0",[351,523,524,526],{},[365,525,397],{},[365,527,528],{},"32 \u002F 32",[351,530,531,536],{},[365,532,533,534,259],{},"Body (",[201,535,423],{},[365,537,538],{},"32 \u002F 28",[351,540,541,545],{},[365,542,533,543,259],{},[201,544,426],{},[365,546,547],{},"0 \u002F 32",[351,549,550,554],{},[365,551,533,552,259],{},[201,553,429],{},[365,555,556],{},"40 \u002F 40",[351,558,559,561],{},[365,560,434],{},[365,562,547],{},[351,564,565,570],{},[365,566,567,568,259],{},"Tail (",[201,569,449],{},[365,571,572],{},"0 \u002F 8",[351,574,575,581],{},[365,576,567,577,373,579,259],{},[201,578,201],{},[201,580,454],{},[365,582,583],{},"0 \u002F 40",[351,585,586,588],{},[365,587,459],{},[365,589,590],{},"0 \u002F 0 (the tiles carry their own 32 \u002F 36 padding)",[351,592,593,595],{},[365,594,472],{},[365,596,597],{},"0 \u002F 36",[351,599,600,602],{},[365,601,485],{},[365,603,521],{},[197,605,606],{},"The actions default is 40, not SPEC §8's 36: the handoff's Q2 frame wins on visual values (D10).",[337,608,610],{"id":609},"apply-the-pair-rules","Apply the pair rules",[197,612,613,614,617,618,621],{},"Pair rules look at two adjacent modules and override the bottom of the first, the top of the second, or both. They are data (",[201,615,616],{},"[]layout.Rule",", in ",[201,619,620],{},"layout\u002Frules.go","), each citing the reference frame its value comes from. They apply in order, and a later match overrides an earlier one on the same side.",[345,623,624,637],{},[348,625,626],{},[351,627,628,631,634],{},[354,629,630],{},"Previous → next",[354,632,633],{},"Effect",[354,635,636],{},"Source",[360,638,639,652,668,682,695,708,720,732,744],{},[351,640,641,646,649],{},[365,642,643,644,259],{},"Hero → Tail (",[201,645,449],{},[365,647,648],{},"Hero bottom 28",[365,650,651],{},"Q1",[351,653,654,662,665],{},[365,655,656,657,659,660,259],{},"Hero (",[201,658,372],{},") → Tabular (",[201,661,408],{},[365,663,664],{},"Hero bottom 24",[365,666,667],{},"Q7",[351,669,670,676,679],{},[365,671,656,672,659,674,259],{},[201,673,372],{},[201,675,345],{},[365,677,678],{},"Hero bottom 16",[365,680,681],{},"Q9 (D10: SPEC says 24)",[351,683,684,690,692],{},[365,685,656,686,659,688,259],{},[201,687,372],{},[201,689,402],{},[365,691,664],{},[365,693,694],{},"SPEC §8",[351,696,697,702,705],{},[365,698,656,699,701],{},[201,700,376],{},") → Tabular",[365,703,704],{},"Hero bottom 32, Tabular top 0",[365,706,707],{},"Q2 (D10)",[351,709,710,714,717],{},[365,711,643,712,259],{},[201,713,201],{},[365,715,716],{},"Hero bottom 0",[365,718,719],{},"Q3",[351,721,722,726,729],{},[365,723,533,724,701],{},[201,725,426],{},[365,727,728],{},"Tabular top 0",[365,730,731],{},"Q6",[351,733,734,739,742],{},[365,735,736,737,259],{},"Band → Body (",[201,738,426],{},[365,740,741],{},"Meta top 32",[365,743,731],{},[351,745,746,751,754],{},[365,747,748,749,259],{},"Tabular → Tail (",[201,750,454],{},[365,752,753],{},"Actions top 8",[365,755,756],{},"Q2",[197,758,759,760,762,763,765],{},"A statement followed by ",[201,761,405],{}," or ",[201,764,413],{}," matches no rule and keeps the Hero default of 36.",[337,767,769],{"id":768},"apply-the-position-rules","Apply the position rules",[197,771,772],{},"Last, a few rules look at where a module sits in the whole email:",[345,774,775,786],{},[348,776,777],{},[351,778,779,782,784],{},[354,780,781],{},"Position",[354,783,633],{},[354,785,636],{},[360,787,788,802,813,822],{},[351,789,790,796,799],{},[365,791,792,793,795],{},"A ",[201,794,372],{}," that is the first module under an H3 header",[365,797,798],{},"Bottom 32",[365,800,801],{},"Q4",[351,803,804,807,810],{},[365,805,806],{},"A Hero that is the last module",[365,808,809],{},"Bottom 40",[365,811,812],{},"Q5 (D10)",[351,814,815,818,820],{},[365,816,817],{},"A notice that is the last module, or follows a Band",[365,819,809],{},[365,821,694],{},[351,823,824,829,832],{},[365,825,792,826,828],{},[201,827,423],{}," that is the first module",[365,830,831],{},"Top 36",[365,833,694],{},[337,835,837],{"id":836},"check-the-nine-reference-stacks","Check the nine reference stacks",[197,839,840,841,844],{},"The nine Quiet examples are the conformance suite for these rules. ",[201,842,843],{},"layout\u002Farrange_test.go"," asserts every value below.",[345,846,847,860],{},[348,848,849],{},[351,850,851,854,857],{},[354,852,853],{},"Example",[354,855,856],{},"Header",[354,858,859],{},"Sections (top \u002F bottom)",[360,861,862,873,883,893,904,914,924,934,944],{},[351,863,864,867,870],{},[365,865,866],{},"01 order",[365,868,869],{},"H1",[365,871,872],{},"statement 40\u002F28 · progress 0\u002F8 · receipt 32\u002F32 · meta 0\u002F32",[351,874,875,878,880],{},[365,876,877],{},"02 payout",[365,879,869],{},[365,881,882],{},"figure 40\u002F32 · breakdown 0\u002F32 · actions 8\u002F40 · signoff 0\u002F36",[351,884,885,888,890],{},[365,886,887],{},"03 reset",[365,889,869],{},[365,891,892],{},"statement 40\u002F0 · code 0\u002F40 · notice 0\u002F40",[351,894,895,898,901],{},[365,896,897],{},"04 journal",[365,899,900],{},"H3",[365,902,903],{},"statement 40\u002F32 · image 0\u002F0 · stories 0\u002F0 · divider 0\u002F0 · quote 40\u002F40",[351,905,906,909,911],{},[365,907,908],{},"05 campaign",[365,910,869],{},[365,912,913],{},"statement 40\u002F36 · image 0\u002F0 · products 0\u002F0 · divider 0\u002F0 · offer 40\u002F40",[351,915,916,919,921],{},[365,917,918],{},"06 job offer",[365,920,869],{},[365,922,923],{},"statement 40\u002F36 · map 0\u002F0 · meta 32\u002F32 · breakdown 0\u002F32",[351,925,926,929,931],{},[365,927,928],{},"07 fee change",[365,930,869],{},[365,932,933],{},"statement 40\u002F24 · compare 32\u002F32 · divider 0\u002F0 · letter 32\u002F28 · signoff 0\u002F36",[351,935,936,939,941],{},[365,937,938],{},"08 outreach",[365,940,869],{},[365,942,943],{},"letter 36\u002F28 · signature 0\u002F36",[351,945,946,949,952],{},[365,947,948],{},"09 internal",[365,950,951],{},"H2",[365,953,954],{},"statement 40\u002F16 · table 32\u002F32 · notice 0\u002F32 · signoff 0\u002F36",[197,956,957],{},"Here is 02. The figure → breakdown rule gives the figure a 32px bottom and the breakdown no top padding, and the Tabular → actions rule drops the actions' top padding to 8:",[959,960],"email-preview",{"name":961,"width":962},"02-payout.sent",600,[337,964,966],{"id":965},"change-the-spacing","Change the spacing",[197,968,969,970,972,973,975,976,979],{},"The rules are part of the library, not the theme, so a consumer cannot change them per brand. If a combination of modules looks wrong, the fix is a new pair rule in ",[201,971,620],{}," with its source, plus a case in ",[201,974,843],{},", and a golden update (see ",[977,978,151],"a",{"href":152},").",[981,982,983],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":212,"searchDepth":267,"depth":267,"links":985},[986,987,988,989,990,991],{"id":339,"depth":267,"text":340},{"id":493,"depth":267,"text":494},{"id":609,"depth":267,"text":610},{"id":768,"depth":267,"text":769},{"id":836,"depth":267,"text":837},{"id":965,"depth":267,"text":966},"How lttr decides the space above and below every module, from class defaults, pair rules and position rules.","md",null,{},{"icon":92},{"title":89,"description":992},"V2vx8xbsDnUS4wmg0U63xQz41WD8OFMQipgZ6HEVenU",[1000,1002],{"title":84,"path":85,"stem":86,"description":1001,"icon":87,"children":-1},"Build a Renderer from a Config, compile templates against your families, and render them for a recipient.",{"title":94,"path":95,"stem":96,"description":1003,"icon":97,"children":-1},"What the HTML part looks like, and how it holds up in Outlook, dark mode and on phones.",1790309827757]