<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Benjamin Walsh</title>
    <description>The latest articles on DEV Community by Benjamin Walsh (@benjwalsh).</description>
    <link>https://dev.to/benjwalsh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F216698%2Fb3157146-dd07-4004-893a-aa838fdca4c9.png</url>
      <title>DEV Community: Benjamin Walsh</title>
      <link>https://dev.to/benjwalsh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/benjwalsh"/>
    <language>en</language>
    <item>
      <title>11 Lessons Learned From Losing A Job</title>
      <dc:creator>Benjamin Walsh</dc:creator>
      <pubDate>Wed, 09 Sep 2020 00:00:00 +0000</pubDate>
      <link>https://dev.to/benjwalsh/11-lessons-learned-from-losing-a-job-2gh8</link>
      <guid>https://dev.to/benjwalsh/11-lessons-learned-from-losing-a-job-2gh8</guid>
      <description>&lt;p&gt;So in November 2019 I lost my job. Without warning or reason. And it hit me like a tonne of bricks. 🧱&lt;/p&gt;

&lt;p&gt;I'd delivered everything expected of me, built a great team, and increased conversion rates for the business. In 1:1s with my manager I was always showered with praise. &lt;/p&gt;

&lt;p&gt;I thought I was safe, even my manager thought I was safe. We were wrong and I was out on my ass.&lt;/p&gt;

&lt;p&gt;I spent the best part of three months before I landed my next role, and here are the lessons I learned and some tips that might help you out too.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Start looking right away
&lt;/h2&gt;

&lt;p&gt;I made the mistake of taking a month to relax before I started my job search. Under contract I couldn't take another job until a month after my period of garden leave, or the company could refuse to pay me.&lt;/p&gt;

&lt;p&gt;I chose to spend that time feeling sorry for myself, and I lost a lot of sleep through anxiety. Four weeks in and the novelty of being off work was wearing off.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Keep a record of your applications
&lt;/h2&gt;

&lt;p&gt;As time goes on in your job hunt, it's so easy to lose track of who you've spoken to and which roles you've applied for.&lt;/p&gt;

&lt;p&gt;This is probably going to come up, recruiters are going to ask you if you have any applications with companies they might already be working with.&lt;/p&gt;

&lt;p&gt;What I do is track my applications Google Sheets. I include information like salary, location, status, date, link to the job spec, and the recruiters information.&lt;/p&gt;

&lt;p&gt;Here's a copy of my spreadsheet to help save you a little time. &lt;a href="https://docs.google.com/spreadsheets/d/1rmPoqFW0ROj4LmHlIKuUkOBtfN44SVq3bVdXhDdCGXA/edit?usp=sharing"&gt;View Spreadsheet&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Some jobs don't exist
&lt;/h2&gt;

&lt;p&gt;I used LinkedIn, Reed and Indeed for most of my job searching. And between them there's a lot of duplication. Keeping track of the job descriptions helps prevent applying for the same role twice.&lt;/p&gt;

&lt;p&gt;Though what I didn't realise is often I would see roles that didn't exist. Roles priced above market rate and in very specific areas of Salford seemed too good to be true!&lt;/p&gt;

&lt;p&gt;They were.&lt;/p&gt;

&lt;p&gt;When contacting the agency responsible for posting, I never got a callback. The jobs are duplicated, by different agents all working for the same company. I can only imagine that it's some of of technique to boost their listing numbers? 🤷‍♂️&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Apply for your dream job
&lt;/h2&gt;

&lt;p&gt;You've got nothing to lose by doing that. I found that many of the applications I completed for bigger companies asked probing questions. Those were great for helpings me answer other applications much more easily. See point 5.&lt;/p&gt;

&lt;p&gt;Reach out to people you already follow on Twitter or LinkedIn. Sell yourself, use the template in point 7 as a guide to help if you need to. Tell them what value you can bring to their company.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Document your application questions and answers
&lt;/h2&gt;

&lt;p&gt;After you submit an application, you don't tend to get a copy of what you submitted. If you get to the next stage interview it's almost certain that you'll get asked about your application answers.&lt;/p&gt;

&lt;p&gt;Having a copy of exactly what you wrote will be invaluable. And you may even need to answer similar questions on other applications, so work smart not hard. 🤓&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Have a cover letter prepared
&lt;/h2&gt;

&lt;p&gt;Cover letters seem like a complete burden. Especially when you're regurgitating the same information that's available on your CV.&lt;/p&gt;

