<?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>DEV Community: Steffen Pedersen</title>
    <description>The latest articles on DEV Community by Steffen Pedersen (@steffenpedersen).</description>
    <link>https://dev.to/steffenpedersen</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%2F167997%2F214f47b8-87bc-4451-92ab-e46881e27645.jpg</url>
      <title>DEV Community: Steffen Pedersen</title>
      <link>https://dev.to/steffenpedersen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/steffenpedersen"/>
    <language>en</language>
    <item>
      <title>AngularJS Recap in 2 Minutes</title>
      <dc:creator>Steffen Pedersen</dc:creator>
      <pubDate>Tue, 14 Jan 2020 18:43:37 +0000</pubDate>
      <link>https://dev.to/steffenpedersen/angularjs-recap-in-2-minutes-183o</link>
      <guid>https://dev.to/steffenpedersen/angularjs-recap-in-2-minutes-183o</guid>
      <description>&lt;p&gt;I recently got a new job 🎉 One of the first projects I am going to work on is build with AngularJS. I will for that reason look into the old framework. &lt;/p&gt;

&lt;p&gt;I have a few years back worked on projects build with AngularJS. It is not completely new to me. I will try to keep this article really short and more like an overview of the main topics. If I miss a important topic, then &lt;strong&gt;please comment below&lt;/strong&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  2-Way Data Binding
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.angularjs.org/guide/databinding#data-binding-in-angularjs-templates"&gt;2-Way data binding&lt;/a&gt; is the synchronization between the model and the view. When data in the model changes, the view reflects the change, and when data in the view changes, the model is updated as well.&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;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;ng-model=&lt;/span&gt;&lt;span class="s"&gt;"hey"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;{{ hey }}&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Directives
&lt;/h2&gt;

&lt;p&gt;Directives are either an attribute &lt;code&gt;ng-&lt;/code&gt; or a HTML tag &lt;code&gt;&amp;lt;custom&amp;gt;&lt;/code&gt;, that tells the library to do something to a DOM element. Most of the &lt;a href="https://docs.angularjs.org/api/ng/directive"&gt;directives in AngularJS&lt;/a&gt; are starting with &lt;code&gt;ng-&lt;/code&gt; where &lt;em&gt;ng&lt;/em&gt; stands for Angular.&lt;/p&gt;

&lt;h2&gt;
  
  
  Expressions
&lt;/h2&gt;

&lt;p&gt;Here we can access variables and functions from the scope. This could be interpolation bindings like &lt;code&gt;&amp;lt;span title="{{ header.title }}"&amp;gt;{{ header.title }}&amp;lt;/span&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Modules
&lt;/h2&gt;

&lt;p&gt;Modules are containers for the different parts of your app including controllers, services, filters and directives.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;myAppModule&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;angular&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;myApp&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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;div&lt;/span&gt; &lt;span class="na"&gt;ng-app=&lt;/span&gt;&lt;span class="s"&gt;"myApp"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    ...
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Controllers
&lt;/h2&gt;

&lt;p&gt;This is here all the business logic behind views are being defined. The &lt;code&gt;$scope&lt;/code&gt; in this example is basically the binding between the controller and the view. The &lt;code&gt;$scope&lt;/code&gt; is a dependency and we need to add it as an array &lt;code&gt;['$scope', ...]&lt;/code&gt;. It will work without adding &lt;code&gt;'$scope'&lt;/code&gt; with an array &lt;code&gt;[...]&lt;/code&gt;, but it can fail while minifying the AngularJS code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;myApp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;WingardiumController&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;$scope&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;spell&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Leviosa&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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;div&lt;/span&gt; &lt;span class="na"&gt;ng-controller=&lt;/span&gt;&lt;span class="s"&gt;"WingardiumController"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    {{ spell }}
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I know there is a lot more to AngularJS, but this is just a briefing of some main topics. Did I miss something extremely important? &lt;strong&gt;Then please comment below.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>angular</category>
      <category>webdev</category>
    </item>
    <item>
      <title>TypeScript: 6 Pros and 4 Cons (biased)</title>
      <dc:creator>Steffen Pedersen</dc:creator>
      <pubDate>Thu, 02 Jan 2020 15:11:07 +0000</pubDate>
      <link>https://dev.to/steffenpedersen/typescript-6-pros-and-4-cons-biased-1l9n</link>
      <guid>https://dev.to/steffenpedersen/typescript-6-pros-and-4-cons-biased-1l9n</guid>
      <description>&lt;p&gt;In this article I will go over some of my thoughts on TypeScript. It will not be an in depth article, and I will try to keep it as short as possible. Let's start with the pros 🎉&lt;/p&gt;

&lt;h2&gt;
  
  
  Pros
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; &lt;strong&gt;Errors:&lt;/strong&gt; You are able to detect &lt;strong&gt;errors during compile-time&lt;/strong&gt;. This will give quick feedback and it makes refactoring much easier. It is also helpful when scaling the project.&lt;br&gt;
&lt;strong&gt;2.&lt;/strong&gt; &lt;strong&gt;IntelliSense:&lt;/strong&gt; There is often good support of IntelliSense. This includes &lt;strong&gt;autocompletion&lt;/strong&gt; and &lt;strong&gt;autoimports&lt;/strong&gt;. I also really like, that I am able to get &lt;strong&gt;quick info&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wjLAMrtK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/apeefotsj9qcv3o7tuwx.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wjLAMrtK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/apeefotsj9qcv3o7tuwx.gif" alt="Alt Text" width="800" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Source: &lt;a href="https://code.visualstudio.com/docs/languages/typescript#_intellisense"&gt;Visual Studio Code&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; &lt;strong&gt;Adopting:&lt;/strong&gt; When you are working on existing JavaScript projects, it is really amazing, that you are able to &lt;strong&gt;gradually adopt TypeScript&lt;/strong&gt;. TypeScript is based on JavaScript, so in practice you could just write plain old JavaScript in a &lt;code&gt;.ts&lt;/code&gt; file.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"TypeScript is a typed superset of JavaScript that compiles to plain JavaScript." - &lt;a href="http://www.typescriptlang.org/"&gt;typescriptlang.org&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; &lt;strong&gt;Patterns:&lt;/strong&gt; I really like, that TypeScript from the start is guiding the user of TypeScript to use structure. When you are writing plain JavaScript, it can easily become spaghetti code. We as developers want to follow some form of patterns and structure. This can be achieved from the start using &lt;a href="https://www.typescriptlang.org/docs/handbook/classes.html"&gt;&lt;code&gt;class&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://www.typescriptlang.org/docs/handbook/interfaces.html"&gt;&lt;code&gt;interface&lt;/code&gt;&lt;/a&gt;, &lt;a href="http://www.typescriptlang.org/docs/handbook/namespaces-and-modules.html"&gt;&lt;code&gt;namespace&lt;/code&gt; and &lt;code&gt;module&lt;/code&gt;&lt;/a&gt;, amongst other things.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;Car&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Fields&lt;/span&gt;

  &lt;span class="c1"&gt;// Constructor&lt;/span&gt;

  &lt;span class="c1"&gt;// Properties&lt;/span&gt;

  &lt;span class="c1"&gt;// Functions&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; &lt;strong&gt;Ability to understand:&lt;/strong&gt; I have talked with people both from frontend and backend. A bunch of people from backend hated JavaScript, but none of them hated TypeScript. I guess it is easier to understand when you are used to work with type heavy languages like Java or C#.&lt;br&gt;
