<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>CSS Mine</title>
    <link>https://www.css-mine.com</link>
    <description>dig into web UI development</description>
    <atom:link href="https://www.css-mine.com/rss" rel="self" type="application/rss+xml" />
      <item>
        <title>CSS text-decoration family (not just for underlining links)</title>
        <link>https://www.css-mine.com/blog/2020-03-30-css-text-decoration-family-not-just-for-underlining-links</link>
        <guid>https://www.css-mine.com/blog/2020-03-30-css-text-decoration-family-not-just-for-underlining-links</guid>
        <description>When you want to study the formerly simple CSS properties, you may be surprised by its sturdiness (and for some, too much of complexity). That’s what happened to me with the feature text-decoration.
But let’s take it pragmatically, as a manual for this group of features. I will issue the latest CSS specifications for text decoration.
The list of properties
Yes, the text-decoration family of properties is all about underlining the links, but the family as such can be used for a lot of other letter decorations - it is useful for authors of various text editors, revisers, authors of technical or chemical texts and so on.
First, let’s take a look at these properties:

text-decoration
text-decoration-line
text-decoration-style
text-decoration-color
text-decoration-skip-ink
text-underline-position
text-underline-offset
text-decoration-width &amp;amp; text-decoration-thickness
text-emphasis

Not always do these features have full support in web browsers. The outdated Internet Explorer is practically always out of the picture, but some of the features are not supported even by the modern web browsers. You’ll see.
text-decoration – the main shortcut (and the main issue)
The attribute that is the shortcut for the 3 features below, according to the latest specifications. 
text-decoration:
&amp;lt;&#039;text-decoration-line&#039;&amp;gt; ||
&amp;lt;&#039;text-decoration-style&#039;&amp;gt; ||
&amp;lt;&#039;text-decoration-color&#039;&amp;gt;
For example:
/* Underlined text: */
text-decoration: underline;

/* Dotted underline text: */
text-decoration: dotted underline;

/* Nothing, because we didn&#039;t define text-decoration-line: */
text-decoration: dotted;
At this point, it is suitable to mention that the specification has one finished level (the well known CSS2) and at the same time two updates in progress - CSS Text Decoration Module Level 3 and CSS Text Decoration Module Level 4.
And there is a difference in the record style of text-decoration  when it comes to CSS2 and new modules. Originally it was a common feature, now it’s a shortcut of more features.  
This difference translates to the implementation by different web browsers. While Firefox, Chrome and its sub browsers accept text-decoration “in a new way” as a shortcut, Safari and Explorer understand it “in the old way” as an individual feature. 
So, if we want to do a green dotted underlined link differently than the usual way (but not the correct one) with the feature border, this is not how it’s gonna work:
.shorthand a {
  text-decoration: dotted green underline;
}
In Explorer, we can do nothing with it (which is not that big of an issue with the decreasing support), but in Safari we can save the situation by mentioning the individual features:
.individuals a {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: green;
}
CodePen: cdpn.io/e/abzPKNB
The main issue can be solved then. So let’s take a look at the individual features designed for text decoration.

Figure: Matrix of properties for text decoration and possible values according to CSS Text Decoration Level 3.
text-decoration-line – types of decorative underlines
It tells us what type of underline will be used.
Possible values:
text-decoration-line: none |
  [ underline || overline || line-through || blink ]
In the central Europe you probably want to often use the underline option.
The blinking value blink is considered old-fashioned and the modern web browsers do not support it. Thank God. 
The notation with blocky brackets and logical operator marks or (||), which I took from the specification, says that it is possible to use multiple values, for example &amp;lt;code&amp;gt;text-decoration-line: underline overline&amp;lt;em&amp;gt;.&amp;lt;/em&amp;gt;&amp;lt;/code&amp;gt;
The value line-through is set in HTML values in default styles of web browsers &amp;lt;s&amp;gt;, &amp;lt;strike&amp;gt; or &amp;lt;del&amp;gt;.
This feature has full support when we leave out the value blink.
text-decoration-style – underline style
It sets the text decoration style - for example, one line, double line, dotted line or wavy line:
text-decoration-style: 
  solid | double | dotted | dashed | wavy
It is used only at the time and only if some of them are defined text-decoration-line.&amp;lt;/em&amp;gt;
The value wavy is cool, for example for highlighting the mistakes in words. 
This feature has full support in modern web browsers.
text-decoration-color – the color of decoration
The color that we use for decoration. It could be the current color or any color of your choice. 
text-decoration-color: &amp;lt;color&amp;gt;
&amp;lt;color&amp;gt; could be current color or any color of your choice. 
This is something that all modern web browsers can do.
Let’s look at the features in the latest CSS specification for text decoration.

Figure: The latest CSS Text Decoration Level 4 features that won’t work everywhere.
text-decoration-skip-ink – to prevent line crossing
The feature that specifies if the decoration line will be in punctuated, so there wouldn’t be any crossings with the text curves. 
text-decoration-skip-ink: auto | none
In the default styles of modern web browsers there is a setting text-decoration-skip-ink:auto, so usually we don’t have to deal with this. Just in case that we would like to turn it off. But I have no clue why would we do this in common situations. 
Originally it used to work in the specification as text-decoration-skip, but now the feature has been deleted - it will be divided into more sub-features.
This feature has full support in modern web browsers. 
text-underline-position – the position of decorative line
Where the decorative line appears: 
text-underline-position: auto |
  [ under || [ left | right ] ]
