<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Felix Häberle</title>
    <description>The latest articles on Forem by Felix Häberle (@felixhaeberle).</description>
    <link>https://forem.com/felixhaeberle</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F97535%2Ff159cd0e-04fd-454e-b3a0-15e967477550.jpg</url>
      <title>Forem: Felix Häberle</title>
      <link>https://forem.com/felixhaeberle</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/felixhaeberle"/>
    <language>en</language>
    <item>
      <title>Supercharging Localization in VS Code with inlang</title>
      <dc:creator>Felix Häberle</dc:creator>
      <pubDate>Wed, 31 Jan 2024 22:35:39 +0000</pubDate>
      <link>https://forem.com/felixhaeberle/supercharging-localization-in-vs-code-with-inlang-2ii6</link>
      <guid>https://forem.com/felixhaeberle/supercharging-localization-in-vs-code-with-inlang-2ii6</guid>
      <description>&lt;p&gt;Localization (also Internationalization, i18n) is a critical aspect of software development, ensuring that applications are accessible and user-friendly for a global audience. The &lt;a href="https://marketplace.visualstudio.com/items?itemName=inlang.vs-code-extension" rel="noopener noreferrer"&gt;inlang extension for Visual Studio Code&lt;/a&gt; revolutionizes this process by integrating translation management directly into the IDE, streamlining the workflow for developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Streamlined the translation/i18n workflow
&lt;/h2&gt;

&lt;p&gt;🎥 WATCH THE LOOM: &lt;a href="https://www.loom.com/share/7cdab3851fd44f65ad0375a5240a3fc6?sid=bb6812cf-d0bb-4d15-8338-586c4b321afd" rel="noopener noreferrer"&gt;https://www.loom.com/share/7cdab3851fd44f65ad0375a5240a3fc6?sid=bb6812cf-d0bb-4d15-8338-586c4b321afd&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The inlang extension simplifies the localization process. Traditional methods often involve constant switching between code and separate translation files, leading to inefficiency and increased potential for errors. &lt;/p&gt;

&lt;p&gt;Inlang integrates i18n into the Visual Studio Code environment, allowing developers to manage translations directly within their code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;💬 &lt;strong&gt;Inline Annotations&lt;/strong&gt;: Translations are visible directly in the code, eliminating the need to toggle between files.&lt;/li&gt;
&lt;li&gt;✂️ &lt;strong&gt;Extract Messages&lt;/strong&gt;: Easily extract new strings with a single click, making the process more intuitive.&lt;/li&gt;
&lt;li&gt;🚦 &lt;strong&gt;Message Linting&lt;/strong&gt;: Automatically notifies developers of missing translations and other issues, ensuring quality and consistency.&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;Monorepo Support&lt;/strong&gt;: Conveniently manage multiple projects within a single repository.&lt;/li&gt;
&lt;li&gt;♻️ &lt;strong&gt;Automatic Updates&lt;/strong&gt;: Changes in source text automatically update corresponding translations.&lt;/li&gt;
&lt;li&gt;✨ &lt;strong&gt;Ease of Use and Setup&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjq3vokp0o72i5rba1rfv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjq3vokp0o72i5rba1rfv.png" alt="features of the inlang extension"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Setting up the inlang extension is straightforward, involving a few simple steps:&lt;/p&gt;

&lt;p&gt;1️⃣ &lt;a href="https://marketplace.visualstudio.com/items?itemName=inlang.vs-code-extension" rel="noopener noreferrer"&gt;Install the extension&lt;/a&gt; directly from the Visual Studio Marketplace.&lt;br&gt;
2️⃣ Configuration: Create a &lt;code&gt;project.inlang/settings.json&lt;/code&gt; file in your project root to configure language settings and modules.&lt;br&gt;
3️⃣ Syntax Matching: Choose a syntax matcher compatible with your project's framework.&lt;/p&gt;

&lt;p&gt;The extension requires Visual Studio Code version 1.84.2 or higher and Node.js version v18 or higher.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enhancing Developer Experience
&lt;/h2&gt;