&lt;p&gt;But the thing is, they often work. Recruiters and hiring managers don't often have time to read every CV front to back. By spelling out why we're a great candidate for a role, you're chance of being considered is higher.&lt;/p&gt;

&lt;p&gt;Bonus points for using plain language, and getting your personality across.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Have a summary ready for recruiters
&lt;/h2&gt;

&lt;p&gt;What I found worked well for getting recruiters to notice me was making their job easy.&lt;/p&gt;

&lt;p&gt;By summarising the information relevant to a position, I was giving them every incentive possible to contact me.&lt;/p&gt;

&lt;p&gt;For a role as Senior Engineering Manager at an ecommerce company I emailed the recruiter the following.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hi [Recruiter],

I'm interested in the position as Senior Engineering Manager you posted on LinkedIn.

Summary of my experience:

- 14 years working with JavaScript, Vue, and Angular.
- 8 years managing and mentoring teams of developers and designers.
- 10 years of my career spent in ecommerce.
- I specialise in web performance and accessibility.
- Also been a designer for a very long time.

Summary of me:
- I built the new app form in Vue that increased conversion rates by 20%.
- I was made redundant in November and I'm available immediately.
- My favourite part of my job is mentoring people, especially developers.

I'm currently interviewing for other roles with:
- Company 2
- Company 3
- Company 4

If my experience sounds like it could be a good fit for the role, please get in touch.

I've attached my CV and my website benjaminwalsh.co.uk has examples of my work too.

Thanks
Ben
[Mobile Number Here]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  8. Some recruiters are awful
&lt;/h2&gt;

&lt;p&gt;While most of my conversations with recruiters were very positive, there was one common trait that frustrated me the most.&lt;/p&gt;

&lt;p&gt;Ghosting 👻&lt;/p&gt;

&lt;p&gt;It seems that the moment a recruiter knows you're no longer on the short-list for a role, they forget you exist.&lt;/p&gt;

&lt;p&gt;9 out of 10 times I'd get rejected without even knowing about it. Having chased the recruiter about the role, I'd get radio silence.&lt;/p&gt;

&lt;p&gt;Not cool.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Prepare for coding challenges
&lt;/h2&gt;

&lt;p&gt;In my experience live coding challenges aren't a realistic way to assess a developer. They don't show you how an engineer will actually work on the tasks you give them on the job. What they're like as a person, and exclude many who don't do well with anxiety inducing conditions. 🙋‍♂️&lt;/p&gt;

&lt;p&gt;Many of the roles I applied for did this anyway. Because even though it's not perfect, it does give the hiring manager some kind of benchmark of technical skill.&lt;/p&gt;

&lt;p&gt;So get prepared, there's a lot of resources available on preparing for these online, far too many to mention here.&lt;/p&gt;

&lt;p&gt;One of the better experiences I had was at MoneySuperMarket. They gave me a task and a laptop, then allowed me to work how I felt most comfortable to complete their challenge.&lt;/p&gt;

&lt;p&gt;So I was able to work without feeling under too much pressure. And nobody was looking over my shoulder at me Googling things. I'm a developer, not an encyclopedia, and there's no shame in that.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Build a financial buffer
&lt;/h2&gt;

&lt;p&gt;My family was lucky. Until October 2019 both my partner and I has been working in full time work.&lt;/p&gt;

&lt;p&gt;This allowed us to save a good amount for renovating our gardens front and back, but I'm glad we'd not touched it, otherwise we'd have been borrowing money.&lt;/p&gt;

&lt;p&gt;As soon as the money stopped coming in. We knew we'd need to use that to keep up with our mortgage payments and bills. And as it's taken me this long to find the right job, you know I'll be making sure to protect myself against this happening in future.&lt;/p&gt;

&lt;p&gt;This comes from a position of privilege and I know for many this is an impossibility.&lt;/p&gt;

&lt;p&gt;If you're struggling to get into a position where you have 3-6 months worth of finances set aside. Please consider speaking to professional debt management organisation or financial planner.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Keep your CV / portfolio updated
&lt;/h2&gt;

&lt;p&gt;I'm so bad at doing this. I always leave things way too late and it makes it difficult to even remember what I've done let alone piece together some good examples of my work.&lt;/p&gt;