The values left and right are meant for Asian languages, that are noted down vertically (Chinese, Japanese, Korean,&amp;#8230;)
For us, the value under is interesting, it will issue the underline under the letter outline (the part of a letter that goes down under the usual line such as p, y or j).
It is recommended to use this in mathematical or chemical texts so that the decorative line wouldn’t interrupt the numbers in lower indexes. 
This feature is not supported by Safari. 
text-underline-offset – the offset of decoration
It defines the shift of decoration line from its original position:
text-underline-offset: auto | &amp;lt;width&amp;gt;
It acts differently according to text-underline-position. When it comes to underline the movement goes down, but with overline the movement goes up. 
The value width is recommended to use in em unit, so it would adapt to the size of the text. 
This feature is supported by Safari and Firefox, but not Chrome. 
text-decoration-width &amp;amp; text-decoration-thickness – the width of decoration line
To set the width of decoration line, we have two properties:
text-decoration-width: auto | &amp;lt;width&amp;gt;;
text-decoration-thickness: auto | &amp;lt;width&amp;gt;;
While:

text-decoration-width is standard according to CSS Text Decoration Module Level 4, but no browser can actually do it.
text-decoration-thickness is not that standard. However, it is supported by Safari and Firefox, but not by Chrome.
If you would like to try this, &amp;lt;width&amp;gt; is recommended again in em to adapt to the size of the text. 

text-emphasis – the position of emphasis (not interesting for Western countries)
This shortcut of features is helpful only for east-asian and other exotic languages again, that is why I will not explain it any further. It draws the accent dot above, under or next to the text.
These features belong here: text-emphasis-style, text-emphasis-color, text-emphasis-position and text-emphasis.
The order of rendering
Since we got more CSS features that decorate the text, it’s good to know the order of their depiction. We’ll look at them in order from those that render from the bottom, shades, upward. 

shades (property text-shadow)
underline (feature text-decoration-line)
overlines (feature text-decoration-line)
text itself
emphasis marks (feature text-emphasis)
line-through (feature text-decoration-line)

According to this list, the browser will solve the conflicts in the depiction of text curves and its decorations. 
Example with all of the features
In the final CodePen we will sum up all the features and their support in web browsers in an overview table:
CodePen: cdpn.io/e/zYxMKJB
As you can see, in the current version of CSS even the usual text decorations can be quite a challenge.</description>
        <content:encoded><![CDATA[
          <p>When you want to study the formerly simple CSS properties, you may be surprised by its sturdiness (and for some, too much of complexity). That’s what happened to me with the feature <code>text-decoration</code>.</p>
<p>But let’s take it pragmatically, as a manual for this group of features. I will issue the latest CSS specifications for text decoration.</p>
<h2 id="the-list-of-properties"><a href="#the-list-of-properties">The list of properties</a></h2>
<p>Yes, the <code>text-decoration</code> family of properties is all about underlining the links, but the family as such can be used for a lot of other letter decorations - it is useful for authors of various text editors, revisers, authors of technical or chemical texts and so on.</p>
<p>First, let’s take a look at these properties:</p>
<ul>
<li><a href="#text-decoration">text-decoration</a></li>
<li><a href="#text-decoration-line">text-decoration-line</a></li>
<li><a href="#text-decoration-style">text-decoration-style</a></li>
<li><a href="#text-decoration-color">text-decoration-color</a></li>
<li><a href="#text-decoration-skip-ink">text-decoration-skip-ink</a></li>
<li><a href="#text-underline-position">text-underline-position</a></li>
<li><a href="#text-underline-offset">text-underline-offset</a></li>
<li><a href="#text-decoration-width">text-decoration-width &amp; text-decoration-thickness</a></li>
<li><a href="#text-emphasis">text-emphasis</a></li>
</ul>
<p>Not always do these features have full support in web browsers. The outdated Internet Explorer is practically always out of the picture, but some of the features are not supported even by the modern web browsers. You’ll see.</p>
<h3 id="text-decoration-the-main-shortcut-and-the-main-issue"><a href="#text-decoration-the-main-shortcut-and-the-main-issue">text-decoration – the main shortcut (and the main issue)</a></h3>
<p>The attribute that is the shortcut for the 3 features below, according to the latest specifications. </p>
<p>text-decoration:</p>
<pre><code>&lt;'text-decoration-line'&gt; ||
&lt;'text-decoration-style'&gt; ||
&lt;'text-decoration-color'&gt;</code></pre>
<p>For example:</p>
<pre><code class="language-css">/* Underlined text: */
text-decoration: underline;

/* Dotted underline text: */
text-decoration: dotted underline;

/* Nothing, because we didn't define text-decoration-line: */
text-decoration: dotted;</code></pre>
<p>At this point, it is suitable to mention that the specification has one finished level (the well known <a href="https://www.w3.org/TR/CSS2/text.html#lining-striking-props">CSS2</a>) and at the same time two updates in progress - <a href="https://www.w3.org/TR/css-text-decor-3/">CSS Text Decoration Module Level 3</a> and <a href="https://www.w3.org/TR/css-text-decor-4/">CSS Text Decoration Module Level 4.</a></p>
<p>And there is a difference in the record style of <code>text-decoration</code>  when it comes to CSS2 and new modules. Originally it was a common feature, now it’s a shortcut of more features.  </p>
<p>This difference translates to the implementation by different web browsers. While Firefox, Chrome and its sub browsers accept text-decoration “in a new way” as a shortcut, Safari and Explorer understand it “in the old way” as an individual feature. </p>
<p>So, if we want to do a green dotted underlined link differently than the usual way (but not the correct one) with the feature border, this is not how it’s gonna work:</p>
<pre><code class="language-css">.shorthand a {
  text-decoration: dotted green underline;
}</code></pre>
<p>In Explorer, we can do nothing with it (which is not that big of an issue with the decreasing support), but in Safari we can save the situation by mentioning the individual features:</p>
<pre><code class="language-css">.individuals a {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: green;
}</code></pre>
<p>CodePen: <a href="https://codepen.io/machal/pen/abzPKNB">cdpn.io/e/abzPKNB</a></p>
<p>The main issue can be solved then. So let’s take a look at the individual features designed for text decoration.</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="https://www.vzhurudolu.cz/prirucka-content/dist/images/large/css-text-decoration-level-3.png" alt="CSS Text Decoration Level 3" /></div><!--.content-full--><div class="content"><div class="article"></p>
<p><em>Figure: Matrix of properties for text decoration and possible values according to CSS Text Decoration Level 3.</em></p>
<h3 id="text-decoration-line-types-of-decorative-underlines"><a href="#text-decoration-line-types-of-decorative-underlines">text-decoration-line – types of decorative underlines</a></h3>
<p>It tells us what type of underline will be used.</p>
<p>Possible values:</p>
<pre><code class="language-css">text-decoration-line: none |
  [ underline || overline || line-through || blink ]</code></pre>
<p>In the central Europe you probably want to often use the underline option.
The blinking value <code>blink</code> is considered old-fashioned and the modern web browsers do not support it. Thank God. </p>
<p>The notation with blocky brackets and logical operator marks or (<code>||</code>), which I took from the specification, says that it is possible to use multiple values, for example &lt;code&gt;text-decoration-line: underline overline&lt;em&gt;.&lt;/em&gt;&lt;/code&gt;
The value <code>line-through</code> is set in HTML values in default styles of web browsers <code>&lt;s&gt;</code>, <code>&lt;strike&gt;</code> or <code>&lt;del&gt;</code>.</p>
<p>This feature has full support when we leave out the value blink.</p>
<h3 id="text-decoration-style-underline-style"><a href="#text-decoration-style-underline-style">text-decoration-style – underline style</a></h3>
<p>It sets the text decoration style - for example, one line, double line, dotted line or wavy line:</p>
<pre><code class="language-css">text-decoration-style: 
  solid | double | dotted | dashed | wavy</code></pre>
<p>It is used only at the time and only if some of them are defined <code>text-decoration-line</code>.&lt;/em&gt;</p>
<p>The value <code>wavy</code> is cool, for example for highlighting the mistakes in words. </p>
<p>This feature has full support in modern web browsers.</p>
<h3 id="text-decoration-color-the-color-of-decoration"><a href="#text-decoration-color-the-color-of-decoration">text-decoration-color – the color of decoration</a></h3>
<p>The color that we use for decoration. It could be the current color or any color of your choice. </p>
<pre><code class="language-css">text-decoration-color: &lt;color&gt;</code></pre>
<p><code>&lt;color&gt;</code> could be current color or any color of your choice. </p>
<p>This is something that all modern web browsers can do.</p>
<p>Let’s look at the features in the latest CSS specification for text decoration.</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="https://www.vzhurudolu.cz/prirucka-content/dist/images/large/css-text-decoration-level-4.png" alt="CSS Text Decoration Level 4" /></div><!--.content-full--><div class="content"><div class="article"></p>
<p><em>Figure: The latest CSS Text Decoration Level 4 features that won’t work everywhere.</em></p>
<h3 id="text-decoration-skip-ink-to-prevent-line-crossing"><a href="#text-decoration-skip-ink-to-prevent-line-crossing">text-decoration-skip-ink – to prevent line crossing</a></h3>
<p>The feature that specifies if the decoration line will be in punctuated, so there wouldn’t be any crossings with the text curves. </p>
<pre><code class="language-css">text-decoration-skip-ink: auto | none</code></pre>
<p>In the default styles of modern web browsers there is a setting <code>text-decoration-skip-ink:auto</code>, so usually we don’t have to deal with this. Just in case that we would like to turn it off. But I have no clue why would we do this in common situations. </p>
<p>Originally it used to work in the specification as <code>text-decoration-skip</code>, but now the feature has been deleted - it will be divided into more sub-features.</p>
<p>This feature has full support in modern web browsers. </p>
<h3 id="text-underline-position-the-position-of-decorative-line"><a href="#text-underline-position-the-position-of-decorative-line">text-underline-position – the position of decorative line</a></h3>
<p>Where the decorative line appears: </p>
<pre><code class="language-css">text-underline-position: auto |
  [ under || [ left | right ] ]</code></pre>
<p>The values <code>left</code> and <code>right</code> are meant for Asian languages, that are noted down vertically (Chinese, Japanese, Korean,&#8230;)</p>
<p>For us, the value <code>under</code> is interesting, it will issue the underline under the letter outline (the part of a letter that goes down under the usual line such as p, y or j).</p>
<p>It is recommended to use this in mathematical or chemical texts so that the decorative line wouldn’t interrupt the numbers in lower indexes. </p>
<p>This feature is not supported by Safari. </p>
<h3 id="text-underline-offset-the-offset-of-decoration"><a href="#text-underline-offset-the-offset-of-decoration">text-underline-offset – the offset of decoration</a></h3>
<p>It defines the shift of decoration line from its original position:</p>
<pre><code class="language-css">text-underline-offset: auto | &lt;width&gt;</code></pre>
<p>It acts differently according to <code>text-underline-position</code>. When it comes to <code>underline</code> the movement goes down, but with overline the movement goes up. </p>
<p>The value <code>width</code> is recommended to use in em unit, so it would adapt to the size of the text. </p>
<p>This feature is supported by Safari and Firefox, but not Chrome. </p>
<h3 id="text-decoration-width-amp-text-decoration-thickness-the-width-of-decoration-line"><a href="#text-decoration-width-amp-text-decoration-thickness-the-width-of-decoration-line">text-decoration-width &amp; text-decoration-thickness – the width of decoration line</a></h3>
<p>To set the width of decoration line, we have two properties:</p>
<pre><code class="language-css">text-decoration-width: auto | &lt;width&gt;;
text-decoration-thickness: auto | &lt;width&gt;;</code></pre>
<p>While:</p>
<ul>
<li><code>text-decoration-width</code> is standard according to CSS Text Decoration Module Level 4, but no browser can actually do it.</li>
<li><code>text-decoration-thickness</code> is not that standard. However, it is supported by Safari and Firefox, but not by Chrome.
If you would like to try this, <code>&lt;width&gt;</code> is recommended again in <code>em</code> to adapt to the size of the text. </li>
</ul>
<h3 id="text-emphasis-the-position-of-emphasis-not-interesting-for-western-countries"><a href="#text-emphasis-the-position-of-emphasis-not-interesting-for-western-countries">text-emphasis – the position of emphasis (not interesting for Western countries)</a></h3>
<p>This shortcut of features is helpful only for east-asian and other exotic languages again, that is why I will not explain it any further. It draws the accent dot above, under or next to the text.</p>
<p>These features belong here: <code>text-emphasis-style</code>, <code>text-emphasis-color</code>, <code>text-emphasis-position</code> and <code>text-emphasis</code>.</p>
<h2 id="the-order-of-rendering"><a href="#the-order-of-rendering">The order of rendering</a></h2>
<p>Since we got more CSS features that decorate the text, it’s good to know the order of their depiction. We’ll look at them in order from those that render from the bottom, shades, upward. </p>
<ul>
<li>shades (property <code>text-shadow</code>)</li>
<li>underline (feature <code>text-decoration-line</code>)</li>
<li>overlines (feature <code>text-decoration-line</code>)</li>
<li>text itself</li>
<li>emphasis marks (feature <code>text-emphasis</code>)</li>
<li>line-through (feature <code>text-decoration-line</code>)</li>
</ul>
<p>According to this list, the browser will solve the conflicts in the depiction of text curves and its decorations. </p>
<h2 id="example-with-all-of-the-features"><a href="#example-with-all-of-the-features">Example with all of the features</a></h2>
<p>In the final CodePen we will sum up all the features and their support in web browsers in an overview table:</p>
<p>CodePen: <a href="https://codepen.io/machal/pen/zYxMKJB">cdpn.io/e/zYxMKJB</a></p>
<p>As you can see, in the current version of CSS even the usual text decorations can be quite a challenge.</p>
        ]]></content:encoded>
        <pubDate>Mon, 30 Mar 2020 16:46:00</pubDate>
      </item>
      <item>
        <title>CSS object-fit and object-position properties: Crop images embedded in HTML</title>
        <link>https://www.css-mine.com/blog/2020-02-12-css-object-fit-and-object-position-properties-crop-images-embedded-in-html</link>
        <guid>https://www.css-mine.com/blog/2020-02-12-css-object-fit-and-object-position-properties-crop-images-embedded-in-html</guid>
        <description>The properties object-fit and object-position are used to specify the size and position of external media inserted into HTML, mainly the images within the &amp;lt;img&amp;gt; tag, but also the content of the &amp;lt;video&amp;gt;, &amp;lt;iframe&amp;gt;, or &amp;lt;embed&amp;gt; elements.
The properties are not supported by Internet Explorer, therefore they are more useful for projects where it’s not that important.
object-fit and object-position can be viewed as parallel to the image properties background-size and background-position. Only that these are intended for elements inserted directly into HTML.

Figure: The object-fit and object-position properties determine how the inserted media behaves when its dedicated space becomes smaller or larger.
Let’s show it on a simple example.
We have the following HTML:
&amp;lt;img class=&quot;img img--cut&quot; src=&quot;image-300x300.jpg&quot;
  width=&quot;300&quot; height=&quot;200&quot; alt=&quot;Image…&quot;&amp;gt;
CSS:
.img--cut {
  object-fit: cover;
  object-position: bottom;
}
And let’s explain:

The image has natural dimensions of 300x300 pixels, but it is only allowed to occupy the height of  200 pixels in HTML, see the height property.
object-fit:cover indicates that the image should be stretched over the entire area of the &amp;lt;img&amp;gt; element so that there is no space left. See object-fit.
object-position:bottom specifies the alignment to the bottom edge of the &amp;lt;img&amp;gt; element surface. See object-position.

Object-fit values
Specifies how to fit the external media to an area specified by the width and height properties in HTML or CSS.

Figure: Object-fit property values applied to an image of 150 × 150 pixels.
This is very similar to embedding images to background using the background-size property.



Values
What does it do?




fill (default)
Fills the entire area. It can distort the aspect ratio of the content but does not crop it.


contain
It does not always fill the entire area. The content does not distort or crop, it displays the entire content.


scale-down
Same like contain, but it never enlarges the image beyond natural size.


cover
Fills the entire area. Does not leave empty space, does not distort content, only crops it.


none
Keeps original size and aspect ratio. Sometimes cropping, sometimes leaving free space.



Figure: In practice, the most useful value is object-fit:cover.
Object-position values
Defines where will be the element positioned by using object-fit. It has exactly the same values as the background-position property.

Figure: Examples of object-position property values.
Let’s look at examples of values.



Value example
What does it do?




50% 50% (default)
Centers the object in the middle of the rendered box.


0 0
Places the object in the upper left corner.


0 -50px
0px from the top and 50px to the left outside the rendered box.


top right
To the top right corner.


bottom
On the lower edge. The second value is taken as the default, ie center.



Use in practice

Both properties are very useful for enforcing aspect ratio when we have images with different shapes and sizes saved on the server.
Object-fit video background works as well. The same with iframe does not.

Support in browsers
Since the Edge explorer has been upgraded to the Chromium rendering engine, only Internet Explorer 11 does not support these properties. 
By the time I am writing this article, Internet Explorer still has a significant share of users in some countries (like for example here, in the Czech Republic), so it will be necessary to sort out the fallback.
caniuse.com/object-fit
How to solve the problem in Internet Explorer:

Instead of object-fit/object-position embed the image to the background by using background-size/background-position. Alternatively, you can play with the transform property and with absolute positioning (See StackOverflow).
For IE11 use polyfill - fregante/object-fit-images. I do not recommend it much, because it slows down the rendering performance in the already slow Explorer.
Detect a non-supporting browser (eg. using the Modernizr library) and deploy a workaround. For example, StackOverflow offers a solution to change &amp;lt;img&amp;gt; to &amp;lt;svg&amp;gt; and resolve the problem in it.
</description>
        <content:encoded><![CDATA[
          <p>The properties <code>object-fit</code> and <code>object-position</code> are used to specify the size and position of external media inserted into HTML, mainly the images within the <code>&lt;img&gt;</code> tag, but also the content of the <code>&lt;video&gt;</code>, <code>&lt;iframe&gt;</code>, or <code>&lt;embed&gt;</code> elements.</p>
<p>The properties are not supported by Internet Explorer, therefore they are more useful for projects where it’s not that important.</p>
<p><code>object-fit</code> and <code>object-position</code> can be viewed as parallel to the image properties <a href="/ebook/css3-background-size"><code>background-size</code></a> and <code>background-position</code>. Only that these are intended for elements inserted directly into HTML.</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="https://res.cloudinary.com/vzhurudolu-cz/image/upload/w_1200,q_100/v1581484633/cssmine_16-9/object-fit_go42wu.png" alt="CSS properties object-fit and object-position" /></div><!--.content-full--><div class="content"><div class="article"></p>
<p><em>Figure: The object-fit and object-position properties determine how the inserted media behaves when its dedicated space becomes smaller or larger.</em></p>
<p>Let’s show it on a simple example.</p>
<p>We have the following HTML:</p>
<pre><code class="language-html">&lt;img class="img img--cut" src="image-300x300.jpg"
  width="300" height="200" alt="Image…"&gt;</code></pre>
<p>CSS:</p>
<pre><code class="language-css">.img--cut {
  object-fit: cover;
  object-position: bottom;
}</code></pre>
<p>And let’s explain:</p>
<ul>
<li>The image has natural dimensions of 300x300 pixels, but it is only allowed to occupy the height of  200 pixels in HTML, see the <code>height</code> property.</li>
<li><code>object-fit:cover</code> indicates that the image should be stretched over the entire area of the <code>&lt;img&gt;</code> element so that there is no space left. See <code>object-fit</code>.</li>
<li><code>object-position:bottom</code> specifies the alignment to the bottom edge of the <code>&lt;img&gt;</code> element surface. See <code>object-position</code>.</li>
</ul>
<h2 id="object-fit-values"><a href="#object-fit-values">Object-fit values</a></h2>
<p>Specifies how to fit the external media to an area specified by the <code>width</code> and <code>height</code> properties in HTML or CSS.</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="https://res.cloudinary.com/vzhurudolu-cz/image/upload/w_1200,q_100/v1581484633/cssmine_16-9/object-fit-property_cht6qt.png" alt="CSS property object-position" /></div><!--.content-full--><div class="content"><div class="article"></p>
<p><em>Figure: Object-fit property values applied to an image of 150 × 150 pixels.</em></p>
<p>This is very similar to embedding images to background using the <a href="https://www.cssmine.com/ebook/css3-background-size"><code>background-size</code></a> property.</p>
<table>
<thead>
<tr>
<th style="text-align: left;"><strong>Values</strong></th>
<th style="text-align: left;"><strong>What does it do?</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;"><code>fill</code> (default)</td>
<td style="text-align: left;">Fills the entire area. It can distort the aspect ratio of the content but does not crop it.</td>
</tr>
<tr>
<td style="text-align: left;"><code>contain</code></td>
<td style="text-align: left;">It does not always fill the entire area. The content does not distort or crop, it displays the entire content.</td>
</tr>
<tr>
<td style="text-align: left;"><code>scale-down</code></td>
<td style="text-align: left;">Same like <code>contain</code>, but it never enlarges the image beyond natural size.</td>
</tr>
<tr>
<td style="text-align: left;"><code>cover</code></td>
<td style="text-align: left;">Fills the entire area. Does not leave empty space, does not distort content, only crops it.</td>
</tr>
<tr>
<td style="text-align: left;"><code>none</code></td>
<td style="text-align: left;">Keeps original size and aspect ratio. Sometimes cropping, sometimes leaving free space.</td>
</tr>
</tbody>
</table>
<p><em>Figure: In practice, the most useful value is <code>object-fit:cover</code>.</em></p>
<h2 id="object-position-values"><a href="#object-position-values">Object-position values</a></h2>
<p>Defines where will be the element positioned by using <code>object-fit</code>. It has exactly the same values as the <code>background-position</code> property.</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="https://res.cloudinary.com/vzhurudolu-cz/image/upload/w_1200,q_100/v1581484633/cssmine_16-9/object-position-property_rwj3j2.png" alt="CSS property object-position" /></div><!--.content-full--><div class="content"><div class="article"></p>
<p><em>Figure: Examples of object-position property values.</em></p>
<p>Let’s look at examples of values.</p>
<table>
<thead>
<tr>
<th style="text-align: left;"><strong>Value example</strong></th>
<th style="text-align: left;"><strong>What does it do?</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;"><code>50% 50%</code> (default)</td>
<td style="text-align: left;">Centers the object in the middle of the rendered box.</td>
</tr>
<tr>
<td style="text-align: left;"><code>0 0</code></td>
<td style="text-align: left;">Places the object in the upper left corner.</td>
</tr>
<tr>
<td style="text-align: left;"><code>0 -50px</code></td>
<td style="text-align: left;">0px from the top and 50px to the left outside the rendered box.</td>
</tr>
<tr>
<td style="text-align: left;"><code>top right</code></td>
<td style="text-align: left;">To the top right corner.</td>
</tr>
<tr>
<td style="text-align: left;"><code>bottom</code></td>
<td style="text-align: left;">On the lower edge. The second value is taken as the default, ie <code>center</code>.</td>
</tr>
</tbody>
</table>
<h2 id="use-in-practice"><a href="#use-in-practice">Use in practice</a></h2>
<ul>
<li>Both properties are very useful for enforcing aspect ratio when we have images with different shapes and sizes saved on the server.</li>
<li><a href="https://codepen.io/remersonc/pen/JXyvbZ">Object-fit video background</a> works as well. <a href="https://codepen.io/machal/pen/yLLrJPZ">The same with iframe</a> does not.</li>
</ul>
<h2 id="support-in-browsers"><a href="#support-in-browsers">Support in browsers</a></h2>
<p>Since the Edge explorer has been upgraded to the Chromium rendering engine, only Internet Explorer 11 does not support these properties. </p>
<p>By the time I am writing this article, Internet Explorer still has a significant share of users in some countries (like for example here, in the Czech Republic), so it will be necessary to sort out the fallback.</p>
<p><a href="https://caniuse.com/#feat=object-fit">caniuse.com/object-fit</a></p>
<p>How to solve the problem in Internet Explorer:</p>
<ol>
<li>Instead of <code>object-fit</code>/<code>object-position</code> embed the image to the background by using <a href="https://www.cssmine.com/ebook/css3-background-size"><code>background-size</code></a>/<code>background-position.</code> Alternatively, you can play with the <a href="https://www.cssmine.com/ebook/css3-transforms">transform property</a> and with absolute positioning (See <a href="https://stackoverflow.com/a/47450998/889682">StackOverflow</a>).</li>
<li>For IE11 use polyfill - <a href="https://github.com/fregante/object-fit-images">fregante/object-fit-images</a>. I do not recommend it much, because it slows down the rendering performance in the already slow Explorer.</li>
<li>Detect a non-supporting browser (eg. using the Modernizr library) and deploy a workaround. For example, <a href="https://stackoverflow.com/a/37792830/889682">StackOverflow</a> offers a solution to change <code>&lt;img&gt;</code> to <code>&lt;svg&gt;</code> and resolve the problem in it.</li>
</ol>
        ]]></content:encoded>
        <pubDate>Wed, 12 Feb 2020 06:07:00</pubDate>
      </item>
      <item>
        <title>Paul Bakaus: AMP is a pretty misunderstood project</title>
        <link>https://www.css-mine.com/blog/2019-09-16-paul-bakaus-amp-is-a-pretty-misunderstood-project</link>
        <guid>https://www.css-mine.com/blog/2019-09-16-paul-bakaus-amp-is-a-pretty-misunderstood-project</guid>
        <description>In a few days, Paul Bakaus from the AMP team will give a talk at WebExpo in Prague. I asked him a few questions: Whether AMP can be considered a successor to the jQuery ecosystem, about the issues associated with the potential opening of AMP benefits to all sites, and finally the AMP Bento subproject.
“AMP can save lots of maintenance and bug fixing time”
Paul, I look forward to you showing AMP as a front-end framework in your talk! The framework impressed me a while ago, but not everyone knows its benefits. Could you briefly list AMP framework advantages over current solutions for content and e-commerce sites — where jQuery is still the most common?
Great to hear! AMP is really a pretty misunderstood project. It was always a framework, but it’s often compared to other walled garden distribution formats. Most web developers are not aware that AMP can be used as a standalone framework.
I’m biased of course, but I do think you get a lot of cool things when you choose to go all-in with AMP. Our core philosophy is to allow developers to focus less on boilerplate code, and more on the code that actually matters, that differentiates them from their competitors. So we solve things at a much higher abstraction layer – we’re not a JS framework, we’re an HTML framework.

Paul Bakaus: “We’re optimistic that AMP can democratize the development of excellent UX.”
That means you almost never have to write JavaScript – which is a feature, not a bug. It also means that AMP can for the most part guarantee good performance, so you don’t need to track perf budgets anymore, a massive time saver. The AMP core library lives on a CDN, so we can ship updates to billions of pages overnight, and improve your website without any redeployments or work on your side. And with amp-script, amp-bind and amp-list, you have powerful interactivity at hand when you need it. In the end, we’re optimistic that AMP can save lots of maintenance and bug fixing time, and therefore democratize the development of excellent UX, as not everyone has the money to pay 5 frontend performance engineers.
“Figuring out a way to measure whether a page is fast is an incredibly complex problem”
Various important members of the community are encouraging Google to give the benefits of AMP sites to regular fast sites. I know the AMP team is already addressing this, but I’m afraid not everyone understands the full range of issues. In particular, what would regular websites have to do to get the benefits?
Jeremy’s blog post was interesting as he walked through the problem space the same way the AMP team has done before, and to his credit, after asking the right questions he arrived at the right set of problems that need to be solved.
He also said that he’s “sure smarter folks than [him] can figure that stuff out”, but the problem is that Jeremy is either underestimating his smartness or overestimating ours: Figuring out a way to measure whether a page is fast or not seems easy on the surface, but is an incredibly complex problem. 

Paul Bakaus: “AMP is not a JS framework, we’re an HTML framework.”
We’re slowly making progress with metrics such as largest contentful paint, but it’s only the tip of the iceberg. Take, for example, run time performance: In order to accurately measure whether a page is fast when interacting with it, during crawl time a bot would have to interact with it, and probably for quite a while. Not only does that crawl get incredibly expensive, it gets worse as without cache, we could not trust the page stays fast, so a platform like Google would have to re-validate multiple times a day.
I didn’t even talk about privacy preserving pre-rendering, the main reason AMP pages have to be hosted on a proxying cache. Signed HTTP exchanges is a promising standard to decouple identity and serving of documents, and could be used to bring privacy-aware pre-fetch to non-AMP content, as long as we also solve the metric issue. And of course, all browsers have to buy in.
In many ways, I’m hoping this day comes rather sooner than later, because it will reveal just how much work AMP does to ensure great UX, and when publishers see how hard it is to implement from scratch with underlying standards, AMP might suddenly seem more attractive!
Paul, you mentioned problems with non-existent metrics and crawler performance when measuring them. But there is already a Chrome UX Report, a database of real-user experiences of the page-speed metrics. Yes, unfortunately, it only provides a small number of metrics so far, but couldn’t this database provide information if a page is fast enough?
The Chrome UX report could definitely be a building block for this. It doesn’t measure runtime performance yet, which is a gap here that we’d need to address, and another issue is the developer workflow: If you’re building a new site, and want to know whether your content is eligible for pre-rendering or not, you would have to wait a few weeks until you’d know. The AMP validator gives you this guarantee instantly. 
Lighthouse is an interesting middle ground but is much less of a guarantee for great performance than real-world reports. All of these tools and metrics have their pros and cons – I believe it’ll end up being a combination of various tools and metrics.
“Turning AMP into an all-around great framework for content websites”
Congratulations on JavaScript in AMP – the new amp-script component. I was also intrigued by the “AMP bento” project, which will eliminate the need to use the AMP runtime, the main JS library, and improve performance when using the framework on regular websites. How far is it and what are the other bigger plans with AMP?
We’ve just recently started to make decent progress with Bento. It’s an incredibly complex project, as it effectively requires a rewrite of AMP, one that makes AMP even more modular than it already is.
Currently, AMP expects to be in total control of the page and its DOM, and the main AMP library (our devs call it runtime) needs to be loaded along with subsequent components. 
So if you wanted to use amp-sidebar on a site running, say, Angular, you could already kinda do it today, but it would be inefficient and error-prone, as you would have to load the whole runtime just to show a sidebar, and would need to be careful about not mutating the DOM after the sidebar has been rendered. 
The Bento rewrite of AMP isolates components much better from each other, introduces a new lifecycle management API and will make components feel much more like traditional web components.
It’s important to note that Bento AMP has one specific purpose: To allow people to gradually upgrade to 100% AMP. Even with a 90% AMP site, developers don’t get the caching and pre-rendering benefits, which would be a shame. So we’re hoping Bento will make it easier to convert over time.
We have plenty of plans to improve AMP, but most can be categorized as turning AMP into an all-around great framework for content websites. We’re convinced that it’s too hard to build great stuff on the web today, and want to do our part to help. Stay tuned!
Thanks for the interview and wish you a pleasant stay in Prague!</description>
        <content:encoded><![CDATA[
          <p><em>In a few days, <a href="https://paulbakaus.com/">Paul Bakaus</a> from <a href="https://amp.dev/">the AMP</a> team will give <a href="https://www.webexpo.net/prague2019/talk/maximizing-web-developer-productivity-with-amp">a talk at WebExpo</a> in Prague. I asked him a few questions: Whether AMP can be considered a successor to the jQuery ecosystem, about the issues associated with the potential opening of AMP benefits to all sites, and finally the AMP Bento subproject.</em></p>
<h2 id="amp-can-save-lots-of-maintenance-and-bug-fixing-time"><a href="#amp-can-save-lots-of-maintenance-and-bug-fixing-time">“AMP can save lots of maintenance and bug fixing time”</a></h2>
<p><strong>Paul, I look forward to you showing AMP as a front-end framework in your talk! The framework impressed me a while ago, but not everyone knows its benefits. Could you briefly list AMP framework advantages over current solutions for content and e-commerce sites — where jQuery is still the most common?</strong></p>
<p>Great to hear! AMP is really a pretty misunderstood project. It was always a framework, but it’s often compared to other walled garden distribution formats. Most web developers are not aware that AMP can be used as a standalone framework.</p>
<p>I’m biased of course, but I do think you get a lot of cool things when you choose to go all-in with AMP. Our core philosophy is to allow developers to focus less on boilerplate code, and more on the code that actually matters, that differentiates them from their competitors. So we solve things at a much higher abstraction layer – we’re not a JS framework, we’re an HTML framework.</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="https://res.cloudinary.com/vzhurudolu-cz/image/upload/w_1200,q_100/v1568600803/amp-paul-bakaus_sx3eyp.jpg" alt="Paul Bakaus" /></div><!--.content-full--><div class="content"><div class="article"></p>
<p><em>Paul Bakaus: “We’re optimistic that AMP can democratize the development of excellent UX.”</em></p>
<p>That means you almost never have to write JavaScript – which is a feature, not a bug. It also means that AMP can for the most part guarantee good performance, so you don’t need to track perf budgets anymore, a massive time saver. The AMP core library lives on a CDN, so we can ship updates to billions of pages overnight, and improve your website without any redeployments or work on your side. And with <a href="https://amp.dev/documentation/components/amp-script/">amp-script</a>, <a href="https://www.ampproject.org/docs/reference/components/amp-bind">amp-bind</a> and <a href="https://amp.dev/documentation/components/amp-list/">amp-list</a>, you have powerful interactivity at hand when you need it. In the end, we’re optimistic that AMP can save lots of maintenance and bug fixing time, and therefore democratize the development of excellent UX, as not everyone has the money to pay 5 frontend performance engineers.</p>
<h2 id="figuring-out-a-way-to-measure-whether-a-page-is-fast-is-an-incredibly-complex-problem"><a href="#figuring-out-a-way-to-measure-whether-a-page-is-fast-is-an-incredibly-complex-problem">“Figuring out a way to measure whether a page is fast is an incredibly complex problem”</a></h2>
<p><strong>Various <a href="https://adactio.com/journal/15726">important members</a> of the community are encouraging Google to give the benefits of AMP sites to regular fast sites. I know the AMP team is <a href="https://blog.amp.dev/2019/05/21/contributing-back-lessons-learned-part-1/">already addressing this</a>, but I’m afraid not everyone understands the full range of issues. In particular, what would regular websites have to do to get the benefits?</strong></p>
<p>Jeremy’s blog post was interesting as he walked through the problem space the same way the AMP team has done before, and to his credit, after asking the right questions he arrived at the right set of problems that need to be solved.</p>
<p>He also said that he’s “sure smarter folks than [him] can figure that stuff out”, but the problem is that Jeremy is either underestimating his smartness or overestimating ours: Figuring out a way to measure whether a page is fast or not seems easy on the surface, but is an incredibly complex problem. </p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="https://res.cloudinary.com/vzhurudolu-cz/image/upload/w_1200,q_100/v1568600802/amp-website_pv5dqd.jpg" alt="The AMP website" /></div><!--.content-full--><div class="content"><div class="article"></p>
<p><em>Paul Bakaus: “AMP is not a JS framework, we’re an HTML framework.”</em></p>
<p>We’re slowly making progress with metrics such as <a href="https://web.dev/largest-contentful-paint">largest contentful paint</a>, but it’s only the tip of the iceberg. Take, for example, run time performance: In order to accurately measure whether a page is fast when interacting with it, during crawl time a bot would have to interact with it, and probably for quite a while. Not only does that crawl get incredibly expensive, it gets worse as without cache, we could not trust the page stays fast, so a platform like Google would have to re-validate multiple times a day.</p>
<p>I didn’t even talk about <a href="https://developers.googleblog.com/2019/08/the-speed-benefit-of-amp-prerendering.html">privacy preserving pre-rendering</a>, the main reason AMP pages have to be hosted on a proxying cache. Signed HTTP exchanges is a promising standard to decouple identity and serving of documents, and could be used to bring privacy-aware pre-fetch to non-AMP content, as long as we also solve the metric issue. And of course, all browsers have to buy in.</p>
<p>In many ways, I’m hoping this day comes rather sooner than later, because it will reveal just how much work AMP does to ensure great UX, and when publishers see how hard it is to implement from scratch with underlying standards, AMP might suddenly seem more attractive!</p>
<p><strong>Paul, you mentioned problems with non-existent metrics and crawler performance when measuring them. But there is already a <a href="https://developers.google.com/web/tools/chrome-user-experience-report/">Chrome UX Report</a>, a database of real-user experiences of the page-speed metrics. Yes, unfortunately, it only provides a small number of metrics so far, but couldn’t this database provide information if a page is fast enough?</strong></p>
<p>The Chrome UX report could definitely be a building block for this. It doesn’t measure runtime performance yet, which is a gap here that we’d need to address, and another issue is the developer workflow: If you’re building a new site, and want to know whether your content is eligible for pre-rendering or not, you would have to wait a few weeks until you’d know. The AMP validator gives you this guarantee instantly. </p>
<p>Lighthouse is an interesting middle ground but is much less of a guarantee for great performance than real-world reports. All of these tools and metrics have their pros and cons – I believe it’ll end up being a combination of various tools and metrics.</p>
<h2 id="turning-amp-into-an-all-around-great-framework-for-content-websites"><a href="#turning-amp-into-an-all-around-great-framework-for-content-websites">“Turning AMP into an all-around great framework for content websites”</a></h2>
<p><strong>Congratulations on JavaScript in AMP – the new <a href="https://amp.dev/documentation/components/amp-script/">amp-script</a> component. I was also intrigued by the “<a href="https://blog.amp.dev/2019/05/01/amp-as-your-web-framework/">AMP bento</a>” project, which will eliminate the need to use the AMP runtime, the main JS library, and improve performance when using the framework on regular websites. How far is it and what are the other bigger plans with AMP?</strong></p>
<p>We’ve just recently started to make decent progress with Bento. It’s an incredibly complex project, as it effectively requires a rewrite of AMP, one that makes AMP even more modular than it already is.</p>
<p>Currently, AMP expects to be in total control of the page and its DOM, and the main AMP library (our devs call it runtime) needs to be loaded along with subsequent components. </p>
<p>So if you wanted to use <a href="https://amp.dev/documentation/components/amp-sidebar/">amp-sidebar</a> on a site running, say, Angular, you could already kinda do it today, but it would be inefficient and error-prone, as you would have to load the whole runtime just to show a sidebar, and would need to be careful about not mutating the DOM after the sidebar has been rendered. </p>
<p>The Bento rewrite of AMP isolates components much better from each other, introduces a new lifecycle management API and will make components feel much more like traditional web components.</p>
<p>It’s important to note that Bento AMP has one specific purpose: To allow people to gradually upgrade to 100% AMP. Even with a 90% AMP site, developers don’t get the caching and pre-rendering benefits, which would be a shame. So we’re hoping Bento will make it easier to convert over time.</p>
<p>We have plenty of plans to improve AMP, but most can be categorized as turning AMP into an all-around great framework for content websites. We’re convinced that it’s too hard to build great stuff on the web today, and want to do our part to help. Stay tuned!</p>
<p><strong>Thanks for the interview and wish you a pleasant stay in Prague!</strong></p>
        ]]></content:encoded>
        <pubDate>Mon, 16 Sep 2019 04:39:00</pubDate>
      </item>
      <item>
        <title>Bootstrap&#039;s Biggest Problem: Missing Style Guide</title>
        <link>https://www.css-mine.com/blog/2018-07-26-bootstraps-biggest-problem-missing-style-guide</link>
        <guid>https://www.css-mine.com/blog/2018-07-26-bootstraps-biggest-problem-missing-style-guide</guid>
        <description>I have always been a big fan of Bootstrap, but one thing has been bothering me.
Bootstrap is great for UI implementation. The fourth version of the framework clearly confirmed that due to the sophistication and ability to focus on things that matter, Bootstrap rules the world of UI frameworks.
Bootstrap is great for implementing web application interfaces such as intranets or content management systems. But when it comes to presentational sites, the use of Bootstrap is below its capabilities or quickly becomes meaningless.
I sometimes take a look at Bootstrap driven sites. You can do it too – there is e.g.  Bootstrap Expo - a showcase of sites built on the most popular front-end framework.

Picture: Bootstrap Expo, site gallery made using (just a little bit of) Bootstrap
Let’s go through those sites.
It’s a gallery of beautiful and creative websites that use… well… just the layout grid and Bootstrap buttons.
Yes, I’m not kidding – they mostly do not make use of more components from Bootstrap.
Presentation sites: The unlocked potential of Bootstrap
The above-mentioned sites also exist here in the Czech Republic. When I’m asking their authors why they used Bootstrap when they only need its layout grid, their answer is:

It was the client’s wish.

It’s true – it is popular among clients to fall for an illusion that using Bootstrap will save the budget. However, if the custom design of the project is not adapted to the design system (hidden in Bootstrap), the use of the framework is very inefficient.
Bootstrap really has a potential to be used on websites, however, I never hear that one correct reason to do so. It would go something like this:

From all existing design systems, Bootstrap was the best choice. We discussed it with the designer, changed a few things in Bootstrap’s design system and we use a large part of the framework components.

The reason why I will never hear such a reason is hidden in the following fictional quotes:

Bootstrap’s design system is invisible. There is no public documentation. It can only be noticed by more experienced and design-savvy developers. It is partly hidden in the code and partly does not exists.
Designers do not see the system. They can’t learn the graphics principles on which Bootstrap is built. There is no documentation which could suggest a sensitive way to edit design principles for a specific project. The adjustments designers then make are sometimes missing the Bootstrap principles. They misunderstand Bootstrap.

What does the red button mean?
To make clear what I mean by using the term design system, let’s take a look at the following modal window built using Bootstrap.

Figure: Not a good implementation for Bootstrap’s modal window
Now tell me: What’s wrong with the design of the user interface?
I’ll let you think…
Just a bit more…
Now, please think it over.
The “Close” button has the wrong color, right? And why? Because the red (created by the .btn-danger class) is designed for risky operations that can, for example, erase data for the user. It was not created for closing the window, which has lower priority than “Save changes”.
Probably.
I say “probably” because we don’t know where the truth is. Bootstrap has no documentation of the meaning of color, as well as no documentation of the meaning of anything. No button page or anything like it.

Figure: Button documentation in Bootstrap. Great for developers, but useless for designers
Bootstrap does not have a design system documentation. It does not have a style guide. So there is no order in Bootstrap’s design – not for designers and not for most developers.
If you take a look at the map of the web tools for designers and developers, it simply occupies the place for the UI library:

Figure: Bootstrap is a great UI library for the web. Nothing more, nothing less
Now let’s compare Bootstrap with Material Design
New to Bootstrap’s segment was Google Material Design. If we’d like to implement a button using Material Design, we will learn, for example, that there is a priority scale:

Figure: Buttons can have three levels of emphasis, that’s interesting information
Other important information is that the location of a button, its shape, color, or location affects the position in the hierarchy:

Figure: The first button has the most emphasis, the second middle and the third is emphasized the least
Yes, besides being a UI library, Material Design is a well-documented design system:

Figure: Material Design is a design system documented by a style guide and it also has UI libraries for all platforms. But as you will soon see, the technical documentation for the UI library is not its strength.
So, if a designer works with Material Design, he is ready to design a web interface based just on this framework. Then a developer can easily implement it.
If a developer works with Material Design (and reads the documentation), then he will make much less designing errors.
This is the strength of Material Design and the weakness of Bootstrap.
Bootstrap has better technical documentation, but the style guide is missing
I’m far away from something like “run away from Bootstrap and let’s use Material Design now”.
Material Design has its own problems. The technical documentation of the Bootstrap buttons is exhausting. There are, for example, the following information:

All modifications including code samples
Possibilities of using different HTML tags
Accessibility aspects
Warning about browser problems
Javascript API documentation

…and much more. The technical documentation of Material Design is basic and insufficient.

Figure: Button documentation for developers is really brief in Material Design
If I make things much simpler than they actually are, Material Design may be more interesting for teams where designers collaborate with developers on a product. Bootstrap, on the other hand, can be more suitable for solitary developers who are working on both the UI design and its implementation. They will really appreciate the detailed technical documentation.
Bootstrap 4 is simply the most sophisticated UI library for the web, however, it lacks the style guide and documentation of the design system.</description>
        <content:encoded><![CDATA[
          <p>I have always been a big fan of Bootstrap, but one thing has been bothering me.</p>
<p>Bootstrap is great for UI implementation. The <a href="https://getbootstrap.com/docs/4.1/getting-started/introduction/">fourth version</a> of the framework clearly confirmed that due to the sophistication and ability to focus on things that matter, Bootstrap rules the world of UI frameworks.</p>
<p>Bootstrap is great for implementing web application interfaces such as intranets or content management systems. But when it comes to presentational sites, the use of Bootstrap is below its capabilities or quickly becomes meaningless.</p>
<p>I sometimes take a look at Bootstrap driven sites. You can do it too – there is e.g.  <a href="http://expo.getbootstrap.com/">Bootstrap Expo</a> - a showcase of sites built on the most popular front-end framework.</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="https://www.vzhurudolu.cz/perch-content/bootstrap-problem001.jpg" alt="" /></div><!--.content-full--><div class="content"><div class="article">
<em>Picture: Bootstrap Expo, site gallery made using (just a little bit of) Bootstrap</em></p>
<p>Let’s go through those sites.</p>
<p>It’s a gallery of beautiful and creative websites that use… well… just the layout grid and Bootstrap buttons.</p>
<p>Yes, I’m not kidding – they mostly do not make use of more components from Bootstrap.</p>
<h2 id="presentation-sites-the-unlocked-potential-of-bootstrap"><a href="#presentation-sites-the-unlocked-potential-of-bootstrap">Presentation sites: The unlocked potential of Bootstrap</a></h2>
<p>The above-mentioned sites also exist here in the Czech Republic. When I’m asking their authors why they used Bootstrap when they only need its layout grid, their answer is:</p>
<blockquote>
<p>It was the client’s wish.</p>
</blockquote>
<p>It’s true – it is popular among clients to fall for an illusion that using Bootstrap will save the budget. However, if the custom design of the project is not adapted to the design system (hidden in Bootstrap), the use of the framework is very inefficient.</p>
<p>Bootstrap really has a potential to be used on websites, however, I never hear that one correct reason to do so. It would go something like this:</p>
<blockquote>
<p>From all existing design systems, Bootstrap was the best choice. We discussed it with the designer, changed a few things in Bootstrap’s design system and we use a large part of the framework components.</p>
</blockquote>
<p>The reason why I will never hear such a reason is hidden in the following fictional quotes:</p>
<ul>
<li>Bootstrap’s <em>design system</em> is invisible. There is no public documentation. It can only be noticed by more experienced and design-savvy developers. It is partly hidden in the code and partly does not exists.</li>
<li><em>Designers</em> do not see the system. They can’t learn the graphics principles on which Bootstrap is built. There is no documentation which could suggest a sensitive way to edit design principles for a specific project. The adjustments designers then make are sometimes missing the Bootstrap principles. They misunderstand Bootstrap.</li>
</ul>
<h2 id="what-does-the-red-button-mean"><a href="#what-does-the-red-button-mean">What does the red button mean?</a></h2>
<p>To make clear what I mean by using the term <em>design system</em>, let’s take a look at the following <a href="https://getbootstrap.com/docs/4.1/components/modal/">modal window</a> built using Bootstrap.</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="https://www.vzhurudolu.cz/perch-content/bootstrap-problem002.jpg" alt="" /></div><!--.content-full--><div class="content"><div class="article">
<em>Figure: Not a good implementation for Bootstrap’s modal window</em></p>
<p>Now tell me: What’s wrong with the design of the user interface?</p>
<p>I’ll let you think…</p>
<p>Just a bit more…</p>
<p>Now, please think it over.
The “Close” button has the wrong color, right? And why? Because the red (created by the <code>.btn-danger</code> class) is designed for risky operations that can, for example, erase data for the user. It was not created for closing the window, which has lower priority than “Save changes”.</p>
<p>Probably.</p>
<p>I say “probably” because we don’t know where the truth is. Bootstrap has no documentation of the meaning of color, as well as no documentation of the meaning of anything. No <a href="http://getbootstrap.com/docs/4.1/components/buttons/">button page</a> or anything like it.</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="https://www.vzhurudolu.cz/perch-content/bootstrap-problem003.jpg" alt="" /></div><!--.content-full--><div class="content"><div class="article">
<em>Figure: Button documentation in Bootstrap. Great for developers, but useless for designers</em></p>
<p>Bootstrap does not have a design system documentation. It does not have a <a href="https://www.uxpin.com/studio/blog/design-systems-vs-pattern-libraries-vs-style-guides-whats-difference/">style guide</a>. So there is no order in Bootstrap’s design – not for designers and not for most developers.</p>
<p>If you take a look at the map of the web tools for designers and developers, it simply occupies the place for the UI library:</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="https://www.vzhurudolu.cz/perch-content/bootstrap-problem004.jpg" alt="" /></div><!--.content-full--><div class="content"><div class="article">
<em>Figure: Bootstrap is a great UI library for the web. Nothing more, nothing less</em></p>
<h2 id="now-let-s-compare-bootstrap-with-material-design"><a href="#now-let-s-compare-bootstrap-with-material-design">Now let’s compare Bootstrap with Material Design</a></h2>
<p>New to Bootstrap’s segment was <a href="https://material.io/">Google Material Design</a>. If we’d like to implement a button using Material Design, we will learn, for example, that there is a priority scale:</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="https://www.vzhurudolu.cz/perch-content/bootstrap-problem006.jpg" alt="" /></div><!--.content-full--><div class="content"><div class="article">
<em>Figure: Buttons can have three levels of emphasis, that’s interesting information</em></p>
<p>Other important information is that the location of a button, its shape, color, or location affects the position in the hierarchy:</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="https://www.vzhurudolu.cz/perch-content/bootstrap-problem007.jpg" alt="" /></div><!--.content-full--><div class="content"><div class="article">
<em>Figure: The first button has the most emphasis, the second middle and the third is emphasized the least</em></p>
<p>Yes, besides being a UI library, Material Design is a well-documented design system:</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="https://www.vzhurudolu.cz/perch-content/bootstrap-problem005.jpg" alt="" /></div><!--.content-full--><div class="content"><div class="article">
<em>Figure: Material Design is a design system documented by a style guide and it also has UI libraries for all platforms. But as you will soon see, the technical documentation for the UI library is not its strength.</em></p>
<p>So, if a designer works with Material Design, he is ready to design a web interface based just on this framework. Then a developer can easily implement it.</p>
<p>If a developer works with Material Design (and reads the documentation), then he will make much less designing errors.</p>
<p>This is the strength of Material Design and the weakness of Bootstrap.</p>
<h2 id="bootstrap-has-better-technical-documentation-but-the-style-guide-is-missing"><a href="#bootstrap-has-better-technical-documentation-but-the-style-guide-is-missing">Bootstrap has better technical documentation, but the style guide is missing</a></h2>
<p>I’m far away from something like “run away from Bootstrap and let’s use Material Design now”.</p>
<p>Material Design has its own problems. The technical documentation of the Bootstrap buttons is exhausting. There are, for example, the following information:</p>
<ul>
<li>All modifications including code samples</li>
<li>Possibilities of using different HTML tags</li>
<li>Accessibility aspects</li>
<li>Warning about browser problems</li>
<li>Javascript API documentation</li>
</ul>
<p>…and much more. The technical documentation of Material Design is basic and insufficient.</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="https://www.vzhurudolu.cz/perch-content/bootstrap-problem008.jpg" alt="" /></div><!--.content-full--><div class="content"><div class="article">
<em>Figure: <a href="https://material.io/develop/web/components/buttons/">Button documentation</a> for developers is really brief in Material Design</em></p>
<p>If I make things much simpler than they actually are, Material Design may be more interesting for teams where designers collaborate with developers on a product. Bootstrap, on the other hand, can be more suitable for solitary developers who are working on both the UI design and its implementation. They will really appreciate the detailed technical documentation.</p>
<p>Bootstrap 4 is simply the most sophisticated UI library for the web, however, it lacks the style guide and documentation of the design system.</p>
        ]]></content:encoded>
        <pubDate>Thu, 26 Jul 2018 08:36:00</pubDate>
      </item>
      <item>
        <title>Mark Robbins: Interview before WebExpo about Interactive E-mail</title>
        <link>https://www.css-mine.com/blog/2017-09-13-mark-robbins-interview-before-webexpo-about-interactive-e-mail</link>
        <guid>https://www.css-mine.com/blog/2017-09-13-mark-robbins-interview-before-webexpo-about-interactive-e-mail</guid>
        <description>Can you imagine coding newsletters without using the &amp;lt;table&amp;gt; tag and inline CSS styles? Or using modern CSS3 technologies? Or using SVG’s? Sci-Fi!
Well, my friends, it is possible. It’s not always easy and straightforward and you also have to do at least one thing: go to see Mark Robbins’s lecture at this year’s WebExpo Prague. Mark spends a lot of time thinking about how to trick email clients using progressive enhancement techniques and how to shed some light onto the dark age of newsletter coding. The following interview is also an invitation to Mark’s lecture. And I bet I know where I will see you on September 23rd.   
Hi, Mark! The first thought that came to my mind when I was going through your work was: I don’t believe it! :)  It has been a long time since I coded the last newsletter template, but I remember people still use a lot of old-school clients such as Outlook or Gmail’s web version. And at the same time, you talk about interactivity, shops in newsletters, latest CSS3… What’s the trick? Could you sum it up in one thought?
Really it’s all about targeting the email clients where it works and adding a fallback for where it doesn’t. These things I talk about won’t work in Outlook and some won’t work in Gmail either but the vast majority of users will see them.  
From a web point of view it’s like writing code for the latest version of Chrome while also considering that 6% of your visitors are using Netscape 4.

In your WebExpo’s presentation summary, I see that we can forget about the fact “that you have to code email like it’s 1999 and everything has to be styled inline and built with table layouts”. Is it really possible to remove inline styling and &amp;lt;table&amp;gt; tags when dealing with Outlook?
Since Gmail made an update last September, over 95% of emails opened now support embedded &amp;lt;style&amp;gt; block, including Outlook.  It’s still best to include some basic inline styles to cover that other 5% but most of it can now be moved.
For &amp;lt;table&amp;gt;s it’s 94% that work without them. And only Outlook holding us back. Most email devs are using conditional comments in their code these days so the tables will only appear in the code for Outlook, and I’m working on a project currently that removes 100% of tables but still rendering fine in Outlook. 
I like the idea of the API I saw in your product called Rebel. However, isn’t it a bit limiting for devs to choose from ready-made templates only? Most of the clients I know (and designers too) want to design their own custom templates.
Through our API we offer a huge amount of customisation, down to every individual element in the interactive components. We also allow custom HTML to be added by our customers. And we have a new update coming that will allow for basically any email layout to be created via nothing but JSON.
How does Rebel work together with existing newsletter workflows and tools like MailChimp?
We sit alongside the ESP’s, we generate the email code and export it as an HTML file. This can then be uploaded manually or in some cases passed automaticall into the ESP ready to be sent.  Once the email is sent we collect analytics on every interaction in the email, these results can be viewed on our dashboard or integrated directly into your existing software.
And the last question: I’m glad you are talking about accessibility in e-mails. It is related to my ongoing WebExpo’s talk about accessibility code patterns. Will you have time to discuss this topic in your talk?
Last year was the first time I’d really heard any talk about accessibility in email, but now it’s a hot topic in the community. I’m doing my best to spread the word along with a few other great email developers. I will be covering it a little in this talk but I’m also working on a full talk about accessibility in email for another time.</description>
        <content:encoded><![CDATA[
          <p>Can you imagine coding newsletters without using the <code>&lt;table&gt;</code> tag and inline CSS styles? Or using modern CSS3 technologies? Or using SVG’s? Sci-Fi!</p>
<p>Well, my friends, it is possible. It’s not always easy and straightforward and you also have to do at least one thing: go to see Mark Robbins’s lecture at this year’s <a href="https://www.webexpo.net/">WebExpo Prague</a>. Mark spends a lot of time thinking about how to trick email clients using progressive enhancement techniques and how to shed some light onto the dark age of newsletter coding. The following interview is also an invitation to Mark’s lecture. And I bet I know where I will see you <a href="https://www.webexpo.net/prague2017/talk/interactive-email/">on September 23rd</a>.   </p>
<p><em>Hi, Mark! The first thought that came to my mind when I was going through your work was: I don’t believe it! :)  It has been a long time since I coded the last newsletter template, but I remember people still use a lot of old-school clients such as Outlook or Gmail’s web version. And at the same time, you talk about interactivity, shops in newsletters, latest CSS3… What’s the trick? Could you sum it up in one thought?</em></p>
<p>Really it’s all about targeting the email clients where it works and adding a fallback for where it doesn’t. These things I talk about won’t work in Outlook and some won’t work in Gmail either but the vast majority of users will see them.  </p>
<p>From a web point of view it’s like writing code for the latest version of Chrome while also considering that 6% of your visitors are using Netscape 4.</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="https://www.vzhurudolu.cz/assets/img/content/dest/original/blog/mark_robbins.jpg" alt="Mark Robbins" /></div><!--.content-full--><div class="content"><div class="article"></p>
<p><em>In your <a href="https://www.webexpo.net/prague2017/talk/interactive-email/">WebExpo’s presentation summary</a>, I see that we can forget about the fact “that you have to code email like it’s 1999 and everything has to be styled inline and built with table layouts”. Is it really possible to remove inline styling and &lt;table&gt; tags when dealing with Outlook?</em></p>
<p>Since Gmail made an update last September, over 95% of emails opened now support embedded <code>&lt;style&gt;</code> block, including Outlook.  It’s still best to include some basic inline styles to cover that other 5% but most of it can now be moved.</p>
<p>For <code>&lt;table&gt;</code>s it’s 94% that work without them. And only Outlook holding us back. Most email devs are using conditional comments in their code these days so the tables will only appear in the code for Outlook, and I’m working on a project currently that removes 100% of tables but still rendering fine in Outlook. </p>
<p><em>I like the idea of the API I saw in your product called Rebel. However, isn’t it a bit limiting for devs to choose from ready-made templates only? Most of the clients I know (and designers too) want to design their own custom templates.</em></p>
<p>Through our API we offer a huge amount of customisation, down to every individual element in the interactive components. We also allow custom HTML to be added by our customers. And we have a new update coming that will allow for basically any email layout to be created via nothing but JSON.</p>
<p><em>How does Rebel work together with existing newsletter workflows and tools like MailChimp?</em></p>
<p>We sit alongside the ESP’s, we generate the email code and export it as an HTML file. This can then be uploaded manually or in some cases passed automaticall into the ESP ready to be sent.  Once the email is sent we collect analytics on every interaction in the email, these results can be viewed on our dashboard or integrated directly into your existing software.</p>
<p><em>And the last question: I’m glad you are talking about <a href="https://www.slideshare.net/M_J_Robbins/accessibility-in-email-eoainsights">accessibility in e-mails</a>. It is related to my <a href="https://www.webexpo.net/prague2017/talk/pristupnost-v-kodu-ukazky-a-navrhove-vzory/">ongoing WebExpo’s talk</a> about accessibility code patterns. Will you have time to discuss this topic in your talk?</em></p>
<p>Last year was the first time I’d really heard any talk about accessibility in email, but now it’s a hot topic in the community. I’m doing my best to spread the word along with a few other great email developers. I will be covering it a little in this talk but I’m also working on a full talk about accessibility in email for another time.</p>
        ]]></content:encoded>
        <pubDate>Wed, 13 Sep 2017 20:24:00</pubDate>
      </item>
      <item>
        <title>“How To Poison The Mobile User” – my first article for Smashing Magazine</title>
        <link>https://www.css-mine.com/blog/2016-11-07-how-to-poison-the-mobile-user-my-first-article-for-smashing-magazine</link>
        <guid>https://www.css-mine.com/blog/2016-11-07-how-to-poison-the-mobile-user-my-first-article-for-smashing-magazine</guid>
        <description>In my first article for Smashing Magazine I teach how to poison the mobile user. It’s easy:

Make The Website Load Slowly
Design Your Carousel Poorly
Hide The Menu Under A Hamburger Icon
Always Rely On The Swipe Gesture
Make All Tap Targets Nice And Small
Make It Responsive, But Only For Certain Resolutions
Don’t Make Phone Numbers Tappable
Disable Zooming
Set * { user-select: none }, And All Is Good
Load Web Fonts Incorrectly
Clutter The Page With Social Media Buttons
Faulty Redirection From Desktop To Mobile
Hide The Content Well

And yes, it’s ironic. ;)
In the article you will get tips on how to avoid the most common problems in mobile web design.
Some of the points aren’t new. In the article you will find arguments for your bosses, clients or colleagues.
I’d like to give special thanks to:

Derek Allard and Smashing Magazine editorial expert reviewers 
Martin Staněk (Abacus Themes) for helping me with translations

Read the article.</description>
        <content:encoded><![CDATA[
          <p>In my first <a href="https://www.smashingmagazine.com/2016/10/how-to-poison-the-mobile-user/">article for Smashing Magazine</a> I teach how to poison the mobile user. It’s easy:</p>
<ol>
<li>Make The Website Load Slowly</li>
<li>Design Your Carousel Poorly</li>
<li>Hide The Menu Under A Hamburger Icon</li>
<li>Always Rely On The Swipe Gesture</li>
<li>Make All Tap Targets Nice And Small</li>
<li>Make It Responsive, But Only For Certain Resolutions</li>
<li>Don’t Make Phone Numbers Tappable</li>
<li>Disable Zooming</li>
<li>Set <code>* { user-select: none }</code>, And All Is Good</li>
<li>Load Web Fonts Incorrectly</li>
<li>Clutter The Page With Social Media Buttons</li>
<li>Faulty Redirection From Desktop To Mobile</li>
<li>Hide The Content Well</li>
</ol>
<p>And yes, it’s ironic. ;)</p>
<p>In the article you will get tips on how to avoid the most common problems in mobile web design.</p>
<p>Some of the points aren’t new. In the article you will find arguments for your bosses, clients or colleagues.</p>
<p>I’d like to give special thanks to:</p>
<ul>
<li><a href="https://twitter.com/derekallard">Derek Allard</a> and Smashing Magazine editorial expert reviewers </li>
<li>Martin Staněk (<a href="http://www.abacusthemes.com/en/">Abacus Themes</a>) for helping me with translations</li>
</ul>
<p><a href="https://www.smashingmagazine.com/2016/10/how-to-poison-the-mobile-user/">Read the article</a>.</p>
        ]]></content:encoded>
        <pubDate>Mon, 07 Nov 2016 10:07:00</pubDate>
      </item>
      <item>
        <title>Three questions for Rachel Andrew before WebExpo Prague: CSS Grid Layout and Perch CMS</title>
        <link>https://www.css-mine.com/blog/2016-09-21-three-questions-for-rachel-andrew-before-webexpo-prague-css-grid-layout-and-perch-cms</link>
        <guid>https://www.css-mine.com/blog/2016-09-21-three-questions-for-rachel-andrew-before-webexpo-prague-css-grid-layout-and-perch-cms</guid>
        <description>When speakers like this appear at WebExpo Prague, it is always a pleasure. I will tell you why Rachel Andrew is a must-see for every front end developer.  