&lt;p&gt;The inlang extension not only enhances efficiency but also improves the overall DX:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reduced Context Switching: By integrating translations within the IDE, developers can focus more on coding rather than juggling between files.&lt;/li&gt;
&lt;li&gt;Quality Control: Linting features ensure that translations are consistent and error-free.&lt;/li&gt;
&lt;li&gt;Faster Turnaround: The direct editing and extraction of translations within the IDE mean faster implementation and updates.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fywo74v0vluyof9ckikej.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fywo74v0vluyof9ckikej.png" alt="App ecosystem image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  App ecosystem
&lt;/h2&gt;

&lt;p&gt;The inlang VS Code extension is part of the inlang ecosystem, a variety of internationalization (i18n) apps working seamlessly together. See:&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://inlang.com/m/gerre34r/library-inlang-paraglideJs" rel="noopener noreferrer"&gt;Paraglide JS&lt;/a&gt; - JS library
&lt;/h4&gt;

&lt;p&gt;A fully configurable JavaScript i18n library that integrates within your framework.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://inlang.com/m/tdozzpar/app-inlang-finkLocalizationEditor" rel="noopener noreferrer"&gt;Fink&lt;/a&gt; – Localization Editor
&lt;/h4&gt;

&lt;p&gt;Your translation workflow with no-code setup and repository-based operation — the ideal i18n solution for translators.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://inlang.com/m/2qj2w8pu/app-inlang-cli" rel="noopener noreferrer"&gt;inlang CLI&lt;/a&gt; - Translation Automation
&lt;/h4&gt;

&lt;p&gt;Command line interface for inlang projects. Many commands and the possibility to do translation automation.&lt;/p&gt;

&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The inlang extension for Visual Studio Code is a game-changer for software localization.&lt;/strong&gt; It provides an integrated, efficient, and error-reducing environment, making the process of localizing software smoother and more developer-friendly. &lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=inlang.vs-code-extension" rel="noopener noreferrer"&gt;Install the extension&lt;/a&gt;&lt;br&gt;
🅇 Follow &lt;a href="https://twitter.com/felixhaberle" rel="noopener noreferrer"&gt;me&lt;/a&gt; on X/Twitter&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fej62d9unm89pqndnk1it.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fej62d9unm89pqndnk1it.png" alt="the inlang tab for i18n"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By adopting this extension, development teams can significantly improve their workflow, ensuring that their applications are truly global-ready.&lt;/p&gt;

</description>
      <category>i18n</category>
      <category>javascript</category>
      <category>localization</category>
      <category>paraglidejs</category>
    </item>
    <item>
      <title>Build an outstanding developer portfolio – [2022 Edition]</title>
      <dc:creator>Felix Häberle</dc:creator>
      <pubDate>Wed, 30 Nov 2022 13:01:42 +0000</pubDate>
      <link>https://forem.com/felixhaeberle/2022-edition-build-an-outstanding-developer-portfolio-5-steps-2mk4</link>
      <guid>https://forem.com/felixhaeberle/2022-edition-build-an-outstanding-developer-portfolio-5-steps-2mk4</guid>
      <description>&lt;p&gt;Are you a developer looking to build an outstanding portfolio that stands out in the highly competitive job market? You’ve come to the right place. The year is 2022 and the digital world has changed drastically since the pandemic, opening up new possibilities for developers to showcase their skills and accomplishments.&lt;/p&gt;

&lt;p&gt;I'm the maker of &lt;a href="https://getstage.app"&gt;Stage&lt;/a&gt; – an API-based portfolio builder: bring you data from pages like DEV.to / GitHub / LinkedIn and we generate you an always in-sync portfolio with ootb nice design – you can even extend it with custom extensions and your own API. &lt;a href="https://tally.so/r/w4a70o"&gt;Sign up&lt;/a&gt; for free!! &lt;/p&gt;

&lt;p&gt;In this blog post, we’ll discuss five key tips for building an impressive developer portfolio for the 2022 edition. &lt;/p&gt;

&lt;h2&gt;
  
  
  🎤 Showcase 2-4 of Your Best Project
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yazmwZxq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1u6zsb380th23rvps7qf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yazmwZxq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1u6zsb380th23rvps7qf.png" alt="projects in portfolio" width="880" height="1341"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a developer, you want to make sure that your portfolio focuses on the projects that best demonstrate your skill set and experience. Choose two to four projects that are the best examples of your work and showcase them prominently on your portfolio page. Make sure you include a detailed overview of the project, screenshots, and links to the actual project if possible.&lt;/p&gt;