&lt;p&gt;A good manager will encourage you to keep these up-to-date and might allow you some time to do that. Either way make sure it happens, you won't regret doing so when you actually need it!&lt;/p&gt;

&lt;p&gt;Heck, set a reminder to do this often, shouldn't consume too much time but will pay off in the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  Feedback
&lt;/h2&gt;

&lt;p&gt;Have you had a similar experience? Have I missed anything important? Let me know on twitter, or comment below 👍&lt;/p&gt;

&lt;p&gt;Good luck finding your next role!&lt;/p&gt;

</description>
      <category>career</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Dark Mode, why and how.</title>
      <dc:creator>Benjamin Walsh</dc:creator>
      <pubDate>Fri, 27 Dec 2019 15:33:45 +0000</pubDate>
      <link>https://dev.to/benjwalsh/dark-mode-why-and-how-41op</link>
      <guid>https://dev.to/benjwalsh/dark-mode-why-and-how-41op</guid>
      <description>&lt;p&gt;To make your product stand out from the competition you've got to go above and beyond to impress your users, so that they become customers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;I'm an advocate for progressive enhancement so I believe it's important that we deliver the best possible experience to users. And recently the web has got some superpowers to help us do this in new ways. And by super powers, I mean new CSS media queries for user preferences.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prefers-color-scheme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;dark&lt;/span&gt;&lt;span class="p"&gt;){}&lt;/span&gt;
&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prefers-reduced-motion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;reduced&lt;/span&gt;&lt;span class="p"&gt;){}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Right now these media queries work in around 80% of all browsers which is great. &lt;a href="https://caniuse.com/#search=%40media%20prefers"&gt;Source - caniuse.com&lt;/a&gt; So for dark mode we need to focus on the first, colour scheme.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prefers Color Scheme
&lt;/h2&gt;

&lt;p&gt;The prefers color scheme media query takes its configuration from the users operating system settings. So that if, as a user, you prefer darker UIs, websites can make adjustments to their designs to respect that.&lt;/p&gt;

&lt;p&gt;Adam Argyle did a great job covering off how this works and why we'd use these media queries at the 2019 Chrome Dev Summit. &lt;/p&gt;

&lt;p&gt;Here's the video, I'd recommend you watch the whole thing, but if you're only interested in the new media queries jump to 4:10, or skip to the next section below.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/-oyeaIirVC0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Coming soon
&lt;/h2&gt;

&lt;p&gt;There's a bunch of new user preferences that are coming to the web that will fundamentally shift the way web design is done.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prefers-contrast&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;high&lt;/span&gt;&lt;span class="p"&gt;){}&lt;/span&gt;
&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prefers-reduced-transparency&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;reduced&lt;/span&gt;&lt;span class="p"&gt;){}&lt;/span&gt;
&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;forced-colors&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;high&lt;/span&gt;&lt;span class="p"&gt;){}&lt;/span&gt;
&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;light-level&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;dim&lt;/span&gt;&lt;span class="p"&gt;){}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;With these new settings, it will be possible to combine user preference settings to deliver the absolute optimum design for our individual users. &lt;/p&gt;

&lt;p&gt;Tweaking text contrast levels based on the current light level, respecting a user choice to use specific colours for links, removing transparency effects when they are causing a distraction or performance issues on low end devices... the list goes on. Really exciting stuff!&lt;/p&gt;

&lt;h2&gt;
  
  
  Who wants Dark Mode
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;5% of users were already configured and ready&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We started tracking the number of users using dark mode when browsing the website. We did this using a custom script in Google Tag manager that uses matchMedia JavaScript API. We discovered around 5% of users were already configured and ready.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;matchMedia&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;matchMedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;(prefers-color-scheme: dark)&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// dark mode use recorded&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Knowing that support for the &lt;code&gt;prefers-colour-scheme&lt;/code&gt; media query is going to grow we decided to lay the foundations for these upcoming user preference styles, and bake them directly into the way the website CSS is written.&lt;/p&gt;

&lt;p&gt;CSS Custom properties are available in all browsers that support these media queries, so we can leverage these to progressively enhance for any user pretty easily.&lt;/p&gt;

&lt;p&gt;We approached this by using our existing design system colours, and building on the available palette with new variations to reduce saturation and tint where needed.&lt;/p&gt;

