<?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 Michael Kennedy on Medium]]></title>
        <description><![CDATA[Stories by Michael Kennedy on Medium]]></description>
        <link>https://medium.com/@MikeKennedyDev?source=rss-9604a14f933c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sIukXv1cJuH4hpiEusX1ig.png</url>
            <title>Stories by Michael Kennedy on Medium</title>
            <link>https://medium.com/@MikeKennedyDev?source=rss-9604a14f933c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 12:41:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@MikeKennedyDev/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[UX Starts with Accessibility]]></title>
            <link>https://medium.com/design-bootcamp/ux-starts-with-accessibility-029f80a3a61d?source=rss-9604a14f933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/029f80a3a61d</guid>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[ep]]></category>
            <category><![CDATA[web-accessibility]]></category>
            <category><![CDATA[design]]></category>
            <dc:creator><![CDATA[Michael Kennedy]]></dc:creator>
            <pubDate>Tue, 09 Jun 2026 22:54:48 GMT</pubDate>
            <atom:updated>2026-06-09T22:54:48.849Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h3>UX starts with accessibility</h3><h4><em>Accessibility is often treated as a compliance exercise, but it shapes the quality of every user experience and the success of a product itself. It influences how people interact with software in ways that go beyond assistive tech. When accessibility is ignored, small usability issues impact engagement, retention, and commercial outcomes. In practice, accessibility isn’t a technical or ethical consideration, but a driver of quality and ultimately financial success.</em></h4><figure><img alt="Article cover image showing someone using a computer with accessibility tech and increasing profit margins in the background." src="https://cdn-images-1.medium.com/max/1000/0*DbVnL6qHGnxHUQHJ.png" /></figure><p>Accessibility is a legal requirement in the UK under the Equality Act of 2010, but digital products fall into the category of “reasonable adjustments”. It’s only under legislation for public sector bodies that WCAG guidelines come into play; for everyone else it’s more a case of “just do the best you can”.</p><p>As software developers, designers, testers, and project managers, we all play a part in the success of our projects, but all too often, product accessibility and usability are forgotten about or left until the last minute in favour of big sexy features that rightly appeal to marketing teams and financial benefactors.</p><p>Accessibility isn’t glamorous, but it also isn’t difficult when considered from the start. Forget about it at your peril, a dozen small usability frustrations can damage a product just as effectively as a major technical failure. More often than not, there won’t be a big error message giving users something to point at, accessibility issues have more nuance, are more likely to be seen as annoyances by non-technical users, and are things that they can’t quite put their finger on because they make the product feel more complicated than it should. Users won’t commonly complain about these things; they’ll just find a different product.</p><h3>Accessibility for everyone</h3><p>From a technical perspective, accessibility makes us think of disabled users requiring screen readers, of people who need assistance using a mouse and keyboard. There is, of course, an element of this, but accessibility considerations are significantly more involved and impact all users.</p><p>Thinking outside of software for a moment, what accessibility improvements do we use every day without giving it a second thought?</p><ul><li>Dropped kerbs and tactile paving.</li><li>Step-free building access and automatic doors.</li><li>Click‑and‑collect services.</li><li>Larger accessible station turnstiles.</li><li>Television subtitles.</li><li>Ergonomic mice, keyboards and tools.</li></ul><p>All these and more were originally designed to close the disability gap and ensure that everyone has the same level of access regardless of their physical needs. Yet we see something interesting in how these things have become commonplace, used not just by people with physical disabilities, but by everyone.</p><p>The further we delve into this, the clearer it is that <strong>everyone</strong> is different and that we can all benefit from accessibility improvements.</p><p>In the UK:</p><ul><li>3 in 5 people wear glasses.</li><li>3 million people have a colour vision deficiency.</li><li>10% of the population has dyslexia.</li></ul><p>Even with just these simple statistics, there’s a strong likelihood that a user working with a product we’ve written will have some sort of accessibility requirement. Do we cater to this; or pretend it doesn’t exist, what we choose here says more about us as people than it does about the user needs.</p><p>When we pick a product, we’ll compare different options; commonly we’ll pick the prettier option, the option with the best features and most importantly — the product that’s easiest to use, because happy users are users who will keep coming back. This is the crux of software accessibility, because the improvements we implement improve the lives of all our users, not just a small subset.</p><h3>WCAG guidelines</h3><p>UK public sector bodies need to comply with the <a href="https://www.w3.org/TR/WCAG22/">WCAG 2.2 AA</a> standard. These extensive requirements are grouped into categories describing what it means for an interface to be usable by real people in real situations.</p><p><strong>Perceivable</strong><br>Users must be able to perceive the content, not necessarily just visually.</p><ul><li>Content must have text alternatives where needed (e.g. images, media).</li><li>Video and audio must include captions or transcripts.</li><li>Information must not be conveyed by colour alone.</li><li>Content must remain readable and distinguishable.</li></ul><p>In practice, this ensures users aren’t forced to guess meaning from appearance alone.</p><p><strong>Operable</strong><br>Users must be able to interact with the interface in a reliable way.</p><ul><li>The interface must be fully usable via keyboard.</li><li>Users must have enough time to read and interact with content.</li><li>Heavy motion and animation should be disabled or reduced.</li><li>Navigation and interactions should be consistent and predictable.</li></ul><p>This is what prevents users from being blocked by interaction patterns they can’t access.</p><p><strong>Understandable</strong><br>Users must be able to understand what the system is doing.</p><ul><li>Language should be clear and defined.</li><li>Behaviour should be consistent and predictable across the application.</li><li>Assistance must be provided to help users avoid and correct mistakes.</li></ul><p>This is the difference between a user making progress and a user guessing what went wrong.</p><p><strong>Robust</strong><br>Content must be able to be interpreted by a wide variety of assistive technologies.</p><ul><li>Interface elements must be correctly identified by assistive technology.</li><li>Status changes should be announced without disrupting user focus.</li></ul><p>This ensures the interface doesn’t break when used outside of a “perfect” setup.</p><p><em>Outside of public sector bodies, these are of course, </em><strong><em>just</em></strong><em> guidelines, but that doesn’t make them any less important; they provide a point of focus for designers and developers and we already know that changes for accessibility enhancements affect everyone positively.</em></p><h3>Accessibility vs User Experience</h3><p>When we think of the User Experience (UX), we tend to think about the way that a product fits together, how users will navigate around, how easy it is to find what we’re looking for, colours, material design, glassmorphism and so on (that same stuff that the marketing team finds irresistible).</p><p>Accessibility isn’t something that should sit separately from UX. Instead it <em>informs</em> design decisions, making sure we don’t get too carried away with the latest trends, it grounds our designs in the real world in much the same way that a trusted colleague can spot when enthusiasm is starting to outrun practicality.</p><p>The two concepts sit side-by-side, it should never be a choice between accessibility or design, but both working together because a good user experience can only be built on a foundation of good accessibility.</p><p>Take the below real-world software issues, these are the sort of things that will annoy users in spite of any accessibility needs:</p><p><strong>The Modal Pop-up</strong></p><blockquote><em>The user clicks a button that opens a modal window within the current page.</em></blockquote><blockquote><em>The button that opens the modal window retains focus. The user can tab into the modal, but it takes 50 presses of the tab key to do so.</em></blockquote><blockquote><em>The user can’t close the modal by pressing the escape button or clicking the greyed out area around the modal. They look for the close button but the OK and Cancel buttons are positioned around the opposite way to a previous screen and it takes a moment to register the difference in behaviour.</em></blockquote><blockquote><em>Finally once the modal has closed, the focus remains on last control clicked and it takes another 50 tabs to return to the original position.</em></blockquote><p>These examples cover some common issues under the <em>Operable</em> and <em>Understandable</em> categories. Components must be accessible by keyboard and their behaviour should be predictable. Users shouldn’t have to learn a different set of interactions for each screen, whether that’s the position of OK and Cancel buttons, the ability to dismiss a modal with the Escape key, or where they are returned to once a task is complete.</p><p>These are basic consistencies, things that should always happen, much like the expectation that hitting enter after entering search criteria will initiate a search without additional clicks.</p><p><strong>Error Messages and Toasts</strong></p><blockquote><em>An error message appears on-screen when a user submits a form. The user has missed one of the required fields, there’s no required identifier in the field label, there’s no error message displayed adjacent to the missing field.</em></blockquote><blockquote><em>A toast message appears at the top of the screen advising the user that the form is incomplete, but doesn’t provide details.</em></blockquote><blockquote><em>The toast is positioned in the top corner of the screen, but it overlaps and hides the menu items beneath it. Furthermore, the user needs to click an “X” button to hide the toast. Worse yet, the background colour of the toast is the same colour as the main menu and as a result the user doesn’t see it immediately.</em></blockquote><blockquote><em>Finally, this is a modern SPA, when the user continues their journey, the toast message is left on-screen.</em></blockquote><p>Here we see some common issues under the <em>Perceivable</em> and <em>Understandable</em> categories. If a user makes a mistake, the application should make it clear what the problem is and how to fix it.</p><p>By not making it clear which fields are required and showing generic warning messages user frustration is increased and task completion becomes slower.</p><p>Furthermore, error messages should be easy to see without getting in the way of other content or requiring the user to take actions to dismiss them. Finally, feedback should always be relevant to the users current task, persisting messages after the user has moved on can create additional uncertainty and confusion.</p><p><strong>Screen Size and Zoom</strong></p><blockquote><em>A user has zoomed the content of their browser by 25% to make it easier to read smaller text without glasses.</em></blockquote><blockquote><em>When they zoom in, the layout of the page doesn’t automatically adapt, a horizontal scrollbar appears at the bottom of the page. The user dismisses its appearance as an annoyance and continues.</em></blockquote><blockquote><em>They click a button which opens a drawer component, sliding in from the left. There’s sufficient content at this zoom level for a vertical scrollbar to appear in the component.</em></blockquote><blockquote><em>There’s an “X” at the top of the component which is hidden when the user scrolls. There are “OK” and “Cancel” buttons at the bottom of the drawer. When the user has scrolled half way down, all navigation buttons are hidden. The user needs to scroll to the top or the bottom of the component before they can close it and move on.</em></blockquote><p>Here we see issues under the <em>Perceivable</em>, <em>Operable</em> and <em>Robust</em> categories. It’s a typical example of developing a product to a specific screen size and not considering how it behaves across other display sizes. This is easy to fall foul of when developing on smaller laptop screens but can have unexpected knock-on effects.</p><p>By not considering scenarios such as screen size or the amount of content shown in a generic component we risk key information and controls becoming inaccessible. Instead of the interface adapting to the user, the user is forced to adapt to the interface.</p><p><em>These guidelines are often treated as compliance requirements, but in practice they describe the conditions for good user experience.</em></p><h3>Accessibility Isn’t a Checkbox</h3><p>Modern libraries like Syncfusion, Telerik and Material UI work to ensure accessibility is provided at the component level. They can handle things like keyboard navigation and focus management straight out of the box.</p><p>There’s no doubt that this provides a huge advantage, but accessibility can’t be handled completely from a component library because individual components can’t see the big picture, they can’t adjust based on the application flow.</p><p>We can put inaccessible content within an accessible component; break accessibility with a misconfiguration, write error messages that only make sense to developers. Ultimately, we can’t just set input.accessibility = true; and be done with it.</p><p>We can mitigate these issues with the usage of tools such as <a href="https://developer.chrome.com/docs/lighthouse">Lighthouse</a> and <a href="https://wave.webaim.org/">WAVE</a>; tools like this can identify contrast problems, missing alt-text properties and a plethora of other problems, but they can’t tell you if a user is successfully able to complete a task.</p><p>There are things that just can’t be achieved without careful consideration at all levels, but while there’s a lot to consider, many accessibility improvements are small. A skip-to-content link can save keyboard users dozens of key presses. Reduced-motion settings can reduce discomfort for users with sensory sensitivities. Larger click targets benefit everyone using touchscreens. High contrast text helps users working outdoors, on poor displays or just at the end of a tiring day.</p><h3>Small Frustrations, Big Consequences</h3><p>Have you ever broken or fractured a bone and had trouble using the mouse or keyboard (it’s not fun), strained to see small text on a screen, zoomed in on a website because the text is too small or struggled to click a tiny close button?</p><p>These are all common accessibility considerations, but they irritate all users. By tackling things of this nature from day one we’re improving every user experience, not just those who use assistive technology.</p><p>A good real-world example of this would be autoplaying video previews on streaming platforms (I’m looking at you, Netflix, and your web-only options screen). Intended to help users discover content, but constant movement and unexpected audio can be distracting, particularly for users with sensory sensitivities, while also frustrating users who are simply trying to browse.</p><p>If you’re reading this then you’re likely a technical expert for your own applications, you instinctively know the oddities of its design and adjust to it because you live in it 24/7 (or at least 7½ hours a day), but most users don’t have that level of technical knowledge of a single product.</p><p>Every time a user comes across a minor inconvenience it damages their impression of your product. If a big architectural problem brings your product down for hours then yes, you have problems that need handling immediately, but you know where the issue is and can deal with it.</p><p>UX issues are different. It’s death by a thousand cuts, repeatedly damaging the reputation of a product. Worse yet, this isn’t something that can be tracked as easily as downtime. Users rarely report every frustration; they simply walk away.</p><p>This is the true business case for accessibility. It should be treated with as much reverence as any other part of the software development lifecycle, because accessibility is the foundation of a good user experience. Without considering it from day one, we’re not designing for our users — we’re designing for our assumptions about them. And if UX is built on assumptions, it means nothing.</p><h4>References</h4><ol><li><a href="https://yougov.com/en-gb/articles/51944-most-uk-adults-prefer-glasses-over-contact-lenses-heres-why">https://yougov.com/en-gb/articles/51944-most-uk-adults-prefer-glasses-over-contact-lenses-heres-why</a></li><li><a href="https://design102.blog.gov.uk/2019/09/06/today-is-colour-blind-awareness-day-how-aware-are-you/">https://design102.blog.gov.uk/2019/09/06/today-is-colour-blind-awareness-day-how-aware-are-you/</a></li><li><a href="https://www.gov.uk/government/publications/understanding-disabilities-and-impairments-user-profiles/simone-dyslexic-user">https://www.gov.uk/government/publications/understanding-disabilities-and-impairments-user-profiles/simone-dyslexic-user</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=029f80a3a61d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/design-bootcamp/ux-starts-with-accessibility-029f80a3a61d">UX Starts with Accessibility</a> was originally published in <a href="https://medium.com/design-bootcamp">Bootcamp</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Applying Visual Themes with SCSS]]></title>
            <link>https://medium.com/@MikeKennedyDev/applying-visual-themes-with-scss-2adac4f5b9d1?source=rss-9604a14f933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/2adac4f5b9d1</guid>
            <category><![CDATA[themes]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[scss]]></category>
            <category><![CDATA[sass]]></category>
            <category><![CDATA[colour-scheme]]></category>
            <dc:creator><![CDATA[Michael Kennedy]]></dc:creator>
            <pubDate>Sun, 17 Sep 2023 15:03:18 GMT</pubDate>
            <atom:updated>2023-09-17T15:17:14.362Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*tbu7XqDgg4HPt7wk.png" /></figure><p>When you have a large legacy web application, implementing a dark mode theme is a pretty daunting concept. Especially when your CSS is all over the place and you have a number of third-party components to worry about.</p><p>The concept of implementing dark mode in our eMarketing product was a natural continuation of conversations the team had had around usage of dark mode in HTML emails and email clients.</p><p>In the past, the team hadn’t given too much consideration to the organisation of CSS. This was in part due to the lack of any overarching design system. As a result, I had appointed myself as our de facto UX expert and the task of figuring out the best way of implementing CSS themes fell to me.</p><h3>Clean Styling</h3><p>There’s no point in even attempting to implement colour schemes in a web product unless the CSS is clean. Modern frameworks rightly separate out HTML, JavaScript and CSS into separate files but our 15 year old application (which was based on an even older ASP solution) hadn’t followed these common processes.</p><p>This multi-step process was probably the most time consuming element of the implementation of visual themes, but well worth it even as an unrelated task.</p><p>We reviewed all of our existing CSS files, split component specific styles into their own separate files. There is no right approach here, what matters most is consistency. I split our CSS between external and internal components; so I created sub-folders for each component provider (i.e. BootStrap, Telerik, etc) and sub-folders for application areas (i.e. application settings, user security, etc) before migrating our CSS to files within these folders. Anything remaining that couldn’t easily fit into a category was migrated to catch-all CSS.</p><p>Once this process had been completed, we installed &amp; configured WebCompiler to automatically compile our styles from the SCSS.</p><p>Finally, we reviewed the usage of inline CSS and CSS style blocks within our CSHTML content (there was a lot of this) and migrated anything theme specific to the new SCSS files.</p><p>There would be more clean-up work on this later, but this put is in a good place for future development and allowed us to split our generated CSS between common application elements which are required all the time and screen specific styles which just needed to be loaded alongside certain screens.</p><p>Because of the amount of CSS being moved around, it’s wise to test changes and compare screens against unmodified versions. This allows us to catch any precedence issues caused by moving things about.</p><h3>Create SCSS Variables and Review Colour Scheme</h3><p>While the team had taken care to ensure that the existing colour scheme was consistent throughout the product, inevitably there were areas where variations had been inadvertently introduced within our CSS.</p><p>This was now the perfect time to review all colour codes and fonts within our SCSS files and question any inconsistencies. This gave us the opportunity to not only streamline the product appearance but to keep the number of CSS variables as low as possible.</p><p>Even with this, after our first pass, we still created over 100 CSS variables. The impact of this clean-up on product appearance was instantly obvious.</p><h3>Theme Generation</h3><p>The next step was to create our first theme from the SCSS variables. I declared each theme in its own file, this isn’t <em>strictly</em> necessary but it makes maintenance significantly easier.</p><p>Each file consists of a list of variables and a theme object which uses these variables, looking something like the below example.</p><pre>// branding colours<br>$branding-primary: #105CC6;<br>$action-edit-button: #00a2e8;<br><br>// fonts<br>$font-primary:&quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;<br>$font-legend: Arial, Helvetica, sans-serif;<br>$font-header: Calibri, Arial, sans-serif;<br>$font-code: Lucida Console;<br><br>$standard-theme: ( <br>    // branding<br>    branding-primary: $branding-primary,<br>    branding-primary-dark: darken($branding-primary, 15%),<br>    branding-primary-edit: $action-edit-button,<br>    branding-primary-edit-dark: darken($action-edit-button, 20%),<br><br>    // base fonts<br>    font-primary: $font-primary,<br>    font-legend: $font-legend,<br>    font-title-area: $font-header,<br>    font-code: $font-code<br>);</pre><p>To generate the final CSS, we need to take our themes and use an SCSS mixin to define additional CSS rules that trigger their usage.</p><p>We achieved this by specifying a CSS class name within the &lt;html&gt; DOM element which would dictate the name of the current theme. The standard theme is enabled by the theme-standard class and the dark theme is enabled by the theme-dark class etc.</p><pre>// import themes from external files<br>@import &#39;standard.scss&#39;;<br>@import &#39;dark.scss&#39;;<br><br>// add themes to an array<br>$themes: (<br>    standard: $standard-theme,<br>    dark: $dark-theme,<br>);<br><br>@mixin theme() {<br>    $array: $themes;<br><br>    @each $theme, $map in $array {<br>        html.theme-#{$theme} &amp; {<br>            $array-map: () !global;<br><br>            @each $key, $submap in $map {<br>                $value: map-get(map-get($array, $theme), &#39;#{$key}&#39;);<br>                $array-map: map-merge($array-map, ($key: $value)) !global;<br>            }<br><br>            @content;<br>            $array-map: null !global;<br>        }<br>    }<br>}<br><br>@function themeValue($key) {<br>    @return map-get($array-map, $key);<br>}</pre><p>We can then modify our SCSS to include a reference to the themeValue function, this will trigger generation of multiple CSS lines, one for each possible theme.</p><pre>body {<br>    @include theme() {<br>        font-family: themeValue(font-primary);<br>    }<br>    font-variant: none;<br>}</pre><h3>Theme Selection</h3><p>Finally, the only thing left to was to configure our theme. This needs to happen as high up the page load as possible in order to prevent any flashes of un-styled content.</p><p>We could of course, just apply the style class to the &lt;html&gt; DOM object and be done with it; however, most applications provide a &quot;System Theme&quot; option and it won&#39;t take too much work to implement this ourselves.</p><p>In this example, we already support theme-standard and theme-dark, we&#39;ll now introduce theme-system as a third option and apply the light or dark theme automatically.</p><pre>// are we using the system theme<br>const isSystemTheme = theme == &quot;theme-system&quot;;<br>if (isSystemTheme)<br>{<br>    // detect colour scheme<br>    if (window.matchMedia &amp;&amp; window.matchMedia(&#39;(prefers-color-scheme: dark)&#39;).matches) {<br>        theme = &quot;theme-dark&quot;;<br>    }<br>    else<br>    {<br>        theme = &quot;theme-standard&quot;;<br>    }<br>}<br><br>setVisualTheme(theme, isSystemTheme);</pre><p>We’ll then clear the existing theme and apply the new one. We’ll want to note if we’re using the default system theme, this will allow us to change the theme without refreshing the page.</p><pre>function setVisualTheme(themeName, isSystemTheme) {<br>    // remove any existing theme<br>    const $html = $(&quot;html&quot;);<br>    $html.attr(&quot;class&quot;, function(i, c){<br>        return c.replace(/(^|\s)theme-\S+/g, &#39;&#39;);<br>    });<br><br>    $(&quot;html&quot;).prop(&quot;usingSystemTheme&quot;, isSystemTheme);<br><br>    // set new theme<br>    $(&quot;html&quot;).addClass(themeName);<br>}</pre><p>We can intercept changes to the system theme by using the JavaScript below. If the operating system theme is changed, then this will be automatically passed to the browser window and we can ensure that this update is reflected on the page:</p><pre>window.matchMedia(&quot;(prefers-color-scheme: dark)&quot;)<br>    .addEventListener(&quot;change&quot;, event =&gt; {<br>        if ($(&quot;html&quot;).prop(&quot;usingSystemTheme&quot;)) {<br>            let targetTheme = &quot;theme-standard&quot;;<br><br>            if (event.matches) {<br>                targetTheme = &quot;theme-dark&quot;;<br>            }<br><br>             setVisualTheme(targetTheme, true);<br>         }<br>    });</pre><p>As a final step, we might also want to update the colour of the browser header to match the theme colour. This provides a more cohesive feel in mobile environments.</p><p>We can do this by adding an additional meta value within our document:</p><pre>&lt;meta name=&quot;theme-color&quot; content=&quot;#4285f4&quot; /&gt;</pre><p>We can’t extract the theme colour directly from CSS, but we can apply the appropriate class to a hidden DOM object and then read that colour using JavaScript and apply it to the theme-color object. This approach also resolved an issue with a third party component which required the colour scheme to be set using JavaScript.</p><p>In conclusion, implementing visual themes in a product that hadn’t ever been written with this in mind was tricky work; however the majority of work was in cleaning up the existing CSS implementation.</p><p>There were a number of points along the journey where the benefit of what we were doing was obvious and this was before we’d even implemented our first colour scheme.</p><p>If this journey proves anything, it’s how important it is to segregate our UI components and associated CSS. This is something modern frameworks do very well, but can be lacking in legacy applications.</p><p><em>Originally published at </em><a href="https://dev.to/mikekennedydev/applying-visual-themes-using-scss-30j1"><em>https://dev.to</em></a><em> on September 17, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2adac4f5b9d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reusable MVC Razor Components with HTML Extension Methods]]></title>
            <link>https://medium.com/@MikeKennedyDev/reusable-mvc-razor-components-with-html-extension-methods-68990c8f619f?source=rss-9604a14f933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/68990c8f619f</guid>
            <category><![CDATA[javascript-frameworks]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[mvc]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[razor]]></category>
            <dc:creator><![CDATA[Michael Kennedy]]></dc:creator>
            <pubDate>Mon, 04 Jul 2022 07:34:59 GMT</pubDate>
            <atom:updated>2022-07-04T11:36:05.815Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Q5PCoySIbM4nvs2b" /><figcaption>Photo by <a href="https://unsplash.com/@valerysysoev?utm_source=medium&amp;utm_medium=referral">Valery Sysoev</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Component reuse is one of the intrinsic features of modern JavaScript frameworks. React, Angular and their counterparts all guide us toward the idea of creating small, reusable elements in order to maintain a clean codebase.</p><p>MVC performs a similar task, but the architecture doesn’t make it as intuitive. As the name suggests, it provides reusable components as standard; unfortunately these components can be relatively unsophisticated making easy to fall into the trap of creating massive views and forgetting about reusability.</p><p>On occasion, the time required to migrate existing solutions to new frameworks is prohibitive, but that doesn’t mean that we can’t provide an easy to use component library within the confines of MVC Razor.</p><p>By simplifying the our source code we can take back control of styling, reduce time to onboard new team members and standardise component usage to prevent subtle differences seeping through in different product areas.</p><p>Approaches will vary depending on the complexity of your components, but we can take inspiration from providers of third party libraries and make our own HTML helpers accessible directly through Visual Studio IntelliSense.</p><h3>What are HTML Helpers?</h3><p>For anyone not familiar with the concept, we can use extension methods to expand on the functionality of any data type. <a href="https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/extension-methods">This</a> Microsoft document explains it in more detail, but essentially we declare something like this:</p><pre>namespace MyExtensionMethods<br>{<br>    public static class MyExtensions<br>    {<br>        public static int WordCount(this string str)<br>        {<br>            return str.Split(new char[] { &#39; &#39;, &#39;.&#39;, &#39;?&#39; },<br>                StringSplitOptions.RemoveEmptyEntries).Length;<br>        }<br>    }<br>}</pre><p>Whenever the namespace is available we can execute the WordCount function against any string type:</p><pre>var stringValue = &quot;There are four words&quot;;<br>var wordCount = stringValue.WordCount(); // outputs 4.</pre><p>This same concept can be applied to the HTML helpers made available by Razor, we can leverage the same approach to make it easier to create &amp; recreate common components; improving discoverability for new and existing developers alike.</p><pre>@(Html.MyHtmlHelper()<br>    .GenerateThisControl(&quot;controlId&quot;)<br>    .EnableOptions(true)<br>);</pre><h3>Basic Usage</h3><p>A basic example might be something like this, which expands on the functionality of Html.Raw() to escape quotation marks for inclusion in DOM attributes:</p><pre>using System.Web;<br>using System.Web.Mvc;<br><br>namespace MyExtensionMethods<br>{<br>    public static class HtmlStringHelper<br>    {<br>        public static IHtmlString RawHtmlString(<br>            this HtmlHelper htmlHelper, string value)<br>        {<br>            return !string.IsNullOrWhiteSpace(value) <br>                ? htmlHelper.Raw(EscapeQuotes(value))<br>                : &quot;&quot;;<br>        }<br>    }<br>}</pre><p>An example like this is of course quite limited. We can use it to perform basic operations in day-to-day work, but it’s not something which will reduce code complexity by any measurable amount.</p><p>But we can expand on this to return entire views:</p><pre>namespace MyExtensionMethods<br>{<br>    public static class HtmlStringHelper<br>    {<br>        public IHtmlString LoadingAnimation(<br>            this HtmlHelper htmlHelper)<br>        {<br>            return _htmlHelper.Partial(<br>                &quot;~/Views/HtmlHelpers/LoadingAnimation.cshtml&quot;);<br>        }<br>    }<br>}</pre><p>There’s still not much benefit to this last example, certainly nothing that we can’t achieve by documenting the location of the loading animation view, but this shows us that we can:</p><ul><li>Use HTML Helpers to store content outside of the core solution. We could make this available as part of a DLL and perhaps directly render the HTML output from an embedded file. This would let us simplify create a component library which can be accessed by multiple projects.</li><li>Guide developers through the generation of HTML content by providing additional configuration options without the need to go digging for the right model or view name.</li></ul><h3>Helper Factory</h3><p>To provide more advanced functionality, we’ll have to expose additional options via helper factories.</p><p>This approach follows previous examples, except this time we’re returning a class which implements IHtmlString instead of a partial view or string.</p><p>First, we add something like this to our existing helper:</p><pre>public static HtmlHelperFactory MyProductName(this HtmlHelper helper)<br>{<br>    return new HtmlHelperFactory(helper);<br>}</pre><p>Which is implements a HtmlHelperFactory class:</p><pre>namespace MyExtensionMethods.HtmlHelpers.Factory<br>{<br>    public class HtmlHelperFactory<br>    {<br>        private readonly HtmlHelper _htmlHelper;<br><br>        public HtmlHelperFactory(HtmlHelper htmlHelper)<br>        {<br>            _htmlHelper = htmlHelper;<br>        }<br><br>        public TooltipBuilder Tooltip(string id, string text)<br>        {<br>            return new TooltipBuilder(_htmlHelper, id, text);<br>        }<br>    }<br>}</pre><p>What we have here will allow us to generate a new tooltip component within our CSHTML files by entering something like @Html.MyProductName().Tooltip(&quot;id&quot;, &quot;This is my tooltip&quot;).</p><p>We can imagine that this would perhaps generate a little “i” icon, with the specified tooltip text automatically escaped and assigned within the title attribute, perhaps using a third party component to make the tooltip look pretty.</p><p>Instead of creating the HTML content within the helper, we can shift it to a builder class, provide it with some additional options and create an appropriate view model.</p><pre>public class TooltipBuilder : IHtmlString<br>{<br>    private readonly HtmlHelper _htmlHelper;<br>    private readonly TooltipModel _model = new TooltipModel();<br><br>    public TooltipBuilder(<br>        HtmlHelper htmlHelper, <br>        string id = &quot;&quot;, <br>        string tooltipText = &quot;&quot;)<br>    {<br>        _model.Id = id;<br>        _model.Text = tooltipText;<br>        _htmlHelper = htmlHelper;<br>    }<br><br>    public TooltipBuilder Colour(string value)<br>    {<br>        _model.Colour = value;<br>        return this;<br>    }<br><br>    public TooltipBuilder Mode(TooltipBuilderMode value)<br>    {<br>        _model.Mode = value;<br>        return this;<br>    }<br><br>    public string ToHtmlString()<br>    {<br>        var returnData = _htmlHelper<br>            .Partial(<br>                &quot;~/Views/HtmlHelpers/Tooltip.cshtml&quot;, <br>                _model<br>            )<br>            .ToHtmlString();<br><br>        return returnData;<br>    }<br>}</pre><p>We can expect the generated tooltip to be pretty simplistic, perhaps a couple of &lt;span&gt;&#39;s and a custom font used to generate an appropriate icon.</p><p>But what we’ve done here is to standardise this simple element and ensure that every instance is rendered in the same way. Should we ever want to change the icon then we’ll only ever need to update a single line of code.</p><p>We’ve also given other developers a list of possible options in a manner which lets us chain operations together.</p><pre>@(Html.MyProductName()<br>    // provide required fields<br>    .Tooltip(&quot;id&quot;, &quot;This is my tooltip&quot;)<br>    // provide optional parameters<br>    .Colour(&quot;#575757&quot;)<br>    .Mode(TooltipBuilderMode.FloatBottom)<br>)</pre><h3>Html Attributes</h3><p>While the tooltip example is pretty basic, we might not want every instance of the same object to behave in exactly the same way, perhaps we want to allow users to specify some additional classes on the parent container, or maybe we want to bind the tooltip value to a model.</p><p>In which case we might expand on TooltipBuilder by introducing some extra operations and enhanced processing:</p><pre>public TooltipBuilder(<br>    HtmlHelper htmlHelper, <br>    string id = &quot;&quot;, <br>    string defaultTooltipText = &quot;&quot;)<br>{<br>    _model.Id = id;<br>    _model.Text = defaultTooltipText;<br>    _htmlHelper = htmlHelper;<br>}<br><br>// provide generic attribute options<br>public TooltipBuilder HtmlAttributes(<br>    IDictionary&lt;string,object&gt; value)<br>{<br>    if (value != null)<br>    {<br>        value.ToList().ForEach(v =&gt; SetHtmlAttribute(v));<br>    }<br>    return this;<br>}<br><br>// provide more specific guided attribute options<br>public TooltipBuilder TitleBindingAttribute(string value)<br>{<br>    SetHtmlAttribute(new KeyValuePair&lt;string,object&gt;(<br>        &quot;data-bind&quot;, <br>        $&quot;attr: {{ title: {value} }}&quot;<br>    ));<br><br>    return this;<br>}<br><br>// combine lists into a single property for processing<br>private void SetHtmlAttribute(<br>    KeyValuePair&lt;string, object&gt; attribute)<br>{<br>    if (!string.IsNullOrWhiteSpace(attribute.Value?.ToString() ?? &quot;&quot;))<br>    {<br>        if (_model.HtmlAttributes.ContainsKey(attribute.Key))<br>        {<br>            _model.HtmlAttributes[attribute.Key] = attribute.Value;<br>        }<br>        else<br>        {<br>            _model.HtmlAttributes.Add(attribute.Key, attribute.Value);<br>        }<br>    }<br>}<br><br>public string ToHtmlString()<br>{<br>    var returnData = _htmlHelper<br>        .Partial(<br>            &quot;~/Views/HtmlHelpers/Tooltip.cshtml&quot;, <br>            _model<br>        )<br>        .ToHtmlString();<br>    return returnData;<br>}</pre><p>With this, we can allow more in-depth customisation while still retaining control over the appearance and behaviour of the tooltip:</p><pre>@(Html.MyProductName()<br>    .Tooltip(&quot;id&quot;, &quot;This is my tooltip&quot;)<br>    .SetHtmlAttribute(<br>        [{@class = &quot;myClassName&quot;}] <br>    )<br>    .TitleBindingAttribute(&quot;tooltipTextField&quot;)<br>)</pre><h3>Grouping Commands</h3><p>Finally, we may find ourselves in a situation where we have so many options within our helper that we want to group them by function to make them easier to work with. <em>(Perhaps hard to believe within the confines of the tooltip example)</em></p><p>We can do this by creating a configurator class and using an Action delegate to preserve the simplicity of creating our control within a single razor command.</p><p>First we need a basic option factory:</p><pre>public class TooltipOptionFactory<br>{<br>    internal TooltipOptions Options = <br>        new TooltipOptions();<br><br>    public TooltipOptionFactory Disabled(bool value)<br>    {<br>        Options.Disabled = value;<br>        return this;<br>    }<br><br>    public TooltipOptionFactory Visible(bool value)<br>    {<br>        Options.Visible = value;<br>        return this;<br>    }<br>}</pre><p>Then we need to integrate it with our TooltipBuilder class:</p><pre>public TooltipBuilder Options(<br>    Action&lt;TooltipOptionFactory&gt; configurator)<br>{<br>    var optionFactory = new TooltipOptionFactory();<br>    configurator.Invoke(optionFactory);<br>    _model.Options = optionFactory.Options;<br>    return this;<br>}</pre><p>Which will allow us to use it within our CSHTML like this:</p><pre>@(Html.MyProductName()<br>    .Tooltip(&quot;id&quot;, &quot;This is my tooltip&quot;)<br>    .Options(o =&gt; {<br>        o.Visible(true);<br>        o.Disabled(false);<br>    })<br>)</pre><p>These are just the first stepping stones in creating a library of reusable Razor components. While there’s clearly some overhead in creating a full library of these components the future time savings from taking this approach are immeasurable.</p><p>As with many approaches, it’s much easier to begin a project with something like this in mind rather than shoehorning it into an established product; as someone who recently spent two weeks fixing issues caused by the upgrade of a third party component library — I really wish our development team had taken this approach 10 years ago, but now we have the tools to correct that mistake.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68990c8f619f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Updating the Collation of an Existing MSSQL Database]]></title>
            <link>https://medium.com/@MikeKennedyDev/updating-the-collation-of-an-existing-mssql-database-e3508ded5c0d?source=rss-9604a14f933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3508ded5c0d</guid>
            <category><![CDATA[database-collation]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[sql-server]]></category>
            <dc:creator><![CDATA[Michael Kennedy]]></dc:creator>
            <pubDate>Sat, 25 Jun 2022 18:00:37 GMT</pubDate>
            <atom:updated>2022-06-25T18:01:22.327Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*5QMLJaBY_XAbRVZu.png" /></figure><p>When products are installed outside of a controlled development environment we expect the unexpected, that’s why we have logging. Product databases are typically an area where this isn’t as much of an issue. Beyond client data, the variables are restricted to SQL version numbers, hardware and the server database collation…</p><p>As much as some might advise otherwise, clients will install multiple products on a single SQL server to reduce licencing costs.</p><p>When we don’t have control over the server collation, products that make heavy use of #temporary tables or that query system databases such as msdb can run into problems. System databases will tend to use the same collation as the server and if we&#39;re not careful we&#39;ll encounter the dreaded collation error:</p><blockquote><em>Cannot resolve the collation conflict between “SQL_Latin1_General_CP1_CI_AS” and “Latin1_General_CI_AS” in the equal to operation.</em></blockquote><p>This situation commonly occurs when an existing database is restored to a SQL server where the target collations don’t match.</p><h3>Preventative Programming</h3><p>As developers, the first thing that we can do to prevent this is by deliberately working environments where the collation of the development database has been deliberately set to something different to the server collation.</p><p>This forces us to automatically consider database collations when writing our stored procedure and function code, substituting collate database_default whenever necessary.</p><h3>Core Database Collation</h3><p>If the proverbial ship has sailed then we can find ourselves in a position where we have to manually update the collation of large client databases.</p><p>At first glance it might look like we just need to open database properties and change the collation but it’s far from being that simple.</p><p>When we update the collation in this manner we’re actually changing the <strong>default collation</strong>, newly created tables and columns will use this collation but existing objects will be unaffected.</p><p>Updating the collation of an existing database is tricky, but it can be boiled down to a simple process.</p><h3>Preparation</h3><ul><li>Take a database backup (because not to do so is to invite disaster).</li><li>Set recovery mode to Simple.</li></ul><pre>USE [master]<br>GO<br>ALTER DATABASE [SampleDatabase] SET RECOVERY SIMPLE WITH NO_WAIT<br>GO</pre><ul><li>Set the database to single user mode (only necessary in an environment where another system could be accessing the database).</li></ul><pre>USE [master]<br>GO<br>ALTER DATABASE [SampleDatabase] SET SINGLE_USER WITH NO_WAIT<br>GO</pre><h3>Target Columns</h3><p>Once our database backup has been configured we’ll need to work out which database columns need to be updated. We can achieve this by querying system tables to retrieve a list of columns which <em>don’t</em> use the new database collation.</p><pre>declare @newCollationName sysname<br>set @newCollationName = &#39;Latin1_General_CI_AI&#39;</pre><pre>select<br>    *<br>from<br>(<br>    select<br>        s.[name] as [schema],<br>        o.[name] as [table],<br>        c.[name] as [column],<br>        t.[name] as [datatype],<br>        case<br>            when <br>                c.[max_length] = -1 AND<br>                (<br>                    lower(t.[name]) = &#39;char&#39; OR<br>                    lower(t.[name]) = &#39;nchar&#39; OR<br>                    lower(t.[name]) = &#39;varchar&#39; OR<br>                    lower(t.[name]) = &#39;nvarchar&#39;<br>                )<br>            then &#39;max&#39;<br>            when lower(t.[name]) = &#39;varchar&#39; OR lower(t.[name]) = &#39;char&#39;  then convert(varchar,c.[max_length])<br>            when lower(t.[name]) = &#39;nvarchar&#39; OR lower(t.[name]) = &#39;nchar&#39;  then convert(varchar,c.[max_length]/2)<br>            else null<br>        end as [length],<br>        c.[collation_name] as [collation]<br>    from sys.objects o<br>    inner join sys.columns c on (c.[object_id] = o.[object_id])<br>    inner join sys.types t on (t.[system_type_id] = c.[system_type_id] AND t.[user_type_id] = c.[system_type_id])<br>    inner join sys.schemas s on (s.[schema_id] = o.[schema_id])<br>    where <br>        o.[is_ms_shipped] = 0 and <br>        o.[type] = &#39;U&#39; and<br>        c.[collation_name] is not null AND<br>        lower(c.[collation_name]) != lower(@newCollationName)<br>    union select<br>        s.[name] as [schema],<br>        o.[name] as [table],<br>        c.[name] as [column],<br>        &#39;cs&#39; as [datatype],<br>        &#39;cs&#39; as [length],<br>        &#39;cs&#39; as [collation]<br>    from sys.objects o<br>    inner join sys.columns c on (c.[object_id] = o.[object_id])<br>    inner join sys.types t on (t.[system_type_id] = c.[system_type_id] AND t.[user_type_id] = c.[system_type_id])<br>    inner join sys.schemas s on (s.[schema_id] = o.[schema_id])<br>    where <br>        o.[is_ms_shipped] = 0 and <br>        c.is_computed = 1<br>) s<br>order by<br>    s.[table],<br>    s.[column]</pre><h3>Incompatible Objects</h3><p>Now we have a list of database columns which need to be updated, but we still can’t act on it, we’ll need to drop all items associated with these columns first — Functions, Indexes, Unique Constraints, Foreign/Primary keys and Computed columns will all need to be dropped before we can attempt to change the collation.</p><blockquote><em>The products I work with make use of a standalone database upgrade tool which compares a targeted database directly against the expected database schema and will automatically re-create any missing items.</em></blockquote><blockquote><em>In other scenarios it will be necessary to script these objects before dropping them in order to recreate them later.</em></blockquote><p>Executing the below SQL will give us the information we need. <em>(where </em><em>#targetColumns is the output of the previous SELECT operation)</em></p><pre>--drop table valued functions<br>select<br>    &#39;DROP FUNCTION [&#39; + s.[name] + &#39;].[&#39; + o.[name] + &#39;]&#39; as command,<br>    1 as [priority]<br>from sys.objects o<br>inner join sys.schemas s on (s.[schema_id] = o.[schema_id])<br>where o.[type] = &#39;TF&#39;</pre><pre>--indexes to drop<br>union SELECT <br>    &#39;DROP INDEX [&#39; + s.[name] + &#39;].[&#39; + t.[name] + &#39;].[&#39; + ind.[name] + &#39;]&#39; as command,<br>    2 as [priority]<br>FROM sys.indexes ind <br>INNER JOIN sys.index_columns ic ON  ind.object_id = ic.object_id and ind.index_id = ic.index_id <br>INNER JOIN sys.columns col ON ic.object_id = col.object_id and ic.column_id = col.column_id <br>INNER JOIN sys.tables t ON ind.object_id = t.object_id <br>inner join sys.schemas s on (s.[schema_id] = t.[schema_id])<br>inner join #targetColumns tcol <br>on <br>(<br>    lower(tcol.[schema]) = lower(s.[name]) AND<br>    lower(tcol.[table]) = lower(t.[name]) AND<br>    lower(tcol.[column]) = lower(col.[name])<br>)<br>WHERE <br>    ind.is_primary_key = 0 AND <br>    ind.is_unique = 0 AND <br>    ind.is_unique_constraint = 0 AND <br>    t.is_ms_shipped = 0 <br>group by<br>    s.[name],<br>    t.[name],<br>    ind.[name]</pre><pre>--drop unique constraints<br>union SELECT <br>    &#39;ALTER TABLE [&#39; + s.[name] + &#39;].[&#39; + t.[name] + &#39;] DROP CONSTRAINT [&#39; + ind.[name] + &#39;]&#39; as command,<br>    2 as [priority]<br>FROM sys.indexes ind <br>INNER JOIN sys.index_columns ic ON  ind.object_id = ic.object_id and ind.index_id = ic.index_id <br>INNER JOIN sys.columns col ON ic.object_id = col.object_id and ic.column_id = col.column_id <br>INNER JOIN sys.tables t ON ind.object_id = t.object_id <br>inner join sys.schemas s on (s.[schema_id] = t.[schema_id])<br>inner join #targetColumns tcol <br>on <br>(<br>    lower(tcol.[schema]) = lower(s.[name]) AND<br>    lower(tcol.[table]) = lower(t.[name]) AND<br>    lower(tcol.[column]) = lower(col.[name])<br>)<br>WHERE <br>    ind.is_primary_key = 0 AND <br>    ind.is_unique = 1 AND <br>    t.is_ms_shipped = 0 <br>group by<br>    s.[name],<br>    t.[name],<br>    ind.[name]</pre><pre>--foreign keys to drop<br>union select<br>    &#39;ALTER TABLE [&#39; + s.fk_schema + &#39;].[&#39; + s.[fk_table] + &#39;] DROP CONSTRAINT [&#39; + s.[fkname] + &#39;]&#39; as command,<br>    3 as [priority]<br>from<br>(<br>    select <br>        fk.name as [fkname],<br>        schema_name(tab.schema_id) as [schema],<br>        tab.name as [table],<br>        col.name as [column],<br>        schema_name(tab.schema_id) as [fk_schema],<br>        tab.name as [fk_table]<br>    from sys.tables tab<br>        inner join sys.columns col <br>            on col.object_id = tab.object_id<br>        inner join sys.foreign_key_columns fk_cols<br>            on fk_cols.parent_object_id = tab.object_id<br>            and fk_cols.parent_column_id = col.column_id<br>        left outer join sys.foreign_keys fk<br>            on fk.object_id = fk_cols.constraint_object_id<br>        left outer join sys.tables pk_tab<br>            on pk_tab.object_id = fk_cols.referenced_object_id<br>        left outer join sys.columns pk_col<br>            on pk_col.column_id = fk_cols.referenced_column_id<br>            and pk_col.object_id = fk_cols.referenced_object_id<br>    union select <br>        fk.name as [fkname],<br>        schema_name(pk_tab.schema_id) as [schema],<br>        pk_tab.name as [table],<br>        pk_col.name as [column]  ,  <br>        schema_name(tab.schema_id) as [fk_schema],<br>        tab.name as [fk_table]<br>    from sys.tables tab<br>        inner join sys.columns col <br>            on col.object_id = tab.object_id<br>        inner join sys.foreign_key_columns fk_cols<br>            on fk_cols.parent_object_id = tab.object_id<br>            and fk_cols.parent_column_id = col.column_id<br>        left outer join sys.foreign_keys fk<br>            on fk.object_id = fk_cols.constraint_object_id<br>        left outer join sys.tables pk_tab<br>            on pk_tab.object_id = fk_cols.referenced_object_id<br>        left outer join sys.columns pk_col<br>            on pk_col.column_id = fk_cols.referenced_column_id<br>            and pk_col.object_id = fk_cols.referenced_object_id<br>) s<br>inner join #targetColumns t <br>on <br>(<br>    lower(t.[schema]) = lower(s.[schema]) AND<br>    lower(t.[table]) = lower(s.[table]) AND<br>    lower(t.[column]) = lower(s.[column])<br>)</pre><pre>--primary keys to drop<br>union SELECT <br>    &#39;ALTER TABLE [&#39; + s.[name] + &#39;].[&#39; + t.[name] + &#39;] DROP CONSTRAINT [&#39; + ind.[name] + &#39;]&#39; as command,<br>    4 as [priority]<br>FROM sys.indexes ind <br>INNER JOIN sys.index_columns ic ON  ind.object_id = ic.object_id and ind.index_id = ic.index_id <br>INNER JOIN sys.columns col ON ic.object_id = col.object_id and ic.column_id = col.column_id <br>INNER JOIN sys.tables t ON ind.object_id = t.object_id <br>inner join sys.schemas s on (s.[schema_id] = t.[schema_id])<br>inner join #targetColumns tcol <br>on <br>(<br>    lower(tcol.[schema]) = lower(s.[name]) AND<br>    lower(tcol.[table]) = lower(t.[name]) AND<br>    lower(tcol.[column]) = lower(col.[name])<br>)<br>WHERE <br>    ind.is_primary_key = 1 AND<br>    t.is_ms_shipped = 0 <br>group by<br>    s.[name],<br>    t.[name],<br>    ind.[name]</pre><pre>--columns to drop<br>union select<br>    &#39;ALTER TABLE [&#39; + s.[name] + &#39;].[&#39; + o.[name] + &#39;] DROP COLUMN [&#39; + c.[name] + &#39;]&#39; as command,<br>    6 as [priority]<br>from sys.objects o<br>inner join sys.columns c on (c.[object_id] = o.[object_id])<br>inner join sys.types t on (t.[system_type_id] = c.[system_type_id] AND t.[user_type_id] = c.[system_type_id])<br>inner join sys.schemas s on (s.[schema_id] = o.[schema_id])<br>where <br>    o.[is_ms_shipped] = 0 and <br>    c.is_computed = 1</pre><blockquote><em>In larger databases, dropping this many items in one go will still add data to the database log even with simple logging mode enabled.</em></blockquote><blockquote><em>Our execution of this process includes a truncation of database logs every 100 records, this is particularly useful when executing in an environment where disk space is at a premium.</em></blockquote><h3>Update Column Collation</h3><p>Once all associated items have been dropped, we can simply iterate through the list of columns and update the database collation.</p><pre>ALTER TABLE [{schema}].[{table}] <br>ALTER COLUMN [{column}] {data type}({length}) <br>COLLATE {new collation name}</pre><h3>Update Database Collation</h3><p>Now we’re in a position where we can update the core database collation. This is easy enough to do within SQL Management Studio, but we can also achieve this by executing the following SQL command:</p><pre>ALTER DATABASE {database name} COLLATE {new collation name};</pre><p>At this point we can recreate previously dropped items and take the database out of single user mode. Depending on the number of items that were changed, it may also be prudent to <a href="https://dev.to/mikekennedydev/database-reindexing-mssql-2jni">reindex</a> the database.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3508ded5c0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing User Logins with MVC and JWT]]></title>
            <link>https://systemweakness.com/securing-user-logins-with-mvc-and-jwt-37ad44044e5f?source=rss-9604a14f933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/37ad44044e5f</guid>
            <category><![CDATA[jwt]]></category>
            <category><![CDATA[mvc]]></category>
            <category><![CDATA[jwt-token]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Michael Kennedy]]></dc:creator>
            <pubDate>Sun, 19 Jun 2022 20:09:50 GMT</pubDate>
            <atom:updated>2022-07-07T08:48:13.552Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ISh5HT1djNUeiSnh" /><figcaption>Photo by <a href="https://unsplash.com/@flyd2069?utm_source=medium&amp;utm_medium=referral">FLY:D</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>At first glance, ensuring that an MVC application is fully secured can feel daunting. The most important part of the login process is the login screen itself, and while is the natural starting point, but it’s only the beginning.</p><h3>Login Screen</h3><p>In our case, we’re making use of the standard login fields (username, password &amp; login button) which we’ve expanded upon by providing a SSO sign-in options supporting both Azure and local Active Directory integration.</p><p>When a user attempts to login, we validate the credentials within our product database and return basic status information, perhaps a success code or an error message. This an area where want our error messages to remain ambiguous; we can retain an element of security by not differentiating between users who don’t exist or where a login has been attempted with an incorrect password. This simple approach makes it harder to ascertain if an incorrect username has been entered and makes it twice as hard for any hacking attempt to be successful.</p><p>We can take this a step further &amp; prevent brute force hacking attempts by temporarily blocking users or perhaps IP addresses where a number of incorrect logins have been attempted within a short time period.</p><h3>JWT Configuration</h3><p>A big problem is that once a user has logged in, we’ll still need to verify their access rights each time an operation is performed. In a modern environment where a single page can make multiple AJAX calls this can amount to a high number of repeated database calls or a lot of cached user data.</p><p>While it initially sounds unavoidable, we can drastically improve product performance by keeping those database calls down.</p><p>This is where JWT comes in.</p><p>Each instance of our application is provided with a random Client Secret. I configured ours so that it’s automatically inserted into web config at the point of installation.</p><p>This unique value is then used to provide the user with two tokens:</p><h4>Access Token</h4><p>The access token is a short-lived token typically living for 5–15 minutes. It contains commonly accessed user information, perhaps a username, configuration options and security access rights.</p><p>This information is encoded into an alphanumeric string and can optionally be encrypted.</p><pre>// using Microsoft.IdentityModel.Tokens;<br>// using System.IdentityModel.Tokens.Jwt;</pre><pre>/* <br>    Get the client secret.</pre><pre>    Our usage of the client secret ensures that the request<br>    and access tokens are generated using completely unique<br>    values.</pre><pre>    In this example we&#39;re using a hard-coded constant, but<br>    this could be achieved any number of ways.<br>*/<br>var key = Encoding.ASCII.GetBytes(_jwtConfig.Secret +<br>    ACCESS_TOKEN_SECRET_SUFFIX);</pre><pre>var tokenHandler = new JwtSecurityTokenHandler();</pre><pre>var claims = new Dictionary&lt;string, object&gt;<br>{<br>    // Add user configuration and security details here<br>};</pre><pre>var tokenDescriptor = new SecurityTokenDescriptor<br>{<br>    Subject = new ClaimsIdentity(new[] {<br>        new Claim(&quot;id&quot;, activeUser.Id.ToString()),<br>        new Claim(&quot;userName&quot;, activeUser.UserName.ToString())<br>    }),<br>    IssuedAt = DateTime.UtcNow,<br>    Claims = claims,<br>    CompressionAlgorithm = CompressionAlgorithms.Deflate,<br>    Expires = DateTime.UtcNow.AddMinutes(_jwtConfig.AccessTokenValidMinutes),<br>    SigningCredentials = new SigningCredentials(<br>        new SymmetricSecurityKey(key), <br>        SecurityAlgorithms.HmacSha256Signature, <br>        SecurityAlgorithms.HmacSha256Signature<br>    )<br>};</pre><pre>var token = tokenHandler.CreateToken(tokenDescriptor);<br>return tokenHandler.WriteToken(token);</pre><h4>Refresh Token</h4><p>The refresh token has a longer life, perhaps 4 hours. It won’t contain any sensitive information beyond a user identifier and even this can be rendered unnecessary.</p><p>The purpose of this token is simply to preserve a user login outside of an webserver session and to enable regeneration of the access token without the need to store usernames and passwords within cookies.</p><pre>// using Microsoft.IdentityModel.Tokens;<br>// using System.IdentityModel.Tokens.Jwt;</pre><pre>var tokenHandler = new JwtSecurityTokenHandler();<br>expiryDate = _jwtConfig.RefreshTokenValidMinutes;<br>var key = Encoding.ASCII.GetBytes(_jwtConfig.Secret +<br>    REFRESH_TOKEN_SECRET_SUFFIX);</pre><pre>var claims = new Dictionary&lt;string, object&gt;<br>{<br>    { &quot;expiry&quot;, expiryDate },<br>    /* <br>        We provide several login methods which aren&#39;t user<br>        specific, this will be lost when the access token<br>        expires, so we&#39;ll save it to the refresh token.<br>    */<br>    { &quot;loginMode&quot;, activeUser.LoginStatus },<br>    /*<br>        We also require a separate user CRM login so this<br>        information also gets encoded in our refresh token.<br>    */<br>    { &quot;crmRoles&quot;, activeUser.ConnectedCrmFunctionality },<br>    { &quot;isAuthenticatedToCrm&quot;, activeUser.IsAuthenticatedToCrm },<br>};</pre><pre>var tokenDescriptor = new SecurityTokenDescriptor<br>{<br>    Subject = new ClaimsIdentity(new[] {<br>        new Claim(&quot;id&quot;, activeUser.Id.ToString()),<br>        new Claim(&quot;userName&quot;, activeUser.UserName.ToString())<br>    }),<br>    IssuedAt = DateTime.UtcNow,<br>    Claims = claims,<br>    CompressionAlgorithm = CompressionAlgorithms.Deflate,<br>    Expires = expiryDate,<br>    SigningCredentials = new SigningCredentials(<br>        new SymmetricSecurityKey(key),<br>        SecurityAlgorithms.HmacSha256Signature,<br>        SecurityAlgorithms.HmacSha256Signature)<br>    };</pre><pre>var token = tokenHandler.CreateToken(tokenDescriptor);<br>return tokenHandler.WriteToken(token);</pre><h3>Login</h3><p>Once a users’ credentials have been confirmed the JWT access and refresh tokens are returned to the client as cookies.</p><p>These cookies should be set to expire at the same time as the associated JWT token, configured with HttpOnly enabled and the SameSite mode set to Lax. This will secure the cookies so that they can&#39;t be read by JavaScript and can only be included in requests sent to the originating server.</p><p>One thing of note is that cookie sizes are typically restricted to 4Kb so we need to be careful about what information is included within the access token, keeping it to critical &amp; commonly used values only and ensuring that the encoding method in place removes unnecessary text (i.e. don’t encode values using JSON with long property names).</p><p>Depending on application flow, it may be necessary to add cookies not only to the response object but also to the request object. This will permit the access token to be regenerated at the start of a call and for the new value to persist without the need to make an additional server-side call.</p><pre>var cookie = new HttpCookie(cookieName, value)<br>{<br>    Expires = DateTime.Now.AddMinutes(expiry),<br>    HttpOnly = httpOnly,<br>    SameSite = SameSiteMode.Lax<br>};</pre><pre>if (!context.Response.Cookies.AllKeys.Contains(cookieName))<br>{<br>    context.Response.Cookies.Add(cookie);<br>}<br>else<br>{<br>    /* If cookie already exists just update it otherwise we&#39;ll add<br>    more data to the HTTP response and potentially trigger an <br>    overflow */<br>    context.Response.Cookies.Set(cookie);<br>}</pre><h3>Securing Server-Side Functions</h3><p>Now that the JWT tokens are available as cookies we can secure our server-side functions. We achieve this by creating an instance of AuthorizeAttribute which in this example we&#39;ll call ProductAuthorizeAttribute.</p><p>First we need to reference this attribute in FilterConfig.cs, this will make sure that all functions are secured by default.</p><pre>public class FilterConfig<br>{<br>    public static void RegisterGlobalFilters(GlobalFilterCollection filters)<br>    {<br>        /*<br>            Set order to a value greater than 0 so that<br>            we can override default security on a<br>            per-function basis.<br>        */<br>        filters.Add(new ProductSecurityAttribute(), 255);<br>    }<br>}</pre><p>We’ll want to prevent security from being triggered on certain operations, such as the login screen. This can be done by adding the AllowAnonymous attribute to any functions that don&#39;t need to be secured.</p><pre>public class LoginController : BaseAsyncController<br>{<br>    [AllowAnonymous]<br>    public ActionResult Index()<br>    {</pre><p>If we want to apply additional security on a given function we can do this by applying the ProductSecurityAttribute to it and specifying any additional properties.</p><pre>[ProductSecurityAttribute(Operation = SecurityType.Create)]<br>public async Task&lt;ActionResult&gt; ActionName()<br>{</pre><p>We can then setup the security attribute so that it automatically reads and decodes the JWT tokens and returns the user to a login or access denied screen if appropriate.</p><pre>public class ProductSecurityAttribute : AuthorizeAttribute<br>{<br>    private bool _triggerTimeout;</pre><pre>    public ProductSecurityAttribute()<br>    {<br>        /*<br>        We need to set the attribute order to 0 so that <br>            it gets processed before the default attribute <br>            configured in FilterConfig.cs.<br>        */<br>    Order = 0;<br>    }</pre><pre>    // Extra security properties here </pre><pre>    /*<br>        Now we override the authorise command and<br>        add our own logic <br>    */<br>    protected override bool AuthorizeCore(HttpContextBase httpContext)<br>    {<br>        var hasAccess = false;</pre><pre>        // decode cookies<br>        var accessCookie = _cookieHelper.Get(_currentContext, ACCESS_TOKEN_NAME);<br>        var refreshCookie = _cookieHelper.Get(_currentContext, REFRESH_TOKEN_NAME);</pre><pre>        // decode access token<br>        var jwtUtils = new JwtUtils(_jwtConfig, HttpContext.Current, _cookieHelper);<br>        var accessToken = jwtUtils.VerifyAccessToken(accessTokenValue);</pre><pre>        /* <br>            If the access token has expired then generate a <br>            new one using the refresh token.<br>        */<br>        if (accessToken.LoginStatus == UserLoginStatus.ExpiredAccessToken || <br>            accessToken.LoginStatus == UserLoginStatus.TokenMissing) <br>        {<br>            var refreshToken = jwtUtils.VerifyRefreshToken(refreshTokenValue);</pre><pre>            /*  <br>                If the access token has expired but the refresh<br>                token is fine then regenerate both tokens.<br>            */</pre><pre>            if (refreshToken.Id &gt; 0 &amp;&amp;<br>                refreshToken.LoginStatus != UserLoginStatus.ExpiredAccessToken &amp;&amp;<br>                refreshToken.LoginStatus != UserLoginStatus.ExpiredRefreshToken &amp;&amp;<br>                refreshToken.LoginStatus != UserLoginStatus.Failure)<br>            {<br>                // regenerate access &amp; refresh tokens<br>            }                   <br>        }</pre><pre>        /*<br>            If all tokens have expired, return false and set<br>            _triggerTimeout = true.</pre><pre>            Otherwise, execute custom security code to work out if <br>            the user has the necessary access<br>        */  <br>        if (hasAccess)<br>        {<br>            // user has access<br>            return true;<br>        }<br>        else<br>        {<br>            // redirect to access denied screen<br>            SetAccessDeniedModel(httpContext, itemIdValue);<br>            return false;<br>        }<br>    }       </pre><pre>    /*<br>        When authentication fails SecurityAttribute automatically<br>        calls this function which we can override to define<br>        how the application behaves when login fails.<br>    */<br>    protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)<br>    {<br>        // child actions can&#39;t execute a redirect<br>        var isChildAction = filterContext.IsChildAction ||<br>            filterContext.HttpContext.Request.IsAjaxRequest();</pre><pre>        if (_triggerTimeout)<br>        {<br>            // The user login has timed out.<br>            var redirectParams = new StringBuilder();<br>            redirectParams.Append(&quot;?logout=true&quot;);</pre><pre>            if (HttpContext.Current.Request.ApplicationPath !=<br>                 HttpContext.Current.Request.CurrentExecutionFilePath.TrimEnd(&#39;/&#39;))<br>            {<br>                redirectParams.Append($&quot;&amp;missingSession&amp;targetPage={HttpContext.Current.Request.CurrentExecutionFilePath}&quot;);<br>            }</pre><pre>            /*<br>                If this is a child action then return an<br>                error state otherwise we can redirect the<br>                user to the login screen. </pre><pre>                If we throw 401 in an environment using IIS <br>                windows authentication then the browser will <br>                prompt the user for windows credentials so we&#39;re<br>                using a 405 instead.<br>            */  <br>            var redirectPath = $&quot;~/Login{redirectParams}&quot;;<br>            filterContext.Result = isChildAction<br>                ? (ActionResult)new HttpStatusCodeResult(System.Net.HttpStatusCode.MethodNotAllowed, redirectPath)<br>                : new RedirectResult(redirectPath);<br>        }<br>        else<br>        {<br>            // The user is logged in but access has been denied.<br>            var redirectPath = &quot;~/AccessDenied?redirect=true&quot;;<br>            filterContext.Result = isChildAction<br>                ? (ActionResult)new HttpStatusCodeResult(System.Net.HttpStatusCode.Forbidden, redirectPath)<br>                : new RedirectResult(redirectPath); // redirects the particular response, not everything<br>        }<br>    }<br>}</pre><h3>Securing AJAX Calls</h3><p>SecurityAttribute is able to redirect calls to an access denied or login screen, but we can’t do that as easily when an AJAX call fails and if a page is AJAX heavy then we’ll need to process both response types.</p><pre>$.ajaxSetup({<br>    // Prevent ajax calls from caching the response<br>    cache: false, <br>    headers: antiForgeryTokenHeader(),<br>    // Intercept the AJAX complete function<br>    complete: function (xhr) {<br>        if (xhr.status == 405) {<br>            /*<br>                User session has timed out.<br>                Redirect user to the login screen,<br>                encode the target page in the URL <br>                so we can redirect on login<br>            */<br>            var rootVal = &quot;@(Url.Content(&quot;~&quot;))&quot;;<br>            var currentHref = window.location.href;<br>            var targetPage = currentHref.substring(currentHref.indexOf(rootVal));<br>            var targetPageParam = &quot;&quot;;<br>            if (targetPage != rootVal) {<br>                targetPageParam = &quot;&amp;targetPage=&quot; + targetPage;<br>            }<br>            window.location.href = &quot;@(Url.Content(&quot;~/Login&quot;))?logout=true&amp;missingSession&quot; + targetPageParam;<br>            setLocalStorageUserState(&quot;logout&quot;);<br>        }<br>        else if (xhr.status == 403) {<br>            // access denied message<br>            window.location.href = &quot;@(Url.Content(&quot;~/AccessDenied?redirect=true&quot;))&quot;;<br>        }<br>        // ignore signalr notifications for service status etc<br>        else if (xhr.responseText != &#39;{ &quot;Response&quot;: &quot;pong&quot; }&#39;) <br>        {<br>            // process user activity timeout<br>            userTimeoutReset();<br>        }<br>    }<br>});</pre><h3>Making Token Values Available to the Browser</h3><p>The standard approach should always be to create the JWT cookie using the HttpOnly parameter because this will ensure that an attacker can&#39;t leverage JavaScript to read the access and/or request tokens.</p><p>However there are scenarios where it might be necessary to read values included within the access token from within the browser.</p><p>In this scenario it’s useful to know that a JWT token is split into Header, Payload and Signature. We can split these into separate cookies and allow payload data to be read from within JavaScript but re-combine them within server operations in order to validate the token.</p><h3>Forcing Session Timeout</h3><p>We can use this method (or another cookie) to expose the amount of time until the users session is due to expire and display a warning message on-screen before automatically logging the user out.</p><pre>function userTimeoutReset() {<br>    //reset any active timeout<br>    userTimeoutElapsed(false); </pre><pre>    var timeoutDate = get_cookie(&quot;t&quot;);<br>    if (timeoutDate != null &amp;&amp; timeoutDate.length &gt; 0) {<br>        /* <br>            Calculate ticks until we should start <br>            displaying the timeout warning<br>            with 2 minutes leeway<br>        */<br>        var timeoutTicks =<br>            new Date(timeoutDate) -<br>            new Date() -<br>            ((USER_SECURITY_DEFAULT_TIMEOUT_PERIOD_MINUTES + 2) * 60000);</pre><pre>        userTimeout = setTimeout(function() {<br>            userTimeoutElapsed(true);<br>        }, timeoutTicks);<br>    }<br>}</pre><pre>function userTimeoutElapsed(timeoutElapsed)<br>{<br>    if (userTimeout != null)<br>    {<br>        clearTimeout(userTimeout);<br>    }</pre><pre>    if (userInterval != null) {<br>        clearInterval(userInterval)<br>    }</pre><pre>    if (timeoutElapsed) {<br>        userTimeoutCountdownPeriod = USER_SECURITY_DEFAULT_TIMEOUT_PERIOD_MINUTES * 60;<br>        setLocalStorageUserState(&quot;resetTimeoutCounter&quot;);<br>        userInterval = window.setInterval(function () {<br>            if (userTimeoutCountdownPeriod &gt; 0) {<br>                userTimeoutCountdownPeriod = userTimeoutCountdownPeriod - 1;<br>            }</pre><pre>            $(&quot;#userTimeout&quot;).html(&quot;Inactivity timeout in &quot; + userTimeoutCountdownPeriod + &quot; seconds&quot;);</pre><pre>            if (userTimeoutCountdownPeriod == 0) {<br>                window.location.href = ROOT + &quot;Login?logout=true&amp;timeout=true&amp;targetPage=&quot; + window.location.pathname + window.location.search;<br>                setLocalStorageUserState(&quot;logout&quot;);<br>            }<br>        }, 1000);<br>    }<br>    else {<br>        setLocalStorageUserState(&quot;abortTimeout&quot;);<br>    }<br>}</pre><h3>Persisting Logout to all Tabs</h3><p>Finally, if the user has multiple tabs open then we’ll need to maintain logout timer between all tabs to avoid the user being automatically logged out on a tab that’s been ignored for a few hours.</p><p>We can use browser local storage to send messages between tabs.</p><pre>function setLocalStorageUserState(value) {<br>    if (window.localStorage != null) {<br>        /* <br>            Reset the existing value <br><br>            The change event won&#39;t trigger if the <br>            value is the same so we&#39;ll need to<br>            do it twice.<br>        */<br>        window.localStorage.setItem(&quot;UserState&quot;, &quot;&quot;); <br>        window.localStorage.setItem(&quot;UserState&quot;, value);<br>    }<br>}<br><br>/* <br>    Listen for events from other tabs, <br>    process result in a manner which <br>    will prevent getting into an <br>    endless loop of tab communication<br>*/<br><br>window.addEventListener(&#39;storage&#39;, (event) =&gt; {<br>    if (event.storageArea != localStorage) <br>        return;<br><br>    /* <br>        We&#39;re processing a message from another <br>        tab, prevent this tab from sending messages <br>        to other tabs &amp; sending us into a loop<br>    */<br>    if (event.key == &quot;UserState&quot; &amp;&amp; event.newValue != &quot;&quot;) {<br>        // if the user has an active session<br>        if (window.location.href.indexOf(&quot;Login?logout&quot;) == -1) {<br>            if (event.newValue === &#39;logout&#39;) {<br>                // another page has been redirected to the login screen<br>                window.location.href = ROOT + &quot;Login?logout=true&amp;targetPage=&quot; + window.location.pathname + window.location.search;<br>            }<br>            else if (event.newValue === &#39;abortTimeout&#39;) {<br>                // action was performed on another tab while we were counting down to timeout, abort this<br>                userTimeoutElapsed(false);<br>            }<br>            else if (event.newValue === &#39;resetTimeoutCounter&#39;) {<br>                // action was performed on another tab, reset the timeout counter<br>                userTimeoutElapsed(true);<br>            }<br>        }<br>    }<br>});</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37ad44044e5f" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/securing-user-logins-with-mvc-and-jwt-37ad44044e5f">Securing User Logins with MVC and JWT</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Case study: HTML email editor]]></title>
            <link>https://medium.com/design-bootcamp/case-study-html-email-editor-8854cfe8776c?source=rss-9604a14f933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8854cfe8776c</guid>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[responsive-email]]></category>
            <category><![CDATA[email-marketing]]></category>
            <category><![CDATA[case-study]]></category>
            <dc:creator><![CDATA[Michael Kennedy]]></dc:creator>
            <pubDate>Sat, 02 Jan 2021 20:06:48 GMT</pubDate>
            <atom:updated>2021-01-02T20:06:48.601Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dS1pCtu5yZsJjSH6qtC-tw.jpeg" /></figure><h3>Applications that allow creation of stunning responsive emails are everywhere yet it’s rare to find any that appeal to users of all experience levels.</h3><p>As a professional, writing a responsive website is an easy process. Take a dash of HTML, mix with JavaScript and CSS, finally sprinkle with a bundle of experience and we end up with something pretty amazing.</p><p>But even for professional designers, repeating the same tasks within an HTML <em>email</em> is exponentially harder, mixing techniques from years gone by and modern practices in order to provide an optimal experience for all email clients.</p><p>This <a href="https://medium.com/@MikeKennedyDev/getting-started-with-html-email-fadce6c5d8c5">previous article</a> discusses the complexity of Responsive HTML email design and the difficulties that can arise for the most experienced of us. With this in mind, how do we go about producing an editor that’s perfect, or at least as close to perfect as we can get.</p><h4>User Profiles and Experience Levels</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/0*EuETGNLW8Y_aZvvq.jpg" /></figure><p>There are lots of applications that allow experienced users to produce stunning responsive emails. There are also countless apps that allow inexperienced users to produce equally stunning emails. However, it’s rare to come across an HTML email editor that appeals to both groups of users.</p><p>The reason for this is simple to understand once you consider the level of knowledge possessed by the two user profiles. The difference comes down to the relationship between senior and junior roles.</p><p>At the novice level, users might have an idea of what they want a mailing to look like but not the experience to produce it quickly; they need help to build something to allow them to concentrate more on the content than layout and behaviour.</p><p>At the expert level our users are more likely to have a well-defined idea of what their mailing should look like and how it should be laid out, but often find that the restrictions of the editor prevent their vision from being fully realised.</p><p>More often than not, what we end up with is an app that provides the building blocks but often requires consultants or even paid developers in order that vision to make it to a users’ inbox. All this comes with a hefty expense for clients.</p><p>So what HTML Email editors are out there, do they achieve a balance between the two approaches or do they just provide simple editors and force their clients to pay hundreds if not thousands for something more bespoke?</p><h4>User Expectation</h4><p>Before we consider how a responsive email application ought to work, we must first determine what users expect to see and how established practices mould that expectation. Providing something familiar helps break down the walls between our novice &amp; expert user groups, it offers a starting point with which everyone is familiar allowing us to tag on extra features that users discover as they become more intimate with the processes we’ll put in place.</p><p>Until a few years ago, the common denominator for all users would have been something like Microsoft Outlook. This is still common for business users, however with cloud computing and mobile devices becoming more common, simplified email clients like Gmail mean that users don’t necessarily all have the same level of experience.</p><p>So our lowest common denominators range between the simplistic UI provided by Gmail/Outlook.com and the text editors such as Microsoft Word that allow creation of more advanced layouts. But; we’re not producing a PDF document here, we’re looking at something that can be displayed in varying sizes, on varying devices and that’s before we even consider DPI and device text size options.</p><h4>Existing HTML Email Editors</h4><p>Email HTML editors come in all shapes &amp; sizes, but they can be broadly split into two categories — Text editors and layout designers.</p><p>Users are familiar with the former, embodied in the likes of Outlook and Gmail. There are other options, but the restrictions of HTML in general and specifically in email make it harder to achieve a design guaranteed to work on every device.</p><p>There are many, many existing HTML email designers out there, but for the sake of simplicity we’ll narrow it down to some of the common ones.</p><p><a href="https://mailchimp.com/"><strong>MailChimp</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HIYcUVHVytjhuxfP.png" /></figure><p>MailChimp comes closest to mimicking a traditional email interface, the initial screen is split nicely into sender, recipient, subject and content areas.</p><p>While there are a few oddities it provides a decent, if somewhat limited editor. Perfect for users who want to produce something quickly without any fuss.</p><p><a href="https://www.campaignmonitor.com/"><strong>Campaign Monitor</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NvdM4Zjk6yxJYH4X.png" /></figure><p>Campaign Monitor ups the game a little. It doesn’t provide quite the same traditional email interface, opting to hide recipient selection until the entire mail has been designed; a common approach among marketers but not suitable for every situation.</p><p>Its editor is a little more advanced than MailChimp, and provides a few nice extra touches like image cropping. <em>Extra brownie points for its collection of ready-to-go layouts.</em></p><p><a href="https://beefree.io/templates/"><strong>BeeFree</strong></a><strong> <em>(or Pro)</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uN9Oz35xM03wcJ1c.png" /></figure><p>What BeeFree provides is far more of an email editor rather than a fully-fledged mailing system. It provides a more than generous selection of pre-configured layouts but generated content then has to be download for use in a separate mail client.</p><p>This editor is far more refined than its counterparts, providing a well defined section editor and drag/drop interface, and options for padding, line height, hexadecimal colour codes alongside a brilliant image editor.</p><p>The editor receives extra kudos for its ability to show or hide elements in desktop/mobile mode. <em>Now, you might argue that hiding items in mobile mode is the wrong approach, and in most circumstances you’d be right, but without deeper knowledge of HTML then there really isn’t any other option here.</em></p><p><a href="https://mosaico.io/"><strong>Mosaico</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5bVJlY2AgE84kYBT.png" /></figure><p>Mosaico takes a similar approach to the Bee editor, ignoring traditional mailing elements and producing pure downloadable HTML content.</p><p>The editor provides preconfigured, draggable sections. Editing of section layout is limited, however it does provide a range of stylings that can be applied to individual content items and full HTML editing of certain areas.</p><p>The Mosaico editors’ handling of colour schemes is where it shines, providing the ability to swap the colour scheme on any particular section at the click of a button. There may only be two colour schemes available in the default view but the editor hints at the ability to add further schemes.</p><p>Of these well-known tools, there’s no one clear best-of-breed option. They all offer good WYSIWYG editors, each with their own advantages. They’re all brilliant tools in their own right, but in their desire to simplify the approach they miss out on the bigger picture and the pixel perfect designs that so many users are looking to achieve.</p><h4>Features of the ideal HTML editor</h4><p>We know what users are likely to expect, and for the purposes of a design review, we have an idea of what other editors can achieve (and more importantly, what they’re missing out on). But we want a fully functioning HTML email editor, usable by all and that requires some more in-depth thought about how <em>our</em> editor should work.</p><ul><li>The most important thing <em>(and something that should ordinarily go without saying)</em> is that our editor needs to be as close to WYSIWYG as is possible. <br>There will always be differences in the way that certain mail clients render our generated HTML, but users need to be able to make a change and see its immediate impact on the design while maintaining a high degree of certainty as to how it will look to the mail recipient.<br>We should be assisting this further, with at a minimum, the ability to swap the editor mode between different screen sizes and view modes in order to simulate how a mailing may look on a smaller screen or in dark mode.</li><li>A user won’t necessarily know all details of a mailing at the point of creating it; as with product design, the details can be in flux right up until the final design is complete.<br>With this in mind, we want users to be able to view sender, subject, recipients and the email design all at the same time<em> (and perhaps even to include some additional fields like the and send time etc)</em>. But we don’t want this overshadowing the design view, ideally these basic fields should be visible alongside the mailing content.</li><li>Pre-defined layouts look pretty and help to inspire users, but they can be restricting. So we’ll want the choice to select between several layouts (or a blank layout), similar to how modern versions of Microsoft Word operates.</li><li>To get past the restrictiveness of such layouts, we’ll want to complement our functionality with draggable rows which can be positioned anywhere within existing content in order to provide responsive email elements. <em>For example we might want a tri-column section which automatically stacks on smaller devices; we might want to allow content to be dragged into a very specific area, preventing changes to all other areas.</em></li><li>In order to maintain compatibility with all mail clients, our sections will need to be table-based. In turn, this opens us up to the possibility of introducing another area that users of common office applications will be used to: the ability to split or merge cells in order to further redefine the layout.<br>Splitting or combining sections will update the manner in which responsive email design will operate so an element of caution is required. Also many HTML emails tend to use multiple levels of nested tables, we’ll need a method of separating those used for content from those added purely for layout purposes.</li><li>With our layout in place, we’ll need to provide the ability to add content components, making adding content as easy as possible at a minimum we’ll need to provide text, image and buttons with the default mode being to add text.<br>We’ll want to give consideration to dividers, bullet points, social media and perhaps even content pulled from an RSS feed. Some mail clients support gifs and videos, so we may also want to consider this, but there are other implications around using these sort of features which would need to be considered.<br>When dragging items we’ll need to implicitly create a table structure around our objects to allow them to be positioned properly, this would also facilitate easier repositioning of components.</li><li>To help users retain similar designs throughout multiple mailings users will want to re-use sub-sections of designs elsewhere in much the same way as adding an image or text area to a mailing. We can allow users to build collections of design elements for later use, even allowing importing of design elements from previous mailings.</li><li>On selecting a section area or a content item we’ll need to provide a list of common options available in most text and HTML editors.<br>This will require separating standard text editor functions into a standard menu/ribbon, or perhaps inline editor while the HTML editing functions (which typically would require more screen space) are held elsewhere.<br>At the very least we’ll want to expose the standard font options, alignment, colour options (foreground, background &amp; text highlight), padding options &amp; table manipulation functions. But we’ll want to keep it simple, with context-sensitive options.</li><li>CSS is a huge part of HTML content, advanced clients tend to setup standard CSS styles for their emails, sometimes reusing stylesheets from other locations such as company websites.<br>Most email clients require CSS in HTML email to be inlined; to simplify the lives of developers we’ll need to provide the ability to add CSS (or even SCSS/LESS) directly to an email and automatically inline it at an appropriate time.<br>Exceptions to this are media queries (usually produced to work alongside dark mode and responsive design) which will need to be handled separately. We can handle separation of media queries from the core CSS automatically, but users will need some method of editing these options.</li><li>Full HTML access can be dangerous, but there are clients who will have their designs professionally built and will then want to import that content into an editor for easier manipulation. Equally there will be those who know exactly what they want and how to go about it.<br>Most HTML email editors tend to concentrate on simpler functionality, but ours needs to be opened up to users of all levels in a safe manner.</li></ul><h4>Editor Layout</h4><p>So here I am, typing into a Microsoft Word document with both the left and right-hand panels open alongside my document, and it occurs that when there is enough screen space to play with, this is the ideal layout for our HTML editor, not only because it’s an interface which will be familiar to users, but because it allows us to better guide them through the creative process.</p><p>We start on the left, with our non-design items (subject, sender, etc) and drag/drop components, move to our full design and WYSIWYG editor and provide a final panel in which a selected component can be edited. This allows the users flow to move left-to-right with the items more likely to be used at the beginning on the left and everything else on the right.</p><p>There is of course, a bit of rearranging to be done for smaller screens, where the visibility of content should be prioritised; the nature of such devices means that it will always be easier to create an HTML email when using a larger screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aomqgmL1ROl5Qd5n.jpg" /></figure><p>In this screen design, we’ve placed a number of tabs on the left-hand side with the following options:</p><blockquote>Email — containing typical settings for email subject, recipients, sender, etc.</blockquote><blockquote>Layout — containing draggable layout sections (single column, multiple columns, 60/40 split, etc).</blockquote><blockquote>Design — containing draggable content items and user-defined snippets.</blockquote><blockquote>CSS — for configuration of pre-inlined CSS to be applied to the entire mailing.</blockquote><p>In earlier designs, this section contained a button to expand the section over the design area, however given that this area could well include the need for a scrollbar this could cause the user interface to appear cluttered. But with the possible length of fields such as the subject and sender name more screen space would be useful to users. We could achieve similar functionality by automatically expanding the area of the emails tab as soon as a user selects a field.</p><p>The right-hand area is displayed only when an item within the editor is selected:</p><blockquote>Containing CSS and HTML attributes appropriate to the item <em>(those that will work within HTML email).</em></blockquote><blockquote>Toward the bottom of the section we have options to swap between complexity modes, standard, advanced and expert — these may be better off being placed within the “View” tab of the main editor if usage can be expanded outside of this area. This would have the effect of making users search for advanced options and reduce the likelihood of making advanced changes to areas that they don’t fully understand (particularly important for HTML emails).</blockquote><p>Finally, the central area takes a more traditional word-processor approach, with a central defined content area and options to zoom in and out in order to view the content in its entirety.</p><p>A ribbon style menu at the top of the screen provides additional options:</p><blockquote>Edit — standard edit toolbar containing font options, alignment, text colour, paste formatting options, etc.</blockquote><blockquote>View mode options, allowing users to swap between simulated design views for desktop &amp; mobile views. Also provides functionality to view without CSS media queries to simulate appearance under desktop applications like Outlook.</blockquote><blockquote>Send options — containing final send operations, validation, configuration of plain text, send time, etc.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9LLUD1CuDc7JSwqi.png" /></figure><p>In the examples of the left-hand panel here, the first tab shows our primary email options, required fields are pushed to the top <em>(and will be identified with an appropriate icon)</em> while less important items are further down. Expandable to any number of possible options, although given the plethora of CRM systems available, recipient selection may be better off being defined as a completely separate screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CO9uYRhSB5See8RJ.png" /></figure><p>The simplistic drag and drop interface initiated from the second tab provides the ability to build the layout of the email design with built-in responsive design elements. While not displayed here, the appearance of the third tab would follow a similar design approach with the exception that design elements need to be dragged into an existing layout element rather than directly onto the canvas.</p><p>As discussed above, the right-hand panel contains configuration options for all HTML attributes and CSS settings within stylised accordion settings. In smaller screen designs, this panel is repositioned to the left of the screen and in even smaller screens the left pane is collapsed entirely until required.</p><p>The complexity of these options will be driven by settings within the view tab. Standard mode provides most options but keeps the configuration simple (i.e. allowing padding to be set to a single value), advanced opens it up to the usual options (i.e. allowing top/bottom/left/right padding values to be set independently) while Expert mode allows users to set the padding values directly (i.e. users can type whatever they deem appropriate, including usage of CSS variables which will be inlined into HTML content as part of a separate process).</p><p>The design view is intended to operate in as close a manner to a standard text editor as possible, the key differences being that administrators are able to define sections that cannot be edited, this ensures that email designs will always be able to follow a set design pattern. HTML content is hidden except when running under Expert mode which provides full access to the underlying HTML of individual sections and components.</p><p>Finally, in addition to editing emails directly, the designer doubles as a template editor, giving expert users access to the entire HTML content and allowing them to define areas where layout areas can be added by standard users. This allows provision of functionality impossible in all HTML email editors where clients want to add double borders and other design elements around the entire content — something that the adding of layout sections can’t deal with on its own, particularly where older email clients are concerned.</p><h4>Conclusion</h4><p>In conclusion, creating a pretty, responsive HTML emails has always been a complex task. Balancing behaviour so that users with all levels of experience can construct their own content will always be something of a tight-rope walk, but given enough consideration of the options we make available to our users anything is possible.</p><p><strong>Thank you for reading, If you got this far please feel free to leave a comment, alternatively if you were even remotely entertained please hit the </strong>👏 <strong>button, or </strong><a href="https://twitter.com/MikeKennedyDev"><strong>follow me on Twitter</strong></a><strong>.</strong></p><p>Originally posted on my blog <a href="https://www.mikekennedy.co.uk/Blog/Entry/18">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8854cfe8776c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/design-bootcamp/case-study-html-email-editor-8854cfe8776c">Case study: HTML email editor</a> was originally published in <a href="https://medium.com/design-bootcamp">Bootcamp</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with HTML email]]></title>
            <link>https://medium.com/@MikeKennedyDev/getting-started-with-html-email-fadce6c5d8c5?source=rss-9604a14f933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/fadce6c5d8c5</guid>
            <category><![CDATA[email-marketing]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[email]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Michael Kennedy]]></dc:creator>
            <pubDate>Tue, 26 May 2020 10:45:26 GMT</pubDate>
            <atom:updated>2022-07-19T12:21:42.120Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<p>An examination of the basics of professional looking HTML email.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f5rQiokrYOvqNn2cFi70rQ.jpeg" /></figure><h4><strong>For most of us, producing a professional email at work is easy — open your chosen mail client; select your recipients; add a subject line and type your content. If you’re anything like me the hardest part is tweaking the wording so that it puts your message across with the right professional ambience.</strong></h4><p>This process suits most of us during our day-to-day lives. Most email applications allow us to go further than basic text, quite often providing full text editor functionality, this is more than enough functionality for the scenarios which most of us are ever likely to encounter.</p><p>But there’s a step beyond that which we don’t usually have to think about, fully formatted HTML emails like those from Amazon, eBay and countless other services giving us account updates or sending marketing communications.</p><p>Going about producing an email with this level of professionalism is a whole step above what most email applications are capable of.</p><p>We might assume that all we need to write an HTML email is some basic HTML knowledge. To a certain extent this is true; but — unlike modern web browsers which receive tend to have high-pace release schedules and automatic updates — email clients tend to remain static.</p><p><em>Put simply, email clients are stuck in the past, if we want to write a professional looking HTML email, we need to take that onboard from the get-go.</em></p><p><strong>Email Clients</strong></p><p>Email clients come in three distinct categories — traditional windows applications (such as Outlook or Apple Mail), web based applications (such as Gmail or Outlook.com) and mobile applications (like Apple iPhone or Samsung Mail).</p><p>In 2019, Litmus <a href="https://litmus.com/blog/infographic-the-2019-email-client-market-share">reported</a> that usage of web based email clients and mobile applications were evenly matched with mobile apps remaining marginally ahead of web clients for the past three years. Usage of windows clients has remained at around 18% for the last four years but interestingly the data shows a potential upward trend.</p><p>The other important piece of information that this report shows us, is that Microsoft Outlook is the third most used email client; this is up from #5 the previous year and accounted for 9.2% of all recorded email opens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-xAMxCfpqGygrCMH.png" /></figure><p>The reason that this is of particular importance is because Outlook uses Microsoft Word to render emails* and has done since 2007. As a consequence, Outlook suffers from a bunch of behavioural quirks which adds an <em>extremely</em> high level of complexity to HTML emails. Microsoft have <a href="https://freshinbox.com/blog/the-outlook-team-reaches-out/">previously indicated</a> that they may be willing to address this, however as of Outlook 2019, little has changed; and even if they had swapped to a web based rendering engine we’ll still be picking up the pieces from older installed versions for years to come.</p><blockquote><em>I’m still running Outlook 2013 on my personal laptop (although I now rarely use it), my office PC runs Outlook 2016 which gets used all the time. However I can’t see myself going through the hassle of upgrading it any time soon.</em></blockquote><p>* Except Office 2011 on Mac which used a separately bundled email application.</p><p><strong>Email Content</strong></p><p>Conventional web development practices advise positioning elements using divs and floats. More recent practices expand on that with advanced CSS functionality such as Grid and Flexbox.</p><p>None of this more advanced functionality can be applied to emails because Outlook cannot possibly support them. We’re also restricted because of the nature of displaying an email within a browser:</p><ul><li>Use of CSS is mostly restricted to inline styles (because we don’t want styles from the opened mailing breaking the layout of the parent page).</li><li>Use of JavaScript (imagine the security implications).</li><li>Use of iFrames — (Limited use in some clients*, unlikely to be of wide use because of the implications of introducing CSS style tags and JavaScript).</li><li>Embedded audio or video content is unsupported by most email clients (I get annoyed at social media videos that auto-play, doing so within an email would be a sure-fire way of a sender getting themselves blocked).</li><li>Forms — a number of email clients treat forms as a security risk, some will trigger spam filters.</li><li>SVG Images are largely unsupported by the majority of email clients.</li></ul><p>With all these restrictions in mind and to support the lowest common denominator; we have to go back in time and properly format our content using nested tables. We’ll also need to be more cautions about our choice of formatting options, resisting the temptation to use more recent CSS options and where possible defer to HTML attribute equivalents such as align, valign, cellpadding, cellspacing, width, border etc.</p><p><strong>Email CSS Styling</strong></p><p>In the past, support for CSS styling within email clients has been quite patchy. Although this has been gradually improving, we’re still greatly restricted by the email clients that our recipients will have installed.</p><p>A large percentage of web based clients now support &lt;style&gt; tags (best placed within the &lt;head&gt; section) while a small percentage support externally referenced CSS files using &lt;link&gt; tags.</p><p>As a best practice, all CSS styles should be applied directly to elements using inlined styles. In practice it’s useful to create CSS styles in the usual way and use a third party tool such as <a href="https://github.com/premailer/premailer#readme">premailer</a> to automatically inline our styles and reduce bugs. Style tags should be used with caution, tho they still have their place when it comes to responsive email design.</p><p>Unsurprisingly, support for CSS styles within emails isn’t as wide ranging as it is in normal web development, we have a core group of CSS options available to us, after which we’ll need to take an approach of progressive enhancement when adding other functionality.</p><p><strong>Safe CSS Properties</strong></p><p>CSS properties which are well supported across all email clients or that can be used without fear of causing display issues in other clients.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*vvJ2F3TjCLm0j0tN1DcYaQ.png" /></figure><p><strong>Well Supported CSS Properties</strong></p><p>CSS properties which are supported by the majority of email clients, can be used with the appropriate fallback or using a pattern of progressive enhancement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*CZT6P8hDz_JoGz1IMcyIHw.png" /></figure><p><strong>CSS Properties to Avoid</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*LXSjjABAwtj1OYbfOTzRmA.png" /></figure><p><strong>Font Styling</strong></p><p>As with fonts on websites, your selected font depends on the fonts available on the users system; it’s always best to select a fallback when working with a less common font. The same goes for web-fonts, which not all email clients support, again requiring that a suitable fall-back is in place using inline CSS.</p><p>We also need to be conscious that CSS support for font styling options under older email clients can be a little erratic. To be absolutely certain of applying bold, underline, italic and strike-through styles we need to fallback to &lt;strong&gt;, &lt;u&gt;, &lt;em&gt; and &lt;del&gt; syntax.</p><p>See <a href="https://templates.mailchimp.com/design/typography/">this article</a> by Mailchimp which digs deeper into font usage in HTML email.</p><p><strong>Responsive Email Design</strong></p><p>Responsive design is best conducted when creating emails with a predefined maximum width in the region of 600–800 pixels, this range covers the width available in the majority of applications. There’s little point in expending time on sizes not generally required by users particularly with the reduced levels of content in email communications.</p><p>The 600px figure goes back to the days of 1024px x 768px screens and the size of Microsoft Outlooks viewable area in those days with around 424px taken up by outlooks sidebar and the vertical scroll for email content.</p><p>With responsive design we have a bit more flexibility, but we still have to consider other non-technical elements such as the users attention span over longer lines and how much harder it is to trace back to the beginning of the next line without losing your place.</p><p>Many email clients still require their content to be held in a base table, so as far as responsive design is concerned, this has to be our starting point.</p><p>We’ll configure a parent table with 100% width, this would perhaps contain a default background colour which differentiates itself from the mail client. We’ll then add a child table, this table is assigned a max-width within the desired range and forced to the centre of the viewable area.</p><p><em>Note that wherever possible we’re positioning our components using older style attributes rather than CSS styles.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hm1QKfrIpE-OvLeY.png" /></figure><p>Our responsive options when building HTML emails are greatly restricted without the likes of Flexbox or CSS Grid to work with. We do have the ability to write basic @media queries but <em>should</em> we use them?</p><p>Writing a responsive email isn’t like putting together a responsive website where you have maybe three or four major browsers to worry about, most of which are based on Chromium anyway.</p><p>Device types, widths, pixel density etc are far more varied, just because we can use media queries doesn’t mean that we should use them for anything more than progressive enhancement.</p><p>Our alternative to media queries is to use an approach termed as “fluid-hybrid”. With this process we don’t need to worry about matching screen designs to different sizes. We create a parent “ghost” table which has a width value of 100% and a max-width of our maximum defined email width defined in pixels (say 600px), into that table we add our &quot;responsive&quot; elements in the form of additional table elements or containers each with the same 100% width value and an appropriate max width (say 2 equal columns each with a max-width value of 350px).</p><p>Taking this approach means that our email content will always fill the available space and will naturally drop from columns to rows when the screen width is not wide enough.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ld-DXF6gKFFIPQeD.png" /></figure><p><strong>Other Areas of Concern</strong></p><p>Regardless of which approach we take, there are a number of areas that we may need to give consideration to:</p><ul><li>When supplementing inline styles by using CSS style tags, be sure to make use of the `!important` flag where there may be overriding properties within the inlined CSS, as this will take priority.</li><li>Split any responsive CSS code into separate style tags, if there are any errors or compatibility issues then the client may strip the entire style section from the email source, separating CSS into sections will reduce the likelihood of this causing further problems.</li><li>When configuring media queries on mobile devices it’s easy to concentrate on device width as we would do normal responsive web development, but pixel density varies more widely on mobile devices. This should also be considered when selecting images to ensure that users have nice crisp and clear experiences regardless of device</li><li>When using GIFS, remember that some mail clients will only display the first frame.</li></ul><p><strong>The Future: Dark Mode</strong></p><p>With the increasing use of dark mode options within email clients (with Gmail recently introducing this as an option), dark mode in email design is becoming more prevalent.</p><p>Email clients are still figuring out the best way of implementing dark mode, some just change the email interface while others provide varying degrees of colour inversion.</p><p>The core problem around dark mode is display of images and HTML elements traditionally designed to work on a lighter background. For example a darker logo on a transparent background won’t be readable in dark mode. Most of these sort of issues can be tackled with a little forethought but this is really just scratching the surface of what will be possible in the future.</p><p>For reference, Litmus have produced a guide on how to tackle dark mode in emails <a href="https://www.litmus.com/blog/the-ultimate-guide-to-dark-mode-for-email-marketers/">here</a>.</p><p><strong>Final Thoughts</strong></p><p><strong>Know your audience</strong>: With the inclusion of an invisible 1x1 pixel image we can read the client <a href="https://developer.chrome.com/multidevice/user-agent">user agent string</a> and retrieve some basic information without breaching GDPR, CASL or any other data protection regulations.</p><p>This can be decoded to give us information about the type of device our recipients are using and the application they’re opening it with.</p><p>While there are some scenarios where an email client may not automatically render images, this approach should give us enough information to identify the range of devices our emails are being opened with. We can then adjust our approach accordingly.</p><p><strong>Test, test and test some more</strong>: If budget allows, use an email testing service, such as Litmus or Email on Acid which will automatically test your email content to give you an idea of how it would appear under different devices.</p><p><strong>Don’t forget about plain text content</strong>: We can produce fancy looking emails, but we can’t forget that even now, not all email clients can read HTML content. Perhaps users have HTML content turned off for accessibility purposes, perhaps they’re still using an old blackberry, perhaps they’re reading an email on an iWatch. Even if it’s automatically converted from HTML. Plain text email conent may not be as important as it once was, but it’s still important.</p><p><strong>Don’t over complicate</strong>: The idea of keeping to a simplistic design doesn’t <em>just</em> apply to HTML email content. The range of devices and applications available makes it a far greater concern than normal.</p><p>In the end, there’s no point in producing a fancy email design which will only work for 20% of users. When in doubt, keep designs simplistic to reduce the likelihood of display issues in different clients.</p><p>Content is still king. For all we can achieve with HTML email, if the end result is that if we force users to <em>think</em> about how they’re going to read an email then it’s not worth it.</p><p><strong>Thank you for reading, If you got this far please feel free to leave a comment, alternatively if you were even remotely entertained please hit the </strong>👏 <strong>button, or </strong><a href="https://twitter.com/MikeKennedyDev"><strong>follow me on Twitter</strong></a><strong>.</strong></p><p>Originally posted on my blog <a href="https://www.mikekennedy.co.uk/articles/blog/getting-started-with-html-email">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fadce6c5d8c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Grief-inspired design]]></title>
            <link>https://uxdesign.cc/grief-inspired-design-b9710b04eda8?source=rss-9604a14f933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9710b04eda8</guid>
            <category><![CDATA[application-design]]></category>
            <category><![CDATA[grief]]></category>
            <category><![CDATA[user-experience]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[ux]]></category>
            <dc:creator><![CDATA[Michael Kennedy]]></dc:creator>
            <pubDate>Sun, 13 Jan 2019 23:12:46 GMT</pubDate>
            <atom:updated>2020-05-17T12:35:17.478Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>Product design doesn’t have anything in common with processing intense grief. Does it? Sometimes we have to be forced into taking a step back in order to see the obvious.</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XWN6pwOupuTBLYgK" /><figcaption>Photo by <a href="https://unsplash.com/@benwhitephotography?utm_source=medium&amp;utm_medium=referral">Ben White</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This is a personal tale of how the loss of a family member lead me to rediscover a love of design, take stock of day-to-day life and bring some good to others.</p><h4>Eight days before Christmas</h4><p>The phone rings; the <em>unthinkable</em> has happened; a deliberate act by somebody we trusted has taken the life of a loved one before her time. The perpetrator of this act also saw fit to take their own life mere hours later.</p><p>The next few months are a jumble of emotion and pointless <em>(and ultimately incorrect)</em> self-recriminations, these are intermingled with a funeral, inquest and countless news articles almost all of which manage to manipulate events for the sake of a more saleable story.</p><p>Ultimately, our family is left with is a list of questions that can never be answered, Why. What if. How could anyone do that.</p><p>Two years later and to many, our loved one is merely a statistic; another woman murdered by her spouse for what? <em>Jealousy? </em>We’ll never truly know.</p><h4>Pushing forward</h4><p>Everyone grieves in their own way; everyone feels it differently. We didn’t have any advanced warning, no time to prepare; this wasn’t something that can be classified as an act of god. It was deliberate. Our experience opens our eyes to how vulgar and unforgiving the world can be.</p><p>It’s still very raw, that’s unlikely to change for the foreseeable future. Yet deep down, we know it could have been worse; that others have been put through events which make our own experience pale in comparison.</p><p>Yet even with all this, Claire would’ve been the first to start plying us with alcohol until we were all laughing and smiling.</p><p>She would’ve reminded that we should love every minute of our lives.</p><p>She would’ve pointed out that life has to go on.</p><p>For our children.</p><p>For ourselves.</p><p>Somehow.</p><p>Keep calm and carry on, right?</p><h4>Spaghetti-brained grief</h4><p>I’m a software developer, I spend my week staring at complex code, muttering and swearing (<em>sometimes</em> even under my breath 😉) until everything compiles.</p><p>Grief complicates even the simplest task, it makes everything feel insurmountable and makes us question ourselves even when we have no need to. In such a situation, we gravitate towards effortless solutions in what usually ends up feeling like a meaningless effort to reassert a level of control over life.</p><p>Writing software isn’t just code, in the right mindset it’s an art form. Admittedly most users don’t get to see our art because it’s hidden away in compiled DLL’s and other encoded files.</p><p>When suffering from grief our thoughts are jumbled like the worst spaghetti code you’ve ever seen. As with coding, the only way to fix the problem is to search for the simplest class, function or module, take that as a starting point and simplify everything from that point onward.</p><p>It was that search for simplicity which fuelled the return to my creative side. As <a href="https://www.headspace.com/blog/2017/04/18/grief-creativity-together/">Headspace</a> states:</p><blockquote>Some of our greatest cultural riches are the byproduct of grief: the pyramids at Giza were burial mounds. Homer’s “Iliad” is a tragedy. Christian texts begin with the loss of Eden. From a safe distance, we admire and appreciate the creative fruits grief has harvested over the course of millennia; collectively, humanity owes a whole lot to heartache.</blockquote><p>This simple statement was something that echoed in my mind, albeit on not anywhere near as grand a scale.</p><p>In one way or another, we all yearn for simplicity, the feeling of grief merely accentuates that feeling, bringing it to the forefront. Grief makes the smallest things feel that much harder to achieve, it creates a feeling of distance between ourselves and the things around us which if we’re not careful, can snowball into something crippling. A sentiment with which I became innately familiar.</p><h4>Return to work</h4><p>So, on to nicer thoughts… In the office, among the multitude of our internal systems is our development task tracking application; it’s a bespoke tool written in ASP with an appearance which wouldn’t have looked out of place in the latter half of the 1980&#39;s.</p><p>As an internal system, it’s always been on the back-burner as far as bug fixes and enhancements are concerned, despite being used by the majority of the team on a daily (if not hourly) basis. More often than not, any updates are hastily applied so that more time can be devoted to the products that keep the company running 💹.</p><p>Because of this, its usability is poor. Sure, the various behavioural oddities and workarounds become second nature, but in the midst of <em>spaghetti-brained grief</em> the tool I’ve been using every single working day for the last who-knows-how-many-years was making my life harder.</p><p>I realised that I could actually get the data I wanted more quickly by querying the database directly than using the front-end application. During a grief fulled rant on the subject a trusted colleague pointed out the obvious — we’re software developers, so if we can’t fix it who can?</p><p>Ordinarily I probably would’ve thought of this as not being my problem, after all, we’ve got enough work to do as it is. But grief does funny things to you...</p><h4>Grief-inspired design</h4><p>It’s a known fact, that there simply aren’t enough hours in the day to do everything we want to do. This is very true of the software development world, where sometimes we’re forced to pick between doing something the right way, or doing it quickly.</p><p>But a project inspired by grief can’t function in this way. <strong>Everything</strong> needed to be perfect and that’s something that can’t happen with an internal system.</p><p>So, this was to be an <em>unapproved</em>, out-of-hours project. Projects of this nature allow us to experiment with different concepts and ideas, we learn more in this sort of situation, where the constraints of time and money don’t apply but there is still a purpose to the work at hand.</p><p>Before long, I had transitioned through half a dozen different design prototypes and rediscovered my creative side, realising that this was the sort of venture that I so badly needed.</p><p>In time, I came to the conclusions that anything I built needed to follow a few basic tenants:</p><ol><li>A simplistic colour pallet. Two or three colours supported by application areas defined by black outlines and white or grey interiors.</li><li>Minimal interface. The existing functionality needed to be preserved, but there’s no point in littering screens with operation buttons which add clutter.</li><li>Multi purpose components. A pop-up isn’t just a pop-up, it provides a status indicator, a tabstrip isn’t just a navigational tool, it provides statistical information. The possibilities go on…</li><li>All pertinent information has to be available at a glance, minimising additional navigation and providing an immediate overview to the end user.</li><li>We can draw attention to product areas with animations, but using fancy animation to reveal product areas only serve to slow the users progress <em>(I really should’ve known better before trying this)</em>.</li></ol><p>The existing tool isn’t overly complex, but it does provide a plethora of options for use by the various teams. Beyond a few more basic options, not everything is used by everyone. I could have introduced use options to define different user types, but as a personal project I didn’t want to mess too much with the underlying data structure.</p><p>This restriction meant that the majority of my work had to be restricted to the search process, but as this was the area of the application I had the biggest problem with, this wasn’t an issue.</p><p>My issues with the existing search functionality could largely be broken down into two categories:</p><ol><li>Complexity of the initial search screen and the difficulty of editing a search once it had been executed.</li><li>The amount of information returned in search results which returned full descriptions of change requests (which could be quite long) while not providing any other information.</li></ol><p>Both categories need to balance the amount of data displayed on-screen with simplicity of the user interface.</p><h4>Finding balance</h4><p>Balance between functionality and data is a core tenant of any search application. Hell; finding balance is a core tenant of life.</p><p>Following the design tenants outlined above, I split the existing search options into eight core categories, and then organised these categories in order of priority.</p><p>These categories are represented on the search screen with the highest priority options displaying on the first line <em>(the number of options automatically adjusts according to screen size)</em>. Additional options are hidden behind an expandable section; this approach allows all users immediate access to core search options while advanced users can expand the options list to two rows of settings — a selection which is remembered in subsequent sessions.</p><p>Search functions are displayed using pop-ups; highlighting indicates the selected options. Initially users are only able to search for a single product, client or employee, but additional drill-down search options allow searching for multiple values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KtA0JABSk5Ez2XUqTBynYg.png" /></figure><p>Results are split into a collection of tabs based on current status, these tabs provide item counts to provide users with a quick overview of current statistics.</p><p>A further set of sub-tabs reveals additional options for advanced users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*57AQwpwoZ1V8VNph_GbF_g.png" /></figure><p>The display of search results follows the same minimalistic principles. Results are contained within a traditional grid but columns are merged in order to provide display large amounts of text in a more natural manner.</p><p>The provided list of columns are sensitive to the existing context, while additional options are provided to allow users to expand upon these defaults.</p><p>A quick-scroll area is provided on screen to allow users to read through the entire description without navigating away from the list of search results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EeAClZWELqRLwq3sWfbRPQ.png" /></figure><p>Additional features allow users to drill down to reveal further information. Tool-tips reveal user contact details while selecting individual records within the search results screen will provide access to further information and full task history.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ON4yy7dTFlFzzZTME1R_PQ.png" /></figure><p>This approach removes the need to navigate around separate application areas, everything is provided to the user within a single screen but is carefully hidden in order to prevent overloading users with too much information in one go.</p><p>There are of course additional screens which expand beyond those demonstrated here, but the design process follows the same basic principles of simplicity.</p><h4>Conclusion</h4><p>Grief makes a mess of our thought processes, in my attempt to straighten out some of that mess, I stumbled across similarities with basic design principles which helped me on my way but these principles aren’t really any different from recommended UX practices.</p><p>The process of working through grief requires simplification of thoughts, segregating the those that matter from those that don’t, stepping back from complicated tasks and allowing us to approach them when we’re ready.</p><p>It’s by no means a process that’s as easy as it sounds. Like good design, it takes time to achieve and there are many false-starts.</p><p>My grief has helped me come to the realisation that life needs to be simple, that the applications I write need to at least <em>appear</em> to be simple. Balancing the that simplicity with a hidden complexity is a skill that needs to be practised.</p><p>My only hope is that I don’t become as practised in processing grief as I am at designing applications and writing code.</p><p><strong>If you got this far please feel free to leave a comment, alternatively if you were even remotely agree with the points I’ve raised then please hit the </strong>👏 <strong>button. Thank you for reading.</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F50d69a%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fux&amp;image=https%3A%2F%2Fucarecdn.com%2F6e8986c7-e64a-4116-9afb-fd71a476f0a9%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/a19f46680bac3cbdc42953c920d0c104/href">https://medium.com/media/a19f46680bac3cbdc42953c920d0c104/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9710b04eda8" width="1" height="1" alt=""><hr><p><a href="https://uxdesign.cc/grief-inspired-design-b9710b04eda8">Grief-inspired design</a> was originally published in <a href="https://uxdesign.cc/">UX Collective</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deep Breaths]]></title>
            <link>https://medium.com/@MikeKennedyDev/deep-breaths-e1a24139b146?source=rss-9604a14f933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1a24139b146</guid>
            <category><![CDATA[life]]></category>
            <category><![CDATA[family]]></category>
            <category><![CDATA[poetry]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[grief]]></category>
            <dc:creator><![CDATA[Michael Kennedy]]></dc:creator>
            <pubDate>Wed, 24 Oct 2018 17:33:47 GMT</pubDate>
            <atom:updated>2021-01-10T20:20:12.313Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xPVN6QYjEp6YeReX42p5gA.jpeg" /></figure><p>We bare witness, for you<br>because it’s what we must do<br>gather courage to enter<br>deep breaths to find our centre<br>contemplate the day ahead<br>to hear the tale of your bloodshed<br>our fear and trepidation<br>give way to complex feelings of frustration<br>as the cameras watch our movements<br>we wonder if we’re here for their amusement</p><p>We bare witness, for you<br>as you’re unable to<br>gently take our seats<br>deep breaths to steady our heartbeats<br>no way we could prepare<br>for now we have to sit and stare<br>silently we listen<br>slowly our eyes glisten<br>as those who never knew thee<br>narrate your final story</p><p>We bare witness, for you<br>and those who your injuries tried to undo<br>overwhelming emotion<br>deep breaths holding back the ocean<br>we cannot be protected<br>as we listen to the detective<br>course of events become crystal clear<br>hard as it is for us to hear<br>realise now that all is told<br>shattered hearts for all involved</p><p>We bare witness, for you<br>hear how life went askew<br>doctor sits at the table<br>deep breaths tell of someone unstable<br>offers of help declined<br>insisted nothing wrong with mind<br>wouldn’t hurt our family<br>not suffering from insanity<br>withheld something more was planned<br>refused help and now is damned</p><p>We bare witness for you<br>denied our chance to say adieu<br>one thing missing from this day<br>deep breaths cannot take away<br>we will never hear a reason<br>an explanation for this treason<br>the one soul who could respond<br>can no longer correspond<br>leaving us bewildered why<br>our loved one travelled to the sky</p><p>We bear witness, for you<br>there’s nothing else we can do<br>upon reaching the conclusion<br>deep breaths temper our confusion<br>that someone whom we trusted<br>could make us feel disgusted<br>waited for you in your home<br>as you returned there all alone<br>to leave you laying lifeless<br>when you only offered kindness</p><p>We bare witness, for you<br>knowing we must continue<br>try to put aside our fears<br>deep breaths no longer hold back the tears<br>every morning when we wake<br>understanding what’s at stake<br>life can never be the same<br>every time we hear your name<br>reminds us we’ve been taught<br>how easy life can be cut short</p><p>We bear witness, for ourselves<br>hoping you have found peace<br>in our dreams you point and say<br>don’t sit there and waste away</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1a24139b146" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lessons learned from Google Inbox]]></title>
            <link>https://uxdesign.cc/lessons-learnt-from-google-inbox-f79d670ddca5?source=rss-9604a14f933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f79d670ddca5</guid>
            <category><![CDATA[visual-design]]></category>
            <category><![CDATA[inbox-by-gmail]]></category>
            <category><![CDATA[application-design]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[user-experience]]></category>
            <dc:creator><![CDATA[Michael Kennedy]]></dc:creator>
            <pubDate>Mon, 24 Sep 2018 17:36:46 GMT</pubDate>
            <atom:updated>2021-04-11T11:31:41.646Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4><em>What Inbox by Gmail teaches us about Product Design.</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fGbSZYr-_FZCpAhb.jpg" /></figure><p>Inbox by Gmail has been a staple of my day-to-day routine and the routines of many others for the last four years. Its design approach has been to email what the introduction of the ribbon bar was to windows applications.</p><p>Its upcoming demise only serves to underline the impact it has had on its’ users and confirms what we all already knew — that nothing else out there does it in the same way.</p><p>On the 12th of September, Google quietly announced the demise of Inbox by Gmail in a <a href="https://twitter.com/inboxbygmail/status/1039952354450309121">twitter post</a>.</p><p>Inbox has directly inspired many of my application designs over the last couple of years, so with the tool being discontinued I wanted to examine just what it is that makes it so easy to use while packing in all of the required functionality.</p><p><strong>Simplicity</strong></p><p>The success of Inbox is driven by its apparent simplicity. Traditionally our email inboxes are cluttered, with a thousand things that need to be remembered and responded to. The use of “negative space” within the design of the application immediately sets the user at ease, navigation and email components are separated out, the most important items rise to the top of the folders menu while the least important are hidden further away.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q1kuJEzsOlFnytlX.jpg" /></figure><p>The simplicity of the user interface moves beyond that of just showing a bit of white-space, options to configure folders are hidden away, only being displayed when the users cursor movement implies the chosen course of action. Overly complex configuration screens are consigned to the past while a relatively simplistic rules engine covers the majority of automated actions a user may wish to configure (it should be noted that the rules engine itself is probably part of the Gmail core code rather than Inbox).</p><p>The folder view offers the same kind of simplicity, mailings are grouped by the date received, separated by white-space. Options are again hidden away until the users cursor movement indicates that they’d like to perform an action.</p><p>Instead of the usual tri-view mail application (folders, content, email content) the content and email screens are merged into a single view. While this reduces the users options in regards to quickly scrolling through a list of emails, it better lends itself to responsive web design.</p><p><strong>Colour</strong></p><p>The simplistic interface is complimented by its’ limited colour palette and basic icons that aren’t dissimilar to those provided by the earlier versions of <a href="https://fontawesome.com/">Font Awesome</a>; subtly colour coded and shaded to prevent the screen from looking too “over designed”. Application areas are colour coded using the same shades as their associated icons, these same colours indicate related operations throughout the application.</p><p>Inbox recognises that it’s just a vessel through which users access their email, the limited usage of colour allows the intended content to shine through.</p><ul><li>Where possible contacts are represented using profile icons (presumably taken from Google+ integration).</li><li>Other contacts are represented using coloured profile icons which appear to be assigned depending on the alphanumeric character that the name of the sender starts with.</li><li>Additional email specific items are displayed on an as-required basis, attachments, images are displayed within the folder content view not only providing users with at-a-glance information but breaking up the monotony of what would otherwise be a basic list of items.</li></ul><p><strong>Functionality</strong></p><p>The simplistic user interface is what initially draws users in, it’s that approach which allows the well thought out functionality to shine through, taking Inbox from an email application into the territory of a personal organiser It almost feels like an old style Filofax wrapped up in a single application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2ZJrDzCppzt_VAgB.jpg" /></figure><p><strong>Personal Organiser</strong></p><p>The most obvious feature of Inbox is the way it bundles together different mailings within the primary inbox. This condenses larger mail boxes into a smaller footprint, I have a relatively small 270 emails within my personal inbox, which is condensed down into less than 20 records.</p><p>This approach could’ve easily been a hit-or-miss scenario, its success is simply down to its simplicity. Existing user created folders form the bulk of email bundles, because they’re inherited from users Gmail inbox they’re effectively already setup and configured with various automated rules (nice little bit of leveraging existing functionality there).</p><p>Inbox cleverly expands upon this existing behaviour by adding a handful of preconfigured folders and rules which is underlined with the ability to automatically file related emails outside of the inbox.</p><p><strong>Reminders</strong></p><p>Reminders are generally restricted to calendar applications, but Inbox has carefully considered the definition of what a reminder actually is and applies the core concept to emails, enabling an email to be hidden from the inbox reappearing at the top at a chosen time. It’s such a simplistic concept that it really should have been commonly in use long before now.</p><p>The ability to create reminders without being associated to an email is itself an extension of that behaviour within the mailbox, it merely serves to blend the lines between different applications.</p><p><strong>Saved Articles</strong></p><p>Expanding on the concept of common day-to-day operations, Inbox provides users with the ability to save bookmarks directly to the inbox. The ability to paste a URL directly into the inbox simplifies life for anyone performing research tasks across multiple sessions. As a software developer, the number of times I find something useful outside of office hours is significant and the ability to just paste a link into my inbox is invaluable.</p><p>Combining this feature with the existing reminder functionality is a stroke of genius — add a URL to my email at 10pm and snooze it until I’m in the office the next morning so that I won’t forget to investigate.</p><p>Something so simple can have such a massive effect on a users planning processes and time management, cleverly topped off with the ability to paste straight from the clipboard in both windows and mobile applications.</p><p><strong>Email Engagement</strong></p><p>Inbox makes extended use of schema.org <a href="https://developers.google.com/gmail/markup/overview">email markup</a> to find and display key information points to users without the need to fully open an email. Again, this is such a simple UI feature, but the difference it makes is immeasurable.</p><p>Expanded email markup integration is drawn together with automatic bundling, making use of the ability to define flight and reservation data in a single place.</p><p><strong>Summary</strong></p><p>Google examined the concept of email and whittled it down to the basic features, then they carefully thought about what an email application should actually contain and how it could be moulded to improve peoples lives.</p><p>This approach gave us a fresh take on email management, removing clutter and focusing on functionality. It was something of a bold move for applications of this nature which traditionally look a certain way and squeeze as much onto the screen as possible. It challenged preconceptions, encouraging users to think differently about organisation, of their daily tasks</p><p>From a technical standpoint, with a little extra data processing, the expanded features offered by Inbox by Gmail are actually pretty simplistic. The true power behind these features comes from the way they’re presented, Inbox cleverly walks the line between complex features and simple interfaces by making careful use of white-space and hiding features away without compromising discoverability.</p><p>If other developers took this same approach novice users would find it infinitely easier to get to grips with new applications while advanced features are quietly sat there waiting to be discovered.</p><p>I for one will miss it when it’s gone.</p><p><strong>If you got this far please feel free to leave a comment, alternatively if you were even remotely entertained please hit the </strong>👏 <strong>button. Thank you for reading</strong> 😃</p><p>Originally posted on my blog <a href="https://www.mikekennedy.co.uk/articles/blog/lessons-learnt-from-google-inbox">here</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Ff%2F50d69a%3Fas_embed%3Dtrue&amp;dntp=1&amp;display_name=Upscribe&amp;url=https%3A%2F%2Fupscri.be%2F50d69a%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/05d5fd32eda31cbd1b83287606744532/href">https://medium.com/media/05d5fd32eda31cbd1b83287606744532/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f79d670ddca5" width="1" height="1" alt=""><hr><p><a href="https://uxdesign.cc/lessons-learnt-from-google-inbox-f79d670ddca5">Lessons learned from Google Inbox</a> was originally published in <a href="https://uxdesign.cc/">UX Collective</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>