First, Rachel Andrew is an expert on new CSS layouts - Flexbox and CSS Grid Layout. She also cooperates with CSS Working Group as an Invited Expert (so she has firsthand information) and she writes an e-mail newsletter called CSS Layout News. This also happens to be the topic she has been dealing with in her books. 
Second, see Perch. It is an extraordinary CMS, Wordpress with a human face if you like. And Rachel happens to be the co-author of this CMS, which is powering CSS Mine along with many other websites. 
So, let’s see three questions I asked Rachel thanks to the organizers of WebExpo.
Rachel, Flexbox combines great technology with a practical application. No doubt about it. But what about CSS Grid Layout? Isn’t too soon to use it?
It’s too soon to be using it in production yes. However I believe it is important that developers and designers engage with specifications as they are in development, get to grips with them and then off feedback to the CSS Working Group. If you don’t do that at the point at which the spec is behind a flag and in development you lose that chance. As once some CSS is out there and being used on real sites, it’s too late to make changes.

Thanks for the excellent Perch CMS! I use it and I’m very happy about it. Are you planning any major innovations which are not publicly known?
We are currently working on a redesign of the UI which will ship with Perch 2.9. I’ve written a couple of posts about that process. 

Rebuilding the Perch UI - not your usual redesign
Rebuilding the Perch UI - creating a pattern library