&lt;h3&gt;
  
  
  5 steps: How to present your projects
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Write an engaging description of each project. Include any key achievements, challenges you faced, and the outcome.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Share images, screenshots, or videos of the project. If you have the original files, consider including them as well.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Showcase any awards or recognition you’ve received for the project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Include client testimonials or any feedback they provided.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Link to the project’s live URL, if applicable.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  🙋 Sprinkle in Some Personality
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6MAKycgf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/crmw9qyi8qh94tuhf7k5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6MAKycgf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/crmw9qyi8qh94tuhf7k5.png" alt="music in portfolio" width="880" height="808"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your portfolio should reflect your unique personality and style. Don’t be afraid to let your creativity shine and make sure that your portfolio looks and feels like you. You can add in some personal branding elements like a profile picture, a brief bio, or even a fun background image – or even the music you like.&lt;/p&gt;

&lt;h2&gt;
  
  
  👔 Add the Formal Part
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AuJZifx0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q1s3kod5wxhs7z4d4cb8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AuJZifx0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q1s3kod5wxhs7z4d4cb8.png" alt="education list" width="880" height="998"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your portfolio should also include the more formal elements of  a resume such as your education, work experience, and skills. Make sure to highlight the most relevant information and focus on the experience and skills that are most important to your career.&lt;/p&gt;

&lt;p&gt;A resume on your personal website also allows employers, recruiters, and potential clients to quickly and easily view your &lt;strong&gt;qualifications, contact information, and accomplishments&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Having a resume on your personal website may also help you stand out among other applicants and may even open up new opportunities or job leads.&lt;/p&gt;

&lt;h2&gt;
  
  
  🪄 Create the Main Action
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--E6oqEe67--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tkrp6nbpihlin6t9be9m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--E6oqEe67--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tkrp6nbpihlin6t9be9m.png" alt="hire me call to action button" width="880" height="594"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your portfolio should also have a clear call-to-action. This could be something as simple as a contact form or a button that links to a demo of your work. Whatever it is, make sure it’s easy to find and understand.&lt;/p&gt;

&lt;p&gt;A good call to action on a website should be &lt;strong&gt;concise and direct&lt;/strong&gt;. It should clearly state the desired action and provide a clear path to take that action. &lt;/p&gt;

&lt;p&gt;It should also be visually appealing and stand out from the rest of the page. Good calls to action should also be tailored to the user's context and be relevant to what they are looking for.&lt;/p&gt;

&lt;h2&gt;
  
  
  ✨ Have Good Design
&lt;/h2&gt;

&lt;p&gt;Finally, make sure your portfolio has a &lt;strong&gt;modern, professional design&lt;/strong&gt;. Everything from the typography to the colors should be carefully chosen to ensure that your portfolio looks great and is easy to navigate. &lt;/p&gt;

&lt;p&gt;Designing a personal website can be challenging, especially for those who are not experienced web designers. It requires a lot of planning, understanding of web design principles, and a good understanding of the technologies needed to create an effective website. &lt;/p&gt;

&lt;p&gt;Additionally, personal websites need to be designed to fit the individual’s needs and tastes, which can be very difficult to achieve. Furthermore, many personal websites need to be updated regularly in order to remain relevant, which can be a lot of work for those who are not experienced web designers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't overengineer&lt;/strong&gt; here, a clean modern look with not much noise is perfectly fine, it even lets the visiting user read the website faster. &lt;/p&gt;

&lt;p&gt;By following these five tips, you’ll be able to create an outstanding developer portfolio for the 2022 edition. Showcase your best projects, sprinkle in some personality, add the formal part, create the main action, and have ootb good design. Good luck!&lt;/p&gt;

&lt;p&gt;PS: I'm the maker of &lt;a href="https://getstage.app"&gt;Stage&lt;/a&gt; – an API-based portfolio builder: bring you data from pages like DEV.to / GitHub / LinkedIn and we generate you an always in-sync portfolio with ootb nice design – you can even extend it with custom extensions and your own API. &lt;a href="https://tally.so/r/w4a70o"&gt;Sign up&lt;/a&gt; for free!! &lt;/p&gt;

