<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jean-Jacques Royneau on Medium]]></title>
        <description><![CDATA[Stories by Jean-Jacques Royneau on Medium]]></description>
        <link>https://medium.com/@jean-jacques.royneau?source=rss-6687f5fc7f5c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OCobXksnQos6xFySaRymlQ.jpeg</url>
            <title>Stories by Jean-Jacques Royneau on Medium</title>
            <link>https://medium.com/@jean-jacques.royneau?source=rss-6687f5fc7f5c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 23:53:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jean-jacques.royneau/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Spring Cleaning for z-indexes]]></title>
            <link>https://medium.com/jobteaser-dev-team/spring-cleaning-for-z-indexes-42beba8e526a?source=rss-6687f5fc7f5c------2</link>
            <guid isPermaLink="false">https://medium.com/p/42beba8e526a</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[z-index]]></category>
            <category><![CDATA[stacking-context]]></category>
            <dc:creator><![CDATA[Jean-Jacques Royneau]]></dc:creator>
            <pubDate>Tue, 05 Nov 2024 10:06:48 GMT</pubDate>
            <atom:updated>2024-11-05T10:06:48.197Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*CxTRU6ST8uiyT51lDFAMfQ.png" /></figure><p>Managing z-index is a classic challenge for front-end developers. As a project grows, display conflicts and bugs related to z-index can quickly turn into serious headaches.</p><p>I recently took some time to clean up the z-indexes in one of our projects.<br>In this article, I’ll share the approach I used for this cleanup (while also laying the foundation for keeping things manageable in the long run).</p><h3><strong>1. Analyzing the existing z-indexes</strong></h3><p>The first step was to perform a thorough audit of all the z-index declarations in the project. This gave me an overview of how many z-indexes we had and what values were being used.</p><p>Here’s what I found:<br>- August 2023: 57 declarations with 8 distinct values.<br>- February 2024: 87 declarations with 19 distinct values.</p><p>This evolution showed me that the use of z-indexes had increased significantly. And there was no reason to believe it would stop.</p><p>With that in mind, my goal became to centralize and standardize these values.</p><h3><strong>2. Centralizing z-indexes with CSS Custom Properties</strong></h3><p>I centralized all the z-index values in a single file using CSS custom properties.</p><p>This allowed me to have an overview of the different layers of elements on the page, helping me get a (slightly) clearer picture of the task ahead.</p><p>If you’d like to get an idea (or maybe scare yourself a bit), here’s what that first file looked like:</p><pre>:root {<br>  - z-index-second-basement: -2;<br>  - z-index-basement: -1;<br><br>  - z-index-ground: 0;<br><br>  - z-index-floor: 1;<br>  - z-index-second-floor: 2;<br>  - z-index-third-floor: 3;<br><br>  - z-index-job-ads-secondary-filters--selects: 10;<br>  - z-index-job-ads-results-sort: 10;<br>  - z-index-job-ads-primary-filters: 20;<br><br>  - z-index-fo-header: 30;<br>  - z-index-above-fo-header: 31;<br>  - z-index-fo-header--dropdowns: 100;<br><br>  - z-index-career-center--login-modal--autocomplete-list: 99;<br><br>  - z-index-bo-drawer-backdrop: 999;<br>  - z-index-bo-drawer: 1000;<br><br>  - z-index-feature-env-switcher: 9999;<br><br>  - z-index-notifications-panel: 10000;<br><br>  - z-index-msw-tools-panel--open-button: 99999;<br>  - z-index-msw-tools-panel: 999999;<br>}</pre><h3><strong>3. Understanding Stacking Contexts</strong></h3><p>While trying to make sense of each of these z-index values, I had to revisit an important CSS concept: stacking contexts.</p><p>Z-indexes are just a tool tied to this concept.</p><p>In my experience, z-indexes can be tricky to master because they interact with stacking contexts in TWO ways<br>- a z-index can <strong>modify</strong> the stacking order (which is fine, that’s its purpose)<br>- a z-index can <strong>create</strong> a new stacking context (and this is where things can go wrong)</p><p>The real challenge isn’t just about the z-index values themselves, but also the <strong>unintentional</strong> creation of stacking contexts. Many z-indexes end up creating stacking contexts that weren’t needed, which complicates the layering of elements.</p><p>For the next phase of my work, I paid special attention to these unintentional stacking context creations.</p><h3><strong>4. Removing, Reducing, and Grouping</strong></h3><p>With a better understanding of stacking contexts, I was able to identify unnecessary or redundant z-index values.</p><p>Quite often, the natural order of elements in the DOM is enough to ensure correct layering without needing a z-index.</p><p>So, I <strong>removed</strong> z-indexes where elements were already stacking correctly based on their HTML order (and in some cases, I even reordered the HTML itself to avoid needing a z-index 😉).</p><p>I also <strong>reduced</strong> the value of some z-indexes when they were higher than necessary.</p><p>This step is crucial because I believe that the lower and more limited z-index values are, the more we can control them over time.</p><p>This reduction also helped me achieve one of my goals: ensuring all z-index values were increments of 1 (I mean: -1, 0, 1, 2, 3…).</p><p><strong>Why increments of 1? Because you need to control your z-indexes.</strong></p><p>No more randomly picking a value (“There was space between 20 and 30, so I went with 27!”).</p><p>Finally, I <strong>grouped</strong> CSS custom properties that had identical values, which allowed me to identify some useful abstractions.</p><h3><strong>5. Defining a Visual Priority Order for Recurring Elements</strong></h3><p>We defined a visual hierarchy for elements that frequently appear on a page: menus, modals, dev tools, and notifications.</p><p>The order we chose is as follows:<br>page content &lt; website menus &lt; modals &lt; dev tools &lt; notifications.</p><p>From the previous work, the highest z-index value that belonged to page content (i.e. not including elements that appear on top) was 3.</p><p>This allowed me to make the priority logic dynamic:</p><pre>:root {<br>  …<br>  --z-index-website-menu: 4;<br><br>  --z-index-modal: calc(var(--z-index-website-menu) + 1);<br><br>  --z-index-dev-tools: calc(var(--z-index-modal) + 1);<br><br>  --z-index-notifications-panel: calc(var(--z-index-dev-tools) + 1);<br>}</pre><p>Now, if the value of --z-index-website-menu ever needs to change (to decrease, of course!), all the following values will update automatically, without developers having to think about it.</p><h3><strong>6. Defining Utility Values</strong></h3><p>At the end of step 4, I had grouped together the CSS custom properties that had identical values. Some of these values turned out to be the recurring elements we discussed earlier.</p><p>Others didn’t correspond to a specific type of element but were often used because they’re <strong>useful</strong> for fine-tuning the stacking order in specific contexts.</p><p>I took these values to define utility custom properties:</p><pre>:root {<br>  --z-down-in-the-current-stacking-context: -1;<br>  <br>  --z-reset-in-the-current-stacking-context: 0;<br><br>  --z-up-in-the-current-stacking-context: 1;<br>  …<br>}</pre><p>These values are used to manage finer adjustments in any current stacking context.</p><h3><strong>7. Discouraging Hardcoded Values</strong></h3><p>To ensure this approach remains sustainable, I added a rule to our CSS linter, Stylelint, which prevents the use of hardcoded z-index values. This rule encourages developers to either use the centralized variables or define new ones when needed.</p><pre>// .stylelintrc<br>&quot;rules&quot;: {<br>  // ...<br>  &quot;scale-unlimited/declaration-strict-value&quot;: &quot;z-index&quot;<br>  // ...<br>}</pre><p>However, be careful: it should be understood as a <strong>guideline</strong> and not a rule. It’s fine to silence the linter and use a hardcoded value. You just have to do it consciously.</p><h3><strong>Final thoughts</strong></h3><p>While all these steps seem to flow nicely in theory, that’s not always the case in real life.<br>In practice, I went back and forth between the different steps multiple times before reaching a satisfactory result. 😉</p><p>By centralizing values, eliminating unnecessary stacking contexts, and reducing the number of different z-index values, I was able to simplify and make z-index management more maintainable. This process lightened the codebase and made the handling of element layering more predictable.</p><p>If this approach seems helpful to you, I encourage you to take inspiration from it and apply it to your own projects. A well-structured z-index management strategy can make a real difference, making maintenance easier and avoiding subtle bugs related to element stacking.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42beba8e526a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jobteaser-dev-team/spring-cleaning-for-z-indexes-42beba8e526a">Spring Cleaning for z-indexes</a> was originally published in <a href="https://medium.com/jobteaser-dev-team">JobTeaser Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deep focus, deep work]]></title>
            <link>https://medium.com/jobteaser-dev-team/deep-focus-deep-work-8cbe85d38f17?source=rss-6687f5fc7f5c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cbe85d38f17</guid>
            <category><![CDATA[time-management]]></category>
            <category><![CDATA[deep-work]]></category>
            <category><![CDATA[deep-focus]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[Jean-Jacques Royneau]]></dc:creator>
            <pubDate>Tue, 15 Nov 2022 10:21:00 GMT</pubDate>
            <atom:updated>2022-11-15T10:21:00.824Z</atom:updated>
            <content:encoded><![CDATA[<p>We, developers, are knowledge workers. As such, we need periods of deep work.</p><p>In this article, I want to focus on this question: how can we create the right conditions for deep work?</p><p>A lot has already been said about it. But teaching is a matter of repetition. So… let’s repeat ;-)</p><h3>What is deep work?</h3><p>“Deep work” was coined by professor Cal Newport, a computer science professor.</p><p>He opposes it to superficial work, which is not cognitively demanding, and is often done while being distracted. Like checking emails every two minutes. This type of work does not create much value.</p><p>Deep work refers to:</p><ul><li><strong>a single task</strong>;</li><li><strong>without distractions</strong>;</li><li><strong>in a state of intense concentration</strong>;</li><li><strong>for long periods of time</strong>.</li></ul><p>Let’s develop these points, not necessarily in order.</p><h3>Give yourself time</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OzCuyNC25q7K-kJto6AlpQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@aronvisuals?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Aron Visuals</a> on <a href="https://unsplash.com/s/photos/time?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Not everyone has the same pace or ability to stay focused for long periods of time.</p><p>One thing is sure though: a work session should last long enough for you to focus. You should be able to continue to work uninterrupted long enough to take advantage of that focus.</p><p>So set (block in your agenda!) an appropriate time for that work session. Try an hour and a half or two hours to start. As you go along, you will see if it’s enough time or not. You can then adjust it.</p><p>This may require blocking off slots in your schedule by turning down appointments during that time.</p><p>You can’t reach a state of deep focus by switching tasks every 30 minutes.</p><p>You can reach an optimal level of concentration if you <strong>overcome resistance and focus on a specific task for a long period of time</strong>.</p><p>Did I say “a specific task”? Perfect transition.</p><h3>What are you focusing on today? Scattering your efforts is your enemy</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LLkT51zInjQ8NvdSMHO_XQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@polarmermaid?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Anne Nygård</a> on <a href="https://unsplash.com/s/photos/focusing?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>It’s better to know where you want to go, if you want to get there.</p><p>Studies have proven that multitasking (or more specifically, alternating tasks) makes people less productive.</p><p>It’s best not to spread yourself too thin during your work sessions.</p><p>Before you start your work session, decide which specific task you’re going to focus on.</p><p>For example: getting a POC up and running locally. Or finish developing the feature and creating the associated PR.</p><p>Force yourself to stay focused on this single task until it’s done, instead of procrastinating by switching to another task that has nothing to do with it. Be careful, there are always going to be distractions.</p><h3>Stay focused: distractions are your enemy too</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jTFJvvEljcWHAeKbnlBueg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@tirzavandijk?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Tirza van Dijk</a> on <a href="https://unsplash.com/s/photos/multitasking?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>We are often reminded that interruptions are a problem. However, this term may suggest interruptions are caused by external sources.</p><p>The word “distraction” has the advantage of reminding you of your responsibility: if you interrupt your work to check slack, that’s your choice.</p><p>If you want to start a work session with peace of mind, remove as many distractions as possible.</p><p>Think about visual distractions, both on your screen (useless tabs…) and in your room (if you work from home, avoid having a post-it note with the shopping list right in front of you).</p><p>And turn off notifications.<br>On your computer.<br>And on your phone.</p><h3>Be focused</h3><p>Actually, there’s nothing more to say on this subject.</p><p>If you go into a work session prepared to avoid distractions, with a clear task in mind and enough time to complete it, you should naturally get into a state of deep focus as you work.</p><h3>One last thing: when you take a break, take a break</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-x08ovYYxlnkbzHQt3xnqg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@areksan?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Arek Adeoye</a> on <a href="https://unsplash.com/s/photos/walk?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>You need downtime, whether it’s between work sessions or between work days.</p><p>Downtime helps you understand.</p><p>Downtime helps to recharge your mind for deep work.</p><p>Letting your brain rest regularly improves the quality of your deep work.</p><p>What’s the difference between a good break and a bad break?</p><p>A true break is a period where you don’t do superficial work or continue to use your directed attention.</p><p><strong>A good break means letting your mind wander and daydream</strong>. It also means letting your thoughts and feelings drift.</p><p>A bad break would be: reading a text, going on social media, talking about work with colleagues, reading your emails, checking your messages.</p><p>These “breaks” don’t allow you to recover fully because they don’t allow your mind to wander.</p><p>A good break to replenish your resources would be:</p><ul><li>looking out the window;</li><li>listening to music;</li><li>changing environment;</li><li>going for a walk;</li><li>playing a game with your children.</li></ul><h3>That’s all for today</h3><p>I hope I taught you some good practices for your work sessions.</p><p>Which ones do you already follow? Can you work for long periods of time and concentrate completely on a single task, without any distractions?</p><p>Share your experience and methods with us.</p><h3>Sources</h3><p>Newport, Cal, Deep Work — Rules for Focused Success in a Distracted World, Grand Central Publishing, Hachette Book Group, 2016</p><p>Cuny, Caroline, “Comment booster sa concentration au travail ?”, Grenoble Ecole de Management, September 2017, <a href="https://www.grenoble-em.com/actualite-comment-booster-sa-concentration-au-travail">https://www.grenoble-em.com/actualite-comment-booster-sa-concentration-au-travail</a> (accessed 12 September 2022).</p><p>SMITH, D., “Multitasking undermines our efficiency, study suggests”, American Psychological Association, October 2001, <a href="https://www.apa.org/monitor/oct01/multitask">https://www.apa.org/monitor/oct01/multitask</a> (accessed 12 September 2022).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cbe85d38f17" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jobteaser-dev-team/deep-focus-deep-work-8cbe85d38f17">Deep focus, deep work</a> was originally published in <a href="https://medium.com/jobteaser-dev-team">JobTeaser Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>