<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Lukas Trumm</title>
  <subtitle>Ideas about web engineering</subtitle>
  <link href="https://lukastrumm.com/feed.xml" rel="self"/>
  <link href="https://lukastrumm.com/"/>
  <updated>2026-10-23T00:00:00Z</updated>
  <id>https://lukastrumm.com/</id>
  <author>
    <name>Lukas Trumm</name>
    <email>lukas.trumm@gmail.com</email>
  </author>
  
  <entry>
    <title>Teach your agent to write better</title>
    <link href="https://lukastrumm.com/tips/teach-your-agent-to-write-better/"/>
    <updated>2026-10-23T00:00:00Z</updated>
    <id>https://lukastrumm.com/tips/teach-your-agent-to-write-better/</id>
    <content type="html">&lt;p&gt;Text output from LLMs doesn’t have a good reputation. It’s too long, hard to follow, and uses the wrong words or tone. That’s why I think it still holds that text meant for another person is better written by hand.&lt;/p&gt;
&lt;p&gt;Still, the cases where we have to read something generated by agents will probably keep growing. So how do we make the text output better? First, upgrade an old model. Opus 5.5, for example, is miles better than Opus 5.&lt;/p&gt;
&lt;p&gt;I often use a skill inspired by a tool for spotting odd AI clichés: &lt;a href=&quot;https://tools.simonwillison.net/llm-cliche-highlighter&quot;&gt;https://tools.simonwillison.net/llm-cliche-highlighter&lt;/a&gt;
I built a script for it that checks some of the principles deterministically too, e.g. the distribution of sentence lengths.&lt;/p&gt;
&lt;p&gt;Another skill I have is trained on what I wrote myself. I use it when it annoys me how formal some text is.&lt;/p&gt;
&lt;p&gt;And finally, when the agent’s answer is just needlessly long, I use the /tldr skill, which says: “Write it in 3 points at most”, and quite often that’s enough.&lt;/p&gt;
&lt;p&gt;You can find the skills mentioned above in my marketplace: &lt;a href=&quot;https://github.com/lttr/claude-marketplace/blob/master/plugins/writing/README.md&quot;&gt;https://github.com/lttr/claude-marketplace/blob/master/plugins/writing/README.md&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Use agents to filter what reaches you</title>
    <link href="https://lukastrumm.com/tips/use-agents-to-filter-what-reaches-you/"/>
    <updated>2026-10-15T00:00:00Z</updated>
    <id>https://lukastrumm.com/tips/use-agents-to-filter-what-reaches-you/</id>
    <content type="html">&lt;p&gt;So far I’ve used AI agents mostly interactively. Recently, though, I found a useful job for them: filtering the content I want to follow.&lt;/p&gt;
&lt;p&gt;With a Claude Managed Agent I built my own news feed that pulls together blogs and social media posts every day. The upside is that I can read it on an e-ink tablet, without being interrupted by ads or irrelevant posts.&lt;/p&gt;
&lt;p&gt;The second example is keeping track of software changes. For Claude Code, I occasionally run a skill that reads my configuration and works out which of all the new features are relevant to me. The skill is here: &lt;a href=&quot;https://github.com/lttr/claude-marketplace/blob/master/plugins/cc/skills/changelog/SKILL.md&quot;&gt;https://github.com/lttr/claude-marketplace/blob/master/plugins/cc/skills/changelog/SKILL.md&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Practice agentic engineering</title>
    <link href="https://lukastrumm.com/tips/practice-agentic-engineering/"/>
    <updated>2026-10-12T00:00:00Z</updated>
    <id>https://lukastrumm.com/tips/practice-agentic-engineering/</id>
    <content type="html">&lt;p&gt;Over the weekend I built a simple photo editing app (none of the existing really suit me 🙂), but at the end I wondered how I had actually built it. I used a coding agent, but also a surprising number of technical terms. I wrote zero lines of code and read only a couple. And yet I used quite a lot of software engineering. So was it vibe coded? Not really, since I care about the source code even though I haven’t read it. It was definitely not AI assisted development either. So it had to be agentically engineered, although on a very small scale. A weird term, but quite precise.&lt;/p&gt;
&lt;p&gt;The term was coined by Simon Willison, who first tried vibe engineering &lt;a href=&quot;https://simonwillison.net/2025/Oct/7/vibe-engineering/&quot;&gt;https://simonwillison.net/2025/Oct/7/vibe-engineering/&lt;/a&gt; but later settled on agentic engineering &lt;a href=&quot;https://simonwillison.net/guides/agentic-engineering-patterns/what-is-agentic-engineering/&quot;&gt;https://simonwillison.net/guides/agentic-engineering-patterns/what-is-agentic-engineering/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is a kind of interesting report on how Claude analyzed my work on the mentioned photo editing app: &lt;a href=&quot;https://html.lukastrumm.com/photo-cruiser-agentic-prompting/&quot;&gt;https://html.lukastrumm.com/photo-cruiser-agentic-prompting/&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Make stories from PR code reviews</title>
    <link href="https://lukastrumm.com/tips/make-stories-from-pr-code-reviews/"/>
    <updated>2026-10-06T00:00:00Z</updated>
    <id>https://lukastrumm.com/tips/make-stories-from-pr-code-reviews/</id>
    <content type="html">&lt;p&gt;You still need to review code, but these days it often makes more sense to look at it from a higher level. And when you spot something, you want to give the agent targeted feedback right in the context of that code.&lt;/p&gt;
&lt;p&gt;You can get the higher-level view by grouping the changes into distinct areas. Try it on any GitHub PR with a tool by Anthony Fu: &lt;a href=&quot;https://pulls.review/&quot;&gt;https://pulls.review&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The feedback part is a review tool you start right from an interactive session with the agent, which then hands your comments back to it. Matteo Collina built such a tool: &lt;a href=&quot;https://githuman.dev/&quot;&gt;https://githuman.dev&lt;/a&gt; I tried to build my own that combines both ideas and adds a bit more. It turned out not to be that hard: &lt;a href=&quot;https://github.com/lttr/git-history-viewer&quot;&gt;https://github.com/lttr/git-history-viewer&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If some simplification is welcome, or necessary because of the amount of changes you have to take in, it can help to have an HTML overview generated. Simon Willison described the approach: &lt;a href=&quot;https://simonwillison.net/guides/agentic-engineering-patterns/linear-walkthroughs/&quot;&gt;https://simonwillison.net/guides/agentic-engineering-patterns/linear-walkthroughs/&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Save 1/3 of the initial context in every Claude session</title>
    <link href="https://lukastrumm.com/tips/save-a-third-of-the-initial-context/"/>
    <updated>2026-09-25T00:00:00Z</updated>
    <id>https://lukastrumm.com/tips/save-a-third-of-the-initial-context/</id>
    <content type="html">&lt;p&gt;Out of the box Claude Code can do more than I need day to day, and every tool and feature costs tokens right at startup. In settings.json I limited what I rarely use and dropped about a third of the system prompt and built-in tools. The difference between models is even bigger. With optimized Opus 5.5 I start a session at 8k tokens, with unoptimized Sonnet 5 at 25k. Comparison: &lt;a href=&quot;https://html.lukastrumm.com/claude-context-compare/&quot;&gt;https://html.lukastrumm.com/claude-context-compare/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The saved context lets you stay in the “smart zone” longer, making better use of the model’s own intelligence. Any feature can be turned back on for a single session when needed. Here is each setting I limited and why: &lt;a href=&quot;https://github.com/lttr/dotfiles/blob/master/claude/README.md&quot;&gt;https://github.com/lttr/dotfiles/blob/master/claude/README.md&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Grill until shared understanding</title>
    <link href="https://lukastrumm.com/tips/grill-until-shared-understanding/"/>
    <updated>2026-09-18T00:00:00Z</updated>
    <id>https://lukastrumm.com/tips/grill-until-shared-understanding/</id>
    <content type="html">&lt;p&gt;Before the agent writes a plan or a spec, let it interview you. Matt Pocock calls this grilling. The AI will happily ask you 30 questions, to the point where it gets a bit uncomfortable. But that is the point, fill in all the gaps and replace the agent’s hidden decisions with your own.&lt;/p&gt;
&lt;p&gt;For me this works better than reading through a lengthy spec the agent generated from a thin brief. A side product is a shared vocabulary for more efficient communication, and a record of the important decisions.&lt;/p&gt;
&lt;p&gt;Details and a concrete skill here: &lt;a href=&quot;https://www.aihero.dev/skills-grill-me&quot;&gt;https://www.aihero.dev/skills-grill-me&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>One-off tools</title>
    <link href="https://lukastrumm.com/tips/one-off-tools/"/>
    <updated>2026-09-14T00:00:00Z</updated>
    <id>https://lukastrumm.com/tips/one-off-tools/</id>
    <content type="html">&lt;p&gt;Don’t hesitate to build your own tool or even a whole program for a single operation. For a woodworker this is a fairly common situation. When there is no tool at hand that fits the job exactly, they make one. A one-off tool improves the precision and elegance of the solution. With an agent, it takes minutes.&lt;/p&gt;
&lt;p&gt;For inspiration, here is the “Playground” skill: &lt;a href=&quot;https://github.com/anthropics/claude-plugins-official/tree/main/plugins/playground&quot;&gt;https://github.com/anthropics/claude-plugins-official/tree/main/plugins/playground&lt;/a&gt; and an elegant demonstration of building a one-off tool (the author is a designer, not a developer): &lt;a href=&quot;https://www.youtube.com/watch?v=lkKGQVHrXzE&amp;amp;t=2172s&quot;&gt;https://www.youtube.com/watch?v=lkKGQVHrXzE&amp;amp;t=2172s&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>AI on the comand line</title>
    <link href="https://lukastrumm.com/blog/ai-on-the-command-line/"/>
    <updated>2025-09-04T00:00:00Z</updated>
    <id>https://lukastrumm.com/blog/ai-on-the-command-line/</id>
    <content type="html">&lt;p&gt;Using AI tools on the command line leverages the elegance of UNIX utilities. The power of these programs lies in composability—each program has a specific focus, and you can chain the output of one as input to another.&lt;/p&gt;
