<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/custom-pretty-feed-v3.xsl" type="text/xsl"?><rss version="2.0"><channel><title>Kristoffer Balintona — #Astro</title><description>Entries tagged with &quot;Astro&quot;</description><link>https://kristofferbalintona.me/</link><language>en-us</language><image><url>https://kristofferbalintona.me/favicon-rss.png</url><title>Kristoffer Balintona — #Astro</title><link>https://kristofferbalintona.me</link></image><item><title>First time web dev</title><link>https://kristofferbalintona.me/posts/202606230934/</link><guid isPermaLink="true">https://kristofferbalintona.me/posts/202606230934/</guid><description>&lt;p&gt;My first touch with &lt;em&gt;actual&lt;/em&gt; web development has been the development of this site using Astro. Previously, I used Hugo to generate the predecessor to the current site’s design—but I don’t consider that “real” web development since much of the logic and hard work has already been done for me (by the static site generator).&lt;/p&gt;
&lt;p&gt;Overall, it has been quite pleasant, relative to how large of a meal Astro + Node + HTML + CSS + routing + deployment + more is.&lt;/p&gt;
&lt;h2&gt;HTML tag semantics &lt;a href=&quot;#html-tag-semantics&quot;&gt;  
§
&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;HTML tag semantics matter. Don’t be confused by the fact that, by default, tags have styling. How a page looks should be controlled by CSS.
&lt;ul&gt;
&lt;li&gt;Don’t confuse the default look of elements for their role in the document&lt;/li&gt;
&lt;li&gt;It is intuitive to use &lt;code&gt;&amp;lt;i&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;b&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt;, and so on for basic styling. However, HTML tags should convey &lt;em&gt;the meaning of text&lt;/em&gt;, not what it looks like.&lt;/li&gt;
&lt;li&gt;In practice, this means these tags should be used pretty much only in prose, not in UI elements like the footer, navbar, site header, and so on.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;HTML semantics also matter for contexts in which your HTML is presented outside of your pages. For example, reader modes (e.g., Firefox’s &lt;a href=&quot;https://support.mozilla.org/en-US/kb/firefox-reader-view-clutter-free-web-pages&quot;&gt;Reader View&lt;/a&gt;), or RSS feeds: these are contexts in which the styling of your text is inferred from your HTML tags and attributes, not your stylesheets.&lt;/li&gt;
&lt;li&gt;Semantics for a few key or rare (but useful) tags:
&lt;dl&gt;&lt;dt&gt;&lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;The “actual” (displayed, rendered) content of the page.&lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;&lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;Dominant content of the page. Typically includes everything but the site footer and header. Only one per page.&lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;&lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;Represents a self-contained piece of composition. Can be used multiple times a page. For example, a blog post or each card in an article listing.&lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;&lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;Introductory content (to site, to article, etc.). Can be used multiple times a page.&lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;&lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;Provides navigational links.&lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;&lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;Closing and supplementary information (e.g., author email address, copyright license, related links) about a given section (e.g., article). Can be used multiple times on a page.&lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;&lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;Delimit thematic grouping of elements in a page. Most of the time, these involves a heading element.&lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;&lt;code&gt;&amp;lt;time&amp;gt;&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;&lt;p&gt;Represent a period or point in time. Useful to search engines and other site features that use machine-readable time formats.&lt;/p&gt;&lt;/dd&gt;&lt;/dl&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Accessibility &lt;a href=&quot;#accessibility&quot;&gt;  
§
&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Don’t forget about it! Consider theme contrast, non-sighted users, and user preferences like preferences for high-contrast (&lt;code&gt;prefers-contrast&lt;/code&gt;) or no motions (&lt;code&gt;prefers-reduced-motion&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Know &lt;a href=&quot;https://www.w3.org/WAI/standards-guidelines/aria/&quot;&gt;ARIA&lt;/a&gt; standards and attributes, like &lt;code&gt;aria-label&lt;/code&gt;, &lt;code&gt;aria-labelledby&lt;/code&gt;, &lt;code&gt;aria-pressed&lt;/code&gt;, and &lt;a href=&quot;https://www.w3.org/WAI/standards-guidelines/wcag/&quot;&gt;WCAG&lt;/a&gt; recommendations.&lt;/li&gt;
&lt;li&gt;There are conventions for accessible use of heading tags. &lt;a href=&quot;https://www.a11yproject.com/posts/how-to-accessible-heading-structure/&quot;&gt;How-to: Accessible heading structure - The A11Y Project&lt;/a&gt; explains, alongside sharing a few browser add-ons to help.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Select one or two fonts &lt;a href=&quot;#select-one-or-two-fonts&quot;&gt;  
§
&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Fewer is better; aim for simplicity and elegance. Almost all sites should only really need 2 fonts. Currently, this site has a main “for prose” font (serif) and a secondary font (sans serif) for various other places, e.g. UI elements and heading text.&lt;/li&gt;
&lt;li&gt;Real life examples: &lt;a href=&quot;https://fontsinuse.com/&quot;&gt;Fonts In Use - Fonts In Use&lt;/a&gt;, phenomenal source to see what fonts people have used with each other&lt;/li&gt;
&lt;li&gt;Font providers
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://fontsource.org/&quot;&gt;Fontsource&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://fonts.google.com/&quot;&gt;Browse Fonts - Google Fonts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Fluid/responsive typography and spacing &lt;a href=&quot;#fluidresponsive-typography-and-spacing&quot;&gt;  
§
&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;See &lt;a href=&quot;https://www.smashingmagazine.com/2022/01/modern-fluid-typography-css-clamp/&quot;&gt;Modern Fluid Typography Using CSS Clamp — Smashing Magazine&lt;/a&gt; and &lt;a href=&quot;https://moderncss.dev/generating-font-size-css-rules-and-creating-a-fluid-type-scale/&quot;&gt;Generating `font-size` CSS Rules and Creating a Fluid Type Scale | Modern CSS Solutions&lt;/a&gt; for a deep dive on the matter.&lt;/li&gt;
&lt;li&gt;The generator I’ve used for this site: &lt;a href=&quot;https://utopia.fyi/&quot;&gt;Fluid Responsive Design | Utopia&lt;/a&gt;.
&lt;ul&gt;
&lt;li&gt;I also use it to generate “fluid spacing”: CSS variables for spacing that are responsive.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The general rationale behind appropriate spacing in design and UI: &lt;a href=&quot;https://www.youtube.com/watch?v=9ElrcTtAxzA&quot;&gt;The Secret Science of Perfect Spacing - YouTube&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;There’s MD, MDX, and Markdoc &lt;a href=&quot;#theres-md-mdx-and-markdoc&quot;&gt;  
§
&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I had to make a decision on what file format my content should be in.&lt;/li&gt;
&lt;li&gt;I chose MDX, since I think it is as expressive as possible. (I export from Org-mode to MDX and don’t think there’s any HTML I want to emit that I can’t have my backend export into MDX.)
&lt;ul&gt;
&lt;li&gt;Exporting to MDX makes for an easier time than exporting directly to HTML since MDX takes advantage of Astro components as well as opens the possibility of inserting &lt;a href=&quot;https://github.com/remarkjs/remark&quot;&gt;Remark&lt;/a&gt; integrations to further customize the emitted HTML (although ideally that customization should be done by modifying my Ox-mdx exporter). I’d rather tidy up and standardize the final HTML output through Astro and its integrations, not Org-mode exporter stage.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;But Markdoc was an enticing, albeit less common and support (by third-party packages), option. See &lt;a href=&quot;https://markdoc.dev/docs/faq&quot;&gt;Markdoc | Frequently asked questions&lt;/a&gt; and &lt;a href=&quot;https://markdoc.dev/docs/syntax&quot;&gt;Markdoc | The Markdoc syntax&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Generators and aggregators &lt;a href=&quot;#generators-and-aggregators&quot;&gt;  
§
&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Fluid typography (font sizing that changes appropriately based on viewport)
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://utopia.fyi/&quot;&gt;https://utopia.fyi/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://typescale.com/&quot;&gt;https://typescale.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Content body width
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://baymard.com/blog/line-length-readability&quot;&gt;Baymard Institute&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://practicaltypography.com/line-length.html&quot;&gt;Butterick’s Practical Typography&lt;/a&gt;, a well-regarded online typography book&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Color palettes
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.realtimecolors.com/?colors=050315-fbfbfe-2f27ce-dedcff-433bff&amp;amp;fonts=Inter-Inter&quot;&gt;Realtime Colors&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.accessibility.build/tools/color-palette-generator&quot;&gt;Accessible Color Palette Generator | WCAG 2.2 UI Color Preview | Free Tool | Accessibility.build&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://colorbox.io/?c0=~p%24s%24%3D11~p%24h%24st%24%3D220~p%24h%24e%24%3D240~p%24h%24c%24%3Deqo~p%24sa%24st%24%3D0.08~p%24sa%24e%24%3D1~p%24sa%24r%24%3D1~p%24sa%24c%24%3Deqo~p%24b%24st%24%3D1~p%24b%24e%24%3D0.2~p%24b%24c%24%3Deqti~o%24n%24%3DBlue~o%24ms%24%3D0%2C1~o%24ro%24%3Dcw&amp;amp;ly=g&amp;amp;col=3&amp;amp;ns=df&quot;&gt;ColorBox&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Pre-made
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://colorhunt.co/palettes/popular&quot;&gt;Color Hunt - The Most Popular Color Palettes of 2026&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.realtimecolors.com/blog-post?colors=0c100a-f6f3ee-4a7fa5-d3dfd3-c64a2f&amp;amp;fonts=Inter-Inter&quot;&gt;Blog Post Template - Realtime Colors&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://color.adobe.com/explore?q=Primary%20colors&quot;&gt;Color Palettes and Gradients – Explore Themes &amp;amp; Ideas | Adobe Express&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Astro components are awesome &lt;a href=&quot;#astro-components-are-awesome&quot;&gt;  
§
&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;They’re great. “Beginner friendly, simple, and powerful yet a thin abstraction” is my impression.&lt;/li&gt;
&lt;li&gt;CSS &lt;em&gt;selectors&lt;/em&gt; get scoped (but not rules, which are rendered normally).&lt;/li&gt;
&lt;li&gt;Makes putting related things (e.g., CSS rules, HTML, JS) near one another.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Favicons &lt;a href=&quot;#favicons&quot;&gt;  
§
&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Favicons and SVGs&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://jakearchibald.github.io/svgomg/&quot;&gt;SVGOMG - SVGO’s Missing GUI for minifying SVGs&lt;/a&gt;, clean up SVG markup&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://svgco.de/&quot;&gt;SVGcode—Convert raster images to SVG vector graphics&lt;/a&gt;, convert images into a SVGs&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Don’t forget to have a favicon for each of your site’s color themes. You can have a different SVG for each theme, or have a &lt;code&gt;style&lt;/code&gt; block in a single SVG which uses CSS media queries to change the colors of the SVG dynamically. For example, this site currently uses something like:&lt;/p&gt;
&lt;div&gt;&lt;figure&gt;&lt;figcaption&gt;&lt;/figcaption&gt;&lt;pre&gt;&lt;code&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&amp;lt;!-- Adaptive-color favicon, depending on `prefers-color-scheme` --&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;svg&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;xmlns&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;&quot;&lt;/span&gt;&lt;span&gt;http://www.w3.org/2000/svg&lt;/span&gt;&lt;span&gt;&quot;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;viewBox&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;&quot;&lt;/span&gt;&lt;span&gt;...&lt;/span&gt;&lt;span&gt;&quot;&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;style&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;.icon-fill {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;fill: #1a1a1a;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;@media (prefers-color-scheme: dark) {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;.icon-fill {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span&gt;fill: #ffffff;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;&amp;lt;/&lt;/span&gt;&lt;span&gt;style&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;path&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;&quot;&lt;/span&gt;&lt;span&gt;icon-fill&lt;/span&gt;&lt;span&gt;&quot;&lt;/span&gt;&lt;span&gt; ... /&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;path&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;&quot;&lt;/span&gt;&lt;span&gt;icon-fill&lt;/span&gt;&lt;span&gt;&quot;&lt;/span&gt;&lt;span&gt; ... /&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;path&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;class&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;&quot;&lt;/span&gt;&lt;span&gt;icon-fill&lt;/span&gt;&lt;span&gt;&quot;&lt;/span&gt;&lt;span&gt; ... /&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&amp;lt;/&lt;/span&gt;&lt;span&gt;svg&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;</description><pubDate>Tue, 23 Jun 2026 09:34:00 GMT</pubDate><category>Astro</category><category>Web development</category><category>Site design</category></item></channel></rss>