{"id":15438,"date":"2022-10-26T08:37:25","date_gmt":"2022-10-26T14:37:25","guid":{"rendered":"https:\/\/macblaze.ca\/?p=15438"},"modified":"2022-10-26T08:37:25","modified_gmt":"2022-10-26T14:37:25","slug":"css-magic","status":"publish","type":"post","link":"https:\/\/macblaze.ca\/?p=15438","title":{"rendered":"CSS Magic"},"content":{"rendered":"<p>I haven&#8217;t been keeping up on my css learning but I saw a new one the other day that is so applicable to text design. One can only hope that ebook reading systems will eventually support it. From <a href=\"https:\/\/www.youtube.com\/watch?v=OGJvhpoE8b4\">https:\/\/www.youtube.com\/watch?v=OGJvhpoE8b4<\/a><\/p>\n<p>Often you want a different spacing between a H1 and H2 than you want between an H1 and paragraph. This is actually quite hard to do:<\/p>\n<h1>Title<\/h1>\n<h2>Subtitle<\/h2>\n<p>This is the paragraph.<\/p>\n<h1>Title<\/h1>\n<p>This is the paragraph.<\/p>\n<p>Using the <code>:has<\/code> selector you can say if the h1 class has (not) a subtitle them change the space after:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;h1 class=&quot;article-title&quot;&gt;Title&lt;\/h1&gt; \r\n    &lt;h2 class=&quot;article-title&quot;&gt;subtitle&lt;\/h2&gt;\r\n    &lt;p&gt;Lorem ipsum baby.&lt;\/p&gt;\r\n\r\n&lt;h1 class=&quot;article-title&quot;&gt;Title&amp;&lt;\/h1&gt;\r\n   &lt;p&gt;Lorem ipsum baby.&lt;\/p&gt;\r\n<\/pre>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\r\n.article-title{\r\n  margin:0;\r\n\r\n.article-subtitle{\r\n  margin:0;\r\n  margin-block-end: 3rem;\r\n}\r\n\r\n.article-title:not(:has(+ .article-subtitle)){\r\n  margin-block-end: 3rem;\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I haven&#8217;t been keeping up on my css learning but I saw a new one the other day that is so applicable to text design. One can only hope that ebook reading systems will eventually support it. From https:\/\/www.youtube.com\/watch?v=OGJvhpoE8b4 Often you want a different spacing between a H1 and H2 than you want between an [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/posts\/15438"}],"collection":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15438"}],"version-history":[{"count":17,"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/posts\/15438\/revisions"}],"predecessor-version":[{"id":15456,"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/posts\/15438\/revisions\/15456"}],"wp:attachment":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}