&lt;p&gt;Then when applying styles we used CSS custom properties as the primary setting for the colour, but also back that up with the SASS variable too, like this example on the body tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight scss"&gt;&lt;code&gt;
&lt;span class="nv"&gt;$white&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;             &lt;span class="mh"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$chrome&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;            &lt;span class="mh"&gt;#f2f2f2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$dark-chrome&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;       &lt;span class="mh"&gt;#4a4a4a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$jet-black&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;         &lt;span class="mh"&gt;#111111&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$pale-purple&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;       &lt;span class="mh"&gt;#9387d8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$electric-purple&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;   &lt;span class="mh"&gt;#604dd5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;:root&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;--body-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="nv"&gt;$white&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="na"&gt;--text-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="nv"&gt;$dark-chrome&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="na"&gt;--text-color-accent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="nv"&gt;$electric-purple&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.dark-mode&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;--body-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="nv"&gt;$jet-black&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="na"&gt;--text-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="nv"&gt;$chrome&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="na"&gt;--text-color-accent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="nv"&gt;$pale-purple&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;body-color&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;So when a browser that doesn't support CSS custom properties visits it'll fall back to the default colour set. in this case that's the light colour scheme. &lt;/p&gt;

&lt;p&gt;For browsers that do support this code, they'll load the light style by default. but we've specifically avoided the media query in this code, why?&lt;/p&gt;

&lt;p&gt;Well I wanted to allow users to toggle the dark theme on and off, so for this example we applying the theme with a class &lt;code&gt;dark-mode&lt;/code&gt; on the body and avoiding the media query for now.&lt;/p&gt;

&lt;h2&gt;
  
  
  Detecting dark mode in Vue
&lt;/h2&gt;

&lt;p&gt;Using the mounted lifecycle in App.vue we can add a function to detect &lt;code&gt;prefers-color-scheme&lt;/code&gt; when it's set to dark and apply our class &lt;code&gt;dark-mode&lt;/code&gt; to update the CSS custom properties on the body, allowing the cascade to do most of the work.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;mounted&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;darkMode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;matchMedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;prefers-color-scheme: dark&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;darkMode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dark-mode&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;By using a well thought out set of CSS custom properties in our components, this one setting can control the look of the entire page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing for Dark Mode
&lt;/h2&gt;

&lt;p&gt;The main challenge for me here was working out where our current design system didn't give me enough flexibility to do what I needed. I found the need to introduce a few new colours just to make the design work.&lt;/p&gt;

&lt;p&gt;Those colours are &lt;code&gt;pale-purple&lt;/code&gt;, &lt;code&gt;almost-black&lt;/code&gt;, and &lt;code&gt;light-black&lt;/code&gt;. And yes naming things is really hard, but we already had a dark gray.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M1i2cD_p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7uhxv3f6uih0ii9m9187.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--M1i2cD_p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7uhxv3f6uih0ii9m9187.png" alt="Colour palette after adding new colours."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing in the browser
&lt;/h2&gt;

&lt;p&gt;Most websites are already designed with a light background, so it's easy to call that your light design, look you're halfway there, kinda.&lt;/p&gt;

&lt;p&gt;Now that we can tailor the look of our site to a users preference we can make sure user sees the right design for them.&lt;/p&gt;

&lt;p&gt;To start designing my dark mode settings I used the Vue-CLI to build a prototype homepage that included the components we have on the homepage. This gives me a starting point which I can tinker with. Oh and if you hadn't already guessed I'm a big fan of designing in the browser.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;if you hadn't already guessed I'm a big fan of designing in the browser.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here's a snippet of the homepage as it existed at the time. I'd updated the bullet point check marks in line with our design system and hollowed out the check mark.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dKznu1is--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/5gmuohxmt20ftcgly58g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dKznu1is--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/5gmuohxmt20ftcgly58g.png" alt="Light design homepage."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Swapping out the background and text colours goes a long way to setting the scene here. The primary call to action purple stands out equally well on both colours so no big changes are required there, but I did take the saturation down a little, that change is almost invisible to my eyes when toggling between the themes.&lt;/p&gt;