&lt;strong&gt;6.&lt;/strong&gt; &lt;strong&gt;Jobs:&lt;/strong&gt; TypeScript is gaining &lt;a href="https://2018.stateofjs.com/javascript-flavors/overview/"&gt;more and more popularity&lt;/a&gt; and more companies are using the language. This gives more job opportunities surrounding TypeScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cons
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; &lt;strong&gt;Time:&lt;/strong&gt; You often need a build environment, and it will therefore take more time upfront.&lt;br&gt;
&lt;strong&gt;2.&lt;/strong&gt; &lt;strong&gt;Errors:&lt;/strong&gt; The error messages can sometimes be misleading, but you should never only just trust the IDE or editor anyway.&lt;br&gt;
&lt;del&gt;&lt;strong&gt;3.&lt;/strong&gt; &lt;strong&gt;Library support:&lt;/strong&gt; Not all JavaScript libraries supports TypeScript, but most of them do.&lt;/del&gt;&lt;br&gt;
&lt;strong&gt;4.&lt;/strong&gt; &lt;strong&gt;Learning:&lt;/strong&gt; Like everything, it takes time to learn. We are only human, and I would not say, that the learning curve is that high, if you already got the basics of programming in place.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note for con #3: The way I wrote this was misleading. Check out &lt;a href="https://www.detroitlabs.com/blog/2018/02/28/adding-custom-type-definitions-to-a-third-party-library/"&gt;this article&lt;/a&gt;. It explains my point 😊&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How Do I Keep up with Scala and Java</title>
      <dc:creator>Steffen Pedersen</dc:creator>
      <pubDate>Sat, 22 Jun 2019 18:25:01 +0000</pubDate>
      <link>https://dev.to/steffenpedersen/how-do-i-keep-up-with-scala-and-java-23mo</link>
      <guid>https://dev.to/steffenpedersen/how-do-i-keep-up-with-scala-and-java-23mo</guid>
      <description>&lt;p&gt;For a long time I have been focused on front-end development. I follow a lot of high profile people on social media. I also read blogs and sometimes newsletters. My focus is slowly shifting from front-end to back-end development. At my job, we write a lot of Scala and Java. I really want to become better at these languages.&lt;/p&gt;

&lt;p&gt;Do you know any high profile Scala or Java developers? &lt;br&gt;
Can you recommend any good blogs on these languages?&lt;/p&gt;

&lt;blockquote data-lang="en"&gt;
&lt;p&gt;I really want to be better at &lt;a href="https://twitter.com/hashtag/Scala?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#Scala&lt;/a&gt;. Do you know any good blogs or people to follow? &lt;a href="https://twitter.com/scaladays?ref_src=twsrc%5Etfw"&gt;@scaladays&lt;/a&gt;&lt;/p&gt;— Steffen Pedersen 🌚 (@mrsteffenp) &lt;a href="https://twitter.com/mrsteffenp/status/1139850060794138626?ref_src=twsrc%5Etfw"&gt;June 15, 2019&lt;/a&gt;
&lt;/blockquote&gt;

</description>
      <category>java</category>
      <category>scala</category>
      <category>discuss</category>
      <category>productivity</category>
    </item>
    <item>
      <title>CSS: Now and the Future</title>
      <dc:creator>Steffen Pedersen</dc:creator>
      <pubDate>Sat, 15 Jun 2019 18:00:18 +0000</pubDate>
      <link>https://dev.to/steffenpedersen/css-now-and-the-future-28n3</link>
      <guid>https://dev.to/steffenpedersen/css-now-and-the-future-28n3</guid>
      <description>&lt;p&gt;I have earlier on written about why so many developers fear CSS. This is often based on either little to no knowledge or outdated knowledge. Can we help overcome the fear with new knowledge? Let us find out!&lt;/p&gt;

&lt;h1&gt;
  
  
  CSS Now 🎉
&lt;/h1&gt;

&lt;p&gt;This will be pretty much like a weather forecast. We must first see how the weather is right now. From there we can look into how the weather will be the rest of the week. Okay, maybe this metaphor is too much. You get the point.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Web Is Everywhere!
&lt;/h2&gt;

&lt;p&gt;Oh no, the days of desktop screens in specific dimensions are long gone. A lot of you have heard about media queries. If you want to attack screens from a certain size, you could do it this way &lt;code&gt;@media screen and (min-width: 600px)&lt;/code&gt;. But you could also aim for orientation of the screen like this &lt;code&gt;@media screen and (orientation: landscape)&lt;/code&gt;. And with specific combinations, we could have an Apple Watch as a target! &lt;strong&gt;Easy!&lt;/strong&gt; So we shouldn't really fear, that we have to aim for different devices these days.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resets
&lt;/h2&gt;

&lt;p&gt;When you work with CSS, you will quickly find out, that the browsers default styling are not the same. There are different ways to deal with those. The two most popular are Reset CSS and Normalize.css. The Reset CSS will wipe out all built-in styling for HTML elements. Normalize.css removes browser inconsistencies for HTML elements. Instead of remove everything like CSS Reset, Normalize.css will preserve some useful defaults. I pretty much always use Normalize.css.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preprocessors
&lt;/h2&gt;

&lt;p&gt;This was an extremely hot topic a few year ago. A CSS preprocessor lets you generate CSS from an unique syntax with features such as mixins, functions, nesting, inheritance and so on. It will (subjectively) make the code easier to read and maintain. It was a hot topic, and the fire is still burning. We have just gotten used to it being there. We are still using Sass, Less and PostCSS. I myself am very happy for Sass with SCSS syntax and PostCSS. But I kinda see the same story repeating with ECMAScript and jQuery - now with CSS and preprocessors. CSS have now support for variables called CSS custom properties. We will properly see CSS develop in the direction of preprocessors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flexbox and Grid
&lt;/h2&gt;