I noticed you’ve been in Prague. It’s something special, what you’re looking forward to?
I’m looking forward to visiting Prague itself - I have been before but was at a conference outside of the city in a business hotel so didn’t really get to experience Prague itself. At WebExpo I like the fact there are talks on business, development and design as these are all strands I think are important.
Thank you for the interviews and I am looking forward to your speech on Saturday afternoon.
Rachel’s speech: The right layout tool for the job.
Photo credits – author: Jeffrey Zeldman, published under CC-BY-2 licence.</description>
        <content:encoded><![CDATA[
          <p>When speakers like this appear at WebExpo Prague, it is always a pleasure. I will tell you why Rachel Andrew is a must-see for every front end developer.  </p>
<p>First, Rachel Andrew is an expert on new CSS layouts - <a href="http://cssmine.com/ebook/css3-flexbox">Flexbox</a> and <a href="https://css-tricks.com/snippets/css/complete-guide-grid/">CSS Grid Layout</a>. She also cooperates with <a href="https://www.w3.org/Style/CSS/members.en.php3">CSS Working Group</a> as an Invited Expert (so she has firsthand information) and she writes an e-mail newsletter called <a href="http://csslayout.news/">CSS Layout News</a>. This also happens to be the topic she has been dealing with in her <a href="https://rachelandrew.co.uk/books">books</a>. </p>
<p>Second, see <a href="https://grabaperch.com/">Perch</a>. It is an extraordinary CMS, Wordpress with a human face if you like. And Rachel happens to be the co-author of this CMS, which is powering <a href="http://cssmine.com/">CSS Mine</a> along with many other websites. </p>
<p>So, let’s see three questions I asked Rachel thanks to the organizers of WebExpo.</p>
<h3 id="rachel-flexbox-combines-great-technology-with-a-practical-application-no-doubt-about-it-but-what-about-css-grid-layout-isn-t-too-soon-to-use-it"><a href="#rachel-flexbox-combines-great-technology-with-a-practical-application-no-doubt-about-it-but-what-about-css-grid-layout-isn-t-too-soon-to-use-it">Rachel, Flexbox combines great technology with a practical application. No doubt about it. But what about CSS Grid Layout? Isn’t too soon to use it?</a></h3>
<p>It’s too soon to be using it in production yes. However I believe it is important that developers and designers engage with specifications as they are in development, get to grips with them and then off feedback to the CSS Working Group. If you don’t do that at the point at which the spec is behind a flag and in development you lose that chance. As once some CSS is out there and being used on real sites, it’s too late to make changes.</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="/assets/img/content/dest/original/rachel-andrew.jpg" alt="Rachel Andrew, foto: Jeffrey Zeldman" /></div><!--.content-full--><div class="content"><div class="article"></p>
<h3 id="thanks-for-the-excellent-perch-cms-i-use-it-and-i-m-very-happy-about-it-are-you-planning-any-major-innovations-which-are-not-publicly-known"><a href="#thanks-for-the-excellent-perch-cms-i-use-it-and-i-m-very-happy-about-it-are-you-planning-any-major-innovations-which-are-not-publicly-known">Thanks for the excellent Perch CMS! I use it and I’m very happy about it. Are you planning any major innovations which are not publicly known?</a></h3>
<p>We are currently working on a redesign of the UI which will ship with Perch 2.9. I’ve written a couple of posts about that process. </p>
<ul>
<li><a href="https://rachelandrew.co.uk/archives/2016/05/03/rebuilding-the-perch-ui-not-your-usual-redesign/">Rebuilding the Perch UI - not your usual redesign</a></li>
<li><a href="https://rachelandrew.co.uk/archives/2016/05/06/rebuilding-the-perch-ui-creating-a-pattern-library/">Rebuilding the Perch UI - creating a pattern library</a></li>
</ul>
<h3 id="i-noticed-you-ve-been-in-prague-it-s-something-special-what-you-re-looking-forward-to"><a href="#i-noticed-you-ve-been-in-prague-it-s-something-special-what-you-re-looking-forward-to">I noticed you’ve been in Prague. It’s something special, what you’re looking forward to?</a></h3>
<p>I’m looking forward to visiting Prague itself - I have been before but was at a conference outside of the city in a business hotel so didn’t really get to experience Prague itself. At WebExpo I like the fact there are talks on business, development and design as these are all strands I think are important.</p>
<h3 id="thank-you-for-the-interviews-and-i-am-looking-forward-to-your-speech-on-saturday-afternoon"><a href="#thank-you-for-the-interviews-and-i-am-looking-forward-to-your-speech-on-saturday-afternoon">Thank you for the interviews and I am looking forward to your speech on Saturday afternoon.</a></h3>
<p><em>Rachel’s speech: <a href="https://webexpo.net/prague2016/talk/the-right-layout-tool-for-the-job/">The right layout tool for the job</a>.<br />
Photo credits – author: <a href="https://www.flickr.com/photos/zeldman/25691520261/in/photostream/">Jeffrey Zeldman</a>, published under <a href="https://creativecommons.org/licenses/by/2.0/">CC-BY-2 licence</a>.</em></p>
        ]]></content:encoded>
        <pubDate>Wed, 21 Sep 2016 06:02:00</pubDate>
      </item>
      <item>
        <title>Interview with Harry Roberts Before Webexpo Prague: about Refactoring CSS and ITCSS</title>
        <link>https://www.css-mine.com/blog/2016-09-06-interview-with-harry-roberts-before-webexpo-prague-about-refactoring-css-and-itcss</link>
        <guid>https://www.css-mine.com/blog/2016-09-06-interview-with-harry-roberts-before-webexpo-prague-about-refactoring-css-and-itcss</guid>
        <description>Harry Roberts (@csswizardry) is one of the most interesting speakers on the upcoming Webexpo conference here in Prague, Czech Republic. I took the opportunity and asked him a few questions about refactoring CSS and his ITCSS, a methodology for organizing large CSS codebases.