</description>
      <category>devtools</category>
      <category>productivity</category>
      <category>design</category>
      <category>portfolio</category>
    </item>
    <item>
      <title>Responsive fix for the Next.js Image component</title>
      <dc:creator>Felix Häberle</dc:creator>
      <pubDate>Thu, 06 May 2021 16:01:02 +0000</pubDate>
      <link>https://forem.com/felixhaeberle/responsive-fix-for-the-next-js-image-component-1351</link>
      <guid>https://forem.com/felixhaeberle/responsive-fix-for-the-next-js-image-component-1351</guid>
      <description>&lt;p&gt;Currently, &lt;code&gt;layout="responsive"&lt;/code&gt; requires you to set &lt;strong&gt;width&lt;/strong&gt; and &lt;strong&gt;height&lt;/strong&gt; which you don't want to set because you &lt;strong&gt;don't know what the aspect ratio&lt;/strong&gt; is going to be.&lt;/p&gt;

&lt;p&gt;This is a new change since version &lt;em&gt;10.0.1&lt;/em&gt; where the team around Next deprecated the &lt;code&gt;unsized&lt;/code&gt; prop, replacing it with &lt;code&gt;layout="fill"&lt;/code&gt; – which doesn't gives you the same functionality.&lt;/p&gt;

&lt;p&gt;Also, if you're going to set &lt;code&gt;layout="fill"&lt;/code&gt; and &lt;code&gt;objectFit="cover"&lt;/code&gt; on the Image component you will get a strange behavior. There are cases in which you can fix this with position: relative on the parent item, but then you also have to set &lt;code&gt;width&lt;/code&gt; and &lt;code&gt;height&lt;/code&gt; which you don't want in case of a responsive image.&lt;/p&gt;

&lt;p&gt;There is an &lt;strong&gt;easy fix&lt;/strong&gt; to this problem, you only have to set a wrapper around the Image component to give a bit of extra styling.&lt;/p&gt;

&lt;p&gt;First, we have to add the wrapping item with the class image-container. Please adjust this to fit your styling needs, e.g. if you're using styled-components the syntax will look slightly different.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;image-container&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Image&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;layout&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"fill"&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;image&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For this to work, it's important that you add two classes: image-container to the parent element and image to the Image component. After adding these classes, you should add this styling.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.image-container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="err"&gt;&amp;gt;&lt;/span&gt; &lt;span class="err"&gt;div&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;unset&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nc"&gt;.image&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;object-fit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;contain&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;unset&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that's it! 🎉&lt;/p&gt;

&lt;p&gt;Your images should now display with the right dimensions and should scale up to 100% width and at the same time having the correct height.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>nextjs</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>3 easy steps to fix slow image loading</title>
      <dc:creator>Felix Häberle</dc:creator>
      <pubDate>Sun, 27 Oct 2019 11:46:30 +0000</pubDate>
      <link>https://forem.com/felixhaeberle/3-easy-steps-to-fix-slow-image-loading-5fh6</link>
      <guid>https://forem.com/felixhaeberle/3-easy-steps-to-fix-slow-image-loading-5fh6</guid>
      <description>&lt;p&gt;Loading images on the web can be a pain, especially if you are doing a website mainly for mobile devices. Because wireless connection is used in such cases, the transfer speed is often slower compared to a wired connection and therefore the content loads slower.&lt;/p&gt;

&lt;p&gt;For text, you might not be able to spot a difference because text gets really fast transported over the web and only weights a few KB's, where images, especially those which have a high resolution, often tend to have a really big file (multiple MB's) size which loads slowly. The easy way would be to exclude the high resolution images, but in most cases, we can't reduce the amount of high-res images so we have to deal with them. Don't worry, I'll show you how to master big images on your website in a minute. ⏱&lt;/p&gt;

&lt;h2&gt;
  
  
  Tools to the win 🏆
&lt;/h2&gt;

&lt;p&gt;First of all, make sure the images you want to include in your webpage are minimized/compressed. You can accomplish this task with a lot of tools, some of them also guarantee that the overall quality of the image does stay the same. That said, it's good to know how and where the image should be used, because you should optimize it for the use case. For example, a picture which is only displayed as a little icon (possibly 20px/20px) doesn't need to have a resolution of 2000px/2000px because that would be too big. On the other side, a big full-width image shouldn't be that small to keep a nice resolution on the image.&lt;/p&gt;