&lt;p&gt;Jøsses (Danish), the fire is getting bigger and stronger! We have properly all heard about CSS Flexbox and CSS Grid. They are both used for layout - but what is the difference? The main difference between Grid and Flexbox is that Grid is two-dimensional and Flexbox is one-dimensional. With grid you can handle both columns and rows and with Flexbox you can either handle a column or a row. The way I see it is, that you should use Grid for the big layout of your page, and that you should use Flexbox for handling the content of your components. Don’t forget that it is super easy centering things with Flexbox nowadays. This example both centers horizontally and vertically.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  display: flex;
  justify-content: center;
  align-items: center;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;One of the things that developers still are struggling with is file structure of their code base. With Sass you can &lt;code&gt;@import&lt;/code&gt; your files, and in that way make a file system. We also now have ITCSS, which stands for &lt;strong&gt;I&lt;/strong&gt;nverted &lt;strong&gt;T&lt;/strong&gt;riangle &lt;strong&gt;CSS&lt;/strong&gt;. It is an architecture that helps you to organize your project CSS files. The concept is that we should not output any CSS in the first 2 layers, then we specify the global selectors and get more and more specific. We then don’t have to make dumb overrides with &lt;code&gt;!important&lt;/code&gt;. With this structure, it also gives a good understanding of how the cascading and inheritance work.&lt;/p&gt;

&lt;h1&gt;
  
  
  CSS Future 🚀
&lt;/h1&gt;

&lt;p&gt;I am by no means a fortune teller. This is just me rambling on. But we know, that the web is spreading to weird devices. We will properly have to deal with that in the future. We are slowly turning towards CSS instead of preprocessors. What will the future bring us? Let us find out!&lt;/p&gt;

&lt;h2&gt;
  
  
  CSS Properties
&lt;/h2&gt;

&lt;p&gt;CSS is getting stronger than ever. They are adding new properties and values all the time. A new value that I am waiting for to be supported better is &lt;code&gt;display: contents&lt;/code&gt;. I love the idea behind this value. &lt;code&gt;display: contents&lt;/code&gt; causes the children of an element to appear as if they were direct children of the element's parent. We are then ignoring the element itself. This is especially useful on list elements. I am also waiting for properties like &lt;code&gt;conic-gradient()&lt;/code&gt; and media queries level 5. It has so many new features like &lt;code&gt;light-level&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Variable Fonts
&lt;/h2&gt;

&lt;p&gt;I am not a font expert, but this sounds really cool. Variable fonts enables different variations of a typeface to be incorporated into a single file. Then you don't have to have separate font files for every weight or style. We can customize the fonts with &lt;code&gt;font-variation-settings&lt;/code&gt; that allows values like wght (weight), wdth (width), ital (italic), slnt (slant/oblique) and you can customize in different other ways. You can look at &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide"&gt;this guide&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  font-weight: 400;
}

.container {
  font-variation-settings: 'wght' 400;
}