Harry, I’m looking forward to your speech! Just imagine this: one part of the CSS code on one of my projects is terribly old. You know, it is the place you don’t want to go after dark. Is it possible to recommend the first three steps that should anyone with a similar problem do?
I help clients refactor old CSS a lot, and the three key steps are usually all
the same: The Three I’s.
Identify
It’s all well and good knowing that ‘your CSS is a mess’, but which bits specifically? Which parts of your codebase are causing you problems right now? Which ones will be the quickest to refactor? Which parts will provide you with the most benefit once refactored? It is important to identify prime candidates for refactoring.
For example, the CSS for your nav might be cumbersome and hard to work with,
but if the nav works correctly, is accessible, and you rarely have to edit the CSS for it, refactoring it will not provide you with much value. However, your
layout/grid system might be incredibly fragmented and inconsistent, it might
have cross-browser issues, its responsiveness may have been bolted on as an
afterthought, and of course it is probably used extensively and frequently, so
you might get a lot of value from tackling that first.
Isolate
Once we have identified candidates for refactoring, we need to isolate them
before and during working on them. Suppose we have decided to refactor our
layout system first, we should rewrite this in isolation, outside of our
project.
In order to do this, open a new jsFiddle, Codepen, etc. and begin work there. Do
not refactor features back into a stale codebase, as doing so runs the risk of
making use of legacy CSS that may itself be refactored in future. For example,
we might be using a traditional reset in the current project, which may be
replaced by Normalize.css in future—we don’t want to build our brand new layout
system on top of a reset that will be removed in six months time).
Build the new/refactored version of your feature in complete isolation so that
you know it is well encapsulated, and it’s making use of any legacy.
Implement
The final step is to implement your refactored feature. Copy and paste the
jsFiddle CSS into the relevant part of your project, and see what happens. 90%
of the time, you’ll find that there are some problems: conflicts with existing
CSS, naming collisions, existing styles leaking into your new code, etc.
We tackle these details at implementation stage, and we need to give careful
consideration as to where we place the fixes. If the fix solves a problem with
the layout system itself, it is usually best to place the fix in the layout
system’s partial. If the fix addresses problems arising from conflicts with
legacy code, it is often best to place it in a Shame.css file. This keeps the
legacy fix away from greenfield CSS, meaning it will be much easier to remove
once we’ve refactored whatever legacy was causing the problem in the first
place.
Author’s note: as you may have noticed, Harry wrote detail blog post on the topic after answering my question.
I follow your ITCSS activities. Is it possible to briefly describe how it is different from the existing methodologies – for instance from SMACSS?
Of all of the CSS methodologies available, ITCSS is most similar to SMACSS. It
deals with types, or Layers, of rules, and strikes a balance between inheritance
and encapsulation models.

The key idea of ITCSS it to use CSS’ inheritance-led design to our advantage,
ordering our CSS in a very specific and particular way (based upon three key
metrics). This paradigm allows us to extend and grow projects very easily, and
allows for a greater number of people to contribute to the codebase in a very
safe manner. It’s also compatible with any view libraries, or Web Components, or
tech stacks you like.
ITCSS borrows paradigms from lots of different areas, but leaves almost
everything completely optional. For example, I use ITCSS with BEM naming, and
OOCSS-based structural CSS, but neither are mandatory for someone to be
considered ITCSS compliant.
ITCSS also has a more granular approach, breaking (S)CSS rules down into seven
default categories that can be extended (but never reordered) depending on
your needs.
And finally - have you ever been to Prague? Are you looking forward to anything in particular?
I haven’t! There isn’t anything in particular, but I am excited for Czech beer,
and exploring the city! I’d love any recommendations you might have…
Thank you for the interview and am looking forward to your speech!
Harry Roberts photo credits – author: Andreas Dantz, published under CC-BY-2 licence).</description>
        <content:encoded><![CDATA[
          <p><a href="http://csswizardry.com/about/">Harry Roberts</a> (<a href="http://twitter.com/csswizardry">@csswizardry</a>) is one of the most interesting speakers on the upcoming Webexpo conference here in Prague, Czech Republic. I took the opportunity and asked him a few questions about <a href="https://webexpo.cz/praha2016/prednaska/refactoring-css-without-losing-your-mind/">refactoring CSS</a> and his <a href="https://speakerdeck.com/dafed/managing-css-projects-with-itcss">ITCSS</a>, a methodology for organizing large CSS codebases.</p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="/assets/img/content/dest/original/harry-roberts-talking.jpg" alt="Harry Roberts" /></div><!--.content-full--><div class="content"><div class="article"></p>
<h3 id="harry-i-m-looking-forward-to-your-speech-just-imagine-this-one-part-of-the-css-code-on-one-of-my-projects-is-terribly-old-you-know-it-is-the-place-you-don-t-want-to-go-after-dark-is-it-possible-to-recommend-the-first-three-steps-that-should-anyone-with-a-similar-problem-do"><a href="#harry-i-m-looking-forward-to-your-speech-just-imagine-this-one-part-of-the-css-code-on-one-of-my-projects-is-terribly-old-you-know-it-is-the-place-you-don-t-want-to-go-after-dark-is-it-possible-to-recommend-the-first-three-steps-that-should-anyone-with-a-similar-problem-do">Harry, I’m looking forward to your speech! Just imagine this: one part of the CSS code on one of my projects is terribly old. You know, it is the place you don’t want to go after dark. Is it possible to recommend the first three steps that should anyone with a similar problem do?</a></h3>
<p>I help clients refactor old CSS a lot, and the three key steps are usually all
the same: The Three I’s.</p>
<p>Identify</p>
<p>It’s all well and good knowing that ‘your CSS is a mess’, but which bits specifically? Which parts of your codebase are causing you problems right now? Which ones will be the quickest to refactor? Which parts will provide you with the most benefit once refactored? It is important to identify prime candidates for refactoring.</p>
<p>For example, the CSS for your nav might be cumbersome and hard to work with,
but if the nav works correctly, is accessible, and you rarely have to edit the CSS for it, refactoring it will not provide you with much value. However, your
layout/grid system might be incredibly fragmented and inconsistent, it might
have cross-browser issues, its responsiveness may have been bolted on as an
afterthought, and of course it is probably used extensively and frequently, so
you might get a lot of value from tackling that first.</p>
<p>Isolate</p>
<p>Once we have identified candidates for refactoring, we need to isolate them
before and during working on them. Suppose we have decided to refactor our
layout system first, we should rewrite this in isolation, outside of our
project.</p>
<p>In order to do this, open a new jsFiddle, Codepen, etc. and begin work there. Do
not refactor features back into a stale codebase, as doing so runs the risk of
making use of legacy CSS that may itself be refactored in future. For example,
we might be using a traditional reset in the current project, which may be
replaced by Normalize.css in future—we don’t want to build our brand new layout
system on top of a reset that will be removed in six months time).</p>
<p>Build the new/refactored version of your feature in complete isolation so that
you know it is well encapsulated, and it’s making use of any legacy.</p>
<p>Implement</p>
<p>The final step is to implement your refactored feature. Copy and paste the
jsFiddle CSS into the relevant part of your project, and see what happens. 90%
of the time, you’ll find that there are some problems: conflicts with existing
CSS, naming collisions, existing styles leaking into your new code, etc.</p>
<p>We tackle these details at implementation stage, and we need to give careful
consideration as to where we place the fixes. If the fix solves a problem with
the layout system itself, it is usually best to place the fix in the layout
system’s partial. If the fix addresses problems arising from conflicts with
legacy code, it is often best to place it in a Shame.css file. This keeps the
legacy fix away from greenfield CSS, meaning it will be much easier to remove
once we’ve refactored whatever legacy was causing the problem in the first
place.</p>
<p><em>Author’s note: as you may have noticed, Harry wrote <a href="http://csswizardry.com/2016/08/refactoring-css-the-three-i-s/">detail blog post on the topic</a> after answering my question.</em></p>
<h3 id="i-follow-your-itcss-activities-is-it-possible-to-briefly-describe-how-it-is-different-from-the-existing-methodologies-for-instance-from-smacss"><a href="#i-follow-your-itcss-activities-is-it-possible-to-briefly-describe-how-it-is-different-from-the-existing-methodologies-for-instance-from-smacss">I follow your ITCSS activities. Is it possible to briefly describe how it is different from the existing methodologies – for instance from SMACSS?</a></h3>
<p>Of all of the CSS methodologies available, ITCSS is most similar to SMACSS. It
deals with types, or Layers, of rules, and strikes a balance between inheritance
and encapsulation models.</p>
<p><a href="https://speakerdeck.com/dafed/managing-css-projects-with-itcss"></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="/assets/img/content/dest/original/itcss.png" alt="ITCSS" /></div><!--.content-full--><div class="content"><div class="article"></a></p>
<p>The key idea of ITCSS it to use CSS’ inheritance-led design to our advantage,
ordering our CSS in a very specific and particular way (based upon three key
metrics). This paradigm allows us to extend and grow projects very easily, and
allows for a greater number of people to contribute to the codebase in a very
safe manner. It’s also compatible with any view libraries, or Web Components, or
tech stacks you like.</p>
<p>ITCSS borrows paradigms from lots of different areas, but leaves almost
everything completely optional. For example, I use ITCSS with BEM naming, and
OOCSS-based structural CSS, but neither are mandatory for someone to be
considered ITCSS compliant.</p>
<p>ITCSS also has a more granular approach, breaking (S)CSS rules down into seven
default categories that can be extended (but <em>never</em> reordered) depending on
your needs.</p>
<h3 id="and-finally-have-you-ever-been-to-prague-are-you-looking-forward-to-anything-in-particular"><a href="#and-finally-have-you-ever-been-to-prague-are-you-looking-forward-to-anything-in-particular">And finally - have you ever been to Prague? Are you looking forward to anything in particular?</a></h3>
<p>I haven’t! There isn’t anything in particular, but I am excited for Czech beer,
and exploring the city! I’d love any recommendations you might have…</p>
<p><em>Thank you for the interview and am looking forward to your speech!</em></p>
<p><em>Harry Roberts photo credits – author: <a href="https://www.flickr.com/photos/szene/8899494021/in/photolist-eytp5o-eyqew6-eytpF7/">Andreas Dantz</a>, published under <a href="https://creativecommons.org/licenses/by/2.0/">CC-BY-2 licence</a>).</em></p>
        ]]></content:encoded>
        <pubDate>Tue, 06 Sep 2016 16:14:00</pubDate>
      </item>
      <item>
        <title>Please Deal with Website Load Speed. Here Is Why</title>
        <link>https://www.css-mine.com/blog/2016-08-01-please-deal-with-website-load-speed-here-is-why</link>
        <guid>https://www.css-mine.com/blog/2016-08-01-please-deal-with-website-load-speed-here-is-why</guid>
        <description>„Never underestimate the importance of fast”, Google CEO Eric Schmidt proclaimed in 2010. 
