<?xml version="1.0" encoding="utf-8"?>
<!-- generator="Kirby" -->
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">

  <channel>
    <title>Mot-cl&#233;: frontend &#183; Blog &#183; Liip</title>
    <link>https://www.liip.ch/fr/blog/tags/frontend</link>
    <generator>Kirby</generator>
    <lastBuildDate>Thu, 08 Feb 2018 00:00:00 +0100</lastBuildDate>
    <atom:link href="https://www.liip.ch" rel="self" type="application/rss+xml" />

        <description>Articles du blog Liip avec le mot-cl&#233; &#8220;frontend&#8221;</description>
    
        <language>fr</language>
    
        <item>
      <title>Innovative web presence of Steps</title>
      <link>https://www.liip.ch/fr/blog/steps-web-relaunch</link>
      <guid>https://www.liip.ch/fr/blog/steps-web-relaunch</guid>
      <pubDate>Thu, 08 Feb 2018 00:00:00 +0100</pubDate>
      <description><![CDATA[<p><strong>Anniversary year</strong><br />
The dance festival Steps celebrates its 30th birthday in 2018. Every two year, the platform for contemporary dance presents approximately a dozen dance companies throughout Switzerland.</p>
<p><strong>Innovative design</strong><br />
The birthday present to Steps was an innovative, reduced design of the website www.steps.ch. The appearance is now completely responsive and therefore usable on mobile phones, tablets as well as at home on the desktop.</p>
<p><strong>Challenging implementation</strong><br />
The implementation of the new design was particularly challenging in the development, as the new appearance consists of several micro animations. This also applies to the current date change in the schedule.</p>
<p><strong>New CMS</strong><br />
The basis of the website was also renewed in the project: Steps now runs on the Sitecore Content Management System.</p>
<p><strong>Cross-agency cooperation</strong><br />
The new Steps appearance was created in close cooperation with Migros in Lead, Y7K as design agency, Namics for the technical implementation in CMS and Liip for the front-end implementation.</p>]]></description>
                  <enclosure url="http://liip.rokka.io/www_card_2/96355a/blog-steps.jpg" length="532950" type="image/jpeg" />
          </item>
        <item>
      <title>5 things you should know about responsive images</title>
      <link>https://www.liip.ch/fr/blog/things-you-should-know-about-responsive-images</link>
      <guid>https://www.liip.ch/fr/blog/things-you-should-know-about-responsive-images</guid>
      <pubDate>Thu, 25 Jan 2018 00:00:00 +0100</pubDate>
      <description><![CDATA[<p>Over the last few years I had to optimize images with <code>srcset</code> on different websites, several times.</p>
<p>After each optimization I thought that I understood how the <code>srcset</code> and <code>sizes</code> attributes of the <code>&lt;img&gt;</code> tag works. But each time, I made some new findings about how these attributes really work and where I need to take care while implementing them. Since there are lots of things you should know before using <code>srcset</code> I thought it could be useful to summarize the most tricky parts in a blog post.</p>
<h2>A short introduction</h2>
<p>I think most of you already heard of responsive images and especially the <code>srcset</code> attribute. But to be on the same page I still would like to start with a short introduction about these two attributes:</p>
<h3>srcset</h3>
<p>The <code>srcset</code> attribute is listing different resolutions of the same image from which the browser chooses the best fitting image source before loading it.</p>
<p>Example: <code>srcset="ninja-1000w.jpg 1000w, ninja-500w.jpg 500w, ..."</code></p>
<p>To calculate this, the browser assumes the image fills up the full viewport width (<code>100vw</code>) by default, which means it uses the full width of the browser.</p>
<h3>sizes</h3>
<p>To tell the browser how much space the image really needs on our viewport, we can use the <code>sizes</code> attribute. This attribute contains a comma separated list of one or more image widths for different viewport sizes.</p>
<p>Each entry is a combination of a <code>media condition</code> and a <code>width</code>. Both of these values are described in <a href="https://webplatform.github.io/docs/tutorials/understanding-css-units/">CSS pixels</a> so we don't need to care about device pixel ratio for this. If the media condition is omitted it evaluates to true automatically (= fallback). The sizes attribute gets read from left to right. As soon as a media condition evaluates to true the width of this entry is used. So be sure to order your values correctly!</p>
<p>Example: <code>sizes="(min-width: 1000px) 50vw, 100vw"</code></p>
<p>The example above tells the browser that if the viewport is at least <code>1000px</code> wide the image fills 50% of the space. If the browser is smaller, the image uses 100% of the available width.</p>
<p>If we combine the above two examples in an <code>&lt;img&gt;</code> tag and request it with a (1x/non-retina) browser the result would be the following:</p>
<ul>
<li>Browser width: <code>500px</code> -&gt; Matching sizes width: <code>100vw</code> -&gt; Needed image size: <code>500w</code> -&gt; Chosen image: <code>ninja-500w.jpg</code>.</li>
<li>Browser width: <code>900px</code> -&gt; Matching sizes width: <code>100vw</code> -&gt; Needed image size: <code>900w</code> -&gt; Chosen image: <code>ninja-1000w.jpg</code>.</li>
<li>Browser width: <code>1000px</code> -&gt; Matching sizes width: <code>50vw</code> -&gt; Needed image size: <code>500w</code> -&gt; Chosen image: <code>ninja-500w.jpg</code>.</li>
</ul>
<h2>Sizes affect how the image is shown</h2>
<p>The first thing which is important to know about the <code>sizes</code> attribute is that it isn't only used to calculate the needed size, it is used as the rendered width of the image if the <code>width</code> is not defined in CSS too.</p>
<p>This means as soon as you add the <code>srcset</code> attribute to the <code>&lt;img&gt;</code> element the image might be displayed differently.</p>
<p>The reason for that is when you add the <code>srcset</code> attribute and omit the <code>sizes</code> attribute, the browser uses the default value for it, which is <code>100vw</code>.</p>
<p>Here's an example (<a href="https://codepen.io/tschortsch/pen/LeMmyO">https://codepen.io/tschortsch/pen/LeMmyO</a>):</p>
<iframe height="370" scrolling="no" title="srcset Example #1" src="//codepen.io/tschortsch/embed/LeMmyO/?height=370&amp;theme-id=0&amp;default-tab=result&amp;embed-version=2" frameborder="no" allowtransparency="true" allowfullscreen="true" style="width: 100%;">See the Pen <a href="https://codepen.io/tschortsch/pen/LeMmyO/">srcset Example #1</a> by Jürg Hunziker (<a href="https://codepen.io/tschortsch">@tschortsch</a>) on <a href="https://codepen.io">CodePen</a>.
</iframe>
<p>As you can see, the browser stretches the image always to the matching size in the sizes attribute, as long as the <code>width</code> is not defined in CSS.</p>
<p>This leads us to <strong>Rule #1: Always set the <code>sizes</code> attribute if you use <code>srcset</code>. If <code>sizes</code> is omitted it defaults to <code>100vw</code>.</strong></p>
<h2>How the browser selects the needed image size</h2>
<p>Short answer: <strong>We can't tell</strong>.</p>
<p>Long answer: Every browser has a slightly different implementation which can change with every version of the browser. This leads to <strong>Rule #2: Never assume which image size the browser will choose</strong>.</p>
<p>The browser just chooses the best matching image for the current size. But if the browser finds a cached version of an image from the current <code>srcset</code> which is bigger than the needed size it prioritizes the image from the cache for example.</p>
<p>This makes it really hard to debug a <code>srcset</code>. To avoid the loading of cached files you should always debug <code>srcset</code>s in your browsers privacy mode.</p>
<p>As a result of this, it is possible that you have two exact same devices (same screen and browser size) but you get a different image size in both browsers.</p>
<p>Another really important takeaway from this brings us to <strong>Rule #3: A <code>srcset</code> should only contain images of the same ratio</strong>.</p>
<p>Since you can't really decide which image is loaded in which browser size you can't use <code>srcset</code> to serve different images on different sizes a.k.a. art direction (eg. 1:1 image on smaller devices, 2:1 image on larger devices). If you would like to do this you should use the <code>&lt;picture&gt;</code> element.</p>
<h2>Pitfalls of the width ('w') descriptor</h2>
<p>The width (<code>w</code>) descriptor of the <code>srcset</code> attribute has also some things which should be taken care of. First of all <strong>Rule #4: The width (<code>w</code>) descriptor should always match the images natural width</strong>. This means if the image has a width of 500px the width (<code>w</code>) descriptor should be exactly <code>500w</code>. This sounds pretty easy to achieve but there are use cases where this isn't as easy.</p>
<p>Think of the following example: You load your images through a CDN, where you predefine all the sizes that should exist of an uploaded image. In the template you define a <code>srcset</code> with all of those predefined sizes. If you do not enable upscaling (on CDN side) and upload an image which is smaller than the biggest defined size, you will get an image which doesn't fit the width (<code>w</code>) descriptor in your template.</p>
<p>If this is the case you can get unexpected results. Let's look at this example (<a href="https://codepen.io/tschortsch/pen/rpoXvW">https://codepen.io/tschortsch/pen/rpoXvW</a> / The problem in the example only occurs with screens that have a DPR &gt;= 2):</p>
<iframe height="370" scrolling="no" title="srcset Example #2" src="//codepen.io/tschortsch/embed/rpoXvW/?height=265&amp;theme-id=0&amp;default-tab=result&amp;embed-version=2" frameborder="no" allowtransparency="true" allowfullscreen="true" style="width: 100%;">See the Pen <a href="https://codepen.io/tschortsch/pen/rpoXvW/">srcset Example #2</a> by Jürg Hunziker (<a href="https://codepen.io/tschortsch">@tschortsch</a>) on <a href="https://codepen.io">CodePen</a>.
</iframe>
<p>If you don't have a display that has a DPR &gt;= 2 here's a screenshot of what would happen if you had:</p>
<figure><img src="https://liip.rokka.io/www_inarticle/edff4e/srcset-example-2-result.jpg" alt=""><figcaption>srcset with wrong size descriptor</figcaption></figure>
<p>What is showed in the example above? As long as we don't define a CSS width, the image (which is originally 400px wide) doesn't fill up a container which is only 300px wide.</p>
<p>Let me explain what's happening here: We have an image container which is 300px wide. The image has a <code>srcset</code> with two possible image sizes: 300w, 600w. The <code>300w</code> image has a natural width of <code>300px</code> (correct). But since the original image has a width of <code>400px</code> the <code>600w</code> doesn't return an image which is <code>600px</code> wide but the original <code>400px</code> image (wrong).</p>
<p>If this container gets loaded with a DPR &gt;= 2 the browser requests the <code>600w</code> image (2 * 300px). Since the browser doesn't know that the image behind this descriptor is smaller than <code>600px</code> it displays it as it would be that size. This means it gets squeezed to half of its size (400px / 2 = 200px). And that's why we end up with this strange situation that the image (which is originally 400px wide) doesn't fill the whole 300px image container.</p>
<p>When we enforce the image width in CSS, like we do in the 2nd example, the (400px) image gets stretched again to fill the 300px container and everything looks like expected.</p>
<p>And here we are with the <strong>Rule #5: Always enforce the image size in CSS when using <code>srcset</code></strong>.</p>
<h2>Wrap up</h2>
<p>As you see responsive images have some parts, you should know when implementing them. Let's quickly go through our rules again:</p>
<ul>
<li><strong>Rule #1: Always set the <code>sizes</code> attribute if you use <code>srcset</code>. If <code>sizes</code> is omitted it defaults to <code>100vw</code>.</strong> Since the <code>sizes</code> attribute has an influence on how the image is displayed, it should never be omitted. If you do so, the browser uses the default value of <code>100vw</code>.</li>
<li><strong>Rule #2: Never assume which image size the browser will choose</strong>. The reason for this is, that all browsers have slightly different implementation on how the correct image from a <code>srcset</code> is chosen. This implementation should be a black box for us, because it can change with every update.</li>
<li><strong>Rule #3: A <code>srcset</code> should only contain images of the same ratio</strong>. As a result of rule #2 we never know which image is loaded by the browser. To get the same result for all visitors every image in the <code>srcset</code> needs the same ratio.</li>
<li><strong>Rule #4: The width (<code>w</code>) descriptor should always match the images real width</strong>. The browser uses the width (<code>w</code>) descriptor to calculate how it should display the image. If it doesn't match the real width, we can get unexpected behaviour.</li>
<li><strong>Rule #5: Always enforce the image size in CSS when using <code>srcset</code></strong>. Since there are some use cases where rule #4 can't be achieved, we should always enforce the width of an image in CSS.</li>
</ul>
<h2>Further resources</h2>
<p>There are some really good resources to learn more about responsive images:</p>
<ul>
<li>Responsive images on Mozilla Developer Network: <a href="https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images">https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images</a></li>
<li>Responsive images on CSS-Tricks: <a href="https://css-tricks.com/responsive-images-youre-just-changing-resolutions-use-srcset/">https://css-tricks.com/responsive-images-youre-just-changing-resolutions-use-srcset/</a></li>
<li>Very nicely done introduction about <code>srcset</code> and <code>sizes</code>: <a href="http://ericportis.com/posts/2014/srcset-sizes/">http://ericportis.com/posts/2014/srcset-sizes/</a></li>
<li><code>&lt;img&gt;</code> Element documentation: <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img</a></li>
</ul>]]></description>
                  <enclosure url="http://liip.rokka.io/www_card_2/f1f97c/tablet-8-digital.jpg" length="1704799" type="image/jpeg" />
          </item>
        <item>
      <title>Liip launches a comprehensive career portal with the Migros Group</title>
      <link>https://www.liip.ch/fr/blog/liip-launches-a-comprehensive-career-portal-with-the-migros-group</link>
      <guid>https://www.liip.ch/fr/blog/liip-launches-a-comprehensive-career-portal-with-the-migros-group</guid>
      <pubDate>Wed, 15 Nov 2017 00:00:00 +0100</pubDate>
      <description><![CDATA[<p>Starting today, the Migros Group has a central point of contact for career matters. The new career portal, Migros Group Arbeitswelt (<em><a href="https://www.migros-gruppe.jobs">www.migros-gruppe.jobs</a></em>), presents all relevant information on the work environment of Switzerland's largest employer and its associated companies to users in a clear and structured manner. In addition to information on business activities, working conditions and numerous portraits of employees, the platform focuses on a comprehensive job exchange. The aim of the new offer is to make it easier for interested candidates to search for jobs and to find suitable job advertisements from the wide range of offers. Liip supports the Migros Group in its long-term strategy of positioning itself as an attractive and versatile employer.</p>
<p>Liip has supported the Migros Group on the basis of a preliminary study, first wireframes and the CI/CD to design the new online career portal, to design it interactively and visually as well as to implement it technically. &quot;One of the biggest challenges in the project was to map the complex group structure of Migros in a way that was easy for the user to understand,&quot; says Product Owner Martin Meier at Liip. The solution to this problem was, among other things, user testing of an early wireframe prototype and a consistent focus on the user on both the visitor and editorial side. Although the &quot;Migros Gruppe Arbeitswelt&quot; hosted more than 60 cooperatives and companies at the launch and the content was created by a correspondingly large number of teams, a very high degree of visual and structural consistency can be ensured through the site. This is made possible by a flat information architecture and numerous content modules that automatically adapt to the respective context. This gives cooperatives and companies sufficient flexibility and scope to optimize their new career site.</p>
<p>The new online platform was implemented together with the Migros Group deliberately following an agile approach. The continuous optimization during the course of the project enabled us to develop a high quality product, which already comes with extensive functions in the first release. The focus is on the search function for 600 jobs per month and the 1500 additional apprenticeships advertised each year, which is extremely efficient and flexible due to the modern Vue.js frontend architecture. For content management, the open source system Drupal 8 was chosen. In summary, Micol Rezzonico, Head of the Competence Center Employer Branding, says: &quot;Together with Liip, we have succeeded in building a clear and stable platform that can be developed further on a modular basis and gives the Migros Group the opportunity to make its extraordinary diversity and the many qualities in the field of career accessable&quot;.</p>
<p><strong>Responsible at the Migros Cooperative Association:</strong> Micol Rezzonico (Head of Competence Center Employer Branding), Christopher Schmidt (Project Manager), Pascal Schwager (Product Owner), Sabina Del Grosso (Content Strategy), Ivan Ganarin (Information Architect); <strong>Responsible at Liip:</strong> Martin Meier (Product Owner, Consultant), Jan Hug (UX Designer, Developer), Jonathan Minder (Developer), Krisztian Kovacs (Developer), Christian Wüthrich (Developer), Christian Stocker (Developer), Fabian Ryf (SEO/Analytics), Daniel Frey (Scrum Master), Tonio Zemp (Consultant).</p>
<p><strong>Link to the Migros Gruppe Arbeitswelt: </strong> <em><a href="https://www.migros-gruppe.jobs">www.migros-gruppe.jobs</a></em></p>]]></description>
                  <enclosure url="http://liip.rokka.io/www_card_2/07c7f82661695503796da9eb027a3530bbbe0973/startseite-migros-gruppe-arbeitswelt.jpg" length="399838" type="image/jpeg" />
          </item>
        <item>
      <title>My Fronteers 2010 experience</title>
      <link>https://www.liip.ch/fr/blog/my-fronteers-2010-experience</link>
      <guid>https://www.liip.ch/fr/blog/my-fronteers-2010-experience</guid>
      <pubDate>Wed, 27 Oct 2010 00:00:00 +0200</pubDate>
      <description><![CDATA[<p>Every liiper gets a time and money budget to learn new stuff. The past four years I attended the <a href="http://www.paris-web.fr/">Paris Web conference</a> and came back every year with fresh ideas. But this year I decided it was time for a change. That's how I ended up attending this year's <a href="http://fronteers.nl/congres/2010">Fronteers conference</a> in Amsterdam.</p>
<p>Now that all the <a href="http://vimeo.com/channels/fronteers10">videos of the Fronteers talks are online</a>, I wanted to shared with you what I came back with, so that you also go benefit from this resource.</p>
<h1>The Venue</h1>
<p>I have been to some conferences, but this venue just rocked them all. We were hosted in the <a href="http://en.wikipedia.org/wiki/Tuschinski">Pathé Tuschinski movie theater in the middle of Amsterdam</a>. The <a href="http://www.flickr.com/photos/lejoe/sets/72157624989374041/detail/">pictures I took of this place</a> describe how perfect this place was, much better than I could explain it with words:</p>
<figure><a href="http://www.flickr.com/photos/lejoe/sets/72157624989374041/detail/"><img src="https://liip.rokka.io/www_inarticle/e92b38bb7cc4a74a75b7a6e9022f2cb7f4b0dbbb/tuschinski.jpg" alt="pathe tuschinski in Amsterdam"></a></figure>
<h1>The Lineup</h1>
<p><a href="http://fronteers.nl/congres/2010/speakers">The lineup of speakers</a> was pretty impressive. Paul Irish, Jeremy Keith, Nicholas Zakas, Robert Nyman, Christian Heilmann, Stoyan Stefanov to name some of them. A whole bunch of wise guys. It was a blessing to listen to what they had to share.</p>
<h1>The topics</h1>
<p><strong>CSS3</strong> , <strong>javascript</strong> and of course everything around <strong>HTML5</strong> were the trending topics. Lately, I somehow got an overdose of hearing about HTML5 everywhere again. But those speakers all presented their stuff with their own perspective and that made it really pleasant and inspiring to follow.</p>
<p><a href="http://adactio.com">Jeremy Keith</a>, for example, took us through <a href="http://vimeo.com/15755349"><strong>the design principles on which HTML5 is built</strong></a>. I am still fascinated on the vision behind this standard. I truly believe such principles are what made the current standard a success and what will ensure its future.</p>
<p><a href="http://people.opera.com/howcome/">Håkon Wium Lie</a>, CTO of opera and long time member of the CSS working group went with us through <strong> <a href="http://vimeo.com/15775937">the new features of CSS3</a></strong> . He shared some pictures and anecdotes of the times he spent with Tim Berners Lee in the CERN, about 20 years ago, to illustrate what was inspiring them while creating the concept of CSS.</p>
<p><a href="http://owltastic.com/">Meagan Fisher</a> and <a href="http://sushiandrobots.com/">Jina Bolton</a> gave us their web designer perspective. Meagan showed us <strong> <a href="http://vimeo.com/15991551">how she uses the new CSS3 properties</a></strong> to give even a better look to her designs on browsers that support them. Jina told us about <a href="http://vimeo.com/15982903"><strong>the workflow she goes through while writing CSS</strong></a>.</p>
<p>I'm not a designer, but I envy their talent and creativity. A journey in a mind of such designers was a real gift to me.</p>
<p>I think you got the point and I won't comment <a href="http://fronteers.nl/congres/2010/sessions">every talk</a> as you can find them <a href="http://vimeo.com/channels/fronteers10">online</a>. Let me just recommend three of them to start with.</p>
<h1>The 3 talks you should see</h1>
<h2>“ <a href="http://vimeo.com/15981041">Progressive Downloads and Rendering</a>” by <a href="http://www.phpied.com/">Stoyan Stefanov</a></h2>
<p>If you care at lot about performance for high traffic websites this is the talk to watch. Probably the talk where I learnt the most.</p>
<h2>“ <a href="http://vimeo.com/15984466">Reusable Code, for good or for awesome!</a>” by <a href="http://www.jakearchibald.com">Jake Archibald</a></h2>
<p>Jake talked about how to design an API and making sure it's reusable. He mostly uses javascript as example, but the principles he presents (and which I cherish too) are relevant to any coding environment. The bonus of this talk is how entertaining that guy is.</p>
<h2>“ <a href="http://vimeo.com/16249024">Reasons to be cheerful</a>” by <a href="http://wait-till-i.com/">Chris Heilmann</a></h2>
<p>This is <strong>THE</strong> talk I would recommend to everyone working for the web. For about an hour he tells us why we have one of the most awesome jobs in the world. I enjoyed sitting there and contemplating his speaker talent delivering all the reasons why I do this job.</p>]]></description>
          </item>
    
  </channel>
</rss>