.container {
  font-variation-settings: 'wght' var(--weight);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  CSS Houdini
&lt;/h2&gt;

&lt;p&gt;Okay, this is really interesting. Houdini CSS is basically a new collection of browser APIs, which allows you to gain more access to your browser’s CSS engine. We can access these APIs through JavaScript. This new concept is a new W3C task force, whose ultimate goal is to make browser support issues go away forever. Houdini CSS currently has 7 APIs, that each will deal with a specific problem. I know little to nothing about this, but I will definitely try it out!&lt;/p&gt;




&lt;p&gt;These are my own little thoughts about CSS. I don't know everything about it. But I like to hand out some knowledge nuggets 🐔&lt;/p&gt;

&lt;blockquote data-lang="en"&gt;
&lt;p&gt;If you are not doing what you love, you are wasting your time.&lt;/p&gt;— Steffen Pedersen 🌚 (@mrsteffenp) &lt;a href="https://twitter.com/mrsteffenp/status/1138098572354883586?ref_src=twsrc%5Etfw"&gt;June 10, 2019&lt;/a&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thank you for your time!&lt;/p&gt;

&lt;p&gt;If you liked this, then please ❤️ and &lt;a href="https://twitter.com/mrsteffenp"&gt;&lt;em&gt;follow me on Twitter&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Why Most Developers Fear CSS</title>
      <dc:creator>Steffen Pedersen</dc:creator>
      <pubDate>Sat, 08 Jun 2019 20:55:43 +0000</pubDate>
      <link>https://dev.to/steffenpedersen/why-most-developers-fear-css-3h99</link>
      <guid>https://dev.to/steffenpedersen/why-most-developers-fear-css-3h99</guid>
      <description>&lt;p&gt;When I started at my job, we where two front-end developers at my team. It was me and a senior front-end developer. Then the senior front-end developer quit his job, I was the only front-end developer at my team. And it was fine. I did my job, and there was no harm. We had some job interviews, but we did not meet the right fit. The time went by, and then it hit me: I was the only one knowing &lt;strong&gt;anything&lt;/strong&gt; about our front-end. The bus factor was at one, which is not a good number in this case. Why? If I get hit by a bus, the project will be in a bad situation.&lt;/p&gt;

&lt;p&gt;I then talked to my boss, and we came to the agreement, that we all should be responsible for the front-end. The work could be done in pair programming. At least until we would find the right match. I thought that was a great idea. I had a total burnt out from working alone on the front-end. &lt;/p&gt;

&lt;p&gt;We then presented the idea, and the first reacting was fear from the other developers. The fear was mostly concerned about CSS. &lt;/p&gt;

&lt;blockquote data-lang="en"&gt;
&lt;p&gt;HTML and CSS is for losers 🙄 We should all use Microsoft Word.&lt;/p&gt;— Steffen 🖤 (@mrsteffenp) &lt;a href="https://twitter.com/mrsteffenp/status/1137427569723265025?ref_src=twsrc%5Etfw"&gt;June 8, 2019&lt;/a&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why do developers fear CSS?
&lt;/h2&gt;

&lt;p&gt;I talked to the other developers about why they fear CSS. The first thing brought up was cascading 😵 What if they make changes to one class, that will effect five hundred other elements?&lt;/p&gt;

&lt;p&gt;The next thing brought up was support of browsers 💻 What if they implement something, that isn't supported in some browsers? &lt;/p&gt;

&lt;p&gt;The final thing was building something from the ground up 🏡 What if they make something, that isn't solid and doesn't look good?&lt;/p&gt;

&lt;h3&gt;
  
  
  Cascading 😵
&lt;/h3&gt;

&lt;p&gt;This is one of the biggest fears. When other developers are talking about this, I guess they are talking about many things. It is both importance, specificity, source order and how properties inherit from different rules. The styling can be specified in many different places, and it can interact in complex ways. This is why CSS is so powerful, but it is also the reason why, it can be confusing and difficult. The cascading can be a devilish thing, if you don’t know the rules of how selectors can overrule other selectors 😈&lt;/p&gt;

&lt;h4&gt;
  
  
  Importance
&lt;/h4&gt;

&lt;p&gt;This is a well talked subject. We all know, that it is (in most cases) bad to use this little helper. This is because &lt;code&gt;!important&lt;/code&gt; will always win 🏆&lt;/p&gt;

&lt;h4&gt;
  
  
  Specificity
&lt;/h4&gt;

&lt;p&gt;Specificity is basically a measure of how specific a selector is. Like, inline styling is the most specific, then &lt;code&gt;#id&lt;/code&gt;, then &lt;code&gt;.class&lt;/code&gt;, and then the &lt;code&gt;element&lt;/code&gt;. From there, the specificity can be measured in a million different ways. If you have doubts, you can use a specificity calculator.&lt;/p&gt;

&lt;h4&gt;
  
  
  Source order
&lt;/h4&gt;

&lt;p&gt;Source order is basically that later rules will win over earlier rules. If you write a selector with a property and a value, and then later on write the same selector with the same property - but with a different value. What will then happen? 🤓&lt;/p&gt;

&lt;h3&gt;
  
  
  Inheritance
&lt;/h3&gt;

&lt;p&gt;Inheritance in CSS is both simple and tricky. It can be explained in this way: &lt;em&gt;Some property values applied to an element will be inherited by the element's children, and some won't&lt;/em&gt;. Doesn't that sound great? 😵 CSS properties like &lt;code&gt;font-size&lt;/code&gt; and &lt;code&gt;color&lt;/code&gt; do inherit, and properties like &lt;code&gt;margin&lt;/code&gt; and &lt;code&gt;padding&lt;/code&gt; don’t inherit. I guess that you will have to use common sense in this one. If &lt;code&gt;margin&lt;/code&gt; would be inherited, it would cause a huge mess! You could use &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Reference"&gt;MDN&lt;/a&gt; as reference.&lt;/p&gt;

&lt;h3&gt;
  
  
  Browser support 💻
&lt;/h3&gt;

&lt;p&gt;Unless your client is a company that only support Internet Explorer 6, you shouldn’t worry that much. Most users are using modern browsers with great support of CSS. If you feel insecure whether you should use a specific property, then you can check it out at &lt;a href="https://caniuse.com/"&gt;caniuse&lt;/a&gt;. If a browser doesn't support the property, but you really want to use it, then most browsers &lt;code&gt;@supports&lt;/code&gt; the CSS at-rule of the same name. Then you can make a fallback solution.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@supports (display: grid) {
  div {
    display: grid;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Building something from the ground up 🏡
&lt;/h3&gt;

&lt;p&gt;This is mostly about the communication between designers and developers. The communication is not always that great. Sometimes the ambitions of the designers can be too high in relation to the company's wallet and the developers' skills - or what is actually possible. &lt;/p&gt;

&lt;p&gt;The point is, that we as developers should be more integrated in the design process, so we all can fell comfortable with the outcome. With that being said, if the developer feels comfortable with the design, then it will be easier building it from the ground up.&lt;/p&gt;




&lt;p&gt;I hope this wasn't a bunch of nonsense. I just really want to tell other developers, that doesn't work with CSS on a daily basis, that CSS isn't magic ✨&lt;/p&gt;

&lt;p&gt;Thank you for your time!&lt;/p&gt;

&lt;p&gt;If you liked this, then please ❤️ and &lt;a href="https://twitter.com/mrsteffenp"&gt;&lt;em&gt;follow me on Twitter&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Stay Healthy as a Developer</title>
      <dc:creator>Steffen Pedersen</dc:creator>
      <pubDate>Sun, 02 Jun 2019 21:03:04 +0000</pubDate>
      <link>https://dev.to/steffenpedersen/stay-healthy-as-a-developer-526c</link>
      <guid>https://dev.to/steffenpedersen/stay-healthy-as-a-developer-526c</guid>
      <description>&lt;p&gt;This is a personal guide for staying healthy. It is by no means an official guide, and I am by no means an instructor or trained to teach in this field.&lt;/p&gt;

&lt;p&gt;I started working full time as a developer a few years ago. Since then, I have become more weak and have got a small belly. I have seen several of my colleagues getting back problems. &lt;strong&gt;I do not want that!&lt;/strong&gt; I will in this simple personal guide show a training program, calorie intake and a meal plan. I hope this can inspire a few developers to start getting healthy habits.&lt;/p&gt;

&lt;blockquote data-lang="en"&gt;
&lt;p&gt;Remember, your mental &amp;amp; physical health comes first 🤕❤️ &lt;a href="https://twitter.com/hashtag/DeveloperCommunity?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#DeveloperCommunity&lt;/a&gt;&lt;/p&gt;— ✨✨ Steffen ✨✨ (@mrsteffenp) &lt;a href="https://twitter.com/mrsteffenp/status/1134888558362333184?ref_src=twsrc%5Etfw"&gt;June 1, 2019&lt;/a&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Training Program
&lt;/h2&gt;

&lt;p&gt;Here is my training program with exercises, that I am currently doing. I am myself somewhat of a beginner. It is therefore a good idea to focus on the basics, and to perform the exercises properly. This will by far provide the best foundation in the long term.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Monday&lt;/th&gt;
&lt;th&gt;Wednesday&lt;/th&gt;
&lt;th&gt;Friday&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Squats&lt;/td&gt;
&lt;td&gt;Deadlifts&lt;/td&gt;
&lt;td&gt;Squats&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pendlay Rows&lt;/td&gt;
&lt;td&gt;Pull-ups&lt;/td&gt;
&lt;td&gt;T-bar Rows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bench Press&lt;/td&gt;
&lt;td&gt;Incline Press&lt;/td&gt;
&lt;td&gt;Chest Dips&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Overhead Press&lt;/td&gt;
&lt;td&gt;Upright Rows&lt;/td&gt;
&lt;td&gt;Overhead Press&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Skull Crushers&lt;/td&gt;
&lt;td&gt;Zottman Curls&lt;/td&gt;
&lt;td&gt;Kick Backs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Standing Calf Raises&lt;/td&gt;
&lt;td&gt;Lateral Raises&lt;/td&gt;
&lt;td&gt;Seated Calf Raises&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cardio&lt;/td&gt;
&lt;td&gt;Cardio&lt;/td&gt;
&lt;td&gt;Cardio&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These exercises are inspired by &lt;a href="https://www.buffdudes.us/"&gt;Buff Dudes&lt;/a&gt;. You could of cause find another training plan, that suits you better. I also improvise on some exercises. I usually go 5 x 5 on each exercise and around 30 minutes of cardio. I often do the cardio on other days.&lt;/p&gt;

&lt;p&gt;A few months back I worked out in the morning before work. I am not really a fan of that, because it can take some energy off work. Now I am doing it after work, and it actually works 😉&lt;/p&gt;

&lt;h2&gt;
  
  
  Calorie Intake
&lt;/h2&gt;

&lt;p&gt;What you eat is crucial, if you want a healthy lifestyle. It is important to know your calorie intake, and the amount of calories you need to eat to maintain your current weight. From there you navigate whether you want to build muscle or lose fat. I want to build muscle and maybe loose some fat 💪🏻🐷. I am not fanatic, and this is a learning process. It is also important to know the balance of protein, carbohydrate and fat. &lt;/p&gt;

&lt;p&gt;My personally maintaining calorie intake is about 2800 calories a day. Here I will add 500 calories, so it will be around &lt;strong&gt;3300 calories a day&lt;/strong&gt;. Maybe I won't go that far because of my small belly. People have different numbers based on age, weight and activity levels. Don’t forget to use a &lt;a href="https://tdeecalculator.net"&gt;TDEE calculator&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I will use a split of &lt;strong&gt;40%&lt;/strong&gt; carbohydrates, &lt;strong&gt;40%&lt;/strong&gt; proteins and &lt;strong&gt;20%&lt;/strong&gt; fats. I will eat lower carb, because my body reacts quite quickly to it. It is important to point out that all numbers are indicative.&lt;/p&gt;

&lt;h2&gt;
  
  
  Meal Plan
&lt;/h2&gt;

&lt;p&gt;I find pleasure in having a specific plan to follow to achieve my goals. I will try to follow a plan, but not be totally strict about it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Breakfast ☀️
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Food&lt;/th&gt;
&lt;th&gt;Protein&lt;/th&gt;
&lt;th&gt;Carb&lt;/th&gt;
&lt;th&gt;Fat&lt;/th&gt;
&lt;th&gt;Calories&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Skyr&lt;/td&gt;
&lt;td&gt;27,5&lt;/td&gt;
&lt;td&gt;10,0&lt;/td&gt;
&lt;td&gt;0,5&lt;/td&gt;
&lt;td&gt;158&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Protein&lt;/td&gt;
&lt;td&gt;21,0&lt;/td&gt;
&lt;td&gt;3,0&lt;/td&gt;
&lt;td&gt;22,5&lt;/td&gt;
&lt;td&gt;117&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Müsli&lt;/td&gt;
&lt;td&gt;3,3&lt;/td&gt;
&lt;td&gt;18,0&lt;/td&gt;
&lt;td&gt;2,0&lt;/td&gt;
&lt;td&gt;109&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Honey&lt;/td&gt;
&lt;td&gt;0,0&lt;/td&gt;
&lt;td&gt;7,5&lt;/td&gt;
&lt;td&gt;0,0&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Muffin&lt;/td&gt;
&lt;td&gt;18,2&lt;/td&gt;
&lt;td&gt;31,6&lt;/td&gt;
&lt;td&gt;14,5&lt;/td&gt;
&lt;td&gt;266&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total&lt;/td&gt;
&lt;td&gt;70,0&lt;/td&gt;
&lt;td&gt;70,1&lt;/td&gt;
&lt;td&gt;39,5&lt;/td&gt;
&lt;td&gt;678&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;At breakfast I will around 250g skyr, 30g müsli, 10g honey and two healthy muffins. Skyr is an Icelandic cultured dairy product. It has the consistency of Greek yogurt, but a milder flavor. We eat it a lot here in Denmark.&lt;/p&gt;

&lt;h3&gt;
  
  
  Snack 🍽
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Food&lt;/th&gt;
&lt;th&gt;Protein&lt;/th&gt;
&lt;th&gt;Carb&lt;/th&gt;
&lt;th&gt;Fat&lt;/th&gt;
&lt;th&gt;Calories&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Banana&lt;/td&gt;
&lt;td&gt;1,4&lt;/td&gt;
&lt;td&gt;29,7&lt;/td&gt;
&lt;td&gt;0,4&lt;/td&gt;
&lt;td&gt;125&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Almonds&lt;/td&gt;
&lt;td&gt;2,5&lt;/td&gt;
&lt;td&gt;2,6&lt;/td&gt;
&lt;td&gt;5,9&lt;/td&gt;
&lt;td&gt;69&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total&lt;/td&gt;
&lt;td&gt;3,9&lt;/td&gt;
&lt;td&gt;32,3&lt;/td&gt;
&lt;td&gt;6,3&lt;/td&gt;
&lt;td&gt;194&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;I usually eat a banana and some almonds at work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lunch 🍽
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Food&lt;/th&gt;
&lt;th&gt;Protein&lt;/th&gt;
&lt;th&gt;Carb&lt;/th&gt;
&lt;th&gt;Fat&lt;/th&gt;
&lt;th&gt;Calories&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Chicken&lt;/td&gt;
&lt;td&gt;24,0&lt;/td&gt;
&lt;td&gt;1,5&lt;/td&gt;
&lt;td&gt;1,9&lt;/td&gt;
&lt;td&gt;119&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Egg&lt;/td&gt;
&lt;td&gt;8,1&lt;/td&gt;
&lt;td&gt;0,6&lt;/td&gt;
&lt;td&gt;6,5&lt;/td&gt;
&lt;td&gt;93&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;White rice&lt;/td&gt;
&lt;td&gt;3,5&lt;/td&gt;
&lt;td&gt;36,6&lt;/td&gt;
&lt;td&gt;0,4&lt;/td&gt;
&lt;td&gt;169&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Vegetables&lt;/td&gt;
&lt;td&gt;0,9&lt;/td&gt;
&lt;td&gt;6,0&lt;/td&gt;
&lt;td&gt;0,2&lt;/td&gt;
&lt;td&gt;27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chili mayo&lt;/td&gt;
&lt;td&gt;0,2&lt;/td&gt;
&lt;td&gt;1,9&lt;/td&gt;
&lt;td&gt;1,8&lt;/td&gt;
&lt;td&gt;26&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total&lt;/td&gt;
&lt;td&gt;36,6&lt;/td&gt;
&lt;td&gt;46,6&lt;/td&gt;
&lt;td&gt;10,8&lt;/td&gt;
&lt;td&gt;433&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;At lunch I will eat 200g chopped chicken with some white rice, egg, vegetables and a tablespoon chili mayo.&lt;/p&gt;

&lt;h3&gt;
  
  
  Afternoon 🍎
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Food&lt;/th&gt;
&lt;th&gt;Protein&lt;/th&gt;
&lt;th&gt;Carb&lt;/th&gt;
&lt;th&gt;Fat&lt;/th&gt;
&lt;th&gt;Calories&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Muffin&lt;/td&gt;
&lt;td&gt;18,2&lt;/td&gt;
&lt;td&gt;31,6&lt;/td&gt;
&lt;td&gt;14,5&lt;/td&gt;
&lt;td&gt;265&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total&lt;/td&gt;
&lt;td&gt;18,2&lt;/td&gt;
&lt;td&gt;31,6&lt;/td&gt;
&lt;td&gt;14,5&lt;/td&gt;
&lt;td&gt;265&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In the afternoon I will eat two healthy muffins.&lt;/p&gt;

&lt;h3&gt;
  
  
  After workout 💪🏻
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Food&lt;/th&gt;
&lt;th&gt;Protein&lt;/th&gt;
&lt;th&gt;Carb&lt;/th&gt;
&lt;th&gt;Fat&lt;/th&gt;
&lt;th&gt;Calories&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Protein powder&lt;/td&gt;
&lt;td&gt;42,0&lt;/td&gt;
&lt;td&gt;6,0&lt;/td&gt;
&lt;td&gt;45,0&lt;/td&gt;
&lt;td&gt;234&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total&lt;/td&gt;
&lt;td&gt;42,0&lt;/td&gt;
&lt;td&gt;6,0&lt;/td&gt;
&lt;td&gt;45,0&lt;/td&gt;
&lt;td&gt;234&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;After workout I will eat two scoops of protein powder.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dinner 🍽
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Food&lt;/th&gt;
&lt;th&gt;Protein&lt;/th&gt;
&lt;th&gt;Carb&lt;/th&gt;
&lt;th&gt;Fat&lt;/th&gt;
&lt;th&gt;Calories&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Dinner&lt;/td&gt;
&lt;td&gt;40,0&lt;/td&gt;
&lt;td&gt;30,0&lt;/td&gt;
&lt;td&gt;10,0&lt;/td&gt;
&lt;td&gt;550&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total&lt;/td&gt;
&lt;td&gt;40,0&lt;/td&gt;
&lt;td&gt;30,0&lt;/td&gt;
&lt;td&gt;10,0&lt;/td&gt;
&lt;td&gt;550&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Dinner will differ, but I will try to keep it around these numbers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Late night 🌙
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Food&lt;/th&gt;
&lt;th&gt;Protein&lt;/th&gt;
&lt;th&gt;Carb&lt;/th&gt;
&lt;th&gt;Fat&lt;/th&gt;
&lt;th&gt;Calories&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Skyr&lt;/td&gt;
&lt;td&gt;27,5&lt;/td&gt;
&lt;td&gt;10,0&lt;/td&gt;
&lt;td&gt;0,5&lt;/td&gt;
&lt;td&gt;158&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Protein&lt;/td&gt;
&lt;td&gt;21,0&lt;/td&gt;
&lt;td&gt;3,0&lt;/td&gt;
&lt;td&gt;22,5&lt;/td&gt;
&lt;td&gt;117&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Müsli&lt;/td&gt;
&lt;td&gt;3,3&lt;/td&gt;
&lt;td&gt;18,0&lt;/td&gt;
&lt;td&gt;2,0&lt;/td&gt;
&lt;td&gt;109&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Honey&lt;/td&gt;
&lt;td&gt;0,0&lt;/td&gt;
&lt;td&gt;7,5&lt;/td&gt;
&lt;td&gt;0,0&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Muffin&lt;/td&gt;
&lt;td&gt;9,1&lt;/td&gt;
&lt;td&gt;15,8&lt;/td&gt;
&lt;td&gt;7,3&lt;/td&gt;
&lt;td&gt;132&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total&lt;/td&gt;
&lt;td&gt;60,9&lt;/td&gt;
&lt;td&gt;54,3&lt;/td&gt;
&lt;td&gt;32,3&lt;/td&gt;
&lt;td&gt;545&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;I just love my skyr and muffins 😬&lt;/p&gt;

&lt;h3&gt;
  
  
  Total 📈
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Subject&lt;/th&gt;
&lt;th&gt;Protein&lt;/th&gt;
&lt;th&gt;Carb&lt;/th&gt;
&lt;th&gt;Fat&lt;/th&gt;
&lt;th&gt;Calories&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Daily&lt;/td&gt;
&lt;td&gt;271,7&lt;/td&gt;
&lt;td&gt;270,9&lt;/td&gt;
&lt;td&gt;158,4&lt;/td&gt;
&lt;td&gt;2900&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Energy balance&lt;/td&gt;
&lt;td&gt;38,8&lt;/td&gt;
&lt;td&gt;38,7&lt;/td&gt;
&lt;td&gt;22,6&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;My numbers are not perfect. I will try to adjust them along the way. Maybe I will add or subtract calories.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supplements
&lt;/h2&gt;

&lt;p&gt;I use a few supplements to optimize my exercise and my overall mood with vitamins, but without being fanatic. I use protein, BCAA, Vitamin D and Omega-3. BCAA is definitely not a must!&lt;/p&gt;




&lt;p&gt;I really want to point out, that this is just my take on being healthy. My main goal is to get stronger. Maybe yours is more focused around mental health.&lt;/p&gt;

&lt;p&gt;Thank you for your time!&lt;/p&gt;

&lt;p&gt;If you liked this, then please ❤️ and &lt;a href="https://twitter.com/mrsteffenp"&gt;&lt;em&gt;follow me on Twitter&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>career</category>
      <category>discuss</category>
      <category>psychology</category>
    </item>
    <item>
      <title>What is subgrid?</title>
      <dc:creator>Steffen Pedersen</dc:creator>
      <pubDate>Sat, 01 Jun 2019 18:15:18 +0000</pubDate>
      <link>https://dev.to/steffenpedersen/what-is-subgrid-192f</link>
      <guid>https://dev.to/steffenpedersen/what-is-subgrid-192f</guid>
      <description>&lt;p&gt;I hear the buzzword everywhere lately. I would really like to know the use case from actual developers.&lt;/p&gt;

&lt;blockquote data-lang="en"&gt;
&lt;p&gt;Can anybody explain to me what subgrid is? &lt;a href="https://twitter.com/hashtag/CSS?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#CSS&lt;/a&gt; &lt;a href="https://twitter.com/hashtag/DevDiscuss?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#DevDiscuss&lt;/a&gt; &lt;a href="https://twitter.com/hashtag/DeveloperCommunity?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#DeveloperCommunity&lt;/a&gt;&lt;/p&gt;— ✨✨ Steffen ✨✨ (@mrsteffenp) &lt;a href="https://twitter.com/mrsteffenp/status/1134475367195000832?ref_src=twsrc%5Etfw"&gt;May 31, 2019&lt;/a&gt;
&lt;/blockquote&gt;

</description>
      <category>discuss</category>
      <category>css</category>
    </item>
    <item>
      <title>Increasing the Bus Factor on Frontend</title>
      <dc:creator>Steffen Pedersen</dc:creator>
      <pubDate>Tue, 28 May 2019 13:08:16 +0000</pubDate>
      <link>https://dev.to/steffenpedersen/increasing-the-bus-factor-on-frontend-331g</link>
      <guid>https://dev.to/steffenpedersen/increasing-the-bus-factor-on-frontend-331g</guid>
      <description>&lt;p&gt;ℹ️ This is an article, I wrote last year on Medium.&lt;/p&gt;

&lt;p&gt;Right now, as I am writing this, I am the only frontend developer on my team. This means that I am unofficially responsible for all frontend and it also means, that it is not tested very well. It may sound livable, but it can be dangerous in the long run if one team member works with a specific area.&lt;/p&gt;

&lt;p&gt;It has been like this since another frontend developer got a new job. He was by the way also a senior developer. Now all frontend issues has my name on it, and that is really not the best way of managing the work of a team. &lt;em&gt;What if I also get a new job?&lt;/em&gt; Then the team is in a very bad situation.&lt;/p&gt;

&lt;p&gt;Normally, this is called the bus factor. It is the number of people in your team who can put your project in a bad situation if they get hit by a bus. Our bus factor on the frontend and the style guide is about 1.25. It is obviously a weird number. Of course, there can’t be 0.25 people. What I mean is, that I know most about frontend and the style guide, but there are a few team members who have looked into the project. The style guide is by the way a project where all frontend is being defined, and where CSS and JS is being outputted from.&lt;/p&gt;

&lt;p&gt;I have been frustrated that there hasn't been much help or discussion about our front end. With that in mind, I chose to write an email to our team. I wrote it so I was sure to get it properly formulated.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Hi guys,&lt;/p&gt;

&lt;p&gt;I think we should have a talk about the style guide.&lt;/p&gt;

&lt;p&gt;Since X said goodbye, I have been alone with frontend development and the style guide. If I get hit by a bus, the team are missing knowledge on this specific area. We can easily continue this way, but I don’t think it’s good for our team, my role in the team or my further development.&lt;/p&gt;

&lt;p&gt;I think a solution would be pair programming and more in-depth testing. It might also help if the style guide is going to be a part of the main project. Then it would not be an alienated project. That is maybe for an other discussion.&lt;/p&gt;

&lt;p&gt;It is not like the style guide is a whole different world. If you know HTML, SCSS, ES2015 and the architecture ITCSS and naming convention BEM — then you know the most essential.&lt;/p&gt;

&lt;p&gt;Knowledge sharing is important, especially when that knowledge depends on one person.&lt;/p&gt;

&lt;p&gt;Think about it and we will have a talk soon.&lt;/p&gt;

&lt;p&gt;Steffen 😀&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We talked about the topic at our &lt;a href="https://www.scrum.org/"&gt;Sprint Retrospective&lt;/a&gt;. Here we defined some action points, which is something that we can improve on in the following sprint. In this case, it was more &lt;strong&gt;pair programming&lt;/strong&gt; and a &lt;strong&gt;presentation&lt;/strong&gt; of the style guide. The other team members would also do more thorough &lt;strong&gt;code reviews&lt;/strong&gt;. I am also trying to make even more &lt;strong&gt;documentation&lt;/strong&gt; on frontend development. I am right now preparing a &lt;strong&gt;workshop&lt;/strong&gt; on frontend and the style guide.&lt;/p&gt;

&lt;p&gt;I would love to hear if you have been in a similar situation. Have you also been alone with a certain part of a project?&lt;/p&gt;

&lt;p&gt;Thank you for your time!&lt;/p&gt;

&lt;p&gt;If you liked this, then please ❤️ and &lt;a href="https://twitter.com/mrsteffenp"&gt;&lt;em&gt;follow me on Twitter&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>webdev</category>
      <category>career</category>
      <category>discuss</category>
    </item>
    <item>
      <title>My Most Used Git Commands</title>
      <dc:creator>Steffen Pedersen</dc:creator>
      <pubDate>Tue, 21 May 2019 17:28:03 +0000</pubDate>
      <link>https://dev.to/steffenpedersen/my-most-used-git-commands-j07</link>
      <guid>https://dev.to/steffenpedersen/my-most-used-git-commands-j07</guid>
      <description>&lt;p&gt;This is not a full guide to which commands you should learn. I just find it inspiring to read about other developers’ habits and work routines. This I would like to contribute to and tell about &lt;em&gt;my most used Git commands&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;I honestly don’t have a specific way on typing these commands. I sometimes write the full command. I sometimes replace &lt;code&gt;git&lt;/code&gt; with &lt;code&gt;g&lt;/code&gt;. And then I sometimes write the full alias. I think it depends on the goal with the command. It is worth mentioning that I am using ZSH with &lt;a href="https://github.com/robbyrussell/oh-my-zsh"&gt;oh-my-zsh&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Main Commands
&lt;/h2&gt;

&lt;p&gt;These are the commands that I use &lt;em&gt;every day&lt;/em&gt; - or almost every day.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add --all
git commit -m “Add this commit”
git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have heard about Git, then you will probably know these three classic commands. I use them pretty much all the time. It is here that it will be nice to use some aliases. &lt;code&gt;gaa&lt;/code&gt;, &lt;code&gt;gcmsg “Add this commit”&lt;/code&gt; and &lt;code&gt;gp&lt;/code&gt; will come in handy!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout develop
git checkout -b my-new-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These will switch to an existing branch or a new branch. There is not much new going on here. I often use the full aliases here too - &lt;code&gt;gcd&lt;/code&gt; and &lt;code&gt;gcb “my-new-branch“&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git pull --rebase
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I always use the option &lt;code&gt;--rebase&lt;/code&gt; when I pull from a repository. This will keep my commits nice and clean on the top of the tree. You could use the alias &lt;code&gt;gup&lt;/code&gt;. It was a senior developer who taught me the power of rebase.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git rebase &amp;lt;branch&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will lead us to rebase itself. &lt;em&gt;Remember to rebase!&lt;/em&gt; This is especially important if you are doing feature branches. We do not want a half-dead branch, which is a billion commits behind its default branch with merge conflicts up to the throat. &lt;em&gt;Ouch!&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git merge &amp;lt;branch&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is not that often that I need to merge directly from my terminal. In my team at work we use a branching strategy with feature branches. When a branch should be merged into the default branch (or another), then we use a pull request from GitHub — and the GUI at the website is just fine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash
git stash pop
git stash apply stash@{1}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Has your project manager given you a new task, which need to be done quickly? Just throw your current work to the side and focus on the new stuff. &lt;em&gt;It is awesome!&lt;/em&gt; I actually don’t use the full alias for this. I am using &lt;em&gt;g&lt;/em&gt; instead of &lt;em&gt;git&lt;/em&gt;. Maybe it is because I want to be absolutely sure, that I am actually stashing 😀&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git status -s
git log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are the commands that keeps me updated, and I use them about 500 times a day. I use &lt;code&gt;gss&lt;/code&gt;, &lt;code&gt;glg&lt;/code&gt; or sometimes &lt;code&gt;glol&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Side Commands
&lt;/h2&gt;

&lt;p&gt;These are the commands that I use occasionally.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push --force-with-lease
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is one of my strange darlings. But why don’t I just use &lt;code&gt;--force&lt;/code&gt;? First of all, it is an extremely dangerous command and a huge &lt;em&gt;no-no&lt;/em&gt; when using shared branches. It is because it will overwrite the remote repository with whatever you have locally. This can be dangerous if other contributors of the repository have pushed in the meantime. I have mostly used &lt;code&gt;--force-with-lease&lt;/code&gt; after a rebase. This is because it works like a safety belt. &lt;a href="https://blog.developer.atlassian.com/force-with-lease/"&gt;This article&lt;/a&gt; has a great example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git for-each-ref — sort=-committerdate refs/heads/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is actually a command, that I found a few months ago from &lt;a href="https://davidwalsh.name/sort-git-branches"&gt;David Walsh&lt;/a&gt;. The command will list the most recently worked on branches from top to bottom. &lt;em&gt;It is so cool!&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git reset --hard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if everything goes like 💩, you can always reset the project.&lt;/p&gt;

&lt;p&gt;Thank you for your time!&lt;/p&gt;

&lt;p&gt;If you liked this, then please ❤️ and &lt;a href="https://twitter.com/mrsteffenp"&gt;&lt;em&gt;follow me on Twitter&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>github</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How To Avoid Long BEM Modifiers</title>
      <dc:creator>Steffen Pedersen</dc:creator>
      <pubDate>Sun, 19 May 2019 10:37:48 +0000</pubDate>
      <link>https://dev.to/steffenpedersen/how-to-avoid-long-bem-modifiers-4b99</link>
      <guid>https://dev.to/steffenpedersen/how-to-avoid-long-bem-modifiers-4b99</guid>
      <description>&lt;p&gt;Before we begin, we should all get on the same page.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is BEM? 🤔
&lt;/h1&gt;

&lt;p&gt;First of all, BEM is a naming convention. In my opinion, it makes the CSS easier to read and understand. It makes it easier to scale and generally more easy to work with. BEM is an abbreviation of the overall concept. The elements of the structure is &lt;strong&gt;B&lt;/strong&gt;lock, &lt;strong&gt;E&lt;/strong&gt;lement and &lt;strong&gt;M&lt;/strong&gt;odifier. The description of the examples are inspired by the official guide.&lt;/p&gt;

&lt;h2&gt;
  
  
  Block
&lt;/h2&gt;

&lt;p&gt;This is a standalone entity that has its own meaning and purpose. The block is &lt;code&gt;.button&lt;/code&gt;.&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;.button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;inline-block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Element
&lt;/h2&gt;

&lt;p&gt;This should be a part of a block that has no standalone meaning and purpose. It should be semantically tied to its block. The element is &lt;code&gt;&amp;amp;__text&lt;/code&gt;.&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;.button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;inline-block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="err"&gt;&amp;amp;__text&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;400&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;h2&gt;
  
  
  Modifier
&lt;/h2&gt;

&lt;p&gt;This should be a flag on a block or an element. Here we are able to change appearance or behavior. The modifier is &lt;code&gt;&amp;amp;--bold&lt;/code&gt;.&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;.button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;inline-block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="err"&gt;&amp;amp;__text&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;400&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="err"&gt;&amp;amp;--bold&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
            &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;700&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;span class="err"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One of the most important rules is, that you can’t have an element inside an element and you can’t have a modifier inside a modifier.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is the problem? 🤔
&lt;/h1&gt;

&lt;p&gt;With BEM modifiers the naming convention can result in very long selectors. This can damage the readability.&lt;/p&gt;

&lt;p&gt;We could make modifiers like this:&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;.button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="err"&gt;&amp;amp;.--small&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2em&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;In this way we could do this &lt;code&gt;&amp;lt;button class="button --small"&amp;gt;&amp;lt;/button&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Instead of this:&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;.button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="err"&gt;&amp;amp;--small&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2em&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;Which results in longer selectors &lt;code&gt;&amp;lt;button class="c-button c-button--small"&amp;gt;&amp;lt;/button&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It would make it easier to get an overview, when reading the outputted code. We just need not to make classes named &lt;code&gt;--modifier&lt;/code&gt; outside of a block. That would also be weird.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What do you think? 🤔&lt;br&gt;
What could break this idea? 🤔&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thank you for your time!&lt;/p&gt;

&lt;p&gt;If you liked this, then please ❤️ and &lt;a href="https://twitter.com/mrsteffenp"&gt;&lt;em&gt;follow me on Twitter&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>css</category>
      <category>html</category>
      <category>discuss</category>
      <category>webdev</category>
    </item>
    <item>
      <title>My Favorite Ways of Centering With CSS</title>
      <dc:creator>Steffen Pedersen</dc:creator>
      <pubDate>Fri, 17 May 2019 15:20:10 +0000</pubDate>
      <link>https://dev.to/steffenpedersen/my-favorite-ways-of-centering-with-css-4bph</link>
      <guid>https://dev.to/steffenpedersen/my-favorite-ways-of-centering-with-css-4bph</guid>
      <description>&lt;h1&gt;
  
  
  My Favorite Ways of Centering With CSS
&lt;/h1&gt;

&lt;p&gt;Back in the day, I thought that centering with CSS was &lt;em&gt;really tricky&lt;/em&gt;. Often, I made it much more complicated than it is. There are many ways to do it depending on the specific situation. These are my favorite ways of centering both horizontally and vertically.&lt;/p&gt;

&lt;h2&gt;
  
  
  Position absolute
&lt;/h2&gt;

&lt;p&gt;The first method or approach is the absolute positioning. We know the height and width of the child and we can then use margins with a negative value of half the width or height of the child.&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;.absolute.parent&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="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.absolute&lt;/span&gt; &lt;span class="nc"&gt;.child&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;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-110px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin-left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-110px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Transform translate
&lt;/h2&gt;

&lt;p&gt;But what if you don't know the height or width? Then you can use the transform property with a negative translate of 50% in both directions. &lt;em&gt;There you have it!&lt;/em&gt;&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;.translate.parent&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="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.translate&lt;/span&gt; &lt;span class="nc"&gt;.child&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;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-50%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;-50%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Flexbox
&lt;/h2&gt;

&lt;p&gt;Something that I came across later on is the flexbox approach. &lt;em&gt;It's genius!&lt;/em&gt; You just need to define two properties with center - which is &lt;code&gt;justify-content&lt;/code&gt; and &lt;code&gt;align-items&lt;/code&gt;. &lt;em&gt;That's it!&lt;/em&gt; You could also write &lt;code&gt;flex-end&lt;/code&gt; if you wanted the element at the bottom right corner. Flexbox is actually really really fun.&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;.flexbox.parent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you know other ways of centering elements, please write a comment below.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Do you use another approach? 🤔&lt;br&gt;
Do you use Sass mixins or other cool things? 🤔&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thank you for your time!&lt;/p&gt;

&lt;p&gt;If you liked this, then please ❤️ and &lt;a href="https://twitter.com/mrsteffenp"&gt;&lt;em&gt;follow me on Twitter&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>css</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