&lt;p&gt;To tackle this task, I can recommend the following sources based on your needs:&lt;/p&gt;

&lt;p&gt;🛰 Online image minimization/compression:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://compressor.io/"&gt;https://compressor.io/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://imagecompressor.com/"&gt;https://imagecompressor.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📦 Integrate the minimization task into your build/preprocessing (recommended):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;webpack: &lt;a href="https://web.dev/codelab-imagemin-webpack"&gt;https://web.dev/codelab-imagemin-webpack&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;gulp: &lt;a href="https://github.com/sindresorhus/gulp-imagemin"&gt;https://github.com/sindresorhus/gulp-imagemin&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;parcel: &lt;a href="https://github.com/DeMoorJasper/parcel-plugin-imagemin"&gt;https://github.com/DeMoorJasper/parcel-plugin-imagemin&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Make sure loading images the right way 🔍
&lt;/h2&gt;

&lt;p&gt;Second, a fundamental part of making your loading faster and better is loading the images the right way. Eventually you have heard of lazy loading things, that's when you interrupt the browser to load things immediately and start it over later usually with JavaScript. Lazy loading is used on sites where there are big amounts of images and you can't afford loading all images at once because then your site would take really long to load or eventually would never stop loading (because of you being bored and cancel). To fix this problem, lazy loading only loads images you specified (at first) and loads the other part after an action is happening e.g. the image gets scrolled into the view or some other interaction is happening. 🕹&lt;/p&gt;

&lt;p&gt;A few lazyload libraries:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://github.com/verlok/lazyload"&gt;https://github.com/verlok/lazyload&lt;/a&gt; (recommended)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/tuupola/lazyload"&gt;https://github.com/tuupola/lazyload&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/aFarkas/lazysizes"&gt;https://github.com/aFarkas/lazysizes&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Another solution to load the right image is choosing the right file for the right viewport. There are often images on websites which could be smaller on mobile devices because they scale down on small viewports anyway and could therefore also be smaller in size. To load different images based on the viewport/screen size, you need to monitor the viewport and set in the right image source. 🖼📱&lt;/p&gt;

&lt;p&gt;1️⃣ The standard &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; element traditionally only lets you point the browser to a single source file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"nice-image-900.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"This is a very nice image"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2️⃣ For setting up responsive image loading we can use two new attributes — &lt;code&gt;srcset&lt;/code&gt; and &lt;code&gt;sizes&lt;/code&gt; — to provide several additional source images along with instructions to help the browser pick the right image.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;srcset=&lt;/span&gt;&lt;span class="s"&gt;"nice-image-340.jpg 340w,
             nice-image-500.jpg 500w,
             nice-image-900.jpg 900w"&lt;/span&gt;
     &lt;span class="na"&gt;sizes=&lt;/span&gt;&lt;span class="s"&gt;"(max-width: 340px) 300px,
            (max-width: 500px) 450px,
            900px"&lt;/span&gt;
     &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"nice-image-900.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"This is a very nice image"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At first, the &lt;code&gt;srcset&lt;/code&gt; and &lt;code&gt;size&lt;/code&gt; look complicated, but they aren't that hard to understand. To dive right in, the &lt;code&gt;srcset&lt;/code&gt; sets the various images and defines the real widths for them (e.g. 340w -&amp;gt; &lt;code&gt;w&lt;/code&gt; not &lt;code&gt;px&lt;/code&gt;). To get the real width of the image, you can inspect the image informations on your computer. The &lt;code&gt;sizes&lt;/code&gt; attribute describes which image fits best for the current viewport.&lt;/p&gt;

&lt;p&gt;At this point, if a supporting browser with a viewport width of 480px loads the page, the (max-width: 480px) media condition will be true, and so the browser chooses the &lt;code&gt;450px&lt;/code&gt; slot. The &lt;code&gt;nice-image-500w.jpg&lt;/code&gt; will be loaded, as its inherent width (&lt;code&gt;450w&lt;/code&gt;) is the closest to &lt;code&gt;500w&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Design with image loading in mind 💡
&lt;/h2&gt;