&lt;p&gt;I changed was the header title accent colour. I used a de-saturated tint of the existing purple to prevent clashing with the black background like this... 🤮&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nfrAuiMD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/hqsoe4ha870qedvxab2l.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nfrAuiMD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/hqsoe4ha870qedvxab2l.PNG" alt="Accent colour clash on dark background."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Along with toning down the text accent colour, I also added a subtle glow to the car image in the main hero. Now this isn't an optimal solution, but the pngs currently in use across the site were never designed to sit on a dark background so are rough around the edges, literally. This softens the edges a little giving us chance to roll out these changes before updating the imagery over time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WrQz4i9W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/fvmszzi9ku80d65cfzac.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WrQz4i9W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/fvmszzi9ku80d65cfzac.png" alt="Dark design homepage."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When swapping out the colours using the method detailed above, I started from the darkest colour in the background and used progressively lighter colours in the foreground.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mlKIn-qK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/nrotyd61dlk1bdarlnre.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mlKIn-qK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/nrotyd61dlk1bdarlnre.png" alt="Dark design banners."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This reverses the way colours are layered currently in the design, as shown here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--65Aj-_I5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/tq1dl2brxbonyw4xgul7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--65Aj-_I5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/tq1dl2brxbonyw4xgul7.png" alt="Light design banners."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Dark mode SVGs
&lt;/h2&gt;

&lt;p&gt;Well you may have noticed in these images that the city scape background didn't change the same way the rest does site. And you're right, it burns me up inside. &lt;/p&gt;

&lt;p&gt;I spent some time over the Christmas break to figure out how I can apply my new colours to my SVGs too.&lt;/p&gt;

&lt;p&gt;I really wanted to add unique elements for specific themes as that little something extra. Think about it, a moon and stars in dark mode, or perhaps a bird in light mode? A cool way to add a touch of personality into our designs.&lt;/p&gt;

&lt;p&gt;I started with the original artwork in Figma and created some color variations I thought might work well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UZpR3RdW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/dwkyulfyxcexc2j2k4ho.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UZpR3RdW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/dwkyulfyxcexc2j2k4ho.jpg" alt="Original Artwork."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I toyed with the idea of adding lights that were left on in the foreground buildings but decided that it was too distracting as these are background images. I also found that using these light blue/purple colours on the building made them pop way too much, distracting from the main vehicle image.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2HCp6xwG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/nkfpjjxndz23aaucq6kk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2HCp6xwG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/nkfpjjxndz23aaucq6kk.jpg" alt="Color scheme variations for dark mode."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I explored plunging them into almost complete darkness and highlighting the outlines instead, as if moonlight was reflecting off the edges of the buildings and leaving only the lights for the skyscrapers in the backgrounds.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VsuL7Nuo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/uapz7phuyadl5gwrvv8a.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VsuL7Nuo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/uapz7phuyadl5gwrvv8a.jpg" alt="Final design for SVGs in dark mode."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once I'd settled on a scheme I created a series of CSS classes and manually replaced the inline fills in the SVGs with those classes.&lt;/p&gt;

&lt;p&gt;Those classes are used for both color and visibility for the paths in the SVGs&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="nc"&gt;.accent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#6accb6&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.cloud&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#333333&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.dark-mode&lt;/span&gt; &lt;span class="nc"&gt;.cloud&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#211e28&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.skin&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.foreground&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.dark-mode&lt;/span&gt; &lt;span class="nc"&gt;.foreground&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#151416&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.foreground-shadow&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#c9d3ff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.dark-mode&lt;/span&gt; &lt;span class="nc"&gt;.foreground-shadow&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#101010&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.bg-color&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#edf1fe&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.dark-mode&lt;/span&gt; &lt;span class="nc"&gt;.bg-color&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#211e28&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.outline&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#333333&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.dark-mode&lt;/span&gt; &lt;span class="nc"&gt;.outline&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#4f4c56&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.dark-show&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.dark-mode&lt;/span&gt; &lt;span class="nc"&gt;.dark-show&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="mi"&gt;.5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.dark-hide&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.dark-mode&lt;/span&gt; &lt;span class="nc"&gt;.dark-hide&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;With a bit of live color tweaking in the browser (as I wasn't 100% happy with the outline colour on the buildings) here is the finished result. It's subtle, blends well with the existing colour scheme and still adds plenty of character above the fold.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1PvhnvCP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/od5ligxfy12q9ih6xj4x.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1PvhnvCP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/od5ligxfy12q9ih6xj4x.PNG" alt="Final homepage design including SVGs in dark mode."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Live demo
&lt;/h2&gt;

&lt;p&gt;If you want to have a play with the designs in your browser please feel free, the link to the &lt;a href="https://elastic-curran.netlify.com/"&gt;Live demo is here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>css</category>
      <category>vue</category>
      <category>design</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