&lt;p&gt;Creating new such programs is convenient with AI command line tools, which can perform smart tricks that are difficult to automate otherwise. Here are some examples of how I use it. I use &lt;code&gt;claude -p&lt;/code&gt;, which is the &lt;em&gt;headless&lt;/em&gt; mode of Claude Code, though similar functionality exists with tools from other providers.&lt;/p&gt;
&lt;p&gt;Headless mode runs Claude Code non-interactively, executing a single prompt and outputting results directly to the terminal. This enables seamless integration into scripts and automation workflows without manual interaction.&lt;/p&gt;
&lt;h2 id=&quot;headless-claude-in-action&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/ai-on-the-command-line/#headless-claude-in-action&quot;&gt;Headless Claude in action&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;quickly-generate-commit-in-a-repo%2C-no-questions-asked&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/ai-on-the-command-line/#quickly-generate-commit-in-a-repo%2C-no-questions-asked&quot;&gt;Quickly generate commit in a repo, no questions asked&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;From time to time I don’t care about the commit message but still want to commit from the command line after making changes.&lt;/p&gt;
&lt;p&gt;It’s important to note that Claude adds itself as a co-author of the commit, which may or may not be desirable. The &lt;code&gt;--allowedTools&lt;/code&gt; flag specifies which tool calls Claude can use without asking.&lt;/p&gt;
&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;claude &lt;span class=&quot;token parameter variable&quot;&gt;--allowedTools&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;Bash(git add:*),Bash(git commit:*)&#39;&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;just commit, no questions asked&#39;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I use a wrapper script called &lt;a href=&quot;https://github.com/lttr/dotfiles/blob/master/scripts/ai-tools/aic.sh&quot;&gt;aic&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;generate-a-bash-command&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/ai-on-the-command-line/#generate-a-bash-command&quot;&gt;Generate a Bash command&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This one is awesome since it combines the strength of AI with deterministic tools. Often I only need to be reminded about a few flags for a utility tool I haven’t used in a while.&lt;/p&gt;
&lt;p&gt;I use the alias &lt;a href=&quot;https://github.com/lttr/dotfiles/blob/master/scripts/ai-tools/aix.sh&quot;&gt;aix&lt;/a&gt;. The linked script outputs an explanation of the desired command, and the command itself is placed on the command line using &lt;code&gt;xdotool&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;claude &lt;span class=&quot;token parameter variable&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;You are a command line expert. Given a task, respond with a oneliner, that can be executed in Bash shell and would satisfy task instructions. I value readable output, long variant of arguments. DO output 2 lines: first line with short explanation of its arguments and second line with the oneliner command. Never output markdown.&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&amp;lt;example&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;List directory contents [ls -l] a long listing format [ls -t] sort by modification time, newest first&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;ls -lt&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&amp;lt;/example&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;Task: ... your description of a command ...&lt;/span&gt;&lt;br /&gt;&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;quick-questions-when-terminal-is-closer-than-chat-window&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/ai-on-the-command-line/#quick-questions-when-terminal-is-closer-than-chat-window&quot;&gt;Quick questions when terminal is closer than chat window&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;For one-off questions, it might be all you need. Keep in mind though that in this bare form it might not have the needed context.&lt;/p&gt;
&lt;p&gt;I have an alias &lt;code&gt;ai=&amp;quot;claude -p&amp;quot;&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;ai &lt;span class=&quot;token string&quot;&gt;&quot;latest nuxt release notes&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;analyze-data-in-a-way-that-is-not-possible-by-hand&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/ai-on-the-command-line/#analyze-data-in-a-way-that-is-not-possible-by-hand&quot;&gt;Analyze data in a way that is not possible by hand&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The pattern goes like:&lt;/p&gt;
&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;retrieve-my-data-somehow &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; ai &lt;span class=&quot;token string&quot;&gt;&quot;analyze ...&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Specific example: fetch Bluesky posts in a Nuxt feed and analyze the sentiment. There might potentially be a lot of data on the input, therefore a cheaper model (here Haiku) might be appropriate.&lt;/p&gt;
&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token function&quot;&gt;curl&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;https://public.api.bsky.app/xrpc/app.bsky.feed.getFeed?feed=at://did:plc:jbeaa5kdaladzwq3r7f5xgwe/app.bsky.feed.generator/nuxt&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; jq &lt;span class=&quot;token string&quot;&gt;&#39;.feed[].post.record.text&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; claude &lt;span class=&quot;token parameter variable&quot;&gt;--model&lt;/span&gt; haiku &lt;span class=&quot;token parameter variable&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;analyze overall sentiment of these posts&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;self-healing-linting&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/ai-on-the-command-line/#self-healing-linting&quot;&gt;Self healing linting&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Lint stuff that’s hard to lint using programmatic linters. A candidate for running in CI, but I’m not there yet. This checks for typos, but easily extends with other forms of linting.&lt;/p&gt;
&lt;p&gt;For example, in the scope of a Vue.js or Nuxt project with more junior team members: &lt;code&gt;Report inappropriate usage of composables&lt;/code&gt;&lt;/p&gt;
&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;claude &lt;span class=&quot;token parameter variable&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;You are a linter. Look at the changes vs main and report any issues related to typos. Follow strictly UNIX error format. Do not return any other text.&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&amp;lt;example&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;foo.js:5:10: Unexpected foo. [Error/foo]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;bar.js:6:11: Unexpected bar. [Warning/bar]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&amp;lt;/example&gt;&lt;/span&gt;&lt;br /&gt;&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then pipe the output into a file to check one by one in an editor (&lt;code&gt;tee&lt;/code&gt; is here to see the output and save into a file at the same time, &lt;code&gt;nvim&lt;/code&gt; stands for neovim, an editor of my choice).&lt;/p&gt;
&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;..&lt;/span&gt;. &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;tee&lt;/span&gt; linting-errors.txt&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;nvim &lt;span class=&quot;token parameter variable&quot;&gt;-q&lt;/span&gt; linting-errors.txt&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Or let AI fix it:&lt;/p&gt;
&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;..&lt;/span&gt;. &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; claude --permission-mode acceptEdit &lt;span class=&quot;token parameter variable&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;fix errors&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;executive-summary-for-dependencies-upgrade&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/ai-on-the-command-line/#executive-summary-for-dependencies-upgrade&quot;&gt;Executive summary for dependencies upgrade&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;I use this before updating dependencies. I typically start with &lt;code&gt;pnpm outdated&lt;/code&gt;. This script makes finding release notes and understanding them faster, especially for side projects where the process doesn’t need to be rigorous.&lt;/p&gt;
&lt;p&gt;Here &lt;code&gt;find-release-notes&lt;/code&gt; is a script that generates lists of release notes for outdated packages, covering their major and minor versions (from pnpm and GitHub).&lt;/p&gt;
&lt;p&gt;Claude tends to jump straight into action, so the &lt;code&gt;--permission-mode plan&lt;/code&gt; flag prevents Claude from editing files or calling pnpm.&lt;/p&gt;
&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;find-release-notes &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; claude --permission-mode plan &lt;span class=&quot;token parameter variable&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;What should I do to upgrade to these versions successfully? Do not upgrade yourself just tell me about important changes in dependencies.&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can find the script on my Github &lt;a href=&quot;https://github.com/lttr/dotfiles/blob/master/scripts/web/find-release-notes.js&quot;&gt;find-release-notes.js&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;aliases-and-scripts-which-i-use&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/ai-on-the-command-line/#aliases-and-scripts-which-i-use&quot;&gt;Aliases and scripts which I use&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;As with any prompting, these tools can be made much more effective or autonomous with proper prompt and context engineering. The auto commit utility can be instructed to follow specific commit message patterns and linted with regular expressions. Or the linting utility can cover many rules.&lt;/p&gt;
&lt;p&gt;My goal was to incorporate the simple approach into my day-to-day work, not to create sophisticated programs that won’t be used. Well at least this time.&lt;/p&gt;
&lt;p&gt;If you are interested, these are my current command line aliases (see implementation on my &lt;a href=&quot;https://github.com/lttr/dotfiles/tree/master/scripts/ai-tools&quot;&gt;github&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ai&lt;/code&gt; - execute prompt directly using Claude Code&lt;/li&gt;
&lt;li&gt;&lt;code&gt;aic&lt;/code&gt; - git commit message generation&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ailint&lt;/code&gt; - code linting and suggestions, currently looking for typos&lt;/li&gt;
&lt;li&gt;&lt;code&gt;aitokens&lt;/code&gt; - estimate number of tokens in files to be input in AI&lt;/li&gt;
&lt;li&gt;&lt;code&gt;aix&lt;/code&gt; - generate commands&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;conclusion&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/ai-on-the-command-line/#conclusion&quot;&gt;Conclusion&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;These techniques lower the friction between Unix tools and AI tools. The non-interactivity might be limiting, but it’s perfect for focused tasks where you need intelligence without conversation.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>The chef&#39;s table</title>
    <link href="https://lukastrumm.com/blog/the-chefs-table/"/>
    <updated>2025-03-20T00:00:00Z</updated>
    <id>https://lukastrumm.com/blog/the-chefs-table/</id>
    <content type="html">&lt;p&gt;An opportunity is an interesting thing. An opportunity has potential that may or may not be realised. And does it have a price? And a value?&lt;/p&gt;
&lt;p&gt;I was in Amsterdam, my first time at a big international conference. The last talk had been given and a party of sorts had begun. Well, maybe a good after-party, but I wanted to talk to others about all the interesting tech topics that had been opened up during the conference. Not really possible during a karaoke session…&lt;/p&gt;
&lt;p&gt;I chatted with Ujjwal from Igalia about feature support in browser engines. We wanted to get away from the noise, so we started walking away from the karaoke. A few other people had the same idea, while also talking about being hungry. Yeah, good idea, I thought. So a group of people formed in front of the conference building.&lt;/p&gt;
&lt;p&gt;A group of people? Well, I was beginning to feel rather uncomfortable. It was not “a” group. The biggest names I know from the JavaScript open source world were there. Evan You, Pooya Parsa, Daniel Roe, Matias Capeletto, Daniel Ehrenberg, Ujjwal Sharma and others. Anyway, they were all very nice, and I started to feel like it might be OK to go with them and draw some of their wisdom.&lt;/p&gt;
&lt;p&gt;Someone said he knew a nice place to eat. So after a while we got there, but the restaurant was very busy and there was no table for all of us. Except — &lt;em&gt;a chef’s table&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Never in my life have I eaten a dinner with such an extraordinary group of people. Never in my life have I eaten such luxurious food.&lt;/p&gt;
&lt;p&gt;It was an opportunity you can’t foresee. For me it was like a dream.&lt;/p&gt;
&lt;p&gt;I can count the price, but I can’t put a price on happiness. However only time will tell the value of this opportunity.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>UnJS libraries are growing</title>
    <link href="https://lukastrumm.com/blog/unjs-libraries-are-growing/"/>
    <updated>2024-10-11T00:00:00Z</updated>
    <id>https://lukastrumm.com/blog/unjs-libraries-are-growing/</id>
    <content type="html">&lt;p&gt;This week I had the opportunity to attend FrontKon, a conference in the Czech Republic for frontend developers and designers. I gave a short talk about UnJS, a growing set of libraries designed to simplify the creation of new frameworks and tools.&lt;/p&gt;
&lt;p&gt;UnJS packages are rapidly growing in popularity. Many of them were created during the development of Nuxt 3. There are more than 60 packages, with 400 million downloads per month and growing.&lt;/p&gt;
&lt;p&gt;The UnJS packages are used in many growing frameworks and tools such as Analog, TanStack Start, Solid Start, Vitest or Tailwind. They are definitely on to something.&lt;/p&gt;
&lt;h2 id=&quot;so-what-exactly-is-unjs%3F&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/unjs-libraries-are-growing/#so-what-exactly-is-unjs%3F&quot;&gt;So what exactly is UnJS?&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;It is a set of JavaScript libraries designed to work well together.
Each package within UnJS is built with a specific purpose in mind, which is very similar to the UNIX philosophy.&lt;/p&gt;
&lt;p&gt;What I like about it is that the libraries are pragmatic. They are not too small, like many packages on npm. They feel like lego bricks that fit together well.&lt;/p&gt;
&lt;p&gt;Since the libraries are used in frameworks like Nuxt, most of them are battle tested and you can find their real use in repositories on Github.&lt;/p&gt;
&lt;h2 id=&quot;unjs-has-good-leadership&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/unjs-libraries-are-growing/#unjs-has-good-leadership&quot;&gt;UnJS has good leadership&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A key aspect of UnJS is the leadership behind it, which addresses concerns about fragmented authorship seen in many npm packages. Pooya Parsa created most of the libraries in the UnJS ecosystem. Daniel Roe, the current Nuxt core team leader, and Anthony Fu, the creator of Vitest and several other influential libraries, are also key figures.&lt;/p&gt;
&lt;p&gt;A smaller number of maintainers is a big advantage in my eyes. A project with a lot of small dependencies depends on a lot of people. And it is only natural to have more unexpected changes and more vulnerabilities in such a case. UnJS feels much more coherent and transparent than a random set of npm packages.&lt;/p&gt;
&lt;p&gt;The maintainers of the UnJS packages are very welcoming. They strive to create very useful libraries and discuss many of their decisions publicly, as anyone can see on their &lt;a href=&quot;https://github.com/unjs&quot;&gt;Github organisation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;part-of-a-bigger-ecosystem&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/unjs-libraries-are-growing/#part-of-a-bigger-ecosystem&quot;&gt;Part of a bigger ecosystem&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;UnJS is part of a larger ecosystem of JavaScript tools. It is interesting to note that the values of the Vite bundler are very similar to those of UnJS.&lt;/p&gt;
&lt;p&gt;Evan You, the creator of Vite and Vue, mentioned the following key values at ViteConf 2024: Tooling should be unified, high performance, composable, and runtime agnostic.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Making sense of Web features</title>
    <link href="https://lukastrumm.com/blog/making-sense-of-web-features/"/>
    <updated>2024-09-12T00:00:00Z</updated>
    <id>https://lukastrumm.com/blog/making-sense-of-web-features/</id>
    <content type="html">&lt;p&gt;There is a huge amount of features on the web. The Browser Compatibility Data project lists more than 14000 of them! How to make sense of it all?&lt;/p&gt;
&lt;p&gt;This is a question that has been unanswered for a long time. Yes, every web developer uses &lt;a href=&quot;https://caniuse.com/&quot;&gt;caiuse.com&lt;/a&gt;. Or they google or maybe ask chatgpt. The problem is that these tools have answers to specific questions, but lack a bigger picture or links to the source of truth.&lt;/p&gt;
&lt;h2 id=&quot;the-webdx-group&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/making-sense-of-web-features/#the-webdx-group&quot;&gt;The WebDX Group&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Not anymore! The WebDX group is now doing an incredible job of organizing, categorizing, and naming things (← this is the hard part, as you know) around the web platform. They are trying to improve the overall developer experience with the web and browsers in a coordinated way.&lt;/p&gt;
&lt;p&gt;WebDX is a community group that is part of the W3C. You can see what they are cooking in their &lt;a href=&quot;https://github.com/web-platform-dx&quot;&gt;repositories&lt;/a&gt;. The most interesting output for me is the &lt;a href=&quot;https://github.com/web-platform-dx/web-features&quot;&gt;web-features repo&lt;/a&gt;. What they have done is to categorize a huge amount of specific features into a more understandable set of higher level features.&lt;/p&gt;
&lt;p&gt;For example, one of the newly available features is &lt;em&gt;Set methods&lt;/em&gt;. Any new method for manipulating a set could be a single feature. However, it becomes much more useful if it is communicated and documented as a single high-level feature.&lt;/p&gt;
&lt;h2 id=&quot;the-documentation&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/making-sense-of-web-features/#the-documentation&quot;&gt;The documentation&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The other part is how to find detailed information about &lt;em&gt;a feature&lt;/em&gt;. Well, this is where the &lt;a href=&quot;https://openwebdocs.org/&quot;&gt;Open Web Docs&lt;/a&gt; initiative came in. While MDN has always been a great reference, there has been a lack of hands-on content. The Open Web Docs group is trying to change that. They are cranking out a ton of new tutorials, guides, and explainers for MDN web documentation, as well as updates to the underlying data — &lt;a href=&quot;https://github.com/mdn/browser-compat-data&quot;&gt;BCD (Browser Compat Data)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;One example is a page on MDN about &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_colors/Relative_colors&quot;&gt;Relative colors&lt;/a&gt;. It is cleanly mapped to a high-level web feature. It provides much better understanding and context around that feature than the individual reference pages for each color feature.&lt;/p&gt;
&lt;h2 id=&quot;the-surveys&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/making-sense-of-web-features/#the-surveys&quot;&gt;The surveys&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;What is really nice about the above effort is that they really want to collaborate. They take input from surveys like &lt;a href=&quot;https://stateofhtml.com/&quot;&gt;The State of HTML&lt;/a&gt; and &lt;a href=&quot;https://stateofcss.com/&quot;&gt;The State of CSS&lt;/a&gt;, and later they can use the same set of names for web features to track survey results about them.&lt;/p&gt;
&lt;p&gt;And by the way, while you are filling out these surveys, you can click the “Add to Reading List” button. It will present you with links to MDN where you can learn more about exactly the things you didn’t know.&lt;/p&gt;
&lt;h2 id=&quot;the-reality&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/making-sense-of-web-features/#the-reality&quot;&gt;The Reality&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Great, but is the Web getting better? Hell, yes it is!&lt;/p&gt;
&lt;p&gt;The initiative to close the gap between desired features and actual availability across browsers is evident. Namely, the &lt;a href=&quot;https://wpt.fyi/interop-2024&quot;&gt;Interop&lt;/a&gt; project ensures that a set of features is implemented as fully as possible in all major browsers. There is a new iteration of this project every year.&lt;/p&gt;
&lt;p&gt;How much and how well these features are implemented is measured using Web Platform Tests. The same set of tests is run against all browsers. That is why we have these nice percentages that reflect the actual state of the features in the browsers.&lt;/p&gt;
&lt;h2 id=&quot;the-baseline&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/making-sense-of-web-features/#the-baseline&quot;&gt;The Baseline&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The moment when a feature is implemented in all major browsers is a very important moment. And since we have nicely grouped the features as described above - the only thing missing is a name for the moment. And there we have it: A feature is Baseline Newly available when it is supported by all major browsers. And a feature is Widely available when two and a half years have passed since it was Newly available.&lt;/p&gt;
&lt;p&gt;You can read more about the &lt;a href=&quot;https://web.dev/baseline/&quot;&gt;Baseline idea on web.dev&lt;/a&gt; since it was initiated by Google.&lt;/p&gt;
&lt;h2 id=&quot;the-visual-dashboards&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/making-sense-of-web-features/#the-visual-dashboards&quot;&gt;The visual dashboards&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Everything starts to make more sense when you can see it in a more visual way. Well-designed tables, graphs, handy links to resources right there…&lt;/p&gt;
&lt;p&gt;This is baked into a few attempts to create useful dashboards. Check them all out, each one is a different take on the subject:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://web-platform-dx.github.io/web-features-explorer/&quot;&gt;Simple dashboard from the folks behind the WebDX group&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://webstatus.dev/&quot;&gt;Nice graphs of passing web platform tests feature by feature by Google Chrome team&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;and &lt;a href=&quot;https://web-features.lttr.cz/&quot;&gt;my attempt to create a more interactive version&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can use them from time to time to catch up on what is new in general or what is new in the Wide adoption status. It is also a good reference when you are starting a new project and deciding what set of features is actually available and supported enough.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;https://lukastrumm.com/blog/making-sense-of-web-features/web-features-explorer.webp&quot; alt=&quot;&quot; /&gt;&lt;figcaption&gt;Web Features Explorer display the information in a clean way&lt;/figcaption&gt;&lt;/figure&gt;
&lt;figure&gt;&lt;img src=&quot;https://lukastrumm.com/blog/making-sense-of-web-features/webstatus.webp&quot; alt=&quot;&quot; /&gt;&lt;figcaption&gt;Webstatus.dev shows real progress on features in terms of passed web platform tests in graphs&lt;/figcaption&gt;&lt;/figure&gt;
&lt;figure&gt;&lt;img src=&quot;https://lukastrumm.com/blog/making-sense-of-web-features/web-platform-features.webp&quot; alt=&quot;&quot; /&gt;&lt;figcaption&gt;My Web Platform Features dashboard allows filtering and sorting features&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;the-future&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/making-sense-of-web-features/#the-future&quot;&gt;The future&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Some features have recently been implemented in all browsers rather quickly. But some may not even be considered a good idea by some browser makers. You can find detailed information about what may or may not be coming at the following sites:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://mozilla.github.io/standards-positions/&quot;&gt;Mozilla standards positions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://webkit.org/standards-positions/&quot;&gt;Webkit team standards positions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://chromestatus.com/roadmap&quot;&gt;Google Chrome feature roadmap&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;conclusion&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/making-sense-of-web-features/#conclusion&quot;&gt;Conclusion&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Watching the web platform evolve is fascinating. The feedback loop is improving. Interoperability is getting better in many areas.&lt;/p&gt;
&lt;p&gt;I have wanted to have a useful dashboard with web features for a long time, and suddenly the data is of such nice quality that I managed to build &lt;a href=&quot;https://web-features.lttr.cz/&quot;&gt;my own&lt;/a&gt; in a couple of evenings.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Committing to writing</title>
    <link href="https://lukastrumm.com/blog/committing-to-writing/"/>
    <updated>2024-08-12T00:00:00Z</updated>
    <id>https://lukastrumm.com/blog/committing-to-writing/</id>
    <content type="html">&lt;p&gt;I have been struggling to write regularly for quite some time. I wanted to write more, publish blog posts and I’m even dreaming of writing a book in the future.&lt;/p&gt;
&lt;p&gt;As usual I am procrastinating this activity a big time. Until today. I finally feel confident in my ability to write, to write several times a week and to stick with it for some time.&lt;/p&gt;
&lt;p&gt;I have the feeling that I recognize myself. I have been there before. It is a feeling where all the conditions are met and you are ready. I had that feeling when I started running almost every day. And it worked, I still run several times a week ten years later.&lt;/p&gt;
&lt;p&gt;There have been a number of reasons for me to write periodically for me. But looking at my website I struggle: 10 posts in 4 years. Better than nothing, maybe.&lt;/p&gt;
&lt;p&gt;So, the reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;writing forces you to shape your ideas&lt;/li&gt;
&lt;li&gt;publishing ideas makes it easy to share them&lt;/li&gt;
&lt;li&gt;publishing ideas makes it easy to archive them&lt;/li&gt;
&lt;li&gt;others can &lt;em&gt;see&lt;/em&gt; what you know&lt;/li&gt;
&lt;li&gt;writing itself puts you in a great state of flow&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There could be more reasons but this is enough. Each item on this list is great in itself.&lt;/p&gt;
&lt;h2 id=&quot;why-am-i-confident-now%3F&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/committing-to-writing/#why-am-i-confident-now%3F&quot;&gt;Why am I confident now?&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Now what are the conditions? Why do I feel confident, that I will be able to write consistently?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I have a stable work schedule, and especially being able to start with my day early in the morning, which is a great time to write.&lt;/li&gt;
&lt;li&gt;I have a lot of ideas. Every week I tell myself to write about something.&lt;/li&gt;
&lt;li&gt;I have some confidence that it will be worth it. This is a classic problem—everything has already been written on the internet—so why should I bother.&lt;/li&gt;
&lt;li&gt;I have a publishing workflow. Write markdown, commit and push. Easy, isn’t it? My favourite editor for writing at the moment is Obsidian with vim keybindings. I like the semi-wysiwyg way of writing markdown. I also already write markdown notes several times a week.&lt;/li&gt;
&lt;li&gt;I believe I know enough English to express the ideas I have in mind.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Only time will tell if I will be successful. But I already have a few people to
thank:&lt;/p&gt;
&lt;p&gt;About the importance of blogging and owning your content I have learned from &lt;a href=&quot;https://www.hanselman.com/blog&quot;&gt;Scott Hanselman&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;From &lt;a href=&quot;https://www.swyx.io/learn-in-public&quot;&gt;Swyx&lt;/a&gt; I have learned about &lt;em&gt;learning in public&lt;/em&gt; and being curious about various web technologies.&lt;/p&gt;
&lt;p&gt;I have studied some ways of writing in a more aproachable way, e.g. on &lt;a href=&quot;https://writy.io/&quot;&gt;writy.io&lt;/a&gt; by Maedah Batool.&lt;/p&gt;
&lt;p&gt;And most recently I have read a great article about writing from a leading Czech frontend engineer Martin Michálek on &lt;a href=&quot;https://www.vzhurudolu.cz/prirucka/psani&quot;&gt;https://www.vzhurudolu.cz/prirucka/psani&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Working with correct versions of tools in the JavaScript ecosystem</title>
    <link href="https://lukastrumm.com/blog/2023/working-with-correct-versions-of-tools-in-the-javascript-ecosystem/"/>
    <updated>2023-04-03T00:00:00Z</updated>
    <id>https://lukastrumm.com/blog/2023/working-with-correct-versions-of-tools-in-the-javascript-ecosystem/</id>
    <content type="html">&lt;p&gt;The ideal is to have the desired version of every tool at every situation during both development and deployment. Docker might be the answer for someone, but it might not be practical to use it all the time. Let’s analyze the situation.&lt;/p&gt;
&lt;p&gt;There is an initiative called &lt;a href=&quot;https://containers.dev/&quot;&gt;devcontainers&lt;/a&gt; to improve the practicality of the docker solution, but I’m not going to discuss that in this article.&lt;/p&gt;
&lt;h2 id=&quot;definitions&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/working-with-correct-versions-of-tools-in-the-javascript-ecosystem/#definitions&quot;&gt;Definitions&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;By &lt;strong&gt;tool,&lt;/strong&gt; I mean the runtime (like &lt;code&gt;nodejs&lt;/code&gt;), package manager (like &lt;code&gt;pnpm&lt;/code&gt;), and others (&lt;code&gt;docker&lt;/code&gt;, &lt;code&gt;git&lt;/code&gt;, and other CLI tools).&lt;/p&gt;
&lt;p&gt;By &lt;strong&gt;situation,&lt;/strong&gt; I mean running your first command after &lt;code&gt;git clone&lt;/code&gt;, running a command after switching &lt;code&gt;git branch&lt;/code&gt;, or running a command in a &lt;code&gt;CI/CD&lt;/code&gt; pipeline.&lt;/p&gt;
&lt;h3 id=&quot;there-are-several-levels-of-perfection&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/working-with-correct-versions-of-tools-in-the-javascript-ecosystem/#there-are-several-levels-of-perfection&quot;&gt;There are several levels of perfection&lt;/a&gt;&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Nothing. When something breaks, someone might fix it.&lt;/li&gt;
&lt;li&gt;Documentation. &lt;a href=&quot;http://readme.md/&quot;&gt;README.md&lt;/a&gt;. After following the docs carefully, a developer should be on the correct version of tools. Extra communication is necessary when updating versions.&lt;/li&gt;
&lt;li&gt;Enforcement. There is configuration in place which forces certain tool versions and refuses to operate otherwise.&lt;/li&gt;
&lt;li&gt;Automagic. The environment (either local or in CI) is set up in such a way, that it automatically uses (and installs before) correct versions of tools as configured. Might be harder to achieve without extra maintenance and documentation.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Based on these options, I think there is no ideal solution.&lt;/p&gt;
&lt;p&gt;For small or personal projects (1) may be enough.
For projects, that are not actively developed, (2) may be appropriate.
When issues with incorrect versions occurs, it is time to make some safeguards (3).
For larger teams or larger amount of projects per developer, it might be beneficial to invest into automation (4).&lt;/p&gt;
&lt;h2 id=&quot;how-to&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/working-with-correct-versions-of-tools-in-the-javascript-ecosystem/#how-to&quot;&gt;How to&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A lot of the times it is enough to specify the major version. Like &lt;code&gt;node 18&lt;/code&gt;, &lt;code&gt;yarn 1&lt;/code&gt; etc. I personally run into most issues because of switching between projects that uses different major versions of tools.&lt;/p&gt;
&lt;h3 id=&quot;use-the-correct-version-in-ci%2Fcd&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/working-with-correct-versions-of-tools-in-the-javascript-ecosystem/#use-the-correct-version-in-ci%2Fcd&quot;&gt;Use the correct version in CI/CD&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;CI/CD needs to be configured in code, ideally in the same repo as the rest of the application code. That way, the definition of versions are closer between local and production environment. One might choose to use &lt;code&gt;docker&lt;/code&gt; to make sure, that the whole environment is the same, but it is not always practical (might be slower for local development, might not fit the app architecture, might require unnecessary know-how).&lt;/p&gt;
&lt;h3 id=&quot;use-the-correct-version-of-the-runtime&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/working-with-correct-versions-of-tools-in-the-javascript-ecosystem/#use-the-correct-version-of-the-runtime&quot;&gt;Use the correct version of the runtime&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;I will focus on &lt;code&gt;nodejs&lt;/code&gt; versions. One might soon need to deal with other runtimes like &lt;code&gt;deno&lt;/code&gt; or &lt;code&gt;bun&lt;/code&gt;, but leave that for another time.&lt;/p&gt;
&lt;p&gt;To enforce a valid version you can use the &lt;code&gt;engines&lt;/code&gt; field in &lt;code&gt;package.json&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&quot;language-json&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token property&quot;&gt;&quot;engines&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;&quot;node&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&gt;=18&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That will inform you about wrong version, but it does not do anything about it. What you want is a tool that installs and/or switches to the correct version whenever you switch directories on your command line.&lt;/p&gt;
&lt;p&gt;First, you configure the desired version. Something like this (I use this with &lt;code&gt;fnm&lt;/code&gt;, but different tools need different configuration):&lt;/p&gt;
&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token function&quot;&gt;node&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;--version&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; .node-version&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And then setup a tool and your command line shell. Some options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/Schniz/fnm&quot;&gt;fnm&lt;/a&gt; is simple&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.volta.sh/&quot;&gt;volta&lt;/a&gt; can manage node, package manager and other tools from NPM&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://asdf-vm.com/&quot;&gt;asdf&lt;/a&gt; is good when you need to handle more languages&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;use-the-correct-package-manager&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/working-with-correct-versions-of-tools-in-the-javascript-ecosystem/#use-the-correct-package-manager&quot;&gt;Use the correct package manager&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;You can go far with a set of shell aliases or functions. I have recently switched to using &lt;a href=&quot;https://github.com/antfu/ni&quot;&gt;@antfu/ni&lt;/a&gt; and it is way better. You can stop warring about the package manager a given project is using from now.&lt;/p&gt;
&lt;h3 id=&quot;use-the-correct-version-of-the-package-manager&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/working-with-correct-versions-of-tools-in-the-javascript-ecosystem/#use-the-correct-version-of-the-package-manager&quot;&gt;Use the correct version of the package manager&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This is more tricky, but using the &lt;code&gt;engines&lt;/code&gt; field in &lt;code&gt;package.json&lt;/code&gt; can enforce a version range.&lt;/p&gt;
&lt;pre class=&quot;language-json&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token property&quot;&gt;&quot;engines&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;	&lt;span class=&quot;token property&quot;&gt;&quot;node&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&gt;=18&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;	&lt;span class=&quot;token property&quot;&gt;&quot;pnpm&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&gt;=7&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Corepack (mentioned below) should improve this point in the future.&lt;/p&gt;
&lt;h3 id=&quot;use-the-correct-versions-of-formatting%2C-linting-and-building-tools&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/working-with-correct-versions-of-tools-in-the-javascript-ecosystem/#use-the-correct-versions-of-formatting%2C-linting-and-building-tools&quot;&gt;Use the correct versions of formatting, linting and building tools&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Define them as &lt;code&gt;devDependencies&lt;/code&gt; and use them via &lt;code&gt;scripts&lt;/code&gt;. Like &lt;code&gt;nr build&lt;/code&gt; from &lt;code&gt;@antfu/ni&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Careful about running them ad hoc, there are a lot of details behind commands like &lt;code&gt;npm exec&lt;/code&gt;, &lt;code&gt;npm x&lt;/code&gt;, &lt;code&gt;npx&lt;/code&gt; , &lt;code&gt;pnpm dlx&lt;/code&gt;, &lt;code&gt;pnpm exec&lt;/code&gt;, …&lt;/p&gt;
&lt;h2 id=&quot;alternatives-and-the-future&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/working-with-correct-versions-of-tools-in-the-javascript-ecosystem/#alternatives-and-the-future&quot;&gt;Alternatives and the future&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;helper-npm-packages&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/working-with-correct-versions-of-tools-in-the-javascript-ecosystem/#helper-npm-packages&quot;&gt;Helper NPM packages&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;There are NPM packages that might help (e.g. &lt;a href=&quot;https://github.com/pnpm/only-allow&quot;&gt;only-allow&lt;/a&gt;). The problem is that it might not work all the time (looking at GitHub issues…) and it is an extra dependency.&lt;/p&gt;
&lt;h3 id=&quot;package-manager-policies&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/working-with-correct-versions-of-tools-in-the-javascript-ecosystem/#package-manager-policies&quot;&gt;Package manager policies&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;If you are using &lt;code&gt;yarn&lt;/code&gt; a lot, it might be worth looking it its version enforcement solution, which is &lt;a href=&quot;https://classic.yarnpkg.com/en/docs/cli/policies/#toc-policies-set-version&quot;&gt;documented here&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;corepack&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/working-with-correct-versions-of-tools-in-the-javascript-ecosystem/#corepack&quot;&gt;Corepack&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://nodejs.org/api/corepack.html&quot;&gt;Corepack&lt;/a&gt; probably will be the way to go—it will manage the versions of package managers for you, using &lt;code&gt;&amp;quot;packageManager&amp;quot;&lt;/code&gt; field in &lt;code&gt;package.json&lt;/code&gt;. It is still experimental and various tools might not work with it yet.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/working-with-correct-versions-of-tools-in-the-javascript-ecosystem/#conclusion&quot;&gt;Conclusion&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The JavaScript ecosystem is moving fast. If you want to be up to date you need tooling that help you keep your sanity. With tooling that I have described in this article, you can forget about some aspects of dependency management—and that is a good thing.&lt;/p&gt;
&lt;h2 id=&quot;update-in-2025&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/working-with-correct-versions-of-tools-in-the-javascript-ecosystem/#update-in-2025&quot;&gt;Update in 2025&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The engines field is still useful. I use it to specify NodeJS version for &lt;a href=&quot;https://nixpacks.com/docs/providers/node&quot;&gt;Nixpacks&lt;/a&gt;, a build tool that infer most information from a project setup.&lt;/p&gt;
&lt;p&gt;I’m not happy with Corepack. It does not work seamlessly as one would expect. I
had issues with &lt;code&gt;pnpm&lt;/code&gt; not being on the path on my Linux machine from time to
time. Support in some environment was lacking.&lt;/p&gt;
&lt;p&gt;What I like now is again &lt;code&gt;pnpm&lt;/code&gt;, which automatically installs the right version
of itself based on the &lt;code&gt;packageManager&lt;/code&gt; field in &lt;code&gt;package.json&lt;/code&gt; since version 10. In environments where Corepack is running well, it works with this setup, since
all that is needed is the same &lt;code&gt;packageManager&lt;/code&gt; field.&lt;/p&gt;
&lt;p&gt;You can do a package manager update like this (after &lt;code&gt;pnpm&lt;/code&gt; is managing its
versions, instead of Corepack):&lt;/p&gt;
&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token function&quot;&gt;pnpm&lt;/span&gt; self-update&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token function&quot;&gt;pnpm&lt;/span&gt; pkg &lt;span class=&quot;token builtin class-name&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;token assign-left variable&quot;&gt;packageManager&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;pnpm@&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;pnpm&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;--version&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For upgrading Node version in a project I use:&lt;/p&gt;
&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;fnm &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;--lts&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;fnm use lts-latest&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token function&quot;&gt;node&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;--version&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; .node-version&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And run tests and other validations, update other environments if needed.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>77+ questions about a web project</title>
    <link href="https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/"/>
    <updated>2023-02-08T00:00:00Z</updated>
    <id>https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/</id>
    <content type="html">&lt;p&gt;You were asked to build a website? Does it seem it will be a larger one? It
might be the case it will actually not be a website but a webapp. It might need
a team to actually do it. Well, better prepare answers for these couple of
questions :-)&lt;/p&gt;
&lt;p&gt;[[toc]]&lt;/p&gt;
&lt;h2 id=&quot;vision-and-requirements&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#vision-and-requirements&quot;&gt;Vision and requirements&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Is there a short document &lt;strong&gt;explaining why&lt;/strong&gt; this piece of software should
exist and a concise description how it would accomplish that?&lt;/li&gt;
&lt;li&gt;Do we have a place for &lt;strong&gt;collecting and prioritizing&lt;/strong&gt; requirements?&lt;/li&gt;
&lt;li&gt;Are &lt;strong&gt;non-functional requirements&lt;/strong&gt; written somewhere?&lt;/li&gt;
&lt;li&gt;Do we have a &lt;strong&gt;schedule&lt;/strong&gt; or milestones which describes at least roughly what
will be done when?&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;communication&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#communication&quot;&gt;Communication&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Can you think of any &lt;strong&gt;expectations&lt;/strong&gt; that are not described by current
requirements?&lt;/li&gt;
&lt;li&gt;Will the &lt;strong&gt;customer collaborate&lt;/strong&gt; with us on a regular basis?
&lt;sup class=&quot;footnote-ref&quot;&gt;&lt;a href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#fn1&quot; id=&quot;fnref1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;technical-environment&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#technical-environment&quot;&gt;Technical environment&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Does anyone from the team have a specific &lt;strong&gt;know-how&lt;/strong&gt; which is necessary /
effective to leverage for successful completion of the project?&lt;/li&gt;
&lt;li&gt;Will there be a reasonable return of investment from &lt;strong&gt;learning&lt;/strong&gt; and
implementing new technologies? Would it be easier to hire new people with such
skills?&lt;/li&gt;
&lt;li&gt;Are there &lt;strong&gt;existing systems&lt;/strong&gt; like CMSes or APIs that needs to be integrated?&lt;/li&gt;
&lt;li&gt;Are there existing URL addresses or domains that needs to be &lt;strong&gt;redirected&lt;/strong&gt; to
new ones once the new website will be released?&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;infrastructure&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#infrastructure&quot;&gt;Infrastructure&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Is there a possibility that currently running systems will be negatively
impacted after deploying this new application on target domain?&lt;/li&gt;
&lt;li&gt;How will we &lt;strong&gt;host&lt;/strong&gt; our website or application? Is it possible to change it
now or in the future?&lt;/li&gt;
&lt;li&gt;What are the pros and cons of chosen hosting environment over some more
traditional choice?&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;users&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#users&quot;&gt;Users&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Do we have some existing &lt;strong&gt;analytics data&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;How many users&lt;/strong&gt; do we expect first day, first month, first year?&lt;/li&gt;
&lt;li&gt;Which &lt;strong&gt;browsers&lt;/strong&gt; and their versions are going to be supported?&lt;/li&gt;
&lt;li&gt;Would the project suffer from missing &lt;strong&gt;accessibility&lt;/strong&gt; features? Is it a
subject of regulation?&lt;/li&gt;
&lt;li&gt;Is it any good to provide users with a &lt;strong&gt;chatbot&lt;/strong&gt; and is it worth the effort
and possible performance issues?&lt;/li&gt;
&lt;li&gt;Are there any use cases for our website/application to be used &lt;strong&gt;without
JavaScript&lt;/strong&gt; enabled?&lt;/li&gt;
&lt;li&gt;Do our users need more language mutations and other &lt;strong&gt;internationalization&lt;/strong&gt;
adaptations? Will we need to support a RTL language?&lt;/li&gt;
&lt;li&gt;Will we need to build &lt;strong&gt;multiple variants&lt;/strong&gt; of the software for different
users/customers?&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;code&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#code&quot;&gt;Code&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;What is/will not be in a &lt;strong&gt;version control&lt;/strong&gt; system? (like secrets, documents,
etc.)&lt;/li&gt;
&lt;li&gt;Is there a &lt;strong&gt;&lt;code&gt;README.md&lt;/code&gt;&lt;/strong&gt; file which has enough information for any developer
to run the application, test it or prepare it for production?&lt;/li&gt;
&lt;li&gt;Does every developer have an automatic way of &lt;strong&gt;formatting&lt;/strong&gt; new code? (in
editor on save, precommit hook)&lt;/li&gt;
&lt;li&gt;Is there a process in CI that checks common code &lt;strong&gt;style issues&lt;/strong&gt; for every
change? (i.e. linting)&lt;/li&gt;
&lt;li&gt;Is there a process in place that ensures that all code is &lt;strong&gt;checked for
quality&lt;/strong&gt;? (code reviews, automated tests and checks)&lt;/li&gt;
&lt;li&gt;Does every developer know when and how a code review is needed and when it is
appropriate to merge? &lt;sup class=&quot;footnote-ref&quot;&gt;&lt;a href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#fn2&quot; id=&quot;fnref2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;Are there some automated &lt;strong&gt;checks for security&lt;/strong&gt;? &lt;sup class=&quot;footnote-ref&quot;&gt;&lt;a href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#fn3&quot; id=&quot;fnref3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;Is there a &lt;strong&gt;CI/CD&lt;/strong&gt; pipeline that deploys every change? (continuous
deployment)&lt;/li&gt;
&lt;li&gt;Is there a &lt;strong&gt;preview environment&lt;/strong&gt; for every change and is it practical to
have them?&lt;/li&gt;
&lt;li&gt;Do we have know-how when and how to use unit &lt;strong&gt;testing&lt;/strong&gt;, integration testing
or end-to-end testing?&lt;/li&gt;
&lt;li&gt;Do we use the right programming &lt;strong&gt;language&lt;/strong&gt; for the job?&lt;/li&gt;
&lt;li&gt;Which &lt;strong&gt;framework&lt;/strong&gt; do we use, what it solves and what problems it does not
solve?&lt;/li&gt;
&lt;li&gt;Is there a way to &lt;strong&gt;generate&lt;/strong&gt; some boring boilerplate code?&lt;/li&gt;
&lt;li&gt;Do we have a set of &lt;strong&gt;testing data&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;Can we develop against this data set without even running the database?&lt;/li&gt;
&lt;li&gt;Will there be only one &lt;strong&gt;version of the software&lt;/strong&gt; at a time? Or will we have
to support multiple versions with following maintenance?&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;runtime&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#runtime&quot;&gt;Runtime&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Does the web app handle &lt;strong&gt;redeployments&lt;/strong&gt; of static assets seamlessly?&lt;/li&gt;
&lt;li&gt;How will the web app handle a breaking &lt;strong&gt;change in backend APIs&lt;/strong&gt; while an old
version of frontend code is still running on the client side?&lt;/li&gt;
&lt;li&gt;How is the cache on the &lt;strong&gt;CDN&lt;/strong&gt; level invalidated?&lt;/li&gt;
&lt;li&gt;Do we send correct &lt;strong&gt;security headers&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;Do we send correct &lt;strong&gt;cache&lt;/strong&gt; headers for HTML, data requests and assets?&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;seo&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#seo&quot;&gt;SEO&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Does every page have its &lt;strong&gt;canonical URL&lt;/strong&gt;? &lt;sup class=&quot;footnote-ref&quot;&gt;&lt;a href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#fn4&quot; id=&quot;fnref4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;Does our canonical URLs end with or without a slash? Do all redirects, sitemap
items and links target this canonical URL?&lt;/li&gt;
&lt;li&gt;Do our domain default to &lt;strong&gt;www&lt;/strong&gt; prefix?&lt;/li&gt;
&lt;li&gt;Do we need more control over Google results, and will we use Google search
console? Will we use structured data?&lt;/li&gt;
&lt;li&gt;Which website &lt;strong&gt;analytics&lt;/strong&gt; solution will be used? Will we try to project for
missing data (blocked by users or usage before consent) and how?&lt;/li&gt;
&lt;li&gt;Do we have a complete &lt;strong&gt;sitemap&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;Do we have a &lt;strong&gt;robots.txt&lt;/strong&gt;? Does it contain only necessary records?&lt;/li&gt;
&lt;li&gt;Do we have a page on the site for every frequent &lt;strong&gt;search term&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;How are we managing &lt;strong&gt;third party scripts&lt;/strong&gt;? Do we need Google Tag Manager?
How much will be the performance influenced by third party scripts?&lt;/li&gt;
&lt;li&gt;Does the application respond with correct &lt;strong&gt;response codes&lt;/strong&gt;? An unknown URL
should be 404 etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;performance%2C-ux%2C-a11y&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#performance%2C-ux%2C-a11y&quot;&gt;Performance, UX, a11y&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Is it OK to display &lt;strong&gt;loading spinners&lt;/strong&gt; for 10 seconds on a 3G network before
displaying the content?&lt;/li&gt;
&lt;li&gt;Will we have to do &lt;strong&gt;image preprocessing&lt;/strong&gt;? Will it be a hosted solution? Do
we care about resolutions and formats of those shipped images?&lt;/li&gt;
&lt;li&gt;Is it useful to measure &lt;strong&gt;Core web vitals&lt;/strong&gt; regularly/automatically?&lt;/li&gt;
&lt;li&gt;Will we use &lt;strong&gt;progressive enhancement&lt;/strong&gt; techniques? Does our team have
knowledge to do so?&lt;/li&gt;
&lt;li&gt;Are we going to optimize the amount of &lt;strong&gt;generated CSS&lt;/strong&gt;? How?&lt;/li&gt;
&lt;li&gt;Can be the desired set of fonts optimized in order to prevent &lt;em&gt;Flash of
unstyled fonts&lt;/em&gt; for most users?&lt;/li&gt;
&lt;li&gt;Which level of &lt;strong&gt;accessibility&lt;/strong&gt; will be our target? Do we have someone who
understands accessibility on this level?&lt;/li&gt;
&lt;li&gt;Do we have a plan for hallway &lt;strong&gt;usability testing&lt;/strong&gt;?
&lt;sup class=&quot;footnote-ref&quot;&gt;&lt;a href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#fn5&quot; id=&quot;fnref5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;design&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#design&quot;&gt;Design&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;How does our &lt;strong&gt;design process&lt;/strong&gt; look like? How are responsibilities
distributed among designers, developers, marketers, product or UX people?&lt;/li&gt;
&lt;li&gt;Do we need our own &lt;strong&gt;design system&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;Which &lt;strong&gt;tools and techniques&lt;/strong&gt; we will use (preprocessing, postprocessing,
feature detection, polyfills, CSS structure and layering, scoping, reset, RTL
support…)?&lt;/li&gt;
&lt;li&gt;How will we approach responsive design? &lt;strong&gt;Mobile or desktop first&lt;/strong&gt;, strict
set of media queries or more fluid techniques, leverage container queries?&lt;/li&gt;
&lt;li&gt;Which &lt;strong&gt;set of icons&lt;/strong&gt; we will use? Will it play well with our framework of
choice?&lt;/li&gt;
&lt;li&gt;Do we have a live web with our &lt;strong&gt;style guide&lt;/strong&gt;?&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;legal&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#legal&quot;&gt;Legal&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Is it necessary to have a &lt;strong&gt;cookie consent&lt;/strong&gt; on the website?&lt;/li&gt;
&lt;li&gt;In case we need a cookie consent would it be beneficial to use a third party
solution? Will we use the analytics from that solution for something?&lt;/li&gt;
&lt;li&gt;Do we need to implement something extra in order to comply with &lt;strong&gt;privacy
laws&lt;/strong&gt; like GDPR?&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;maintenance&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#maintenance&quot;&gt;Maintenance&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Where will we &lt;strong&gt;track tasks and bugs&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;How can our &lt;strong&gt;customers report&lt;/strong&gt; bugs?&lt;/li&gt;
&lt;li&gt;Do we have an automated system for &lt;strong&gt;reporting runtime errors&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;How are our production systems &lt;strong&gt;backuped&lt;/strong&gt;? When was the last time we have
done a restoration from those backups?&lt;/li&gt;
&lt;li&gt;How often there is a change in some data or source code? For how long will our
system handle the increasing frequency of change?&lt;/li&gt;
&lt;li&gt;Which types of changes would our &lt;strong&gt;architecture&lt;/strong&gt; allow easily and which would
be hard?&lt;/li&gt;
&lt;li&gt;Do we have a place for writing down &lt;strong&gt;maintenance procedures&lt;/strong&gt;? (E.g. updating
dependencies, data schema migration, adding redirects, etc.)&lt;/li&gt;
&lt;li&gt;Who manages credentials and how? Do we need to use an external service for
them? Do we need to rotate them?&lt;/li&gt;
&lt;li&gt;Is there a single place (like a URL) which anybody from the team can visit and
see important links or other useful information about the project? (I call
this a &lt;strong&gt;project signpost&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;Do we need to track special events in the system, like &lt;strong&gt;conversions&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;Do we have a way to automatically check for links that accidentally targets
&lt;strong&gt;PAGE NOT FOUND&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;Does our &lt;strong&gt;monitoring, logging&lt;/strong&gt; and tracking solution solve real problems?&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;marketing-and-sales&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#marketing-and-sales&quot;&gt;Marketing and sales&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;How does marketing or sales strategy correspond to a &lt;strong&gt;release date&lt;/strong&gt; of our
product?&lt;/li&gt;
&lt;li&gt;Do we focus enough on &lt;strong&gt;feedback&lt;/strong&gt; from users, developers, investors?&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;the-bottom-line&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#the-bottom-line&quot;&gt;The bottom line&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This is not an exhaustive list, although I was trying to be complete—based on
my experience. BUT keep in mind that it is also critical to &lt;strong&gt;maximize the
amount of work that does not need to be done!&lt;/strong&gt; &lt;sup class=&quot;footnote-ref&quot;&gt;&lt;a href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#fn6&quot; id=&quot;fnref6&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;h4 class=&quot;footnotes-title&quot;&gt;Notes&lt;/h4&gt;
&lt;section class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;&lt;li id=&quot;fn1&quot; class=&quot;footnote-item&quot;&gt;&lt;p&gt;From &lt;a href=&quot;https://agilemanifesto.org/&quot;&gt;Agile manifesto&lt;/a&gt;:
Customer collaboration over contract negotiation &lt;a href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#fnref1&quot; class=&quot;footnote-backref&quot;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn2&quot; class=&quot;footnote-item&quot;&gt;&lt;p&gt;One nice strategy for this is called &lt;a href=&quot;https://martinfowler.com/articles/ship-show-ask.html&quot;&gt;Ship / Show /
Ask&lt;/a&gt; &lt;a href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#fnref2&quot; class=&quot;footnote-backref&quot;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn3&quot; class=&quot;footnote-item&quot;&gt;&lt;p&gt;For example GitHub has tools for automated checks of
&lt;a href=&quot;https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates&quot;&gt;dependencies&lt;/a&gt;
and &lt;a href=&quot;https://github.com/github/codeql-action&quot;&gt;static code analysis&lt;/a&gt; &lt;a href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#fnref3&quot; class=&quot;footnote-backref&quot;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn4&quot; class=&quot;footnote-item&quot;&gt;&lt;p&gt;There are quite a few rules for canonical URLs so it is best
to consult &lt;a href=&quot;https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls&quot;&gt;Google search
documentation&lt;/a&gt; &lt;a href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#fnref4&quot; class=&quot;footnote-backref&quot;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn5&quot; class=&quot;footnote-item&quot;&gt;&lt;p&gt;Hallway usability testing is mentioned for example
in the famous &lt;a href=&quot;https://www.joelonsoftware.com/2000/08/09/the-joel-test-12-steps-to-better-code/&quot;&gt;Joel’s
test&lt;/a&gt; &lt;a href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#fnref5&quot; class=&quot;footnote-backref&quot;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn6&quot; class=&quot;footnote-item&quot;&gt;&lt;p&gt;Again a quote from &lt;a href=&quot;https://agilemanifesto.org/&quot;&gt;Agile
manifesto&lt;/a&gt; &lt;a href=&quot;https://lukastrumm.com/blog/2023/77+-questions-about-a-web-project/#fnref6&quot; class=&quot;footnote-backref&quot;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
</content>
  </entry>
  
  <entry>
    <title>Multi-branch, multi-language website story</title>
    <link href="https://lukastrumm.com/blog/2022/multi-branch-multi-language-website-story/"/>
    <updated>2022-12-30T00:00:00Z</updated>
    <id>https://lukastrumm.com/blog/2022/multi-branch-multi-language-website-story/</id>
    <content type="html">&lt;p&gt;At the beginning of 2021, which is already almost two years ago, my team and I
have started working on a rather large website. The requirements were
interesting… and as it usually happens they have changed quite significantly
during implementation.&lt;/p&gt;
&lt;p&gt;I am going to tell a story about one project where I learned a lot of things.
The project was not a failure, we managed to deliver the solution and it runs in
production, but I will focus on what went wrong.&lt;/p&gt;
&lt;h2 id=&quot;what-we-got&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2022/multi-branch-multi-language-website-story/#what-we-got&quot;&gt;What we got&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The initial requirements for the set of websites were roughly these:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You will be provided with custom designs for components and pages, the result
should match perfectly&lt;/li&gt;
&lt;li&gt;The company has a set of branches and every branch will need its own website,
possibly in multiple languages (!)&lt;/li&gt;
&lt;li&gt;Most of the content but not all (!) will be the same&lt;/li&gt;
&lt;li&gt;The design must be the same for every website and editors should have very
little room for diverging from the original design&lt;/li&gt;
&lt;li&gt;All (!) content should be editable by editors, ideally in a WYSIWYG way,
stored in a CMS&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;what-we-had&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2022/multi-branch-multi-language-website-story/#what-we-had&quot;&gt;What we had&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A small team and a lot to explain. The deadline can’t be in two months, please.&lt;/p&gt;
&lt;p&gt;So we started with prototyping right away. We set first milestone for us to make
a decision about framework, tools and the CMS in 14 days. The first bets looked
promising and we quickly converged to these technologies:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Storyblok as a headless CMS&lt;/li&gt;
&lt;li&gt;Nuxt 2 as the framework&lt;/li&gt;
&lt;li&gt;Bootstrap for its styling internals&lt;/li&gt;
&lt;li&gt;Gitlab for pipelines&lt;/li&gt;
&lt;li&gt;Azure for hosting&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let’s briefly discuss every building block.&lt;/p&gt;
&lt;h3 id=&quot;cms&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2022/multi-branch-multi-language-website-story/#cms&quot;&gt;CMS&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Storyblok has very nice compromise between structured and visual editing of the
content. The documentation and integration with VueJS ecosystem were great. We
also liked other features like multi-language support, the flexibility of the
content structure, fast CDN based content delivery and built in image
processing.&lt;/p&gt;
&lt;h3 id=&quot;nuxt&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2022/multi-branch-multi-language-website-story/#nuxt&quot;&gt;Nuxt&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Most of our team’s frontend experience were with VueJS, so Nuxt was a natural
choice. The initial requirements looked suitable for a static site builder or a
Jamstack like solution, but we knew it might be challenged in the future and
Nuxt will be ready for that. And it was challenged, but more about that later.&lt;/p&gt;
&lt;h3 id=&quot;bootstrap-and-sass&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2022/multi-branch-multi-language-website-story/#bootstrap-and-sass&quot;&gt;Bootstrap and SASS&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The styling looked like a big portion of the whole project. The choice to use
Bootstrap and Sass were again based on our experience. We used only some parts
of the Bootstrap internals and Sass utilities. It led us to a quick start.&lt;/p&gt;
&lt;h3 id=&quot;gitlab&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2022/multi-branch-multi-language-website-story/#gitlab&quot;&gt;Gitlab&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Gitlab pipelines became a central part of our solution since we focused on
static generation. While there is nothing bad about Gitlab pipelines
specifically it became the weakest point of the entire system because it was
overused. Data fetching, caching, monorepo tooling and any other logic can be
solved much easier in an application than in a build pipeline.&lt;/p&gt;
&lt;h3 id=&quot;azure&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2022/multi-branch-multi-language-website-story/#azure&quot;&gt;Azure&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;It was a requirement to use Azure, but unfortunately I don’t remember how it
happened. We spent unreasonable amount of time configuring Azure CDNs and
deployment. Something like a Netlify site would be done 10 times faster.&lt;/p&gt;
&lt;h2 id=&quot;what-went-wrong&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2022/multi-branch-multi-language-website-story/#what-went-wrong&quot;&gt;What went wrong&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Let me start from the end. Unfortunately, the contract between companies ended
unexpectedly, and we were not able to pay the technical debt back as we
developers would like to do. Sometimes we have to say ‘It is good enough.’&lt;/p&gt;
&lt;p&gt;First challenge was the know-how. I was quite new to a team/tech leader role,
while other colleagues were even new to software development. At the same time
our customer didn’t have a good understanding about the scope of the project.
For example communication with other branches of the company took a long time.
For a long time there was nobody who understands requirements well. These
challenges led to very poor estimations. The go-live deadline was postponed
several months.&lt;/p&gt;
&lt;h3 id=&quot;cms-1&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2022/multi-branch-multi-language-website-story/#cms-1&quot;&gt;CMS&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;One of the big ideas that we wanted to implement was to have a set of
components, that would hold the same concept for business people, for the CMS,
as well as for developers. Good example would be a Steps component, which
represents a series of steps one have to follow in order to achieve something.
Every step has a number, a title and a description. A concept that can work for
designers, developers and editors. Although we have strived to communicate it
well and show it live in a styleguide to everyone, it was still difficult to
achieve consistency. Storyblok, our CMS of choice, have a concept of a
component. But it is all about discipline to avoid having 4 different Steps
components in the CMS mapping to 3 different components in code. And then
someone needs a 6-step component where so far every aspect of the design of this
component was based on the fact that it can only have a maximum of 5 steps.&lt;/p&gt;
&lt;p&gt;I would say that we could do two things to improve this situation. One is to
have a set of shared principles not only between a designer and a developer but
also between business people and editors. Reminds me of Domain driven design and
ubiquitous language. Apparently it can be helpful even in the field of building
websites.&lt;/p&gt;
&lt;p&gt;The other thing is automation. We could implement an automated check for
component mapping accross the system, the APIs are waiting to be used…&lt;/p&gt;
&lt;p&gt;The last part is documentation. While Storyblok has mostly great docs, there
were some missing guidance for building a large, complex website with multiple
languages.&lt;/p&gt;
&lt;p&gt;We have also struggled with one late requirement from the client—to use
Storyblok for writing blog posts, that are enhanced with custom components. At
the time of building the site it was not really possible to have both clean
editing experience and using our own Vue components to build the articles. The
issue is that editors typically support either editing content in fixed page
structure, completely free form page building or writing mostly text, links and
maybe some images (think of CKEditor). We needed something in between where it
would still be acceptable for non-technical editors to create consistent and
rich blog posts.&lt;/p&gt;
&lt;h3 id=&quot;seo%2C-performance%2C-css&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2022/multi-branch-multi-language-website-story/#seo%2C-performance%2C-css&quot;&gt;SEO, performance, CSS&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;One problematic part was that our client, despite our effort, was reluctant to
give as any input about how performant the site should be and how much we should
focus on SEO. Making a website performant and SEO friendly takes time and has to
be planned. It is important to set some expectations up front, otherwise there
might be some unpleasant surprises. And there were, since we had to prioritize
other things than performance and SEO to meet deadlines.&lt;/p&gt;
&lt;p&gt;The performance part was a bit problematic because of Nuxt. At version 2 it was
a great framework for applications, but the frontend had too much Javascript
even in full static generation mode.&lt;/p&gt;
&lt;p&gt;Search functionality was another half-baked feature that we have shipped. The
decision was to have at least some search and don’t spend much time with it
rather than involving 3rd party service or a sophisticated backend. This decision
was made based on an idea that visitors come from Google anyway. So the internal
search was based on build in Nuxt/content package, which has a client side
search. Yeah, it means downloading an index in json, which has several
megabytes. A poor man’s solution that worked OK in some situations.&lt;/p&gt;
&lt;p&gt;The SEO is a lot of little things that are easier to manage if someone plan to
do them up front. Correct HTTP status codes in all special cases, canonical
urls, handcrafted metadata, etc. etc. We had to go back and improve all of
these in later stages of the project when we got enough agreement and
necessary information.&lt;/p&gt;
&lt;p&gt;Styling went mostly well, but there was one area, that we have underestimated.
We have produced unnecessarily big CSS bundles because we were not careful
enough with generating helper classes. When we noticed the problem it was too
late to purge all the redundant styles easily. It was about the time when the
tooling for Tailwind started to be great, it’s a pity… We might have been ok,
if we had handcrafted all the CSS. Even with a huge help from VueJS with scoped
styles, it is hard to keep it on the right track when several new developers
start committing at the same time.&lt;/p&gt;
&lt;h3 id=&quot;updating-a-static-site&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2022/multi-branch-multi-language-website-story/#updating-a-static-site&quot;&gt;Updating a static site&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;A big misconception we had was about frequency of updates. What first looked
like a mostly static site turned out not to be so.&lt;/p&gt;
&lt;p&gt;Static site generation meant (at least for Nuxt at that time) a full rebuild of
the whole site for every code or data change. It might not be a concern running
a 5-minute build couple times a day. But as the pipeline grows the build and
deploy no longer takes 5 minutes but may take 15. And a couple of websites times
a couple of code, data and CMS changes results in too much work the pipelines
has to do in one day. And resulted in unexpected slowdowns in delivery.&lt;/p&gt;
&lt;p&gt;Nuxt can be switched to SSR mode with minimal code changes. Unfortunately
because of our infrastructure and for historical reasons we were not able to use
it during the time we had.&lt;/p&gt;
&lt;p&gt;Frequent redeployments have another issue. The CDN, caching and Javascript in
the browser has to be setup in such a way so that new deployments are
transparent for the user of the website and does not cause missing assets or
other errors. At the same time it should reasonably cache everything it can to
speed up page load time. The Nuxt SSG site is served as HTML for the initial
page load but is immediately enhanced with Javascript and becomes a single page
application. At the time we had issues making this SPA to be refreshed if a
deployment happened while a user was browsing the website. We had to write some
rather hacky code to improve the situation (involving a forced full page
reload).&lt;/p&gt;
&lt;h2 id=&quot;what-was-a-success&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2022/multi-branch-multi-language-website-story/#what-was-a-success&quot;&gt;What was a success&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;As far as I know the site was down maybe once because of some DNS issues, but
never because of infrastructure or code bug. Nothing can beat a web statically
hosted from a CDN.&lt;/p&gt;
&lt;p&gt;We have managed to implement very nice design system. That is mostly designer’s
credit because she shared with us a set of principles and design tokens that we
have followed all the time. We have created a set of sass variables, utility
classes and base components as building blocks for everything else. That worked
great.&lt;/p&gt;
&lt;p&gt;Another great experience was the integration with Storyblok. Its API was flexible
and fast and most of the tasks were straight forward. For example, we needed to
be notified when there was a change published in a subset of the site and that
was convenient with their webhooks.&lt;/p&gt;
&lt;h2 id=&quot;what-is-the-future&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2022/multi-branch-multi-language-website-story/#what-is-the-future&quot;&gt;What is the future&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Rich Harris called it Transitional web apps in one of his
&lt;a href=&quot;https://www.youtube.com/watch?v=860d8usGC0o&quot;&gt;presentations&lt;/a&gt;. The idea is to
extract the best characteristics of multipage architecture and single page apps
into one solution that is, well, transitional. We have used Vue framework which
helped more junior members of our team to quickly became productive. On the
other hand a good old PHP based solution would be better from several
perspectives. A framework implementing the ideas of Transitional web apps could
be very helpful for a project like this. From improving general know-how,
delivering better performance and SEO, to simplifying deployment. The future is
bright I guess…&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>How I work</title>
    <link href="https://lukastrumm.com/blog/2022/how-i-work/"/>
    <updated>2022-12-16T00:00:00Z</updated>
    <id>https://lukastrumm.com/blog/2022/how-i-work/</id>
    <content type="html">&lt;p&gt;I feel like it is time to write down some specifics about how I work. This is no
longer changing every year, so it might be useful as a reference for future
collaborations. Also it works for me, so I am going to change it only if
something significant will cross my way.&lt;/p&gt;
&lt;p&gt;This is documenting how I have worked in the last several years and what I value
at work. It might be more like a living document more than a blog post.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I work from home. I value occasional in person meetings.&lt;/li&gt;
&lt;li&gt;I usually work between 6:30 and 15:30 CET, averaging 7 work hours per day.&lt;/li&gt;
&lt;li&gt;I go for a run every day, typically before lunchtime.&lt;/li&gt;
&lt;li&gt;I work on my personal skills or side projects almost every day, before or
after my work hours depending on when my children needs me more.&lt;/li&gt;
&lt;li&gt;Rest of my time is primarily for my family, I do not work in the evening if
not necessary.&lt;/li&gt;
&lt;li&gt;During a year I have 30 days on average when I do not work (vacation, sick
days; not including national holidays).&lt;/li&gt;
&lt;li&gt;Every week I reserve several time blocks for deep work and weekly review.&lt;/li&gt;
&lt;li&gt;I need to know the ‘Why?’ in order to feel comfortable at work. Why is this
piece of technology used here? Why we need to do this before that? How does it
work? And why does it work like this? You can expect these questions from me.&lt;/li&gt;
&lt;li&gt;I keep things organized. Creating order out of chaos energizes me, the
opposite is killing me.&lt;/li&gt;
&lt;li&gt;I value documentation. I document my progress, my results, my failures. I like
when others write documentation too.&lt;/li&gt;
&lt;li&gt;I value simplicity, openness, transparency, honesty and reliability.&lt;/li&gt;
&lt;li&gt;Work is serious, the life is more.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;software-development&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2022/how-i-work/#software-development&quot;&gt;Software development&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I use Linux (Pop_OS).&lt;/li&gt;
&lt;li&gt;I use command line whenever it is suitable.&lt;/li&gt;
&lt;li&gt;I love web technologies.&lt;/li&gt;
&lt;li&gt;I program in Neovim.&lt;/li&gt;
&lt;li&gt;My config and other projects are &lt;a href=&quot;https://github.com/lttr/&quot;&gt;open on Github&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;When applicable I prefer continuous integration as a &lt;a href=&quot;https://martinfowler.com/articles/ship-show-ask.html&quot;&gt;collaboration
scheme&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;notes&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2022/how-i-work/#notes&quot;&gt;Notes&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I’ve written a note about similar topic earlier. It was about &lt;a href=&quot;https://lukastrumm.com/notes/key-values&quot;&gt;key values at
work&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Reusable components</title>
    <link href="https://lukastrumm.com/blog/2021/reusable-components/"/>
    <updated>2021-02-15T00:00:00Z</updated>
    <id>https://lukastrumm.com/blog/2021/reusable-components/</id>
    <content type="html">&lt;p&gt;In this article I am trying to summarize a couple of techniques that are
typically used for building reusable components. The idea came to me from a
course on VueJS by Michael Thiessen. I am writing the examples in simple
javascript functions and not in any framework code.&lt;/p&gt;
&lt;style&gt;
button {
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
}
@media (prefers-color-scheme: dark) {
  button {
      color: var(--text-color);
      background: var(--body-back-color);
      border-color: var(--primary-color);
    }
}
&lt;/style&gt;
&lt;p&gt;Video course &lt;a href=&quot;https://michaelnthiessen.com/reusable-components&quot;&gt;Reusable components by Michael Thiessen&lt;/a&gt; is another take on
some basic features of VueJS. Michael is explaining the concepts that one need
to create a reusable component and specific VueJS features only happen to be the
implementation.&lt;/p&gt;
&lt;p&gt;I’m going to summarize every technique (Michael calls them &lt;em&gt;levels of
reusability&lt;/em&gt;), but I’ll only use simple javascript functions as examples, since
the ideas are not framework dependant.&lt;/p&gt;
&lt;h2 id=&quot;templating&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2021/reusable-components/#templating&quot;&gt;Templating&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Is about reusing the same markup. Copy pasting a piece of markup might be a good
starting point. And it might be enough—not everyting needs to be absolutely
DRY and componentized.&lt;/p&gt;
&lt;pre class=&quot;klipse-fallback language-js&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; buttonTemplate &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&amp;lt;button&gt;😊 &amp;lt;/button&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;MyButtonComponent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&amp;lt;button&gt;😊 Foo&amp;lt;/button&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token function&quot;&gt;MyButtonComponent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-js&quot; data-editor-type=&quot;code-mirror&quot;&gt;&lt;code class=&quot;klipse-eval-js language-js&quot;&gt;
      const buttonTemplate = `&amp;lt;button&amp;gt;😊 &amp;lt;/button&amp;gt;`
function MyButtonComponent() {
  return `&amp;lt;button&amp;gt;😊 Foo&amp;lt;/button&amp;gt;`
}

MyButtonComponent()
      &lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;result&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2021/reusable-components/#result&quot;&gt;Result&lt;/a&gt;&lt;/h3&gt;
&lt;div id=&quot;b1&quot;&gt;&lt;/div&gt;
&lt;script&gt;
function MyButtonComponent() {
  return `&lt;button&gt;😊 Foo&lt;/button&gt;`
}
document.getElementById(&#39;b1&#39;).innerHTML = MyButtonComponent()
&lt;/script&gt;
&lt;br /&gt;
&lt;h2 id=&quot;configuration&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2021/reusable-components/#configuration&quot;&gt;Configuration&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Is parametrized template. This is the core of any templating language. Also this
is how a so called dumb component looks like.&lt;/p&gt;
&lt;pre class=&quot;klipse-fallback language-js&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;MyButtonComponent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; text &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&amp;lt;button&gt;😊 &amp;lt;em&gt;&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;text&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&amp;lt;/em&gt;&amp;lt;/button&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token function&quot;&gt;MyButtonComponent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;My Emphasised Button&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-js&quot; data-editor-type=&quot;code-mirror&quot;&gt;&lt;code class=&quot;klipse-eval-js language-js&quot;&gt;
      function MyButtonComponent({ text }) {
  return `&amp;lt;button&amp;gt;😊 &amp;lt;em&amp;gt;${text}&amp;lt;/em&amp;gt;&amp;lt;/button&amp;gt;`
}
MyButtonComponent({ text: &amp;quot;My Emphasised Button&amp;quot; })
      &lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;result-1&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2021/reusable-components/#result-1&quot;&gt;Result&lt;/a&gt;&lt;/h3&gt;
&lt;div id=&quot;b2&quot;&gt;&lt;/div&gt;
&lt;script&gt;
function MyButtonComponent({ text }) {
  return `&lt;button&gt;😊 &lt;em&gt;${text}&lt;/em&gt;&lt;/button&gt;`
}
document.getElementById(&#39;b2&#39;).innerHTML = MyButtonComponent({ text: &#39;My Emphasised Button&#39; })
&lt;/script&gt;
&lt;br /&gt;
&lt;h2 id=&quot;adaptability&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2021/reusable-components/#adaptability&quot;&gt;Adaptability&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A component is adaptable, when it can be used for different purposes. And it is
typically the case when the component accepts &lt;em&gt;slots&lt;/em&gt; for external content.&lt;/p&gt;
&lt;pre class=&quot;klipse-fallback language-js&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;MyButtonComponent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&amp;lt;button&gt;&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;content&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&amp;lt;/button&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token function&quot;&gt;MyButtonComponent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;&amp;lt;strong&gt;My Strong Button 🙍&amp;lt;/strong&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-js&quot; data-editor-type=&quot;code-mirror&quot;&gt;&lt;code class=&quot;klipse-eval-js language-js&quot;&gt;
      function MyButtonComponent(content) {
  return `&amp;lt;button&amp;gt;${content}&amp;lt;/button&amp;gt;`
}
MyButtonComponent(&amp;quot;&amp;lt;strong&amp;gt;My Strong Button 🙍&amp;lt;/strong&amp;gt;&amp;quot;)
      &lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;result-2&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2021/reusable-components/#result-2&quot;&gt;Result&lt;/a&gt;&lt;/h3&gt;
&lt;div id=&quot;b3&quot;&gt;&lt;/div&gt;
&lt;script&gt;
function MyButtonComponent(content) {
  return `&lt;button&gt;${content}&lt;/button&gt;`
}
document.getElementById(&#39;b3&#39;).innerHTML = MyButtonComponent(&#39;&lt;strong&gt;My Strong Button 🙍&lt;/strong&gt;&#39;)
&lt;/script&gt;
&lt;br /&gt;
&lt;h2 id=&quot;inversion&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2021/reusable-components/#inversion&quot;&gt;Inversion&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Only the child component in this example knows a special algorithm to compute
something, while only the parent component knows how to present the information
in text. Passing a funciton as a component property is known as &lt;em&gt;render props&lt;/em&gt;.&lt;/p&gt;
&lt;pre class=&quot;klipse-fallback language-js&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// Child component&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;MyButtonComponent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;contentFunction&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token function-variable function&quot;&gt;computeLevelFromContent&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;length&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; level &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;computeLevelFromContent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;contentFunction&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; content &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;contentFunction&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;level&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&amp;lt;button&gt;&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;content&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&amp;lt;/button&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// Parent component&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Parent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;MyButtonComponent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;My Powerful Button (level: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;level&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token function&quot;&gt;Parent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-js&quot; data-editor-type=&quot;code-mirror&quot;&gt;&lt;code class=&quot;klipse-eval-js language-js&quot;&gt;
      // Child component
function MyButtonComponent(contentFunction) {
  const computeLevelFromContent = (content) =&amp;gt; content.length
  const level = computeLevelFromContent(contentFunction(&amp;quot;&amp;quot;))
  const content = contentFunction(level)
  return `&amp;lt;button&amp;gt;${content}&amp;lt;/button&amp;gt;`
}

// Parent component
function Parent() {
  return MyButtonComponent((level) =&amp;gt; `My Powerful Button (level: ${level})`)
}
Parent()
      &lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;result-3&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2021/reusable-components/#result-3&quot;&gt;Result&lt;/a&gt;&lt;/h3&gt;
&lt;div id=&quot;b4&quot;&gt;&lt;/div&gt;
&lt;script&gt;
function MyButtonComponent(contentFunction) {
  const computeLevelFromContent = (content) =&gt; content.length
  const level = computeLevelFromContent(contentFunction(&#39;&#39;))
  const content = contentFunction(level)
  return `&lt;button&gt;${content}&lt;/button&gt;`
}
document.getElementById(&#39;b4&#39;).innerHTML
  = MyButtonComponent((level) =&gt; `My Powerful Button (level: ${level})`)
&lt;/script&gt;
&lt;br /&gt;
&lt;h2 id=&quot;extension&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2021/reusable-components/#extension&quot;&gt;Extension&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Extensible component is like an adaptable component in this context but with an
&lt;em&gt;extension point&lt;/em&gt;. One can provide custom content for this extension point or
use the default. There might be multiple extension points, which would be
implemented as &lt;em&gt;named scoped slots&lt;/em&gt; in VueJS for example.&lt;/p&gt;
&lt;pre class=&quot;klipse-fallback language-js&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;MyButtonComponent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; buttonText &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;buttonText&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token function-variable function&quot;&gt;buttonText&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;My Powerful Button (level: &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;level&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token function-variable function&quot;&gt;computeLevelFromContent&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;length&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; level &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;computeLevelFromContent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;buttonText&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; content &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;buttonText&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;level&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&amp;lt;button&gt;&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;content&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&amp;lt;/button&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;Parent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;MyButtonComponent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt; &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;MyButtonComponent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token function-variable function&quot;&gt;buttonText&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;level&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt; My Extended Button 😉&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token function&quot;&gt;Parent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-js&quot; data-editor-type=&quot;code-mirror&quot;&gt;&lt;code class=&quot;klipse-eval-js language-js&quot;&gt;
      function MyButtonComponent({ buttonText } = {}) {
  if (!buttonText) {
    buttonText = (level) =&amp;gt; `My Powerful Button (level: ${level})`
  }
  const computeLevelFromContent = (content) =&amp;gt; content.length
  const level = computeLevelFromContent(buttonText(&amp;quot;&amp;quot;))
  const content = buttonText(level)
  return `&amp;lt;button&amp;gt;${content}&amp;lt;/button&amp;gt;`
}

function Parent() {
  return `${MyButtonComponent()} ${MyButtonComponent({
    buttonText: (level) =&amp;gt; `${level} My Extended Button 😉`,
  })}`
}
Parent()
      &lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;result-4&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2021/reusable-components/#result-4&quot;&gt;Result&lt;/a&gt;&lt;/h3&gt;
&lt;div id=&quot;b5&quot;&gt;&lt;/div&gt;
&lt;script&gt;
function MyButtonComponent({ buttonText } = {}) {
  if (!buttonText) {
    buttonText = (level) =&gt; `My Powerful Button (level: ${level})`
  }
  const computeLevelFromContent = (content) =&gt; content.length
  const level = computeLevelFromContent(buttonText(&#39;&#39;))
  const content = buttonText(level)
  return `&lt;button&gt;${content}&lt;/button&gt;`
}
document.getElementById(&#39;b5&#39;).innerHTML
  = `${MyButtonComponent()} ${MyButtonComponent({
    buttonText: (level) =&gt; `Level ${level}: My Extended Button 😉`,
  })}`
&lt;/script&gt;
&lt;br /&gt;
&lt;h2 id=&quot;nesting&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2021/reusable-components/#nesting&quot;&gt;Nesting&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When we nest components while using previous techniques we end up passing
content from parent components down into nested child components. Slots inside
slots. Maximum adaptability but also maximum cognitive overhead.&lt;/p&gt;
&lt;p&gt;In Vue placing a slot that is passed into another component’s slot is not that
bad, but I’m not going to write a convoluted vanilla javascript example. This
piece of Vue template shows a slot that a parent component can use to pass
content down into AdaptableComponent and use all its props.&lt;/p&gt;
&lt;p&gt;One interesting aspect of this is that we can decide where we want the content
to come from and where in the hierarchy the default content will be placed.&lt;/p&gt;
&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;template&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;AdaptableComponent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;template&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;#default&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;scope&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;      &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;slot&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;v-bind&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;scope&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;template&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;AdaptableComponent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;template&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  
  <entry>
    <title>You need grit for css grid</title>
    <link href="https://lukastrumm.com/blog/2020/you-need-grit-for-css-grid/"/>
    <updated>2020-12-29T00:00:00Z</updated>
    <id>https://lukastrumm.com/blog/2020/you-need-grit-for-css-grid/</id>
    <content type="html">&lt;p&gt;CSS grid is an awesome piece of browser technology. The other side is that the concepts are not super intuitive and there is some work to be done before you can appreciate it. Endurance and passion is needed. Courage. Grit. Especially with those grid lines…&lt;/p&gt;
&lt;p&gt;First you need at least a little bit of experience with css grid, because I will dive deep into it rather quickly. Let’s draw a picture.&lt;/p&gt;
&lt;style&gt;
  .grid-picture-default {
    display: grid;
    grid-template-rows:
      [start] 1fr 30px
      [center] repeat(3, 30px) 1fr
      [end];
    grid-template-columns:
      [start] 1fr 30px
      [center] repeat(3, 30px) 1fr
      [end];
    background-color: var(--base03);
    width: 300px;
    height: 300px;
  }

  .grid-picture-default .a {
    grid-area: start / 2 / center / auto;
    background-color: var(--yellow);
  }

  .grid-picture-default .b {
    grid-area: 2 / center / auto / end;
    background-color: var(--blue);
  }

  .grid-picture-default .c {
    grid-area: center / center / end / auto;
    background-color: var(--red);
  }

  .grid-picture-default .d {
    grid-area: center / 1 / center / center;
    background-color: var(--green);
  }
&lt;/style&gt;
&lt;figure&gt;
  &lt;div class=&quot;grid-picture-default&quot;&gt;
    &lt;div class=&quot;a&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;b&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;c&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;d&quot;&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;figcaption&gt;
    This picture was created using css grid with named grid lines and grid-area property
  &lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Firefox has been a go to tool to visualize what is going on with css grid. Recently Chrome Dev tools added support too, and it can even show grid line names!&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;https://lukastrumm.com/blog/2020/you-need-grit-for-css-grid/css-grid-chrome-devtools.png&quot; alt=&quot;&quot; /&gt;&lt;figcaption&gt;Previous picture under Chrome Dev tools grid analyzer&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Suddenly you can see what is going on. There are six columns and six rows in this grid. There are lines around those columns and rows and some of them have name. These names can help with defining css properties—otherwise it can be very difficult to understand the code. I’m going to build the same picture with several approaches to show you the differencies.&lt;/p&gt;
&lt;h2 id=&quot;grid-line-numbers&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/you-need-grit-for-css-grid/#grid-line-numbers&quot;&gt;Grid line numbers&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Rows and columns are called tracks in css grid. Every track is bounded by lines. Therefore you can target specific locations in grid using line numbers. Grid area is a set of fields occupied by an element. You define the element’s area using &lt;code&gt;grid-area&lt;/code&gt; property like this:&lt;/p&gt;
&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.item&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &amp;lt;start-row&gt;/&amp;lt;start-column&gt;/&amp;lt;end-row&gt;/&amp;lt;end-column&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The first approach is to use the line numbers. The &lt;code&gt;auto&lt;/code&gt; keyword means default value. A negative number means some number of lines from the end.&lt;/p&gt;
&lt;pre class=&quot;klipse-fallback language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token style&quot;&gt;&lt;span class=&quot;token language-css&quot;&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-one&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; grid&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-template-rows&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1fr &lt;span class=&quot;token function&quot;&gt;repeat&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;4&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 30px&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; 1fr&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-template-columns&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1fr &lt;span class=&quot;token function&quot;&gt;repeat&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;4&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 30px&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; 1fr&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--base03&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 300px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 300px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-one .a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1 / 2 / 4 / auto&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--yellow&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-one .b&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 2 / 3 / auto / 7&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--blue&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-one .c&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 3 / 3 / -1 / auto&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--red&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-one .d&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 3 / 1 / 3 / 3&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--green&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;grid-picture-one&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;a&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;b&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;c&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;d&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-html&quot; data-editor-type=&quot;html&quot;&gt;&lt;code class=&quot;klipse-eval-html language-html&quot;&gt;
      &amp;lt;style&amp;gt;
  .grid-picture-one {
    display: grid;
    grid-template-rows: 1fr repeat(4, 30px) 1fr;
    grid-template-columns: 1fr repeat(4, 30px) 1fr;
    background-color: var(--base03);
    width: 300px;
    height: 300px;
  }

  .grid-picture-one .a {
    grid-area: 1 / 2 / 4 / auto;
    background-color: var(--yellow);
  }

  .grid-picture-one .b {
    grid-area: 2 / 3 / auto / 7;
    background-color: var(--blue);
  }

  .grid-picture-one .c {
    grid-area: 3 / 3 / -1 / auto;
    background-color: var(--red);
  }

  .grid-picture-one .d {
    grid-area: 3 / 1 / 3 / 3;
    background-color: var(--green);
  }
&amp;lt;/style&amp;gt;

&amp;lt;div class=&amp;quot;grid-picture-one&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;b&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;c&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;d&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
      &lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;grid-line-names&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/you-need-grit-for-css-grid/#grid-line-names&quot;&gt;Grid line names&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You can use line names instead of line number. Line names are those words in [square brackets]. Here is how I have build the initial example.&lt;/p&gt;
&lt;pre class=&quot;klipse-fallback language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token style&quot;&gt;&lt;span class=&quot;token language-css&quot;&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-two&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; grid&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-template-rows&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;      [start] 1fr 30px&lt;/mark&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;      [center] &lt;span class=&quot;token function&quot;&gt;repeat&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;3&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 30px&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; 1fr&lt;/mark&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;      [end]&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-template-columns&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;      [start] 1fr 30px&lt;/mark&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;      [center] &lt;span class=&quot;token function&quot;&gt;repeat&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;3&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 30px&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; 1fr&lt;/mark&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;      [end]&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--base03&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 300px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 300px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-two .a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; start / 2 / center / auto&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--yellow&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-two .b&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 2 / center / auto / end&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--blue&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-two .c&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; center / center / end / auto&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--red&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-two .d&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; center / 1 / center / center&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--green&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;grid-picture-two&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;a&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;b&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;c&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;d&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-html&quot; data-editor-type=&quot;html&quot;&gt;&lt;code class=&quot;klipse-eval-html language-html&quot;&gt;
      &amp;lt;style&amp;gt;
  .grid-picture-two {
    display: grid;
    grid-template-rows:
      [start] 1fr 30px
      [center] repeat(3, 30px) 1fr
      [end];
    grid-template-columns:
      [start] 1fr 30px
      [center] repeat(3, 30px) 1fr
      [end];
    background-color: var(--base03);
    width: 300px;
    height: 300px;
  }

  .grid-picture-two .a {
    grid-area: start / 2 / center / auto;
    background-color: var(--yellow);
  }

  .grid-picture-two .b {
    grid-area: 2 / center / auto / end;
    background-color: var(--blue);
  }

  .grid-picture-two .c {
    grid-area: center / center / end / auto;
    background-color: var(--red);
  }

  .grid-picture-two .d {
    grid-area: center / 1 / center / center;
    background-color: var(--green);
  }
&amp;lt;/style&amp;gt;

&amp;lt;div class=&amp;quot;grid-picture-two&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;b&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;c&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;d&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
      &lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;named-grid-areas&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/you-need-grit-for-css-grid/#named-grid-areas&quot;&gt;Named grid areas&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Another approach is to define the areas all at once using &lt;code&gt;grid-template-areas&lt;/code&gt; property.&lt;/p&gt;
&lt;pre class=&quot;klipse-fallback language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token style&quot;&gt;&lt;span class=&quot;token language-css&quot;&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-three&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; grid&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-template-rows&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1fr &lt;span class=&quot;token function&quot;&gt;repeat&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;4&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 30px&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; 1fr&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-template-columns&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1fr &lt;span class=&quot;token function&quot;&gt;repeat&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;4&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 30px&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; 1fr&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-template-areas&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;      &lt;span class=&quot;token string&quot;&gt;&#39;. a . . . .&#39;&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;      &lt;span class=&quot;token string&quot;&gt;&#39;. a b b b b&#39;&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;      &lt;span class=&quot;token string&quot;&gt;&#39;d d c . . .&#39;&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;      &lt;span class=&quot;token string&quot;&gt;&#39;. . c . . .&#39;&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;      &lt;span class=&quot;token string&quot;&gt;&#39;. . c . . .&#39;&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;      &lt;span class=&quot;token string&quot;&gt;&#39;. . c . . .&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--base03&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 300px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 300px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-three .a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; a&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--yellow&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-three .b&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; b&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--blue&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-three .c&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; c&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--red&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-three .d&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; d&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--green&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;grid-picture-three&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;a&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;b&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;c&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;d&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-html&quot; data-editor-type=&quot;html&quot;&gt;&lt;code class=&quot;klipse-eval-html language-html&quot;&gt;
      &amp;lt;style&amp;gt;
  .grid-picture-three {
    display: grid;
    grid-template-rows: 1fr repeat(4, 30px) 1fr;
    grid-template-columns: 1fr repeat(4, 30px) 1fr;
    grid-template-areas:
      &amp;#39;. a . . . .&amp;#39;
      &amp;#39;. a b b b b&amp;#39;
      &amp;#39;d d c . . .&amp;#39;
      &amp;#39;. . c . . .&amp;#39;
      &amp;#39;. . c . . .&amp;#39;
      &amp;#39;. . c . . .&amp;#39;;
    background-color: var(--base03);
    width: 300px;
    height: 300px;
  }

  .grid-picture-three .a {
    grid-area: a;
    background-color: var(--yellow);
  }

  .grid-picture-three .b {
    grid-area: b;
    background-color: var(--blue);
  }

  .grid-picture-three .c {
    grid-area: c;
    background-color: var(--red);
  }

  .grid-picture-three .d {
    grid-area: d;
    background-color: var(--green);
  }
&amp;lt;/style&amp;gt;

&amp;lt;div class=&amp;quot;grid-picture-three&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;b&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;c&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;d&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
      &lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Or you can do the same with special &lt;code&gt;-start&lt;/code&gt; and &lt;code&gt;-end&lt;/code&gt; grid line names suffixes. But in this case, it is a mess.&lt;/p&gt;
&lt;pre class=&quot;klipse-fallback language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token style&quot;&gt;&lt;span class=&quot;token language-css&quot;&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-four&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; grid&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-template-rows&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;      [a-start] 1fr&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;      [b-start] 30px&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;      [a-end b-end c-start d-start] 30px&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;      [d-end] 30px&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;      30px&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;      1fr&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;      [c-end]&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-template-columns&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;      [d-start] 1fr&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;      [a-start] 30px&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;      [a-end b-start c-start d-end] 30px&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;      [c-end] 30px&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;      30px&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;      1fr&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;      [b-end]&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--base03&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 300px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 300px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-four .a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; a&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--yellow&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-four .b&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; b&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--blue&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-four .c&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; c&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--red&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.grid-picture-four .d&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;grid-area&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; d&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;--green&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;grid-picture-four&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;a&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;b&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;c&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;d&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-html&quot; data-editor-type=&quot;html&quot;&gt;&lt;code class=&quot;klipse-eval-html language-html&quot;&gt;
      &amp;lt;style&amp;gt;
  .grid-picture-four {
    display: grid;
    grid-template-rows:
      [a-start] 1fr
      [b-start] 30px
      [a-end b-end c-start d-start] 30px
      [d-end] 30px
      30px
      1fr
      [c-end];
    grid-template-columns:
      [d-start] 1fr
      [a-start] 30px
      [a-end b-start c-start d-end] 30px
      [c-end] 30px
      30px
      1fr
      [b-end];
    background-color: var(--base03);
    width: 300px;
    height: 300px;
  }

  .grid-picture-four .a {
    grid-area: a;
    background-color: var(--yellow);
  }

  .grid-picture-four .b {
    grid-area: b;
    background-color: var(--blue);
  }

  .grid-picture-four .c {
    grid-area: c;
    background-color: var(--red);
  }

  .grid-picture-four .d {
    grid-area: d;
    background-color: var(--green);
  }
&amp;lt;/style&amp;gt;

&amp;lt;div class=&amp;quot;grid-picture-four&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;a&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;b&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;c&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;d&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
      &lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;conclusions&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/you-need-grit-for-css-grid/#conclusions&quot;&gt;Conclusions&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;grid areas are only shortcuts for a set of grid lines that bound the area&lt;/li&gt;
&lt;li&gt;&lt;code&gt;grid-template-areas&lt;/code&gt; might be the most readable approach for placing elements on specific areas in grid&lt;/li&gt;
&lt;li&gt;for more dynamic or bigger grids it might be useful to use line numbers or named lines but the readability goes away rather quickly&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  
  <entry>
    <title>Power management on Ubuntu and Pop!_OS</title>
    <link href="https://lukastrumm.com/blog/2020/power-management-on-ubuntu-and-pop_os/"/>
    <updated>2020-12-16T00:00:00Z</updated>
    <id>https://lukastrumm.com/blog/2020/power-management-on-ubuntu-and-pop_os/</id>
    <content type="html">&lt;p&gt;Is it possible to hibernate a Linux machine? What is the difference between sleep, suspend, stand-by and hibernation? Why isn’t my machine waking up after pressing keys on my keyboard?&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;https://lukastrumm.com/blog/2020/power-management-on-ubuntu-and-pop_os/will-it-sleep.png&quot; alt=&quot;&quot; /&gt;&lt;figcaption&gt;What is going to happen?&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;I can finally answer these questions after a long time wondering why something does not work. Let me explain some of the concepts first.&lt;/p&gt;
&lt;h2 id=&quot;power-management-concepts&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/power-management-on-ubuntu-and-pop_os/#power-management-concepts&quot;&gt;Power management concepts&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;These concepts are general but what I’m describing here might be specific for Ubuntu based Linux systems.&lt;/em&gt;&lt;/p&gt;
&lt;h3 id=&quot;sleep-and-suspend&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/power-management-on-ubuntu-and-pop_os/#sleep-and-suspend&quot;&gt;Sleep and suspend&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;These terms are used interchangeably. The state of your machine is saved to RAM and the computer puts as much as it can to some low power consumption mode. Energy is still consumed and there is a risk of losing unsaved work in case energy is no longer available (e.g. empty battery). The advantage is, that suspending and waking up is fast (couple of seconds in my experience).&lt;/p&gt;
&lt;h3 id=&quot;hibernate&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/power-management-on-ubuntu-and-pop_os/#hibernate&quot;&gt;Hibernate&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;When a computer hibernates it saves its state to hard drive and then shuts down. Someone might call it &lt;em&gt;suspend to disk&lt;/em&gt;. When it wakes up it restores its state from hard drive into memory. You need space on your hard drive in other to save the state.&lt;/p&gt;
&lt;p&gt;Hibernation has most issues, probably because it is dependant on the combination of hardware and operating system. You might not need hibernation—sleep might save enough energy and power off might be fast enough.&lt;/p&gt;
&lt;p&gt;Update: Hibernation might be useful. A hibernated system does not consume power
and hibernation protects from some class of possible attacks when the drive is
encrypted as mentioned in &lt;a href=&quot;https://support.system76.com/articles/enable-hibernation&quot;&gt;this article from System76&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;power-off&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/power-management-on-ubuntu-and-pop_os/#power-off&quot;&gt;Power off&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Is a normal process of properly shutting down a computer. &lt;em&gt;Halting&lt;/em&gt; a computer might be slightly different. As I understand it &lt;em&gt;powering off&lt;/em&gt; is a more complete process.&lt;/p&gt;
&lt;h3 id=&quot;lock-screen&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/power-management-on-ubuntu-and-pop_os/#lock-screen&quot;&gt;Lock screen&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;When you manually lock your computer or when you are away for some time it provides you with a prompt for password—your computer is locked. The same happens when the computer is waking up.&lt;/p&gt;
&lt;h3 id=&quot;log-out&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/power-management-on-ubuntu-and-pop_os/#log-out&quot;&gt;Log out&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Shuts down your running applications (it might not stop all of the background processes) and effectively locks the screen.&lt;/p&gt;
&lt;h3 id=&quot;idle-time&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/power-management-on-ubuntu-and-pop_os/#idle-time&quot;&gt;Idle time&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Is a time when the computer evaluates that it is doing nothing. From the practical point of view the computer can be configured to do something useful after some specific time of beiing idle and it might lock the screen or suspend itself.&lt;/p&gt;
&lt;h3 id=&quot;standby-and-awake&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/power-management-on-ubuntu-and-pop_os/#standby-and-awake&quot;&gt;Standby and awake&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;I believe you can’t directly force your computer to go into those states, those are probably internal. In &lt;em&gt;awake&lt;/em&gt; state all components are running, while in &lt;em&gt;standby&lt;/em&gt; state harddisks and other peripherials might be turned off.&lt;/p&gt;
&lt;h2 id=&quot;shutting-down&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/power-management-on-ubuntu-and-pop_os/#shutting-down&quot;&gt;Shutting down&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Or rather sleeping down because at least for me, suspending is way more convenient (read: faster) way of ending my work. I usually hit a dedicated key on my keyboard (a cheep Cherry keyboard). Another way is to let your machine sleep after a specific time. In Gnome settings there is an item called Automatic suspend (Settings ➙ Power), where you can set it up. Wierdly enough you need Gnome Tweaks to set the suspend action after closing a lid of your notebook (it is in General section there).&lt;/p&gt;
&lt;h2 id=&quot;waking-up&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/power-management-on-ubuntu-and-pop_os/#waking-up&quot;&gt;Waking up&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A reasonable way to wake up your computer is to hit some key on a keyboard. It might sound simple, but there are issues with external keyboards for notebooks or wireless keyboards. In my case I have checked &lt;a href=&quot;https://askubuntu.com/&quot;&gt;askUbuntu&lt;/a&gt; and my BIOS settings and found a disabled option. Now I can wake up my notebook (from sleep) using keyboard (not mouse—but I like it) which is connected via USB dongle.&lt;/p&gt;
&lt;h2 id=&quot;sources&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/power-management-on-ubuntu-and-pop_os/#sources&quot;&gt;Sources&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://askubuntu.com/questions/369760/what-are-the-differences-between-sleep-standby-suspend-and-hibernate-in-ubuntu&quot;&gt;https://askubuntu.com/questions/369760/what-are-the-differences-between-sleep-standby-suspend-and-hibernate-in-ubuntu&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://askubuntu.com/questions/848698/wake-up-from-suspend-using-wireless-usb-keyboard-or-mouse-for-any-linux-distro/1155666#1155666&quot;&gt;https://askubuntu.com/questions/848698/wake-up-from-suspend-using-wireless-usb-keyboard-or-mouse-for-any-linux-distro/1155666#1155666&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://help.ubuntu.com/stable/ubuntu-help/power-suspend.html.en&quot;&gt;https://help.ubuntu.com/stable/ubuntu-help/power-suspend.html.en&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://help.ubuntu.com/stable/ubuntu-help/shell-exit.html.en#suspend&quot;&gt;https://help.ubuntu.com/stable/ubuntu-help/shell-exit.html.en#suspend&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://wiki.ubuntu.com/PowerManagement&quot;&gt;https://wiki.ubuntu.com/PowerManagement&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://help.ubuntu.com/stable/ubuntu-help/session-screenlocks.html.en&quot;&gt;https://help.ubuntu.com/stable/ubuntu-help/session-screenlocks.html.en&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://support.system76.com/articles/enable-hibernation&quot;&gt;https://support.system76.com/articles/enable-hibernation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  
  <entry>
    <title>Flexbox zombies</title>
    <link href="https://lukastrumm.com/blog/2020/flexbox-zombies/"/>
    <updated>2020-11-14T00:00:00Z</updated>
    <id>https://lukastrumm.com/blog/2020/flexbox-zombies/</id>
    <content type="html">&lt;p&gt;Recently I have finished the Flexbox zombies game. The way the author forces you to deliberately practice a skill is great.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://flexboxzombies.com/&quot;&gt;Flexbox zombies&lt;/a&gt; is an online course that teaches you the &lt;code&gt;display: flex&lt;/code&gt; css property. It presents quite a boring topic—placing items on a screen—in a very atractive way.&lt;/p&gt;
&lt;p&gt;Even if you think you know css flexbox I would still recommend it, because it is interesting how it is presented directly inside a browser and everything is interactive. And you will probably find out you don’t know everything. I have found a couple of new facts and following are some notes about it.&lt;/p&gt;
&lt;h2 id=&quot;start-with-display%3A-flex&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/flexbox-zombies/#start-with-display%3A-flex&quot;&gt;Start with display: flex&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The number of times one have to write &lt;code&gt;display: flex&lt;/code&gt; in the course is overwhelming, but at the end, it was worth it. As the author said—it is about deliberate practice.&lt;/p&gt;
&lt;p&gt;Lets define a class with &lt;code&gt;display: flex&lt;/code&gt; and a couple of other properties.&lt;/p&gt;
&lt;style&gt;
  .flex-container {
    display: flex;
    width: 300px;
    height: 100px;
    background: rebeccapurple;
  }

  .flex-item {
    color: white;
    background: darkcyan;
  }
&lt;/style&gt;
&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.flex-container&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; flex&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 300px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 100px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; rebeccapurple&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.flex-item&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; white&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; darkcyan&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;flexible-width&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/flexbox-zombies/#flexible-width&quot;&gt;Flexible width&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Width is flexible—who would guess?&lt;/p&gt;
&lt;pre class=&quot;klipse-fallback language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token style&quot;&gt;&lt;span class=&quot;token language-css&quot;&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.my-box&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 200px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;min-width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 150px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 250px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;flex-basis&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 225px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.item-1&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;flex-shrink&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.item-2&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;flex-grow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-container&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Fits the content&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-container&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item my-box&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Flex-basis wide&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-container&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item my-box item-1&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;No need to shrink&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-container&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item my-box item-2&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Grow stops at 250px&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-html&quot; data-editor-type=&quot;html&quot;&gt;&lt;code class=&quot;klipse-eval-html language-html&quot;&gt;
      &amp;lt;style&amp;gt;
  .my-box {
    width: 200px;
    min-width: 150px;
    max-width: 250px;
    flex-basis: 225px;
  }

  .item-1 {
    flex-shrink: 1;
  }

  .item-2 {
    flex-grow: 1;
  }
&amp;lt;/style&amp;gt;
&amp;lt;div class=&amp;quot;flex-container&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item&amp;quot;&amp;gt;Fits the content&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div class=&amp;quot;flex-container&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item my-box&amp;quot;&amp;gt;Flex-basis wide&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div class=&amp;quot;flex-container&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item my-box item-1&amp;quot;&amp;gt;No need to shrink&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div class=&amp;quot;flex-container&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item my-box item-2&amp;quot;&amp;gt;Grow stops at 250px&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
      &lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;flex-shorthand&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/flexbox-zombies/#flex-shorthand&quot;&gt;Flex shorthand&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Shorthand property &lt;code&gt;flex&lt;/code&gt; combines &lt;code&gt;flex-grow&lt;/code&gt;, &lt;code&gt;flex-shrink&lt;/code&gt; and &lt;code&gt;flex-basis&lt;/code&gt;. When you omit the last one, &lt;code&gt;flex-basis&lt;/code&gt; became &lt;code&gt;0&lt;/code&gt; instead of &lt;code&gt;auto&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&quot;klipse-fallback language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token style&quot;&gt;&lt;span class=&quot;token language-css&quot;&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.flex-basis-auto&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;flex-basis&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; initial&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.flex-basis-zero&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-container&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item flex-basis-auto&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Flex-basis auto&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-container&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item flex-basis-zero&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Flex-basis 0&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-html&quot; data-editor-type=&quot;html&quot;&gt;&lt;code class=&quot;klipse-eval-html language-html&quot;&gt;
      &amp;lt;style&amp;gt;
  .flex-basis-auto {
    flex-basis: initial;
  }

  .flex-basis-zero {
    flex: 0 0;
  }
&amp;lt;/style&amp;gt;
&amp;lt;div class=&amp;quot;flex-container&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item flex-basis-auto&amp;quot;&amp;gt;Flex-basis auto&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div class=&amp;quot;flex-container&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item flex-basis-zero&amp;quot;&amp;gt;Flex-basis 0&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
      &lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;align-content&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/flexbox-zombies/#align-content&quot;&gt;Align content&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In the following example the &lt;code&gt;align-content&lt;/code&gt; property pushes all the items to the vertical center of the container while &lt;code&gt;align-items&lt;/code&gt; to the center of their lines.&lt;/p&gt;
&lt;pre class=&quot;klipse-fallback language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token style&quot;&gt;&lt;span class=&quot;token language-css&quot;&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.content-aligned&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;flex-wrap&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; wrap&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;align-content&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; center&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.items-aligned&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;flex-wrap&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; wrap&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; center&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;token selector&quot;&gt;.content-aligned &gt; *,&lt;br /&gt;  .items-aligned &gt; *&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;flex-basis&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 140px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; center&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-container content-aligned&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token special-attr&quot;&gt;&lt;span class=&quot;token attr-name&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token value css language-css&quot;&gt;&lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; darkcyan&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Item 1&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token special-attr&quot;&gt;&lt;span class=&quot;token attr-name&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token value css language-css&quot;&gt;&lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; darkgreen&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Item 2&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token special-attr&quot;&gt;&lt;span class=&quot;token attr-name&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token value css language-css&quot;&gt;&lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; cadetblue&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Item 3&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;br&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-container items-aligned&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token special-attr&quot;&gt;&lt;span class=&quot;token attr-name&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token value css language-css&quot;&gt;&lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; purple&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token special-attr&quot;&gt;&lt;span class=&quot;token attr-name&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token value css language-css&quot;&gt;&lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; darkcyan&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Item 1&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token special-attr&quot;&gt;&lt;span class=&quot;token attr-name&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token value css language-css&quot;&gt;&lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; darkgreen&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Item 2&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token special-attr&quot;&gt;&lt;span class=&quot;token attr-name&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token value css language-css&quot;&gt;&lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; cadetblue&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Item 3&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-html&quot; data-editor-type=&quot;html&quot;&gt;&lt;code class=&quot;klipse-eval-html language-html&quot;&gt;
      &amp;lt;style&amp;gt;
  .content-aligned {
    flex-wrap: wrap;
    align-content: center;
  }

  .items-aligned {
    flex-wrap: wrap;
    align-items: center;
  }

  .content-aligned &amp;gt; *,
  .items-aligned &amp;gt; * {
    flex-basis: 140px;
    text-align: center;
  }
&amp;lt;/style&amp;gt;
&amp;lt;div class=&amp;quot;flex-container content-aligned&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item&amp;quot; style=&amp;quot;background: darkcyan&amp;quot;&amp;gt;Item 1&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item&amp;quot; style=&amp;quot;background: darkgreen&amp;quot;&amp;gt;Item 2&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item&amp;quot; style=&amp;quot;background: cadetblue&amp;quot;&amp;gt;Item 3&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;br /&amp;gt;
&amp;lt;div class=&amp;quot;flex-container items-aligned&amp;quot; style=&amp;quot;background: purple&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item&amp;quot; style=&amp;quot;background: darkcyan&amp;quot;&amp;gt;Item 1&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item&amp;quot; style=&amp;quot;background: darkgreen&amp;quot;&amp;gt;Item 2&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item&amp;quot; style=&amp;quot;background: cadetblue&amp;quot;&amp;gt;Item 3&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
      &lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;new-properties&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/flexbox-zombies/#new-properties&quot;&gt;New properties&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;There are new properties available in some browsers that are not mentioned in the Flexbox zombies course.&lt;/p&gt;
&lt;p&gt;One is &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/CSS/gap&quot;&gt;&lt;code&gt;gap&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;pre class=&quot;klipse-fallback language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token style&quot;&gt;&lt;span class=&quot;token language-css&quot;&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.flex-with-gap&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;gap&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-container flex-with-gap&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Item 1&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Item 2&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Item 3&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-html&quot; data-editor-type=&quot;html&quot;&gt;&lt;code class=&quot;klipse-eval-html language-html&quot;&gt;
      &amp;lt;style&amp;gt;
  .flex-with-gap {
    gap: 20px;
  }
&amp;lt;/style&amp;gt;
&amp;lt;div class=&amp;quot;flex-container flex-with-gap&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item&amp;quot;&amp;gt;Item 1&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item&amp;quot;&amp;gt;Item 2&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item&amp;quot;&amp;gt;Item 3&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
      &lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Another one is &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/CSS/place-content&quot;&gt;&lt;code&gt;place-content&lt;/code&gt;&lt;/a&gt; a shorthand for &lt;code&gt;justify-content&lt;/code&gt; and &lt;code&gt;align-content&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;klipse-fallback language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token style&quot;&gt;&lt;span class=&quot;token language-css&quot;&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.flex-centered&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;flex-wrap&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; wrap&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;place-content&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; center&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.flex-centered &gt; *&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 120px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-container flex-centered&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Item 1&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Item 2&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;flex-item&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Item 3&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-html&quot; data-editor-type=&quot;html&quot;&gt;&lt;code class=&quot;klipse-eval-html language-html&quot;&gt;
      &amp;lt;style&amp;gt;
  .flex-centered {
    flex-wrap: wrap;
    place-content: center;
  }

  .flex-centered &amp;gt; * {
    width: 120px;
  }
&amp;lt;/style&amp;gt;
&amp;lt;div class=&amp;quot;flex-container flex-centered&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item&amp;quot;&amp;gt;Item 1&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item&amp;quot;&amp;gt;Item 2&amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;flex-item&amp;quot;&amp;gt;Item 3&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
      &lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;conclusion&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/flexbox-zombies/#conclusion&quot;&gt;Conclusion&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The Flexbox zombies is a great course and great game at the same time. That’s rare!&lt;/p&gt;
&lt;p&gt;I don’t remember if the course mentioned a very useful value of &lt;code&gt;justify-content&lt;/code&gt;: &lt;code&gt;space-evenly&lt;/code&gt;. Other than that it is very thorough. I highly recommend this style of learning!&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>My Getting things done in 2020</title>
    <link href="https://lukastrumm.com/blog/2020/my-getting-things-done-in-2020/"/>
    <updated>2020-04-23T00:00:00Z</updated>
    <id>https://lukastrumm.com/blog/2020/my-getting-things-done-in-2020/</id>
    <content type="html">&lt;p&gt;For my personal time management I like to use a variant of the Getting Things
Done methodology. The nice thing about this GTD thing is that you can use only
small parts of the whole methodology and still benefit from it.&lt;/p&gt;
&lt;p&gt;I am using some sort of GTD system for about 10 years now. I have tried a couple
of time management methodologies and used systems for both paper and digital
variants.&lt;/p&gt;
&lt;p&gt;My current system is probably very close to ZTD (Zen To Done)&lt;sup class=&quot;footnote-ref&quot;&gt;&lt;a href=&quot;https://lukastrumm.com/blog/2020/my-getting-things-done-in-2020/#fn1&quot; id=&quot;fnref1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;. When you
are doing something for a long time you usually stick with its core features and
fundamentals. And that is what the ZTD is to the GTD.&lt;/p&gt;
&lt;h2 id=&quot;the-core-tool&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/my-getting-things-done-in-2020/#the-core-tool&quot;&gt;The core tool&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I have been using Wunderlist for several years, but it is going to be discontinued. Microsoft ToDo is its successor, but the feature set and design is a little bit different and I don’t quite like it.&lt;/p&gt;
&lt;p&gt;Recently I found &lt;a href=&quot;https://ticktick.com/&quot;&gt;TickTick&lt;/a&gt;. It is also a multiplatform todo
app. It has the advantage that you can customize the menu—namely remove the unnecessary items. It is important when you are looking for a tool, that is simple but has certain features. Primarily I need an Inbox and a couple of specific lists.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;https://lukastrumm.com/blog/2020/my-getting-things-done-in-2020/gtd-inbox.png&quot; alt=&quot;&quot; /&gt;&lt;figcaption&gt;Here is an example of how the Inbox screen looks like in my TickTick.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Other than that I like the option to create subtasks (for items in Projects list) and the ability to show and hide completed tasks.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;https://lukastrumm.com/blog/2020/my-getting-things-done-in-2020/gtd-projects.png&quot; alt=&quot;&quot; /&gt;&lt;figcaption&gt;The Projects list is a list of bigger or longer tasks where I track a series of my todos. When this is not enough or when there is more people involved I use a Trello board.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;information-archive&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/my-getting-things-done-in-2020/#information-archive&quot;&gt;Information archive&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Another important part of the GTD methodology is some sort of system for storing information. This topic is worth a separate article or maybe a book. To stick with description of the current state of my GTD system I’m only going to say: This website is becoming my information archive and I love it.&lt;/p&gt;
&lt;p&gt;The advantages I am currently seeing:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Writing is simple (in Markdown; a note can be generated with short command line alias)&lt;/li&gt;
&lt;li&gt;Reading is simple (the result is a website)&lt;/li&gt;
&lt;li&gt;Search is simple (my own search from command line or maybe google it)&lt;/li&gt;
&lt;li&gt;Backup and history is built in (everything is in git)&lt;/li&gt;
&lt;li&gt;The output can be plain text or a very interactive thing (because the result is a website)&lt;/li&gt;
&lt;li&gt;Everything is instantly shareable (send a link)&lt;/li&gt;
&lt;li&gt;There is a possibility to integrate other sources of my information (e.g. list of &lt;a href=&quot;https://lukastrumm.com/reading/&quot;&gt;books I have read from Goodreads.com&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;additional-tools&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/my-getting-things-done-in-2020/#additional-tools&quot;&gt;Additional tools&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I keep various lists in separate app. Those lists are focused more on thinging and helping remember things, not doing things. I use &lt;a href=&quot;https://simplenote.com/&quot;&gt;Simplenote&lt;/a&gt;. It is truly simple but still have some nice features like history and seamless synchronization. My favorite lists are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Things I want to buy (it should be on this list for some time before I
actually buy it)&lt;/li&gt;
&lt;li&gt;Possible articles or blog posts&lt;/li&gt;
&lt;li&gt;Inspirational people&lt;/li&gt;
&lt;li&gt;Habits I am currently working on&lt;/li&gt;
&lt;li&gt;Things I should get rid of (sell it)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more complex projects I use &lt;a href=&quot;https://trello.com/&quot;&gt;Trello&lt;/a&gt;. It is useful for
projects where there are multiple tasks in various levels of completeness.&lt;/p&gt;
&lt;p&gt;When I need to collect a lot of links, images and other web content I use
&lt;a href=&quot;https://keep.google.com/&quot;&gt;Google Keep&lt;/a&gt; (I have used Evernote before, but it is
unnecessarily complex for me).&lt;/p&gt;
&lt;h4 class=&quot;footnotes-title&quot;&gt;Notes&lt;/h4&gt;
&lt;section class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;&lt;li id=&quot;fn1&quot; class=&quot;footnote-item&quot;&gt;&lt;p&gt;Leo Babauta is the author of the &lt;a href=&quot;https://www.goodreads.com/book/show/6056601-zen-to-done&quot;&gt;ZTD book&lt;/a&gt;. He focuses on simplicity and minimalism. &lt;a href=&quot;https://lukastrumm.com/blog/2020/my-getting-things-done-in-2020/#fnref1&quot; class=&quot;footnote-backref&quot;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
</content>
  </entry>
  
  <entry>
    <title>Markdown capabilities in Eleventy</title>
    <link href="https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/"/>
    <updated>2020-01-30T00:00:00Z</updated>
    <id>https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/</id>
    <content type="html">&lt;p&gt;Let’s try what markdown offers in context of Eleventy static site generator.&lt;/p&gt;
&lt;p&gt;Markdown in Eleventy is parsed by &lt;a href=&quot;https://github.com/markdown-it/markdown-it&quot;&gt;markdown-it&lt;/a&gt;. It can be extended by a number of &lt;a href=&quot;https://www.npmjs.com/search?q=keywords:markdown-it-plugin&quot;&gt;plugins&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The first example is a table of content—it is a list that consists of headings on level 2. The plugin for this is &lt;a href=&quot;https://www.npmjs.com/package/markdown-it-table-of-contents&quot;&gt;&lt;code&gt;markdown-it-table-of-contents&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;table-of-contents&quot;&gt;&lt;div class=&quot;toc-heading&quot;&gt;Table of content&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#this-is-a-heading-h2&quot;&gt;This is a heading h2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#text&quot;&gt;Text&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#extras&quot;&gt;Extras&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#my-custom-plugins&quot;&gt;My custom plugins&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;h2 id=&quot;this-is-a-heading-h2&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#this-is-a-heading-h2&quot;&gt;This is a heading h2&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;this-is-a-heading-h3&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#this-is-a-heading-h3&quot;&gt;This is a heading h3&lt;/a&gt;&lt;/h3&gt;
&lt;h4&gt;This is a heading h4&lt;/h4&gt;
&lt;h5&gt;This is a heading h5&lt;/h5&gt;
&lt;h2 id=&quot;text&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#text&quot;&gt;Text&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Paragraphs in markdown have to be divided by a blank line.&lt;/p&gt;
&lt;!-- prettier-ignore --&gt;
&lt;p&gt;This paragraph contains
multiple lines in source code,
&lt;s&gt;because I like it more this way&lt;/s&gt;.&lt;/p&gt;
&lt;p&gt;Default markdown behavior is not inserting &lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt; on places of newlines. This is the behavior of html, too. It is better because there is less ambiguity in source code and you can let your formatter do it’s work.&lt;/p&gt;
&lt;h3 id=&quot;text-elements&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#text-elements&quot;&gt;Text elements&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;bold&lt;/strong&gt; &lt;em&gt;italic&lt;/em&gt; &lt;s&gt;strikethrough&lt;/s&gt; &lt;code&gt;code&lt;/code&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Quote&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre class=&quot;language-js&quot;&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; foo &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;more code&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;(Code block with language specified as &lt;code&gt;js&lt;/code&gt;.)&lt;/em&gt;&lt;/p&gt;
&lt;h3 id=&quot;lists&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#lists&quot;&gt;Lists&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;First
&lt;ul&gt;
&lt;li&gt;Alpha&lt;/li&gt;
&lt;li&gt;Beta&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Second&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
&lt;li&gt;First
&lt;ul&gt;
&lt;li&gt;Alpha&lt;/li&gt;
&lt;li&gt;Beta&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Second&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;automatic-conversions&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#automatic-conversions&quot;&gt;Automatic conversions&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Links like &lt;a href=&quot;http://example.com/&quot;&gt;example.com&lt;/a&gt; are automatically converted.&lt;/p&gt;
&lt;p&gt;You can use two hyphens to produce an n-dash, e.g. 9–12. Or three hyphens—to create &lt;a href=&quot;https://www.thepunctuationguide.com/em-dash.html&quot;&gt;m-dash&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;“Quotation marks” and ellipsis is supported too…&lt;/p&gt;
&lt;p&gt;Arrows: rain ➙ wet&lt;/p&gt;
&lt;h2 id=&quot;extras&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#extras&quot;&gt;Extras&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Extra markdown functionality is provided either by embedded or external
&lt;code&gt;markdown-it&lt;/code&gt; plugins.&lt;/p&gt;
&lt;h3 id=&quot;tables&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#tables&quot;&gt;Tables&lt;/a&gt;&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Memory&lt;/th&gt;
&lt;th&gt;Latency (ns)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;L1 cache&lt;/td&gt;
&lt;td&gt;0.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;L2 cache&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Main memory&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Source: &lt;a href=&quot;https://gist.github.com/jboner/2841832&quot;&gt;Latency Numbers Every Programmer Should Know&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&quot;footnotes&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#footnotes&quot;&gt;Footnotes&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;You can specify references to footnotes by writing something like this inside markdown: &lt;sup class=&quot;footnote-ref&quot;&gt;&lt;a href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#fn1&quot; id=&quot;fnref1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;[^markdown-capabilities]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And somewhere after that:&lt;/p&gt;
&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;[^markdown-capabilities]: [markdown capabilities](https://github.com/markdown-it/markdown-it#syntax-extensions)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;anchors&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#anchors&quot;&gt;Anchors&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Hover over a heading, click the &lt;code&gt;#&lt;/code&gt; sign and use targeted url…&lt;/p&gt;
&lt;h3 id=&quot;figures&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#figures&quot;&gt;Figures&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Look, this is a &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; with caption.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/dependencies.png&quot; alt=&quot;&quot; /&gt;&lt;figcaption&gt;Box with title App depend on a bunch of Libs&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;my-custom-plugins&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#my-custom-plugins&quot;&gt;My custom plugins&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You can write your own plugin for &lt;code&gt;markdown-it&lt;/code&gt;—it is one function.&lt;/p&gt;
&lt;h3 id=&quot;code-blocks-with-title&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#code-blocks-with-title&quot;&gt;Code blocks with title&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This line&lt;/p&gt;
&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;```html [Elaborate html document]&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;...html code...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;produces&lt;/p&gt;
&lt;pre class=&quot;language-html&quot;&gt;&lt;h2 class=&quot;title&quot;&gt;Elaborate html document&lt;/h2&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;body&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;h1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Page&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;h1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;body&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;mermaid&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#mermaid&quot;&gt;Mermaid&lt;/a&gt;&lt;/h3&gt;
&lt;figure&gt;
          &lt;pre class=&quot;mermaid&quot; style=&quot;
      min-height: 320px;
      visibility: hidden;
    &quot;&gt;
            graph TD;
linkStyle default interpolate basis;
  F[Feature]:::violet --&amp;gt; E(enable?):::blue;
  E -- no --&amp;gt; OFF;
  E -- yes --&amp;gt; P(permissions):::blue;
  P -- unauthorized --&amp;gt; OFF:::red;
  P -- authorized --&amp;gt; ON:::green;

        &lt;/pre&gt;
          &lt;figcaption&gt; &lt;code&gt;Role&lt;/code&gt; based &lt;b&gt;toggling&lt;/b&gt;&lt;/figcaption&gt;
        &lt;/figure&gt;&lt;h3 id=&quot;executable-code-blocks&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#executable-code-blocks&quot;&gt;Executable code blocks&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Using &lt;a href=&quot;https://github.com/viebel/klipse&quot;&gt;klipse&lt;/a&gt;.&lt;/p&gt;
&lt;pre class=&quot;klipse-fallback language-js&quot;&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; t &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; window&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;performance&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;timing&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; duration &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; t&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;domContentLoadedEventEnd &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt; t&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;navigationStart&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;DOM loaded after &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;duration&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt; ms&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-js&quot; data-editor-type=&quot;code-mirror&quot;&gt;&lt;code class=&quot;klipse-eval-js language-js&quot;&gt;
      const t = window.performance.timing
const duration = t.domContentLoadedEventEnd - t.navigationStart
;`DOM loaded after ${duration} ms`
      &lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;klipse-fallback language-html&quot;&gt;&lt;h2 class=&quot;title&quot;&gt;HTML and CSS&lt;/h2&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token style&quot;&gt;&lt;span class=&quot;token language-css&quot;&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token selector&quot;&gt;.my-text&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; hidden&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;text-overflow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; ellipsis&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;white-space&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; nowrap&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 120px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;my-text&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Once upon a time, there was a man&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-html&quot; data-editor-type=&quot;html&quot;&gt;&lt;code class=&quot;klipse-eval-html language-html&quot;&gt;
      &amp;lt;style&amp;gt;
  .my-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 120px;
  }
&amp;lt;/style&amp;gt;
&amp;lt;p class=&amp;quot;my-text&amp;quot;&amp;gt;Once upon a time, there was a man&amp;lt;/p&amp;gt;
      &lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;klipse-fallback language-js&quot;&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; array &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; sum1 &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; array&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;reduce&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;acc&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; curr&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; acc &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; curr&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;del class=&quot;highlight-line highlight-line-remove&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; sum2 &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;/del&gt;&lt;br /&gt;&lt;ins class=&quot;highlight-line highlight-line-add&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; n &lt;span class=&quot;token keyword&quot;&gt;of&lt;/span&gt; array&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/ins&gt;&lt;br /&gt;&lt;ins class=&quot;highlight-line highlight-line-add&quot;&gt;  sum2 &lt;span class=&quot;token operator&quot;&gt;+=&lt;/span&gt; n&lt;/ins&gt;&lt;br /&gt;&lt;ins class=&quot;highlight-line highlight-line-add&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/ins&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;console&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;sum1&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;console&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;sum2&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;pre class=&quot;klipse-actual language-js&quot; data-editor-type=&quot;code-mirror&quot;&gt;&lt;code class=&quot;klipse-eval-js language-js&quot;&gt;
      const array = [1, 2, 3]
let sum1 = array.reduce((acc, curr) =&amp;gt; acc + curr, 0)
let sum2 = 0
for (const n of array) {
  sum2 += n
}

console.log(sum1)
console.log(sum2)
      &lt;/code&gt;&lt;/pre&gt;&lt;h4 class=&quot;footnotes-title&quot;&gt;Notes&lt;/h4&gt;
&lt;section class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;&lt;li id=&quot;fn1&quot; class=&quot;footnote-item&quot;&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/markdown-it/markdown-it#syntax-extensions&quot;&gt;markdown capabilities&lt;/a&gt; &lt;a href=&quot;https://lukastrumm.com/blog/2020/markdown-capabilities-in-eleventy/#fnref1&quot; class=&quot;footnote-backref&quot;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
</content>
  </entry>
</feed>