&lt;p&gt;Third, the best solution to prevent slow image loading or loading problems in general is to reduce the overall amount of images which you load initially on your website. The more images you load the slower your site will get and the tips I gave you above are only in the case you can't dispense with it.&lt;/p&gt;

&lt;p&gt;Designers tend to do more vector graphics such as SVG these days because SVG files ares basically text and therefore load really quickly. Also, you can modify SVG code to a certain point in your code after loading them which is pretty neat in some cases. Thus, it can be said that SVGs should be used wherever it is possible and images are only used where necessary. Another part of the image loading solution is choosing the right image format in general, a good read about this can be found &lt;a href="https://www.freecodecamp.org/news/best-image-format-for-web-in-2019-jpeg-webp-heic-avif-41ba0c1b2789/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Thus, it can be said that SVGs should be used wherever it is possible and images are only used where necessary.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Happy coding and improving your images to be lighting fast! 🚀💫&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>performance</category>
      <category>html</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The core of every Software Design Pattern</title>
      <dc:creator>Felix Häberle</dc:creator>
      <pubDate>Fri, 25 Oct 2019 09:34:00 +0000</pubDate>
      <link>https://forem.com/felixhaeberle/the-core-of-every-software-design-pattern-ld6</link>
      <guid>https://forem.com/felixhaeberle/the-core-of-every-software-design-pattern-ld6</guid>
      <description>&lt;p&gt;As Software Developers, we often valuate our code through Design Patterns. It’s the core of every good or bad written code and a high factor for security and performance only to mention two. We are often looking for opportunities to write our code better and searching for new Design Patterns. I think we’re often misusing this words to describe Best-Practices or To-Do’s which we should follow anyway. For me, the core of Software Design Patterns consists of the following 6 rules.&lt;/p&gt;

&lt;p&gt;1️⃣ They are proven solutions&lt;br&gt;
 2️⃣ They are easily reusable&lt;br&gt;
 3️⃣ They are expressive&lt;br&gt;
 4️⃣ They ease communication&lt;br&gt;
 5️⃣ They prevent the need for refactoring code&lt;br&gt;
 6️⃣ They lower the size of the codebase&lt;/p&gt;

&lt;h2&gt;
  
  
  1️⃣ They are proven solutions
&lt;/h2&gt;

&lt;p&gt;Because design patterns are often used by many developers, you can be certain that they work. And not only that, you can be certain that they were revised multiple times and optimizations were probably implemented.&lt;/p&gt;

&lt;h2&gt;
  
  
  2️⃣ They are easily reusable
&lt;/h2&gt;

&lt;p&gt;Design patterns document a reusable solution which can be modified to solve multiple particular problems, as they are not tied to a specific problem.&lt;br&gt;
If you want to guarantee quality over the lifespan of the software project, a reusable adaption must be considered. This procedure also offers other developers a simple adaption into the existing solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  3️⃣ They are expressive
&lt;/h2&gt;

&lt;p&gt;Design patterns can explain a large solution quite elegantly.&lt;br&gt;
There is often code in your codebase, which you would like to exchange, because it is very slow or difficult to understand. Do not be afraid to exchange it or delete it completely and write it from scratch. If this is not possible, try to separate the individual tasks of the code better to make the code more understandable.&lt;/p&gt;

&lt;h2&gt;
  
  
  4️⃣ They ease communication
&lt;/h2&gt;

&lt;p&gt;When developers are familiar with design patterns, they can more easily communicate with one another about potential solutions to a given problem.&lt;br&gt;
If you’re working with colleagues in a team of multiple developers, agree with them about the design patterns, as they can help you better with a problem. Also with regard to the maintenance of software you should follow such procedures, as you make maintenance operations faster and more efficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  5️⃣ They prevent the need for refactoring code
&lt;/h2&gt;

&lt;p&gt;If an application is written with design patterns in mind, it is often the case that you won’t need to refactor the code later on because applying the correct design pattern to a given problem is already an optimal solution. If such solutions are then updated, they can be seamlessly applied by any good software developer and do not cause any problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  6️⃣ They lower the size of the codebase
&lt;/h2&gt;

&lt;p&gt;Because design patterns are usually elegant and optimal solutions, they usually require less code than other solutions. This does not always have to be the case as many developers write more code to improve understanding.&lt;/p&gt;