You don’t have to be Google to know that speeding up the website will increase the user experience and will help you achieve the goals of your website. 
We (Humans) Simply Want It Fast
It is good to admit that users are actually just humans. In the 1960s, Robert B. Miller tested the perception of the speed of the user interface and in the 1990s, Jacob Nielsen took over the results. They tested the patience of people while waiting for a response from the interface after doing a user action. 

up to 100 ms – we perceive it at an instant response
up to 1 second – we can experience the delay but we will not interrupt the action
over 10 seconds – we lose focus and we tend to start performing other tasks 

There are some other interesting numbers related to human perceptual abilities that can be found at the Google Developer site.
Page Load Speed Has a Significant Impact on The Success of the Website
At least that is what studies and test of this topic say. 
Wallmart, for example, has calculated that each 1-second page load acceleration will increase their conversion rate by two percent. 
Other case studies show us that increasing the site’s load speed will positively influence all key indicators - conversion rate, page views, the number of visits or the customer satisfaction. All world stats can be found at WPO stats. If you prefer infographics, just take a look here. 
Speed Also Affects Listing of AdWords Ads and Generic Google Search Results
Don’t forget that the load speed is one of the listing parameters of the AdWords campaigns. 
Google says that the load speed will affect the search results. And the order of the results is directly affected by the server loading speed. 
Speed is, therefore, affecting not only conversions but the possibility a user will land on your website as well. 
Mobile Connection Will Never Be Equal To The Wired One
Even if the transmission speed is increasing on 3G/4G networks, it will never be the same as your home or office connection. You ask why? The key problem is latency, i.e. the time it takes for the client to connect to the server.
Just take a look at the following table. It is inspired by a book by Ilya Grigorik, High Performance Browser Networking:



Connection
Mbit/s transfer rate
Latency (ms)




2G/EDGE
0,1 - 0,4
300 - 1000


3G
0,5 - 5
100 - 500


4G/LTE
1 - 50
&amp;lt; 100


Wifi
1 - 50
&amp;lt; 10



The explanation is quite clear - the architecture of the mobile connection network is far more complex than the wired one. The data travel through the air, we use BTS and they can be busy. 
The Western world is covered by LTE networks, however, this speed is not accessible for everyone, and will not be for a long time. 
The conclusion is that it is wise to look into load speed of your website. It is very likely you will draw more traffic to your website and a fast website will significantly improve key indicators that show your website’s success.</description>
        <content:encoded><![CDATA[
          <p>„Never underestimate the importance of fast”, Google CEO Eric Schmidt proclaimed in 2010. </p>
<p>You don’t have to be Google to know that speeding up the website will increase the user experience and will help you achieve the goals of your website. </p>
<h2 id="we-humans-simply-want-it-fast"><a href="#we-humans-simply-want-it-fast">We (Humans) Simply Want It Fast</a></h2>
<p>It is good to admit that users are actually just humans. In the 1960s, Robert B. Miller tested the perception of the speed of the user interface and in the 1990s, <a href="https://www.nngroup.com/articles/response-times-3-important-limits/">Jacob Nielsen took over the results</a>. They tested the patience of people while waiting for a response from the interface after doing a user action. </p>
<ul>
<li><em>up to 100 ms</em> – we perceive it at an instant response</li>
<li><em>up to 1 second</em> – we can experience the delay but we will not interrupt the action</li>
<li><em>over 10 seconds</em> – we lose focus and we tend to start performing other tasks </li>
</ul>
<p>There are <a href="https://developers.google.com/web/tools/chrome-devtools/profile/evaluate-performance/rail#focus-on-the-user">some other interesting numbers related to human perceptual abilities</a> that can be found at the Google Developer site.</p>
<h2 id="page-load-speed-has-a-significant-impact-on-the-success-of-the-website"><a href="#page-load-speed-has-a-significant-impact-on-the-success-of-the-website">Page Load Speed Has a Significant Impact on The Success of the Website</a></h2>
<p>At least that is what studies and test of this topic say. </p>
<p>Wallmart, for example, has calculated that each 1-second page load acceleration will<a href="http://www.slideshare.net/devonauerswald/walmart-pagespeedslide/46"> increase their conversion rate by two percent</a>. </p>
<p>Other case studies show us that increasing the site’s load speed will positively influence all key indicators - conversion rate, page views, the number of visits or the customer satisfaction. All world stats can be found at <a href="https://wpostats.com/">WPO stats</a>. If you prefer infographics, just <a href="https://hostingfacts.com/slow-website-infographic/">take a look here</a>. </p>
<h2 id="speed-also-affects-listing-of-adwords-ads-and-generic-google-search-results"><a href="#speed-also-affects-listing-of-adwords-ads-and-generic-google-search-results">Speed Also Affects Listing of AdWords Ads and Generic Google Search Results</a></h2>
<p>Don’t forget that the load speed is <a href="https://adwords.googleblog.com/2008/06/landing-page-load-time-now-affects.html">one of the listing parameters of the AdWords campaigns</a>. </p>
<p>Google says that the load speed will <a href="https://webmasters.googleblog.com/2010/04/using-site-speed-in-web-search-ranking.html">affect the search results</a>. And the order of the results is directly affected <a href="https://moz.com/blog/how-website-speed-actually-impacts-search-ranking">by the server loading speed</a>. </p>
<p>Speed is, therefore, affecting not only conversions but the possibility a user will land on your website as well. </p>
<h2 id="mobile-connection-will-never-be-equal-to-the-wired-one"><a href="#mobile-connection-will-never-be-equal-to-the-wired-one">Mobile Connection Will Never Be Equal To The Wired One</a></h2>
<p>Even if the transmission speed is increasing on 3G/4G networks, it will never be the same as your home or office connection. You ask why? The key problem is latency, i.e. the time it takes for the client to connect to the server.</p>
<p>Just take a look at the following table. It is inspired by a book by <a href="http://shop.oreilly.com/product/0636920028048.do">Ilya Grigorik, High Performance Browser Networking</a>:</p>
<table>
<thead>
<tr>
<th>Connection</th>
<th>Mbit/s transfer rate</th>
<th>Latency (ms)</th>
</tr>
</thead>
<tbody>
<tr>
<td>2G/EDGE</td>
<td>0,1 - 0,4</td>
<td>300 - 1000</td>
</tr>
<tr>
<td>3G</td>
<td>0,5 - 5</td>
<td>100 - 500</td>
</tr>
<tr>
<td>4G/LTE</td>
<td>1 - 50</td>
<td>&lt; 100</td>
</tr>
<tr>
<td>Wifi</td>
<td>1 - 50</td>
<td>&lt; 10</td>
</tr>
</tbody>
</table>
<p>The explanation is quite clear - the architecture of the mobile connection network is far more complex than the wired one. The data travel through the air, we use BTS and they can be busy. </p>
<p>The Western world is covered by LTE networks, however, this speed is not accessible for everyone, and will not be for a long time. </p>
<p>The conclusion is that it is wise to look into load speed of your website. It is very likely you will draw more traffic to your website and a fast website will significantly improve key indicators that show your website’s success.</p>
        ]]></content:encoded>
        <pubDate>Mon, 01 Aug 2016 14:49:00</pubDate>
      </item>
      <item>
        <title>Even Better Flexbox Cheatsheet  at CSS Mine</title>
        <link>https://www.css-mine.com/blog/2016-06-27-even-better-flexbox-cheatsheet-at-css-mine</link>
        <guid>https://www.css-mine.com/blog/2016-06-27-even-better-flexbox-cheatsheet-at-css-mine</guid>
        <description>Introducing updated guide to flexbox, now with six richly illustrated chapters. You can read it online for free.


What is Flexbox?
Flexbox: Practical Examples
[Updated] Flex Container Properties
[Updated] Flex Item Properties
Flexbox Browser Support
[New] What Is Good To Know about Flexbox
Interesting Links to Flexbox

Each property is now illustrated with a picture and demos from Codepen.io are attached.
Read it online or buy it as an ebook.</description>
        <content:encoded><![CDATA[
          <p>Introducing updated guide to flexbox, now with six richly illustrated chapters. You can read it online for free.</p>
<p><a href="/ebook/css3-flexbox"></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="/perch/resources/flexbox-priklady-2.jpg" alt="Flexbox Cheatsheet" /></div><!--.content-full--><div class="content"><div class="article"></a></p>
<ul>
<li><a href="/ebook/css3-flexbox">What is Flexbox?</a></li>
<li><a href="/ebook/flexbox-examples">Flexbox: Practical Examples</a></li>
<li>[Updated] <a href="/ebook/flexbox-container">Flex Container Properties</a></li>
<li>[Updated] <a href="/ebook/flexbox-items">Flex Item Properties</a></li>
<li><a href="/ebook/flexbox-support">Flexbox Browser Support</a></li>
<li>[New] <a href="/ebook/flexbox-good-to-know">What Is Good To Know about Flexbox</a></li>
<li><a href="/ebook/flexbox-links">Interesting Links to Flexbox</a></li>
</ul>
<p>Each property is now illustrated with a picture and demos from <a href="http://codepen.io/collection/Dmrzxz/">Codepen.io</a> are attached.</p>
<p><a href="/ebook/css3-flexbox">Read it online</a> or <a href="/ebook">buy it as an ebook</a>.</p>
        ]]></content:encoded>
        <pubDate>Mon, 27 Jun 2016 18:33:00</pubDate>
      </item>
      <item>
        <title>How To Deal With Mobile Navigation And Why Do We Need Hamburgers?</title>
        <link>https://www.css-mine.com/blog/2016-06-21-how-to-deal-with-mobile-navigation-and-why-do-we-need-hamburgers</link>
        <guid>https://www.css-mine.com/blog/2016-06-21-how-to-deal-with-mobile-navigation-and-why-do-we-need-hamburgers</guid>
        <description>We are used to making mobile menus so they do not fit the mobile screen. This is why we are hiding them and providing a switch for them. This is the state of mind of the current web developers. 
However, hiding a navigation is not a good idea. So let’s dig deeper into this topic and investigate the hamburger icon in general. After all, it has been a very popular topic in all online discussions. Is it good or bad?
But first, let me ask you a fundamental question. 
Why Didn’t We Hide The Navigation When There Were Desktop Websites Only?
Because, we are not stupid! We know that the navigation is there to perform the following tasks:

To serve as a map – users should easily understand the website structure and should be able to find what they search for.
To serve as a pointer – users should clearly understand where on the map they actually are. 
To advertise content – it is in the website owner’s interest that users don’t miss anything important.

Now tell me, how does a hidden navigation perform the above-mentioned tasks? You say in no way? Bingo!
If the navigation is concise, the problem is solved. We just don’t hide it on mobiles. But that is wishful thinking. 
There are websites with complex navigations and also devices of various screen sizes. 

How To Think When Designing The Main Navigation?
Design the navigation as simple as possible. When designing the website structure, apply the Mobile First approach. Simply forget about twenty-six items in the main navigation and about the second and third level. This will save your butt when designing the website. 
Design the website as if the navigation was not there. It is absolutely clear that on the smallest devices, we will have to hide a part of the menu. Therefore, we have to start designing websites without it. Just duplicate the navigation scheme in the content and place something like the site map on the homepage.
If you can fit the whole navigation in, show it on mobiles as well. It may sound a little funny, but the world is full of menus with 4 items that hide the menu under a hamburger icon just because it is cool. If the resolution is high enough, just show the menu. 
If you can’t show the whole navigation, consider using different design patterns than the show / hide pattern. I suggest you take a look at The Priority+ Navigation Pattern. 
And if nothing of this works, then choose the show / hide design pattern – the one we call a hamburger, based on the icon shape.   
Keep reading - by choosing the hamburger design pattern, you are very likely to run into a lot of problems. 
The Hamburger Icon Is a Troublemaker, But We Need it
The hamburger icon and hiding the navigation has recently been under fire from critics. I say that on some websites we can’t do without it and web design as a discipline needs it. 
It is well-known that icons take time for people to get to know them. The mankind was not born with the knowledge of what the play, pause and stop icons stand for. 

One of the main reasons we’re able to use these symbols (play, pause and stop) unlabeled is the fact that it worked its way into our cultural repertoire thanks to continued repetition on tape decks and VCRs.
– Andy Budd, In defence of the hamburger menu

The hamburger icon is relatively new and it gets even more complicated when you consider operating systems and their native apps. These apps use various icons for opening the navigation (hamburgers, kebabs, meat balls…). Users simply don’t know what these icons stand for. 
Earlier in the text, I said we need the hamburger icon in web design. Therefore, we have to educate users by using test labels. 
In the age of minimalism and flat design, it is also important to say that an icon should look like a button. 
Does The Hamburger Icon Reveal What It Represents?
Every icon is an abstract simplification of what it triggers. In the case of the hamburger icon, it stands for a list of items. This may correlate with a simple navigation with items stacked onto each other. However, it may also reveal a multilevel menu or a whole secondary content as we can see at the website of the Czech magazine Respekt.  This is just not right. 

If we don’t want to discourage our users, we should use the hamburger menu icon as an abstract simplification of the content it represents. 
In connection with this issue – my Czech fellow Adam Fendrych is saying that it might sometimes be beneficial to replace the “Menu” label with something that describes the content we will find when opened, e.g. “Categories”, “Recipes”, etc. 
What To Do If a Hamburger Icon Must Be Used?
Some websites can display the whole navigation on mobiles, some do not even need it and some use a better navigational pattern - item prioritization. 
Therefore, we are left with websites where hiding the menu, or its part, is simply inevitable - especially when talking about really small screens, e.g. 240 pixels. Well, in that case we will need some icon to do that, won’t we? 
In conclusion, the hamburger icon is a good thing, but the following conditions must be met:

We should not use the icon for showing content it does not represent.
We should label the icon as “Menu”, especially when the target group is not “geekish”.
We should not hide the navigation on screens where at least a part of it can be displayed.
We should make sure the area around the icon looks like a button.
</description>
        <content:encoded><![CDATA[
          <p>We are used to making mobile menus so they do not fit the mobile screen. This is why we are hiding them and providing a switch for them. This is the state of mind of the current web developers. </p>
<p>However, hiding a navigation is not a good idea. So let’s dig deeper into this topic and investigate the hamburger icon in general. After all, it has been a very popular topic in all online discussions. Is it good or bad?</p>
<p>But first, let me ask you a fundamental question. </p>
<h2 id="why-didn-t-we-hide-the-navigation-when-there-were-desktop-websites-only"><a href="#why-didn-t-we-hide-the-navigation-when-there-were-desktop-websites-only">Why Didn’t We Hide The Navigation When There Were Desktop Websites Only?</a></h2>
<p>Because, we are not stupid! We know that the navigation is there to perform the following tasks:</p>
<ol>
<li>To serve as a <em>map</em> – users should easily understand the website structure and should be able to find what they search for.</li>
<li>To serve as a <em>pointer</em> – users should clearly understand where on the map they actually are. </li>
<li>To <em>advertise</em> content – it is in the website owner’s interest that users don’t miss anything important.</li>
</ol>
<p>Now tell me, how does a hidden navigation perform the above-mentioned tasks? You say in no way? Bingo!</p>
<p>If the navigation is concise, the problem is solved. We just don’t hide it on mobiles. But that is wishful thinking. </p>
<p>There are websites with complex navigations and also devices of various screen sizes. </p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="http://cssmine.com/perch/resources/hamburger-bad-good-2.jpg" alt="Hamburger - gut and bad" /></div><!--.content-full--><div class="content"><div class="article"></p>
<h2 id="how-to-think-when-designing-the-main-navigation"><a href="#how-to-think-when-designing-the-main-navigation">How To Think When Designing The Main Navigation?</a></h2>
<p><strong>Design the navigation as simple as possible.</strong> When designing the website structure, apply the Mobile First approach. Simply forget about twenty-six items in the main navigation and about the second and third level. This will save your butt when designing the website. </p>
<p><strong>Design the website as if the navigation was not there.</strong> It is absolutely clear that on the smallest devices, we will have to hide a part of the menu. Therefore, we have to start designing websites without it. Just duplicate the navigation scheme in the content and place something like the site map on the homepage.</p>
<p><strong>If you can fit the whole navigation in, show it on mobiles as well.</strong> It may sound a little funny, but the world is full of menus with 4 items that hide the menu under a hamburger icon just because it is cool. If the resolution is high enough, just show the menu. </p>
<p>If you can’t show the whole navigation, consider using different design patterns than the show / hide pattern. I suggest you take a look at <a href="https://css-tricks.com/the-priority-navigation-pattern/">The Priority+ Navigation Pattern</a>. </p>
<p>And if nothing of this works, then choose the show / hide design pattern – the one we call a <em>hamburger</em>, based on the icon shape.   </p>
<p>Keep reading - by choosing the hamburger design pattern, you are very likely to run into a lot of problems. </p>
<h2 id="the-hamburger-icon-is-a-troublemaker-but-we-need-it"><a href="#the-hamburger-icon-is-a-troublemaker-but-we-need-it">The Hamburger Icon Is a Troublemaker, But We Need it</a></h2>
<p>The hamburger icon and hiding the navigation has recently been <a href="http://jamesarcher.me/the-hamburger-menu/">under fire from critics</a>. I say that on some websites we can’t do without it and web design as a discipline needs it. </p>
<p>It is well-known that icons take time for people to get to know them. The mankind was not born with the knowledge of what the play, pause and stop icons stand for. </p>
<blockquote>
<p>One of the main reasons we’re able to use these symbols (play, pause and stop) unlabeled is the fact that it worked its way into our cultural repertoire thanks to continued repetition on tape decks and VCRs.<br />
– <a href="http://www.andybudd.com/archives/2016/01/in_defence_of_the_hamburger_menu/">Andy Budd, In defence of the hamburger menu</a></p>
</blockquote>
<p>The hamburger icon is relatively new and it gets even more complicated when you consider operating systems and their native apps. These apps use various icons for opening the navigation (hamburgers, kebabs, meat balls…). Users simply don’t know what these icons stand for. </p>
<p>Earlier in the text, I said we need the hamburger icon in web design. Therefore, we have to educate users by using test labels. </p>
<p>In the age of minimalism and flat design, it is also important to say that an icon should look like a button. </p>
<h2 id="does-the-hamburger-icon-reveal-what-it-represents"><a href="#does-the-hamburger-icon-reveal-what-it-represents">Does The Hamburger Icon Reveal What It Represents?</a></h2>
<p>Every icon is an abstract simplification of what it triggers. In the case of the hamburger icon, it stands for a list of items. This may correlate with a simple navigation with items stacked onto each other. However, it may also reveal a multilevel menu or a whole secondary content as we can see at the website of the Czech magazine <a href="http://www.respekt.cz">Respekt</a>.  This is just not right. </p>
<p></div><!--.article--></div><!--.content--><div class="content-full ta-c"><img src="http://cssmine.com/perch/resources/hamburger-globus-respekt.jpg" alt="Hamburger - Globus and Respekt" /></div><!--.content-full--><div class="content"><div class="article"></p>
<p>If we don’t want to discourage our users, we should use the hamburger menu icon as an abstract simplification of the content it represents. </p>
<p>In connection with this issue – my Czech fellow Adam Fendrych <a href="https://twitter.com/adlo/status/720266123774713856">is saying</a> that it might sometimes be beneficial to replace the “Menu” label with something that describes the content we will find when opened, e.g. “Categories”, “Recipes”, etc. </p>
<h2 id="what-to-do-if-a-hamburger-icon-must-be-used"><a href="#what-to-do-if-a-hamburger-icon-must-be-used">What To Do If a Hamburger Icon Must Be Used?</a></h2>
<p>Some websites can display the whole navigation on mobiles, some do not even need it and some use a better navigational pattern - item prioritization. </p>
<p>Therefore, we are left with websites where hiding the menu, or its part, is simply inevitable - especially when talking about really small screens, e.g. 240 pixels. Well, in that case we will need some icon to do that, won’t we? </p>
<p>In conclusion, the hamburger icon is a good thing, but the following conditions must be met:</p>
<ol>
<li>We should not use the icon for showing content it does not represent.</li>
<li>We should label the icon as “Menu”, especially when the target group is not “geekish”.</li>
<li>We should not hide the navigation on screens where at least a part of it can be displayed.</li>
<li>We should make sure the area around the icon looks like a button.</li>
</ol>
        ]]></content:encoded>
        <pubDate>Tue, 21 Jun 2016 19:04:00</pubDate>
      </item>
      <item>
        <title>Bootstrap’s Reboot — Next Evolutionary Step for CSS Reset</title>
        <link>https://www.css-mine.com/blog/2016-06-03-bootstraps-reboot-next-evolutionary-step-for-css-reset</link>
        <guid>https://www.css-mine.com/blog/2016-06-03-bootstraps-reboot-next-evolutionary-step-for-css-reset</guid>
        <description>Bootstrap 4 is coming, among other things, with substitution for Normalize.css. Its own browser defaults unification code, Reboot.
Since the days of Eric A. Meyer’s CSS Reset are long gone, Normalize.css has come with a more sensitive approach — instead of resetting all values, it simply unifies the display of basic styles in browsers. In our code, we just set values we disagree with.
Reboot Follows Normalize.css and Adds Two Concepts I Warmly Welcome
I am pleased, because I am using both concepts in any non-Bootstrap projects:

All typographical measures are in rem units. The interface can then globally zoom in and out from one default font size value.
Only one direction is used for the vertical margin — bottom. Thanks to this, is easier to follow the typographic rhythm in your own code.

→ If you want to study Reboot and Normalize results in detail, I made these two Codepens just for this purpose — Normalize.css and Reboot.
Four Interesting Things in the Reboot Code
1) Border Box Everywhere
Reboot calculates the dimensions of elements including padding and border. Finally, with the declaration for pseudoclasses. (Code)
html {  
  box-sizing: border-box;  
}
*,  
*::before,  
*::after {  
  box-sizing: inherit;  
}
2) Viewport on Windows Phone
You probably know that you must not forget the @-ms-viewport declaration. But what you might not be aware of is the @at-root Sass directive. It enforces rule insertion into the top level and thus outside all nesting. (Code)
@at-root {  
  @-ms-viewport { width: device-width; }  
}
As a result of deploying this rule, IE 11 and Edge are adding strange behavior to scrollbars. Therefore, the workaround for yet another level of struggle with Microsoft looks like this:
body {  
  -ms-overflow-style: scrollbar;  
}
3) Removing 300ms Delay
a,  
area,  
button,  
[role=&quot;button&quot;],  
input,  
label,  
select,  
summary,  
textarea {  
  touch-action: manipulation;  
}
The touch-action property is finally supported by mobile Safari, so you will not need to use the FastClick library in the near future. It is ready in Reboot. (Code)
4) Reset for min-width: min-content
You may not be familiar with one of the new values for the min-width — min-content. It sets the minimum width of the element to inner width which is the width of the longest word or the width of the table or picture. Reboot removes gotchas in some browsers that are created by setting the value for fieldsets.
fieldset {  
  /* Chrome and Firefox setting here  
     min-width: min-content */  
  min-width: 0;  
}
Reboot can not be downloaded and installed separately, but in the Bootstrap 4 documentation, there is some stuff already prepared. Anyway, a copy / paste installation works here.
Originally posted on my Medium.com.</description>
        <content:encoded><![CDATA[
          <p><a href="http://v4-alpha.getbootstrap.com/">Bootstrap 4</a> is coming, among other things, with substitution for Normalize.css. Its own browser defaults unification code, <a href="http://v4-alpha.getbootstrap.com/content/reboot/">Reboot</a>.</p>
<p>Since the days of <a href="https://medium.com/u/c22238b76ed">Eric A. Meyer</a>’s <a href="http://meyerweb.com/eric/tools/css/reset/">CSS Reset</a> are long gone, <a href="https://necolas.github.io/normalize.css/">Normalize.css</a> has come with a more sensitive approach — instead of resetting all values, it simply unifies the display of basic styles in browsers. In our code, we just set values we disagree with.</p>
<h2 id="reboot-follows-normalize-css-and-adds-two-concepts-i-warmly-welcome"><a href="#reboot-follows-normalize-css-and-adds-two-concepts-i-warmly-welcome">Reboot Follows Normalize.css and Adds Two Concepts I Warmly Welcome</a></h2>
<p>I am pleased, because I am using both concepts in any non-Bootstrap projects:</p>
<ol>
<li>All typographical measures are in <a href="http://cssmine.com/css3-units">rem units</a>. The interface can then globally zoom in and out from one default font size value.</li>
<li>Only one direction is used for the vertical margin — bottom. Thanks to this, is easier to follow the typographic rhythm in your own code.</li>
</ol>
<p>→ If you want to study Reboot and Normalize results in detail, I made these two Codepens just for this purpose — <a href="http://s.codepen.io/machal/debug/qZZzPa">Normalize.css</a> and <a href="http://s.codepen.io/machal/debug/KzzjXE">Reboot</a>.</p>
<h2 id="four-interesting-things-in-the-reboot-code"><a href="#four-interesting-things-in-the-reboot-code">Four Interesting Things in the Reboot Code</a></h2>
<h3 id="1-border-box-everywhere"><a href="#1-border-box-everywhere">1) Border Box Everywhere</a></h3>
<p>Reboot calculates the dimensions of elements including padding and border. Finally, with the declaration for pseudoclasses. (<a href="https://github.com/twbs/bootstrap/blob/v4-dev/scss/_reboot.scss#L22-L30">Code</a>)</p>
<pre><code class="language-css">html {  
  box-sizing: border-box;  
}</code></pre>
<pre><code class="language-css">*,  
*::before,  
*::after {  
  box-sizing: inherit;  
}</code></pre>
<h3 id="2-viewport-on-windows-phone"><a href="#2-viewport-on-windows-phone">2) Viewport on Windows Phone</a></h3>
<p>You probably know that you must not forget the @-ms-viewport declaration. But what you might not be aware of is the <a href="http://www.sitepoint.com/sass-reference/at-root/">@at-root</a> Sass directive. It enforces rule insertion into the top level and thus outside all nesting. (<a href="https://github.com/twbs/bootstrap/blob/v4-dev/scss/_reboot.scss#L33">Code</a>)</p>
<pre><code class="language-css">@at-root {  
  @-ms-viewport { width: device-width; }  
}</code></pre>
<p>As a result of deploying this rule, IE 11 and Edge are <a href="http://trochu%20divně%20chovat">adding strange behavior</a> to scrollbars. Therefore, the workaround for yet another level of struggle with Microsoft looks like this:</p>
<pre><code class="language-css">body {  
  -ms-overflow-style: scrollbar;  
}</code></pre>
<h3 id="3-removing-300ms-delay"><a href="#3-removing-300ms-delay">3) Removing 300ms Delay</a></h3>
<pre><code class="language-css">a,  
area,  
button,  
[role="button"],  
input,  
label,  
select,  
summary,  
textarea {  
  touch-action: manipulation;  
}</code></pre>
<p>The <a href="http://caniuse.com/#search=touch-action">touch-action property is finally supported by mobile Safari</a>, so you will not need to use the FastClick library in the near future. It is ready in Reboot. (<a href="https://github.com/twbs/bootstrap/blob/v4-dev/scss/_reboot.scss#L241">Code</a>)</p>
<h3 id="4-reset-for-min-width-min-content"><a href="#4-reset-for-min-width-min-content">4) Reset for min-width: min-content</a></h3>
<p>You may not be familiar with one of the <a href="http://tympanus.net/codrops/css_reference/min-width/">new values for the min-width — min-content</a>. It sets the minimum width of the element to <em>inner</em> width which is the width of the longest word or the width of the table or picture. Reboot removes <a href="https://github.com/twbs/bootstrap/issues/12359">gotchas in some browsers</a> that are created by setting the value for fieldsets.</p>
<pre><code class="language-css">fieldset {  
  /* Chrome and Firefox setting here  
     min-width: min-content */  
  min-width: 0;  
}</code></pre>
<p>Reboot can not be downloaded and installed separately, but in the Bootstrap 4 documentation, there is some stuff already prepared. Anyway, a <a href="https://github.com/twbs/bootstrap/blob/v4-dev/scss/_reboot.scss">copy / paste installation works here</a>.</p>
<p><em>Originally posted on <a href="https://medium.com/css-mine/bootstraps-reboot-next-evolutionary-step-for-css-reset-a30f718521b9">my Medium.com</a>.</em></p>
        ]]></content:encoded>
        <pubDate>Fri, 03 Jun 2016 09:48:00</pubDate>
      </item>
  </channel>
</rss>
