{"id":229,"date":"2026-09-30T17:16:35","date_gmt":"2026-09-30T17:16:35","guid":{"rendered":"https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/better-spacing-in-oxygen\/"},"modified":"2026-09-30T18:21:15","modified_gmt":"2026-09-30T18:21:15","slug":"better-spacing-in-oxygen","status":"publish","type":"post","link":"https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/better-spacing-in-oxygen\/","title":{"rendered":"Oxygen Spacing System: Reusable Variables and a Card Example"},"content":{"rendered":"<p class=\"bo-doc-status\">Documentation-based practice example; check the controls in your installed Oxygen version.<\/p>\n<nav class=\"bo-doc-toc\" aria-label=\"On this page\">\n<p><strong>On this page<\/strong><\/p>\n<ul>\n<li><a href=\"#overview\">Start with repeated spacing roles<\/a><\/li>\n<li><a href=\"#scale\">Generate a small starting scale<\/a><\/li>\n<li><a href=\"#example\">Worked example: a guide-card group<\/a><\/li>\n<li><a href=\"#responsive\">Make the layout responsive<\/a><\/li>\n<li><a href=\"#roles\">Gap, padding and margin solve different problems<\/a><\/li>\n<li><a href=\"#troubleshooting\">Troubleshooting and checks<\/a><\/li>\n<\/ul>\n<\/nav>\n<section id=\"overview\">\n<h2>Start with repeated spacing roles<\/h2>\n<p>A useful spacing system reduces unrelated values. Give repeated gaps and padding names so one change can improve several layouts. Start with a guide-card group: space between cards, space inside each card, and space between a heading and its description.<\/p>\n<\/section>\n<section id=\"scale\">\n<h2>Generate a small starting scale<\/h2>\n<p>Open the <a href=\"https:\/\/benjaminolsen.dev\/index.php\/spacing-scale-generator\/\">Spacing Scale Generator<\/a>. Use an 8px starting value, a 1.5 ratio and four steps at a 16px root. The working tool produces:<\/p>\n<pre><code>:root {\n  --space-1: 0.5rem;\n  --space-2: 0.75rem;\n  --space-3: 1.125rem;\n  --space-4: 1.6875rem;\n}<\/code><\/pre>\n<p>That is 8, 12, 18 and 27px at a 16px root. These values are a starting proposal, not mandatory design rules. Round or refine them when the content needs a different rhythm.<\/p>\n<\/section>\n<section id=\"example\">\n<h2>Worked example: a guide-card group<\/h2>\n<ol>\n<li>Add a parent Container with two guide cards. Give the parent the class <code>guide-grid<\/code>.<\/li>\n<li>Give each card the class <code>guide-card<\/code>. Include a title, summary and one destination.<\/li>\n<li>Use the largest starting token for the gap between cards and their inner padding. Use a smaller token between the title and summary.<\/li>\n<li>Keep all equivalent cards on the same classes so spacing changes propagate.<\/li>\n<\/ol>\n<pre><code>.guide-grid {\n  display: grid;\n  grid-template-columns: repeat(2, minmax(0, 1fr));\n  gap: var(--space-4);\n}\n.guide-card {\n  display: flex;\n  flex-direction: column;\n  gap: var(--space-2);\n  padding: var(--space-4);\n}<\/code><\/pre>\n<\/section>\n<section id=\"responsive\">\n<h2>Make the layout responsive<\/h2>\n<p>Stack the cards when two columns no longer leave enough room for the actual summaries. The example below uses 767px; use the breakpoint that fits your content and builder configuration.<\/p>\n<pre><code>@media (max-width: 767px) {\n  .guide-grid { grid-template-columns: minmax(0, 1fr); }\n  .guide-card { padding: var(--space-3); }\n}<\/code><\/pre>\n<p>You can set the same layout properties through Oxygen class controls instead. Choose one method for each property so CSS and controls do not compete.<\/p>\n<\/section>\n<section id=\"roles\">\n<h2>Gap, padding and margin solve different problems<\/h2>\n<p><code>gap<\/code> separates children in a flex\/grid group. Padding creates space inside an element. Margin affects the element\u2019s relationship to surrounding content. If both a parent gap and child margins supply the same separation, the result can be larger than intended.<\/p>\n<\/section>\n<section id=\"troubleshooting\">\n<h2>Troubleshooting and checks<\/h2>\n<ul>\n<li><strong>A token does nothing:<\/strong> inspect whether the variable is defined, spelled correctly and overridden by another rule.<\/li>\n<li><strong>One card looks different:<\/strong> compare its class list and local overrides.<\/li>\n<li><strong>Spacing doubles:<\/strong> inspect parent gap, child margins and default paragraph spacing together.<\/li>\n<li><strong>Mobile feels sparse:<\/strong> reduce a role\u2019s responsive spacing rather than creating unrelated one-off values on every element.<\/li>\n<\/ul>\n<p>Test a long heading, multi-line summary and missing optional image. Reference: <a href=\"https:\/\/oxygenbuilder.com\/documentation\/design\/classes\/\">Oxygen classes<\/a>.<\/p>\n<\/section>\n<section id=\"related\">\n<h2>Related guides and tools<\/h2>\n<ul>\n<li><a href=\"https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/oxygen-container\/\">Oxygen 6 Container: A responsive project introduction<\/a><\/li>\n<li><a href=\"https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/oxygen-container-link\/\">Oxygen 6 Container Link: A project card with one destination<\/a><\/li>\n<li><a href=\"https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/practical-css-clamp-guide\/\">CSS clamp() in Oxygen: Fluid Typography with Worked Examples<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/benjaminolsen.dev\/index.php\/tools\/\">Explore all tools<\/a> \u00b7 <a href=\"https:\/\/benjaminolsen.dev\/index.php\/guides\/\">Browse the documentation library<\/a><\/p>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>Build a reusable spacing system in Oxygen with CSS variables. Follow a card-layout example, inspect responsive spacing and fix inconsistent gaps.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_oxygen_hide_in_design_set":false,"_oxygen_tags":"","footnotes":""},"categories":[4,6],"tags":[],"bo_topic":[19,17],"bo_resource_type":[21],"bo_doc_section":[23],"class_list":["post-229","post","type-post","status-publish","format-standard","hentry","category-native-oxygen","category-tips","bo_topic-css-web-design","bo_topic-oxygen-6"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Oxygen Spacing System: Reusable Variables and a Card Example | Benjamin Olsen<\/title>\n<meta name=\"description\" content=\"Build a reusable spacing system in Oxygen with CSS variables. Follow a card-layout example, inspect responsive spacing and fix inconsistent gaps.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/better-spacing-in-oxygen\/\" \/>\n<meta property=\"og:locale\" content=\"da_DK\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Oxygen Spacing System: Reusable Variables and a Card Example | Benjamin Olsen\" \/>\n<meta property=\"og:description\" content=\"Build a reusable spacing system in Oxygen with CSS variables. Follow a card-layout example, inspect responsive spacing and fix inconsistent gaps.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/better-spacing-in-oxygen\/\" \/>\n<meta property=\"og:site_name\" content=\"Benjamin Olsen\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-30T17:16:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-09-30T18:21:15+00:00\" \/>\n<meta name=\"author\" content=\"Benjamin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Benjamin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutter\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/benjaminolsen.dev\\\/index.php\\\/2026\\\/09\\\/30\\\/better-spacing-in-oxygen\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/benjaminolsen.dev\\\/index.php\\\/2026\\\/09\\\/30\\\/better-spacing-in-oxygen\\\/\"},\"author\":{\"name\":\"Benjamin\",\"@id\":\"https:\\\/\\\/benjaminolsen.dev\\\/#\\\/schema\\\/person\\\/aee4e89bcb6704d860babf7ba16a0b8d\"},\"headline\":\"Oxygen Spacing System: Reusable Variables and a Card Example\",\"datePublished\":\"2026-09-30T17:16:35+00:00\",\"dateModified\":\"2026-09-30T18:21:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/benjaminolsen.dev\\\/index.php\\\/2026\\\/09\\\/30\\\/better-spacing-in-oxygen\\\/\"},\"wordCount\":435,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/benjaminolsen.dev\\\/#\\\/schema\\\/person\\\/aee4e89bcb6704d860babf7ba16a0b8d\"},\"articleSection\":[\"Native Oxygen\",\"Tips\"],\"inLanguage\":\"da-DK\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/benjaminolsen.dev\\\/index.php\\\/2026\\\/09\\\/30\\\/better-spacing-in-oxygen\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/benjaminolsen.dev\\\/index.php\\\/2026\\\/09\\\/30\\\/better-spacing-in-oxygen\\\/\",\"url\":\"https:\\\/\\\/benjaminolsen.dev\\\/index.php\\\/2026\\\/09\\\/30\\\/better-spacing-in-oxygen\\\/\",\"name\":\"Oxygen Spacing System: Reusable Variables and a Card Example | Benjamin Olsen\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/benjaminolsen.dev\\\/#website\"},\"datePublished\":\"2026-09-30T17:16:35+00:00\",\"dateModified\":\"2026-09-30T18:21:15+00:00\",\"description\":\"Build a reusable spacing system in Oxygen with CSS variables. Follow a card-layout example, inspect responsive spacing and fix inconsistent gaps.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/benjaminolsen.dev\\\/index.php\\\/2026\\\/09\\\/30\\\/better-spacing-in-oxygen\\\/#breadcrumb\"},\"inLanguage\":\"da-DK\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/benjaminolsen.dev\\\/index.php\\\/2026\\\/09\\\/30\\\/better-spacing-in-oxygen\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/benjaminolsen.dev\\\/index.php\\\/2026\\\/09\\\/30\\\/better-spacing-in-oxygen\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/benjaminolsen.dev\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Oxygen Spacing System: Reusable Variables and a Card Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/benjaminolsen.dev\\\/#website\",\"url\":\"https:\\\/\\\/benjaminolsen.dev\\\/\",\"name\":\"Benjamin Olsen\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/benjaminolsen.dev\\\/#\\\/schema\\\/person\\\/aee4e89bcb6704d860babf7ba16a0b8d\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/benjaminolsen.dev\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"da-DK\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/benjaminolsen.dev\\\/#\\\/schema\\\/person\\\/aee4e89bcb6704d860babf7ba16a0b8d\",\"name\":\"Benjamin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"da-DK\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fda08b9a3a73cd1a57fc39c2a767fb6441b2dbf176857221a8da88161187eeb1?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fda08b9a3a73cd1a57fc39c2a767fb6441b2dbf176857221a8da88161187eeb1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fda08b9a3a73cd1a57fc39c2a767fb6441b2dbf176857221a8da88161187eeb1?s=96&d=mm&r=g\",\"caption\":\"Benjamin\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fda08b9a3a73cd1a57fc39c2a767fb6441b2dbf176857221a8da88161187eeb1?s=96&d=mm&r=g\"},\"sameAs\":[\"http:\\\/\\\/benjaminolsen.dev\"],\"url\":\"https:\\\/\\\/benjaminolsen.dev\\\/index.php\\\/author\\\/benjamin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Oxygen Spacing System: Reusable Variables and a Card Example | Benjamin Olsen","description":"Build a reusable spacing system in Oxygen with CSS variables. Follow a card-layout example, inspect responsive spacing and fix inconsistent gaps.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/better-spacing-in-oxygen\/","og_locale":"da_DK","og_type":"article","og_title":"Oxygen Spacing System: Reusable Variables and a Card Example | Benjamin Olsen","og_description":"Build a reusable spacing system in Oxygen with CSS variables. Follow a card-layout example, inspect responsive spacing and fix inconsistent gaps.","og_url":"https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/better-spacing-in-oxygen\/","og_site_name":"Benjamin Olsen","article_published_time":"2026-09-30T17:16:35+00:00","article_modified_time":"2026-09-30T18:21:15+00:00","author":"Benjamin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Benjamin","Est. reading time":"2 minutter"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/better-spacing-in-oxygen\/#article","isPartOf":{"@id":"https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/better-spacing-in-oxygen\/"},"author":{"name":"Benjamin","@id":"https:\/\/benjaminolsen.dev\/#\/schema\/person\/aee4e89bcb6704d860babf7ba16a0b8d"},"headline":"Oxygen Spacing System: Reusable Variables and a Card Example","datePublished":"2026-09-30T17:16:35+00:00","dateModified":"2026-09-30T18:21:15+00:00","mainEntityOfPage":{"@id":"https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/better-spacing-in-oxygen\/"},"wordCount":435,"commentCount":0,"publisher":{"@id":"https:\/\/benjaminolsen.dev\/#\/schema\/person\/aee4e89bcb6704d860babf7ba16a0b8d"},"articleSection":["Native Oxygen","Tips"],"inLanguage":"da-DK","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/better-spacing-in-oxygen\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/better-spacing-in-oxygen\/","url":"https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/better-spacing-in-oxygen\/","name":"Oxygen Spacing System: Reusable Variables and a Card Example | Benjamin Olsen","isPartOf":{"@id":"https:\/\/benjaminolsen.dev\/#website"},"datePublished":"2026-09-30T17:16:35+00:00","dateModified":"2026-09-30T18:21:15+00:00","description":"Build a reusable spacing system in Oxygen with CSS variables. Follow a card-layout example, inspect responsive spacing and fix inconsistent gaps.","breadcrumb":{"@id":"https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/better-spacing-in-oxygen\/#breadcrumb"},"inLanguage":"da-DK","potentialAction":[{"@type":"ReadAction","target":["https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/better-spacing-in-oxygen\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/benjaminolsen.dev\/index.php\/2026\/09\/30\/better-spacing-in-oxygen\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/benjaminolsen.dev\/"},{"@type":"ListItem","position":2,"name":"Oxygen Spacing System: Reusable Variables and a Card Example"}]},{"@type":"WebSite","@id":"https:\/\/benjaminolsen.dev\/#website","url":"https:\/\/benjaminolsen.dev\/","name":"Benjamin Olsen","description":"","publisher":{"@id":"https:\/\/benjaminolsen.dev\/#\/schema\/person\/aee4e89bcb6704d860babf7ba16a0b8d"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/benjaminolsen.dev\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"da-DK"},{"@type":["Person","Organization"],"@id":"https:\/\/benjaminolsen.dev\/#\/schema\/person\/aee4e89bcb6704d860babf7ba16a0b8d","name":"Benjamin","image":{"@type":"ImageObject","inLanguage":"da-DK","@id":"https:\/\/secure.gravatar.com\/avatar\/fda08b9a3a73cd1a57fc39c2a767fb6441b2dbf176857221a8da88161187eeb1?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/fda08b9a3a73cd1a57fc39c2a767fb6441b2dbf176857221a8da88161187eeb1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fda08b9a3a73cd1a57fc39c2a767fb6441b2dbf176857221a8da88161187eeb1?s=96&d=mm&r=g","caption":"Benjamin"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/fda08b9a3a73cd1a57fc39c2a767fb6441b2dbf176857221a8da88161187eeb1?s=96&d=mm&r=g"},"sameAs":["http:\/\/benjaminolsen.dev"],"url":"https:\/\/benjaminolsen.dev\/index.php\/author\/benjamin\/"}]}},"_links":{"self":[{"href":"https:\/\/benjaminolsen.dev\/index.php\/wp-json\/wp\/v2\/posts\/229","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/benjaminolsen.dev\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/benjaminolsen.dev\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/benjaminolsen.dev\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/benjaminolsen.dev\/index.php\/wp-json\/wp\/v2\/comments?post=229"}],"version-history":[{"count":2,"href":"https:\/\/benjaminolsen.dev\/index.php\/wp-json\/wp\/v2\/posts\/229\/revisions"}],"predecessor-version":[{"id":582,"href":"https:\/\/benjaminolsen.dev\/index.php\/wp-json\/wp\/v2\/posts\/229\/revisions\/582"}],"wp:attachment":[{"href":"https:\/\/benjaminolsen.dev\/index.php\/wp-json\/wp\/v2\/media?parent=229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/benjaminolsen.dev\/index.php\/wp-json\/wp\/v2\/categories?post=229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/benjaminolsen.dev\/index.php\/wp-json\/wp\/v2\/tags?post=229"},{"taxonomy":"bo_topic","embeddable":true,"href":"https:\/\/benjaminolsen.dev\/index.php\/wp-json\/wp\/v2\/bo_topic?post=229"},{"taxonomy":"bo_resource_type","embeddable":true,"href":"https:\/\/benjaminolsen.dev\/index.php\/wp-json\/wp\/v2\/bo_resource_type?post=229"},{"taxonomy":"bo_doc_section","embeddable":true,"href":"https:\/\/benjaminolsen.dev\/index.php\/wp-json\/wp\/v2\/bo_doc_section?post=229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}