&lt;p&gt;Therefore, if you're writing code on a daily basis, design patterns of your code might be interesting for you. Try to validate them with these basic ruleset to verify them. Happy coding! 👩‍💻👨‍💻&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>career</category>
      <category>showdev</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Use CSS Grid in production — today</title>
      <dc:creator>Felix Häberle</dc:creator>
      <pubDate>Thu, 24 Oct 2019 09:08:56 +0000</pubDate>
      <link>https://forem.com/felixhaeberle/use-css-grid-in-production-today-p5e</link>
      <guid>https://forem.com/felixhaeberle/use-css-grid-in-production-today-p5e</guid>
      <description>&lt;p&gt;Everyone wants CSS Grid. It’s about a new layout method that will significantly change the way we design our content on the Internet. With CSS Grid you have the opportunity to place content in an unprecedented form on a website and sort it dynamically between viewports. This technique has therefore emerged, as many authors of websites had too limited possibilities working with the grid. With regard to the variety of devices on which websites are presented today, this state had not been sustainable.&lt;/p&gt;

&lt;p&gt;CSS Grid was created.💫&lt;/p&gt;

&lt;h2&gt;
  
  
  📅 Yes, CSS Grid is new. But around for quite a while.
&lt;/h2&gt;

&lt;p&gt;It is a new technology that recently emerged so we have to look around in the ecosystem of this technology and see where we can use that technology. Since this technique has to be supported by the browser, we can verify the current browser support on caniuse.com.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fnmk86hrke3eem6fynonf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fnmk86hrke3eem6fynonf.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This shows us that all common browsers are supporting CSS Grid. But what if the customer wants support for IE 10 + 11 or earlier versions of Internet Explorer? I try to answer this question in this article.&lt;/p&gt;

&lt;h2&gt;
  
  
  💡 Use &lt;a href="https://github.com/postcss/autoprefixer" rel="noopener noreferrer"&gt;Autoprefixer&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;There is a common problem with showing CSS attributes in all browsers with the same effect, so fully automated tools have been developed that can improve your code and you can make yourself a coffee, a quick coffee, because it all happens in less than one second. On tools like Autoprefixer you should take a closer look. Autoprefixer is a tool that checks your CSS code and adds the necessary attributes to unify your code in all browsers. With Autoprefixer you could thus cover all browsers in which CSS Grid attributes are supported including Internet Explorer 10 / 11. For browsers that are not supported you use fallbacks.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠 Plan fallbacks with the first line of code
&lt;/h2&gt;

&lt;p&gt;Since there are still browsers that do not support CSS Grid (around 10% of all browsers worldwide), we rely on creating alternative solutions. Fallbacks come into play here. This technique works by detecting unsupported browsers and then providing them with other code they support. The best way to do this is to use the following argument if you have decided to support IE10+11 over -ms prefixes:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fy8pb7xwcmikww8nzieqc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fy8pb7xwcmikww8nzieqc.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to use different code for Internet Explorer 10 and 11 and other non-functioning browsers, you can use the following fallback directive:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fnbhokn88xrgfbqq06dub.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fnbhokn88xrgfbqq06dub.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With these &lt;a class="mentioned-user" href="https://dev.to/support"&gt;@support&lt;/a&gt; queries you have the possibility to design your layout for older browsers completely independent of CSS Grid. 🏎&lt;/p&gt;

&lt;h2&gt;
  
  
  👩‍💼 Convince your customer with the right arguments
&lt;/h2&gt;

&lt;p&gt;You should convince your customers of this new and exciting technology. Advantages here are the responsive restructuring of content and the better accessibility of a layout method, which otherwise can only be guaranteed by “heavy” frameworks such as bootstrap.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Through fallbacks which cover the browsers that do not have CSS Grid support, you can use this technology today without hesitation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🎇 CSS Grid will take over
&lt;/h2&gt;

&lt;p&gt;Hopefully, in 1–2 years you will be able to eliminate the fallbacks from your code. Browsers such as Internet Explorer will be replaced by Edge (with Chrome Engine) or other browsers with CSS Grid support, and CSS Grid will prevail as a layout method on websites.&lt;/p&gt;

</description>
      <category>css</category>
      <category>productivity</category>
      <category>html</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
