Entries by admin

So You Want to Persuade Users? Make Things Simple!

Original Source: https://www.smashingmagazine.com/2018/07/persuasion-user-experience-design/

So You Want to Persuade Users? Make Things Simple!

So You Want to Persuade Users? Make Things Simple!

Lyndon Cerejo

2018-07-17T16:15:38+02:00
2018-07-17T15:48:55+00:00

(This article is kindly sponsored by Adobe.) The persuasive design toolbox is filled with powerful tools based on psychology. These tools range from Cialdini’s set of six principles of persuasion to ten times that number of Persuasive Patterns. Presented with all these methods, it can be tempting to use all of them to cover all possible bases, using a shotgun approach, hoping that one will resonate with your target users.

However, applying persuasion principles and patterns in a haphazard manner just ends up being persuasive design clutter. Like user experience design, designing for everyone is designing for no one. Randomly thrown together persuasive techniques will also make users feel manipulated, not in control, making them abandon the site or experience. The key to persuading your users is to keep it simple: using focused persuasive techniques and tactics that will work for your users.

Persuasion Funnel

AIDA is an acronym used in marketing and advertising to describe the stages that a customer goes through in the purchase process. The stages of Attention, Interest, Desire and Action, generically follow a series of cognitive (thinking) and affective (feeling) stages culminating in a behavioral (doing e.g. purchase or trial) stage. This should sound familiar since this is what we do through design, especially persuasive design.

When it comes to persuasive design, users go through a few stages between Awareness and Action, and the design should guide them from one stage to the next. I don’t have a clever acronym for it (yet), but the stages the design has to take the users through are:

Awareness
Relevant
Credible
Usable
Desirable
Persuasive
Action

(Large preview)

When users are contemplating an action (like booking a hotel room), they have to be aware of your site, app, or experience. Once they begin their journey on your site, they quickly evaluate the experience and either proceed to the next step or leave and go elsewhere. With fewer users continuing to subsequent stages, the number of users at each stage begins to resemble the shape of a funnel as shown above.

Let’s peek inside what could be going on in hypothetical users’ minds as they go through the experience of booking a hotel room for New Year’s Eve in Times Square, and some of the reasons they may drop off in each stage.

Awareness

“Hmmm… Where do I start? Hotel chains promise the lowest rate if we book directly with them, but I won’t be able to see other hotel options around Times Square. Hotel… Maybe I should try an online travel agency like Trivago (looks like the Trivago guy / Trivago girl advertising works!) to find a wider range of hotels. I’m going to also quickly Google it to see if there are other options.”

Users have to be aware of your site, app or experience to use it — Duh!

Relevant

“I found HotelTonight on Google. It looks like a great way to get rooms last minute, but not this far in advance — it’s not relevant to me.”

If your experience is not relevant to the task they are trying to accomplish, users will leave and try elsewhere. If your products or services are relevant, but not findable by the user, work on your navigation, search, and content layout to ensure your products and services are visible. Everything does not have to be one click away, but if the user gets the scent of information, or cues that make them think they are on the right path, they will follow the trail to that information.

Credible

“This design looks like it hasn’t been updated since the [GeoCities era](http://www.arngren.net/).

— Warning bells go off in head —

I’m out of here.”

Users are aware of many of the risks available online and look for trust indicators including a known brand and domain, secure site, professional design, real-world contact information and third-party certificates or badges. Incorporate these elements to create a comfort level for the user.

Usable

“I can’t figure out where things are in the navigation, and the search results had hundreds of unhelpful results. The homepage has nice big images, but that meant I had to scroll before I could see any real content.”

Usability is surprisingly still an issue with many sites. Follow User Experience best practices during design, and test with users to validate that the design is usable.

Desirable

“This reminds me of Craigslist — it is usable, but the design does not make me want to stay and use it. I’ll try that other hotel website that provides an immersive, interactive experience as I search for hotels.”

As much as we like to believe it, users’ decisions are not always rational, and very often driven by emotion, and we can address that through design. Usability is about making it work well; this is about making it beautiful as well.

In his book Emotional Design, Don Norman explains: “Attractive things do work better — their attractiveness produces positive emotions, causing mental processes to be more creative, more tolerant of minor difficulties.” Don talks about the three different aspects of design: visceral, behavioral, and reflective. Visceral design is about appearance, behavioral about the pleasure and effectiveness of use, and reflective design involves the rationalization and intellectualization of a product.

Persuasive

“Oh, Wow! That’s a long list of hotels, with plenty of availability for New Year’s Eve. There’s no real reason to book now. I’ll just come back to book after Thanksgiving…”

The user was interested, able, and willing, but the design did not motivate him to take intended action. Use relevant persuasion techniques that apply to your user to move them toward the desired action.

Examples of persuasive methods while shopping on Travelocity for a hotel room for New Year’s Eve.

Examples of persuasive methods while shopping on Travelocity for a hotel room for New Year’s Eve. (Large preview)

Action

“Oh, Wow! 65% of hotels are already booked in this area for New Year’s Eve. I better make a reservation now. . This looks like a nice hotel, and it also offers free cancellation – I’m reserving it now!”

The user who made it to this stage was interested, able, and willing, and the design nudged him to take intended action of making a reservation before leaving the site.

Persuasion is not about applying all available principles and patterns to your designs, but systematically identifying how you can address users’ barriers and motivators during each step of the journey, and guiding your users through the funnel to take the desired action.

The KISS Approach

Most of us are familiar with the acronym KISS: “Keep It Simple, Stupid,” a principle advocating simplicity as a key goal in design by avoiding unnecessary complexity. Let’s borrow that acronym for a 4-step approach to persuasive design.

Know The Right Behavior To Target

The first step is knowing the behavior you would like to target, and identifying the simplest action that can lead to that behavior change. Take the example of term life insurance companies who, to put it very bluntly, stand to benefit if their policyholders are healthy and don’t die while the policy is active. While those companies have a long-term ambitious goal of helping their policyholders lead healthy lives (mutually beneficial), that could be broken down into a simpler target behavior of walking 10,000 steps daily. This behavior is simple to understand, achieve, measure, and contributes to the long-term goal of healthier policyholders.

One such insurance company is offering new policyholders the latest Apple Watch for a low initial down payment ($25). The ongoing monthly payments can be waived each month that the policyholder leads an active lifestyle and exercises regularly (e.g. walks about 10,000 steps a day). About half the people who participated have achieved monthly goals, despite potential privacy implications.

John Hancock Term Life Insurance Apple Watch offer targets walking about 10,000 steps a day.

John Hancock Term Life Insurance Apple Watch offer targets walking about 10,000 steps a day. (Large preview)

Identify Barriers And Motivators

User research for persuasive design digs below the surface thinking level to the feeling level, and moves beyond the rational to the emotional level, as shown below. Getting to know your users at a deeper level will help you use psychology to focus your design to get users to engage in the target behavior identified above. User interviews that focus on users’ feelings and emotions are used to uncover barriers and motivators they consciously or subconsciously face while trying to achieve the target behavior. This helps us identify which blocks we need to weaken, and which motivators we should strengthen, through persuasive design techniques and tactics.

Tip of the iceberg user research diagram

(Large preview)

Simplify The Experience

Simplify the design experience of the first stages of the funnel, as users go through the mental verifications of relevancy, credibility, and usability of the experience. This includes making it easy for the user to find what they are looking for, credibility indicators like professional design, contact information, and third-party certificates or badges, as well as addressing usability issues. As Steve Krug put it very succinctly: “Don’t Make Me Think”.

Select Appropriate Triggers

Users who have made it this far in the process are interested in something you have to offer. As a designer, you have to nudge them to take the desired action. A good starting point is Robert Cialdini’s, six key principles of persuasion:

Reciprocity
People are obliged to give something back in exchange for receiving something.
Scarcity
People want more of those things they can have less of.
Authority
People follow the lead of credible, knowledgeable experts.
Consistency
People like to be consistent with the things they have previously said or done.
Liking
People prefer to say yes to those that they like.
Consensus (Social Proof)
Especially when they are uncertain, people will look to the actions and behaviors of others to determine their own.

These principles can be applied through dozens of different persuasive design patterns and methods, some of which have been previously published on Smashing Magazine (patterns, triggers), or in the books listed in the resources at the end. As you may notice, many persuasive patterns are related to UI patterns, because part of persuasion is reducing friction and simplifying what the user needs to do at any given point in time. For example, the persuasive pattern of Limited Choice can be realized through UI Pattern of Progressive Disclosure.

Given that there are dozens of patterns and methods (depending on where you look), it is important to selectively use methods that will resonate with your users. Applying all design patterns in the hope of some working will result in persuasion clutter and overwhelm the user, possibly driving them away from your site.

Examining Persuasion

Let’s take a closer look at the earlier example of the term life insurance through the eyes of someone who is motivated (shopping for life insurance) and has the ability (to pay monthly life insurance cost). Like me, let’s assume that this user was made aware of this through a sponsored post on Facebook. During the stages of awareness and relevance, there are a few persuasive triggers as shown below that make the user click “Learn More”.

facebook

(Large preview)

Clicking the “Learn More” button takes the user to a landing page that we will examine in sections for a persuasive flow:

(Large preview)

The user’s primary motivation in shopping for term life insurance is: “Protect Family,” and a big barrier is “High Cost.”

Reputable Name (Credibility)
Even if you’ve not heard of this company, John Hancock is a famous person and the term used as a synonym in the United States for one’s signature. The company reinforces it’s longevity later on the page.
Toll-free Number (Credibility)
Established and legitimate organization.
Message Framing
Live healthy, is also reinforced by the image of a family enjoying outdoors.
“This life insurance product will help me live longer, lead a happy life like them, and protect my family in case something happens, and won’t cost much.”
People Like Me & Association
This family looks like mine (or the family next door) — I can see myself in this wide-open field (visceral and reflective triggers).
Extrinsic Reward
An Apple watch for $25 — that’s a bonus here!
Visual Cueing
The person in focus (stereotypical breadwinner) has his gaze directly focused at the form below, leading the user to the next step.
Foot In The Door
This quote won’t cost anything — zip, nada.
Computer As A Social Actor
The information takes a conversational tone and format, not the usual form in rows and columns. The information seems reasonable to generate a quote.
Commitment & Consistency
By filling this quick, easy, and free form, chances are that the user will act consistently and proceed when it comes to the next step (application), unless there’s another barrier (price, benefits, etc.)

(Large preview)

Control
The user has a choice of devices.
Extrinsic Rewards
More rewards to be earned.
Control
The user controls how much they pay (the more active, the less you’ll pay). Also, in case the user does is not active, the cost is framed as just $13 (for a month).
Credibility
The company reinforces longevity and protector of America.
Authority
Licensed Coverage Coach (not just a sales agent).
Flow
One way to keep users in the flow and not get distracted is by disabling the social media links (which could raise the question: why display them?).

That took longer to dissect and read than it does in real life, where most of this is processed consciously and subconsciously in a few seconds, often with a glance or two.

Apart from the methods establishing credibility, the persuasive methods are used to strengthen the primary motivator of “Protect Family” (get insurance, extrinsic reward will help me live longer for my family), and weaken the barrier of “High Cost” (low monthly cost, additional savings, no ongoing watch payments). Note how they work together and don’t conflict or clutter the experience.

Conclusion

Persuasion is all around us, in our everyday lives. As designers, we can use ethical persuasive design methods to get users to take some action. With plenty of persuasive methods available, we have to be selective about what we use. We can use the KISS approach to keep it simple:

Know the right behavior to target
Identify barriers and motivators
Simplify the experience
Select appropriate triggers

KISS also reminds us to Keep It Simple & Straightforward, by selecting a simple target behavior, simplifying the experience for the user, and by applying persuasive techniques that will lead to the target behavior without overwhelming the user.

Further Reading

“Neuro Web Design: What Makes Them Click?,” Susan Weinschenk
“Design for the Mind: Seven Psychological Principles of Persuasive Design,” Victor S. Yocco
“Influence: The Psychology of Persuasion, by Robert B. Cialdini
“Persuasive Technology: Using Computers to Change What We Think and Do,” B.J. Fogg
“Persuasive Design Patterns (scroll down the page),” UI-Patterns
“Persuasive Patterns Card Deck,” UI-Patterns

This article is part of the UX design series sponsored by Adobe. Adobe XD tool is made for a fast and fluid UX design process, as it lets you go from idea to prototype faster. Design, prototype, and share — all in one app. You can check out more inspiring projects created with Adobe XD on Behance, and also sign up for the Adobe experience design newsletter to stay updated and informed on the latest trends and insights for UX/UI design.

Smashing Editorial
(yk, il)

Collective #433

Original Source: http://feedproxy.google.com/~r/tympanus/~3/e1VmhUIvmjw/

C433_AffinityDesignerIpad

Our Sponsor
Affinity Designer for iPad

Take the full power of professional vector graphic design wherever you go. Available now at an introductory price $13.99/£13.99/14,99€.

Tell me more

C433_TermSheets

Term Sheets

With Term Sheets you can create animated terminal presentations and export them as SVG, animated GIF, or HTML with CSS.

Check it out

C433_malicous

Anatomy of a malicious script: how a website can take over your browser

In this interesting article, Paolo Mioni shows how to find and take apart a malicious script.

Read it

C433_v8n

V8N

A reusable JavaScript validation library with a simple API.

Check it out

C433_stiches

Stitches

A template generator with functional CSS by Amie Chen. Check out the GitHub repo here.

Check it out

C433_Guppy

Guppy

Guppy is an application manager and task runner for React.js.

Check it out

C433_lint

Postmortem for Malicious Packages Published on July 12th, 2018

Read about the incident with ESLint, where an attacker compromised the npm account of a maintainer and published malicious versions of two packages. Read the GitHub issue discussion here.

Read it

C433_CSS

CSS: A New Kind Of JavaScript

Heydon Pickering’s hilarious introduction to a new tool that will make styling so much easier!

Read it

C433_fontplayground

Font Playground

Wenting Zhang’s project will let you play with variable fonts.

Check it out

C433_track

Track

A musical WebVR experience built with WebGL, Houdini, and Three.js.

Check it out

C433_cubeform

3D Cube Form

A great rotating 3D cube form made by Clément Roche.

Check it out

C433_delay

First Input Delay

Learn how you can use First Input Delay (FID) in the Chrome UX Report to measures the time that it takes for a web page to respond to the first user interaction with the page.

Watch it

C433_didfile

did.txt file

Patrick Tran shows how to create an insanely simple “did” file accessible by terminal.

Read it

C433_Nucleardissent

Nuclear Dissent

A great documentary and web experience about the tragic fate of the victims of France’s terrible nuclear tests in French Polynesia.

Watch it

C433_font1

Free Font: Facón

A very dynamic looking font designed by Alejo Bergmann.

Get it

C433_webassembly

WebAssembly is more than the web

Steve Klabnik writes about the marvels of WebAssembly as a versatile embeddable language.

Read it

C433_cssgrid3d

Isometric eCommerce CSSGrid

Andy Barefoot’s experimental eCommerce grid layout made with CSS Grid.

Check it out

C433_ramd

ramd.js

A minimal JavaScript library for building TODO like web applications.

Check it out

C433_cssgridcomplex

How to build complicated grids using CSS grid

In case you missed it: Dan Webb shows how to pull off a real world grid layout.

Read it

C433_alaskafont

Free Font: Alaska

A great looking display typeface made by the team of Unblast.

Get it

C433_seedbank

Seedbank

Seedbank is a registry and search engine for Colab(oratory) notebooks for and around machine learning for rapid exploration and learning.

Check it out

C433_cool

coolHue

Great for your next design project: some new gradient hues and swatches were added to coolHue.

Check it out

Collective #433 was written by Pedro Botelho and published on Codrops.

How to pick the perfect colour palette every time

Original Source: http://feedproxy.google.com/~r/CreativeBloq/~3/YE0lZ2Ep6Ho/how-to-pick-the-perfect-colour-palette-every-time

In the 1980s, colour psychologist Angela Wright revolutionised colour theory by identifying links between patterns of colour and patterns of human behaviour. She found that all colours can be classified into one of four tonal groups, and that mathematical relationships underpin the shades and tones within each group. In other words, Wright proved objective colour harmony.

She went on to develop the Colour Affects System, which identifies links between the four colour groups and four basic personality types, based on original research involving Aristotle, Newton and German writer Johann Wolfgang von Goethe.

If harnessed correctly, designers can use the Colour Affects System to control the message of their colour palettes and, crucially, kill subjective debate around colour in client meetings with evidence to back up their decisions. Here's how it works…

Colour Affects System: the basics  

Bp logo

BP uses group 1 colours: clear, delicate and warm

Every shade, tone or tint on the colour spectrum can be classified into one of four colour groups, based on how warm or cool it is. All colours within each group correlate mathematically and naturally harmonise, while colours combined from different families don't. 

There are also four basic personality types – ranging between extrovert and introvert – and each type has a natural affinity with one colour group. Universally, everyone will find a palette chosen with colours from the same group harmonious, but they'll find a palette drawn from their personality type's corresponding colour group even more attractive.

You'll find a breakdown of the different colour groups on the next page.

Dreams logo

Bedding firm Dreams uses elegant and timeless group 2 colours
Colour in harmony 

"Music and colour work in much the same way," explains Wright, who developed the Colour Affects System from her earlier research, The Wright Theory. She's provided colour palettes for clients ranging from Shell International Petroleum Company and Procter & Gamble to BT, Unilever, and more. 

"One musical note has its own properties, but it doesn't do much until you put it with other notes. There are no wrong notes, and there are no wrong colours, either. It's how you use them. If you put them together in harmony, they produce a positive response. But it only takes one bum note to throw the whole thing out."

Currently, Wright is working on a digital version of the Colour Affects System, which will be launching at the end of this year. The software enables users to select their starting colour – the dominant logo colour, for instance – and then classifies it into one of the four groups, removing all colours from the other three groups. Users are left with a huge, harmonious selection from which to then develop a brand's colour palette. 

McDonald's logo

McDonald’s corporate colours are mainly group 3: intense and fiery

"You pick the subsequent colours for your branding scheme in the same way as you do now," Wright explains. "You've got a large framework – there are millions of colours to choose from – except there are no bum notes, because there are mathematical correlations that underpin each colour," she adds. 

How effective is the Colour Affects System?

A few years ago, Wright was asked by a mail order company to adjust the colours of a leaflet selling an opera CD. "The in-house design team had created a leaflet and they wanted me to tweak the colours into harmony," she recalls. "The ones they'd used were okay – quite familiar – but they're weren't right, either psychologically or harmoniously."

texaco logo

Texaco uses a group 4 palette, suggesting efficiency, sophistication and excellence

Wright adapted the colours so that the chosen palette came from the same tonal family. "They sent out two identical mail shots, and they sold 560,000 more CDs with the tweaked leaflet than the original," she says. 

"And all I did was tweak the harmony after it had been designed – I didn't specify the colours used in the first place." It seems the right colours do sell.

Next page: the four colour groups revealed

Group 1: Type 1 personality

group 1 colours

Group 1 colours are often used for fun brands

Group 1 colours are clear, delicate and warm, and contain yellow, but no black. Examples include soft cream, turquoise and cobalt. "They're lively, sharp, fresh, clean and youthful – all about new beginnings," says Wright. 

"It's very common to use them in the branding of things like children's toys, PR, sales, sport, and fun sectors of anything." However, if misused, these colours can be perceived as frivolous and immature. 

Personalities that reflect these colours are "externally motivated and eternally youthful". Light on their feet, these people love to dance and are clever, but don't like being bogged down with academic debate.

Group 2: Type 2 personality

Group 2 colours

Group 2 colours reflect understated elegance and timelessness, but are seen as recessive

Group 2 colours are cool (they contain blue), mid range (most contain grey) and delicate, but not necessarily light – for example raspberry, maroon or sage green. Characteristics include understated elegance and timelessness.

"The personalities are cool, calm and collected," says Wright. "They're internally motivated, but very sensitive to how others are feeling. They don't want to be at the forefront of anything, but they'll be the power behind the throw. In branding terms, these colours are rarely – if ever – used, because they're very recessive," she explains.

Group 3: Type 3 personality

Group 3 colours

The Group 3 palette features quite flamboyant and unusual colours

Group 3 colours are warmer than group 1 (they contain more yellow-based hues), are intense and fiery, and contain black. Examples include olive green, burnt orange and aubergine. "They're quite flamboyant and unusual; you don't get many primaries in there," says Wright. "And the personalities are strong. Like type 1, they're externally motivated – but they're fiery, even if it isn't immediately apparent."

Friendly, traditional and reliable, these tones are popular in branding and work for well-established companies. However, they can convey bossiness or appear old-fashioned if they are misused.

Group 4: Type 4 personality

Group 4 colours

Group 4 suggests efficiency, sophistication and excellence, but also expense and unfriendliness

Group 4 colours contain blue and are cold rather than cool. They're pure and either very light, very dark or very intense. "The personalities are the same – very clear; everything's black and white," says Wright, adding that type 4 personalities are internally motivated, often very efficient and don't suffer fools.  

Containing black, white, magenta, lemon and indigo, this group's characteristics include efficiency, sophistication and excellence – but misused, the colours can be seen as unfriendly, materialistic and expensive.

This article originally appeared in Computer Arts, the world's leading graphic design magazine. Subscribe here.

Related articles:

21 outstanding uses of colour in branding5 unusual uses of colour in logo designThe designer's guide to using colour in branding

The Holy Grail Of Reusable Components: Custom Elements, Shadow DOM, And NPM

Original Source: https://www.smashingmagazine.com/2018/07/reusable-components-custom-elements-shadow-dom-npm/

The Holy Grail Of Reusable Components: Custom Elements, Shadow DOM, And NPM

The Holy Grail Of Reusable Components: Custom Elements, Shadow DOM, And NPM

Oliver Williams

2018-07-16T13:30:58+02:00
2018-07-16T17:29:08+00:00

For even the simplest of components, the cost in human-labour may have been significant. UX teams do usability testing. An array of stakeholders have to sign off on the design.

Developers conduct AB tests, accessibility audits, unit tests and cross-browser checks. Once you’ve solved a problem, you don’t want to repeat that effort. By building a reusable component library (rather than building everything from scratch), we can continuously utilize past efforts and avoid revisiting already solved design and development challenges.

A screenshot of Google’s material components website – showing various components.

Large preview

Building an arsenal of components is particularly useful for companies such as Google that own a considerable portfolio of websites all sharing a common brand. By codifying their UI into composable widgets, larger companies can both speed up development time and achieve consistency of both visual and user-interaction design across projects. There’s been a rise in interest in style guides and pattern libraries over the last several years. Given multiple developers and designers spread over multiple teams, large companies seek to attain consistency. We can do better than simple color swatches. What we need is easily distributable code.

Sharing And Reusing Code

Manually copy-and-pasting code is effortless. Keeping that code up-to-date, however, is a maintenance nightmare. Many developers, therefore, rely on a package manager to reuse code across projects. Despite its name, the Node Package Manager has become the unrivalled platform for front-end package management. There are currently over 700,000 packages in the NPM registry and billions of packages are downloaded every month. Any folder with a package.json file can be uploaded to NPM as a shareable package. While NPM is primarily associated with JavaScript, a package can include CSS and markup. NPM makes it easy to reuse and, importantly, update code. Rather than needing to amend code in myriad places, you change the code only in the package.

Getting workflow just right ain’t an easy task. So are proper estimates. Or alignment among different departments. That’s why we’ve set up “this-is-how-I-work”-sessions — with smart cookies sharing what works well for them. A part of the Smashing Membership, of course.

Explore features →

Smashing TV, with live sessions for professional designers and developers.

The Markup Problem

Sass and Javascript are easily portable with the use of import statements. Templating languages give HTML the same ability — templates can import other fragments of HTML in the form of partials. You can write the markup for your footer, for example, just once, then include it in other templates. To say there exists a multiplicity of templating languages would be an understatement. Tying yourself to just one severely limits the potential reusability of your code. The alternative is to copy-and-paste markup and to use NPM only for styles and javascript.

This is the approach taken by the Financial Times with their Origami component library. In her talk “Can’t You Just Make It More like Bootstrap?” Alice Bartlett concluded “there is no good way to let people include templates in their projects”. Speaking about his experience of maintaining a component library at Lonely Planet, Ian Feather reiterated the problems with this approach:

“Once they copy that code they are essentially cutting a version which needs to be maintained indefinitely. When they copied the markup for a working component it had an implicit link to a snapshot of the CSS at that point. If you then update the template or refactor the CSS, you need to update all versions of the template scattered around your site.”

A Solution: Web Components

Web components solve this problem by defining markup in JavaScript. The author of a component is free to alter markup, CSS, and Javascript. The consumer of the component can benefit from these upgrades without needing to trawl through a project altering code by hand. Syncing with the latest changes project-wide can be achieved with a terse npm update via terminal. Only the name of the component and its API need to stay consistent.

Installing a web component is as simple as typing npm install component-name into a terminal. The Javascript can be included with an import statement:

<script type=”module”>
import ‘./node_modules/component-name/index.js’;
</script>

Then you can use the component anywhere in your markup. Here is a simple example component that copies text to the clipboard.

See the Pen Simple web component demo by CSS GRID (@cssgrid) on CodePen.

A component-centric approach to front-end development has become ubiquitous, ushered in by Facebook’s React framework. Inevitably, given the pervasiveness of frameworks in modern front-end workflows, a number of companies have built component libraries using their framework of choice. Those components are reusable only within that particular framework.

A component from IBM’s Carbon Design System

A component from IBM’s Carbon Design System. For use in React applications only. Other significant examples of component libraries built in React include Atlaskit from Atlassian and Polaris from Shopify. (Large preview)

It’s rare for a sizeable company to have a uniform front-end and replatorming from one framework to another isn’t uncommon. Frameworks come and go. To enable the maximum amount of potential reuse across projects, we need components that are framework agnostic.

A screenshot from npmjs.com showing components that do that same thing built exclusively for particular javascript frameworks.

Searching for components via npmjs.com reveals a fragmented Javascript ecosystem. (Large preview)

A graph charting the popularity of frameworks over time. Ember, Knockout and Backbone have plunged in popularity, replaced by newer offerings.

The ever-changing popularity of frameworks over time. (Large preview)

“I have built web applications using: Dojo, Mootools, Prototype, jQuery, Backbone, Thorax, and React over the years…I would love to have been able to bring that killer Dojo component that I slaved over with me to my React app of today.”

— Dion Almaer, Director of Engineering, Google

When we talk about a web component, we are talking about the combination of a custom element with shadow DOM. Custom Elements and shadow DOM are part of both the W3C DOM specification and the WHATWG DOM Standard — meaning web components are a web standard. Custom elements and shadow DOM are finally set to achieve cross-browser support this year. By using a standard part of the native web platform, we ensure that our components can survive the fast-moving cycle of front-end restructuring and architectural rethinks. Web components can be used with any templating language and any front-end framework — they’re truly cross-compatible and interoperable. They can be used everywhere from a WordPress blog to a single page application.

The Custom Elements Everywhere project by Rob Dodson documents the interoperability of web components with various client-side Javascript frameworks.

The Custom Elements Everywhere project by Rob Dodson documents the interoperability of web components with various client-side Javascript frameworks. React, the outlier here, will hopefully resolve these issues with React 17. (Large preview)

Making A Web Component

Defining A Custom Element

It’s always been possible to make up tag-names and have their content appear on the page.

<made-up-tag>Hello World!</made-up-tag>

HTML is designed to be fault tolerant. The above will render, even though it’s not a valid HTML element. There’s never been a good reason to do this — deviating from standardized tags has traditionally been a bad practice. By defining a new tag using the custom element API, however, we can augment HTML with reusable elements that have built-in functionality. Creating a custom element is much like creating a component in React — but here were extending HTMLElement.

class ExpandableBox extends HTMLElement {
constructor() {
super()
}
}

A parameter-less call to super() must be the first statement in the constructor. The constructor should be used to set up initial state and default values and to set up any event listeners. A new custom element needs to be defined with a name for its HTML tag and the elements corresponding class:

customElements.define(‘expandable-box’, ExpandableBox)

It’s a convention to capitalize class names. The syntax of the HTML tag is, however, more than a convention. What if browsers wanted to implement a new HTML element and they wanted to call it expandable-box? To prevent naming collisions, no new standardized HTML tags will include a dash. By contrast, the names of custom elements have to include a dash.

customElements.define(‘whatever’, Whatever) // invalid
customElements.define(‘what-ever’, Whatever) // valid

Custom Element Lifecycle

The API offers four custom element reactions — functions that can be defined within the class that will automatically be called in response to certain events in the lifecycle of a custom element.

connectedCallback is run when the custom element is added to the DOM.

connectedCallback() {
console.log(“custom element is on the page!”)
}

This includes adding an element with Javascript:

document.body.appendChild(document.createElement(“expandable-box”)) //“custom element is on the page”

as well as simply including the element within the page with a HTML tag:

<expandable-box></expandable-box> // “custom element is on the page”

Any work that involves fetching resources or rendering should be in here.

disconnectedCallback is run when the custom element is removed from the DOM.

disconnectedCallback() {
console.log(“element has been removed”)
}
document.querySelector(“expandable-box”).remove() //”element has been removed”

adoptedCallback is run when the custom element is adopted into a new document. You probably don’t need to worry about this one too often.

attributeChangedCallback is run when an attribute is added, changed, or removed. It can be used to listen for changes to both standardized native attributes like disabled or src, as well as any custom ones we make up. This is one of the most powerful aspects of custom elements as it enables the creation of a user-friendly API.

Custom Element Attributes

There are a great many HTML attributes. So that the browser doesn’t waste time calling our attributeChangedCallback when any attribute is changed, we need to provide a list of the attribute changes we want to listen for. For this example, we’re only interested in one.

static get observedAttributes() {
return [‘expanded’]
}

So now our attributeChangedCallback will only be called when we change the value of the expanded attribute on the custom element, as it’s the only attribute we’ve listed.

HTML attributes can have corresponding values (think href, src, alt, value etc) while others are either true or false (e.g. disabled, selected, required). For an attribute with a corresponding value, we would include the following within the custom element’s class definition.

get yourCustomAttributeName() {
return this.getAttribute(‘yourCustomAttributeName’);
}
set yourCustomAttributeName(newValue) {
this.setAttribute(‘yourCustomAttributeName’, newValue);
}

For our example element, the attribute will either be true or false, so defining the getter and setter is a little different.

get expanded() {
return this.hasAttribute(‘expanded’)
}

// the second argument for setAttribute is mandatory, so we’ll use an empty string
set expanded(val) {
if (val) {
this.setAttribute(‘expanded’, ”);
}
else {
this.removeAttribute(‘expanded’)
}
}

Now that the boilerplate has been dealt with, we can make use of attributeChangedCallback.

attributeChangedCallback(name, oldval, newval) {
console.log(`the ${name} attribute has changed from ${oldval} to ${newval}!!`);
// do something every time the attribute changes
}

Traditionally, configuring a Javascript component would have involved passing arguments to an init function. By utilising the attributeChangedCallback, its possible to make a custom element that’s configurable just with markup.

Shadow DOM and custom elements can be used separately, and you may find custom elements useful all by themselves. Unlike shadow DOM, they can be polyfilled. However, the two specs work well in conjunction.

Attaching Markup And Styles With Shadow DOM

So far, we’ve handled the behavior of a custom element. In regard to markup and styles, however, our custom element is equivalent to an empty unstyled <span>. To encapsulate HTML and CSS as part of the component, we need to attach a shadow DOM. It’s best to do this within the constructor function.

class FancyComponent extends HTMLElement {
constructor() {
super()
var shadowRoot = this.attachShadow({mode: ‘open’})
shadowRoot.innerHTML = `<h2>hello world!</h2>`
}

Don’t worry about understanding what the mode means — its boilerplate you have to include, but you’ll pretty much always want open. This simple example component will just render the text “hello world”. Like most other HTML elements, a custom element can have children — but not by default. So far the above custom element we’ve defined won’t render any children to the screen. To display any content between the tags, we need to make use of a slot element.

shadowRoot.innerHTML = `
<h2>hello world!</h2>
<slot></slot>
`

We can use a style tag to apply some CSS to the component.

shadowRoot.innerHTML =
`<style>
p {
color: red;
}
</style>
<h2>hello world!</h2>
<slot>some default content</slot>`

These styles will only apply to the component, so we are free to make use of element selectors without the styles affecting anything else of the page. This simplifies writing CSS, making naming conventions like BEM unnecessary.

Publishing A Component On NPM

NPM packages are published via the command line. Open a terminal window and move into a directory that you would like to turn into a reusable package. Then type the following commands into the terminal:

If your project doesn’t already have a package.json, npm init will walk you through generating one.
npm adduser links your machine to your NPM account. If you don’t have a preexisting account, it will create a new one for you.
npm publish

NPM packages are published via the command line

Large preview

If all’s gone well, you now have a component in the NPM registry, ready to be installed and used in your own projects — and shared with the world.

An example of a component in the NPM registry, ready to be installed and used in your own projects.

Large preview

The web components API isn’t perfect. Custom elements are currently unable to include data in form submissions. The progressive enhancement story isn’t great. Dealing with accessibility isn’t as easy as it should be.

Although originally announced in 2011, browser support still isn’t universal. Firefox support is due later this year. Nevertheless, some high-profile websites (like Youtube) are already making use of them. Despite their current shortcomings, for universally shareable components they’re the singular option and in the future we can expect exciting additions to what they have to offer.

Smashing Editorial
(il, ra, yk)

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and more

Original Source: http://feedproxy.google.com/~r/abduzeedo/~3/XNbE8pXiflA/ui-inspiration-weeks-selections-slava-kornilov-hristo-hristov-and-more

UI Inspiration: This week’s selections from Slava Kornilov, Hristo Hristov and more

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and more

AoiroStudio
Jul 16, 2018

It’s that time of the week for our collection of UI/UX interactions to boost your UI inspiration. We are focusing on cool animations, layout designs, UX thinking and more. We are mixing it all from static, dynamic and even live prototypes, this might be a great weekly series to bookmark! This week, we are kicking it off with a very cool combination of colours and UI components designed by Slava Kornilov. You should check out another intuitive UI transition by Ning xiao dong about a Wallet App page. Hope this will give you some inspiration!

In this collection we are featuring the work from Slava Kornilov, Hristo Hristov, Adam Przybylski, Shaban Iddrisu™ and more.

More Links
For more, check out Dribbble
Follow my tweets @aoirostudio
Follow my pictures on Instagram
via Dribbble

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Slava Kornilov

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Hristo Hristov

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Adam Przybylski

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Shaban Iddrisu™

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Yuanxu

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Robert Felizardo

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Ning xiao dong

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Abdullah Un Noman

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Veera

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by QiYang

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Aleksandr Lunev

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Netflayo

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by JUST Team

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Josh Parenti

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Christian Puga

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Boja

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Graphic Assets

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Alexandr Kotelevets

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Sunil kumar

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Yolanda ju

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Prometheus x GTR

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Shekh Al Raihan ✪

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by JONDesigner

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Giga Tamarashvili

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Zahidul

UI Inspiration: This week's selections from Slava Kornilov, Hristo Hristov and moreDesign by Divan Raj

ui inspiration
UI/UX
ui design
interaction design


Elegant Brand Identity for MONAJANS branding and digital agency

Original Source: http://feedproxy.google.com/~r/abduzeedo/~3/fAs7H7x52yw/elegant-brand-identity-monajans-branding-and-digital-agency

Elegant Brand Identity for MONAJANS branding and digital agency

Elegant Brand Identity for MONAJANS branding and digital agency

abduzeedo
Jul 16, 2018

MONAJANS shared a very elegant brand identity project on their Behance profile. The project was done for their company, which always makes it so much more challenging, at least for me. Have you tried to create your portfolio or a logo for yourself? Maybe things have changed now, but for me it’s always been very difficult. I am glad to see that the folks over at MONAJANS manage to accomplish something beautiful for theirs. 

MONAJANS is a a branding and digital agency established in Istanbul which creates, raises and expands brands. Their motives are understanding idea and they apply a strategic and creative mindset for branding and digital solutions, including marketing and communication. For more information make sure to check out http://www.monajans.com/

Brand identity

 

branding


Collective #432

Original Source: http://feedproxy.google.com/~r/tympanus/~3/ORWtpDvt6kg/

C432_WOTW

Inspirational Website of the Week: Die Antwort

A beautifully playful web experience with fun animations and lovely details. Our pick this week.

Get inspired

C424_Hello

This content is sponsored via Syndicate Ads
Reinvest Your Time with HelloSign API

G2 Crowd says HelloSign’s API is 2x faster to implement than any other eSign provider. What are you going to do with all the time you save?

Try it free today

C432_typegame

Font Memory Game

Train your ability to distinguish fonts with this fun game.

Check it out

C432_Phenomenon

Phenomenon

Phenomenon is a small, low-level WebGL library that provides the essentials to deliver a high performance experience.

Check it out

C432_addy

I’m Addy Osmani, Ask Me Anything!

A great AMA session with Google engineering manager Addy Osmani.

Read it

C432_tobi

Tobi

A compact, open source lightbox script without dependencies.

Check it out

C432_susty

Delivering WordPress in 7KB

A really inspiring article by Jack Lenox on how and why he built Susty WP.

Read it

C432_undoix

Un Deux Trois

A tutorial on how to reproduce one of Vera Molnár’s generative artworks, Un Deux Trois.

Read it

C432_threejscss

Three.js in Paint Worklet Test

An interesting demo by Ada Rose Cannon where three.js CanvasRender is used to render inside a Houdini paint() worklet. Basically it’s three.js working in CSS!

Check it out

C432_cheat.sh

cheat.sh

Unified access to the best community driven cheat sheets repositories of the world with a curl/browser interface.

Check it out

C432_kleur

Kleur

A Node.js library for formatting terminal text with ANSI colors.

Check it out

C432_brutal

brutal.js

A minimal framework for building raw web applications.

Check it out

C432_scale

SCSScale

A useful SCSS typographic modular scale starter based on the body’s font-size.

Check it out

C432_carbon1

Carbon

A tool to create beautiful images of your code right from your terminal.

Check it out

C432_listitem

Slice list items

Aaron Iker created this nice demo where checked list items are sliced into half.

Check it out

C432_font1

Free Font: Chamuyo

A beautiful typeface designed by Caio Kondo.

Get it

C432_githubissues

Mirror

In case you missed it: a blogging tool powered by GitHub issues.

Check it out

C432_font2

Free Font: Lemon Bird

A playful hand drawn typeface made by Ian Barnard. Free for a registration.

Get it

C432_dahsboard

Shards Dashboard Lite

A free Bootstrap admin dashboard template with some useful UI elements by Designrevision.

Check it out

C432_emojiicons

How to Use Emojis as Icons

In case you missed it: Preethi Sam shows a brilliant trick for using Emojis as icons.

Read it

Collective #432 was written by Pedro Botelho and published on Codrops.

Get more from the Atom text editor

Original Source: http://feedproxy.google.com/~r/CreativeBloq/~3/jy8i-mSzxY4/get-more-atom-text-editor-21619396

Of all the text editors available, Atom is a favourite amongst designers and developers. Atom is developed by GitHub and was open sourced in early 2014. Since then, this web design tool has grown to have more than 500,000 monthly users. Out of the box Atom is Git-aware, includes Markdown previews, auto-complete and more. It is designed to be hackable to the core.

In addition to being open source, Atom is built using web technology: JavaScript, HTML and CSS. This makes Atom's core and extensibility options accessible to a wide range of developers.

In this article I'll share ways in which you can extend and customise Atom, from managing packages to adding custom behaviours.

atom landing page

Atom is built with JavaScript, HTML and CSS
Package ecosystem

At the time of writing, over 7,000 packages and more than 2,000 themes had been published for Atom. Atom itself is created by bundling the core app with dozens of packages for each default feature.

These packages do things like add Markdown preview support, display your directory's Git status, and control Find and Replace. They can be managed through the Settings view. Atom's Settings view sets it apart because it includes a package manager by default, giving you access to the packages you have installed, as well as the thousands created by the community. You can browse and install these from within Atom.

You can open the Settings view by clicking Packages > Settings View > Open in your menu bar or by using the cmd+, keyboard shortcut.

Packages

packages in Atom

Use packages to extend and customise Atom

With the Settings view open, you’ll find the Packages tab on the left. This will display all the packages you have installed, and their type:

Community packages: Packages written by people outside of GitHub's Atom teamCore packages: Developed by the Atom team and bundled with AtomDevelopment packages: Packages you have on your machine and use in Atom from local source

From the Packages view, you can manage your installed packages by selecting to install/uninstall or disable/enable them. Clicking on a package in this view takes you to the package's available settings (if any) as well as the README that describes the package. If you want to know more, you can click on the link and be taken to the package's repository or issue tracker.

Install packages

The Install tab in the Settings view connects you to the thousands of packages available for Atom. At the top you'll find featured packages, but you can also use the search bar to find the one you're looking for.

Packages are published to Atom using Atom Package Manager (APM), which is included with Atom. You'll find published Atom packages in the Install view, and they can also be found on Atom's website.

Just like in the Packages view, clicking on a single package displays the README, so you can see what it does before you install it. It also links to the package's code repository.

You can install new packages from the community in this view by clicking the Install button on a listed package. You can then manage packages from the Packages view.

Development packages

In order to use a package you’re developing locally in Atom before you publish it with APM, you can link it to Atom using the APM CLI. For instance, from within the package’s directory in Terminal or Bash, use the following command:

Linked packages will show up in the Development Packages section in the Packages view. You can see linked packages with this command:

Themes in Atom

In the Install view, toggle the search bar to Themes to search the available Atom themes. Once you have themes installed, you can manage and set them as the current theme in the Themes view.

UI and syntax themes

Atom has themes for both the UI and the code syntax. The syntax themes style how the code looks in the editor itself, and the UI themes style how the rest of Atom looks (e.g. the tabs and file tree).You can even make small changes to Atom without creating a complete theme or package.

Alternative customisation in Atom

The Settings tab in the Settings view provides your options for customising Atom, but you can go beyond the default options by adding JavaScript or CSS within your config. Every instance of Atom has a .atom directory that contains its configuration settings, where you can create custom behaviour or styles. 

To open your .atom configuration directory, click the ‘Open config folder' button on the left side of the Settings view.

Init.coffee file

The init.coffee file allows you to add custom behaviour to Atom every time a new window is launched. It's executed after packages are loaded and any previous editor state has been restored.

You can use CoffeeScript in this default file or create a new file, init.js, to use JavaScript. In init you can make use of the full Node.js API. For example, if each time you opened a window you wanted Atom to greet you with the version of Node.js it is using, you could add this to your init file:

To interact more with Atom, you can use the Atom API. Documentation on the API is available on the Atom site.

Styles.css

Just like the init.coffee file, styles.css is a file that is loaded after Atom starts up. The styles you add here will override or add onto Atom's existing styles, and they will take effect immediately upon saving. 

For example, you could change the editor's background colour by adding this CSS:

A quick way to find the property names in Atom is to make use of the fact that underneath Atom is Chromium, so you have access to DevTools. You can toggle DevTools on and off by pressing alt+cmd+I.

With DevTools open, you can use the magnifying glass to select elements in Atom and reveal their class or element names. Target them in your styles.css file to change their properties.

With Atom's package manager and configuration files you can customise your Atom environment right from within Atom. This introduction should get you well on your way, and if you have any questions, open an issue on the project.

This article originally appeared in issue 277 of net, the world's leading web design magazine. Subscribe here.

To improve your web design skills further, head to our conference Generate and experience a packed schedule of industry-leading speakers, workshops and valuable networking opportunities. Don't miss it! Get your Generate ticket now.

Related articles:

What to learn to upgrade your web design skillsBeware the cutting edge of web design13 best pieces of user testing software

Monthly Web Development Update 7/2018: Practical Accessibility, Design Mistakes, And Feature Control

Original Source: https://www.smashingmagazine.com/2018/07/monthly-web-development-update-7-2018/

Monthly Web Development Update 7/2018: Practical Accessibility, Design Mistakes, And Feature Control

Monthly Web Development Update 7/2018: Practical Accessibility, Design Mistakes, And Feature Control

Anselm Hannemann

2018-07-13T14:20:17+02:00
2018-07-13T12:33:42+00:00

The web continues to amaze me. With all its variety and different changes to the platform, it’s hard to see a straight pattern — if there even is (just) one. But it’s wonderful to see what is being changed, which features are added to the platform, which ones get deprecated, and how browsers implement more and more technology to protect the user from malicious website attacks. It’s interesting to see that these security features nowadays are getting as much attention as a feature for developers; this shows the importance of privacy and security and how unstable and insecure the web was in the past.

But the best thing about all of this is that it shows how important it is to stick to the things that people give us. Instead of implementing our own solutions for everything, it’s often much better to re-use an existing system. Not only is it safer to rely on, but also less work while more inclusive to extend a native DOM element with a custom element (instead of writing our own custom element from scratch). If we think about whether we should build our own version of SSL or use an existing software for this, why would we build a clickable element based on nothing instead of altering the behavior of an a or button element? And why would we check for resource host validation on our own, if the browser already gives us an API for that? This week’s articles are all dedicated to these topics.

Another thing that has been stuck in my head is Andrea Giammarchi’s article, “A Bloatless Web,” in which he describes how we blindly use Babel as developers when we write JavaScript to be able to write modern ECMAScript. But we usually don’t realize that transpiling all of our modern code in modern browsers isn’t the most efficient way. I’m glad that Andrea offers some ideas on how we can improve that situation and improve our web apps’ performance. Wouldn’t it be amazing to just serve a third of the bundle size by not transpiling the code anymore for each and every browser?

News

Site Isolation effectively makes it harder for untrusted websites to access or steal information from your accounts on other websites. Chrome 67 is now shipping with it and Cross-Origin Read Blocking (CORB) will no longer load, e.g. a JSON file as image. But even further, these changes mean that full-page layout is no longer guaranteed to be synchronous. This new feature affects you if you read out calculated sizes from an element in JavaScript or use unload event listeners. Ensure that you know about this and check if your sites still work as expected.
By now, we know a bit about Content Security Policies — a feature that lets developers limit the load of certain resources by hostnames. But browser vendors have come up with something new now: Feature Policy. This allows web developers to selectively enable, disable, or modify the behavior of certain APIs and web features in the browser. It’s like CSP but instead of controlling security, it controls features and Eric Bidelman wrote an introduction to Feature Policy explaining everything.
The Brave browser team shows their latest feature to protect their users’ privacy: Tabs that connect via the Tor network.

With so much happening on the web, what should we really pay attention to? At SmashingConf New York 2018 ?? we’ll explore everything from PWAs, font loading best practices, web performance and eCommerce UX optimization, to refactoring CSS, design workflows and convincing your clients. With Sarah Drasner, Dan Mall, Sara Soueidan, Jason Grigsby, and many other speakers. Oct 23–24.

Check the speakers →

SmashingConf New York 2018, with Dan Mall, Sara Soueidan, Sarah Drasner and many others.

Generic

Anton Sten asks if Tech Sector Values are Broken? Analyzing the marketing strategies by Apple, Microsoft, Google, Amazon but also small other companies and how we can do really purposeful work and stick to our values instead of treating them as marketing-material that we don’t need to respect or stick to.
Now that the technology sector of the world is rapidly transforming all of the world’s things into digital things, many have called for more ethics in our field. That is in many instances quite a vague goal, so let’s apply it to one part of digital: front-end development. How can we be more ethical as front-end developers, what kinds of things can we do? Hidde de Vries wrote an article about that.

Security

Ticketmaster’s customer data has been compromised and as it seems, it’s due to a customized single line of code that includes a third-party script.

UI/UX

Eugen Eşanu shows ten small design mistakes we still make and what we can do instead to make our design more user-friendly.

what we design vs. what a user needs

Users do not have time to read more than necessary, and yet designers still tend to put a lot of text because they think people need to know that. (Image source)

Privacy

This is an interesting report about how Google allows outside app developers to read people’s Google emails when they grant permission during app authorization. The issue with that is that there is no way to easily prevent that and it might have quite some impact if you use Gmail for your company as it might affect privacy policies and is under subject of GDPR.

Web Performance

Max Böck on how we can build components that react to the actual device connection speed using the Network Information API. And despite it’s currently only available in Chrome and Samsung Internet browsers, it’s worth trying it out and maybe already serve it to these users.
From time to time, we can still read articles mentioning the importance of optimizing CSS selectors in order to improve performance. This originates in research done several years ago but Ivan Čurić researched this again and found out it doesn’t matter.

Accessibility

Microsoft’s developer team shares a video playlist about practical accessibility, including how to optimize presentations or language for inclusion or how to build a proper “skip navigation” functionality on your website.
Sara Novak shares how she managed to show empathy by experimenting with going colorblind to understand how other people experience the world differently.
The Developer Tools of Firefox now have an Accessibility Inspector mode. Here’s how to activate it and how to use it.

A form with color-based indicators

In her article, Sara Novak explains why it’s important not to rely on color alone as an indicator. Symbols and error message can be much more helpful to users. (The image above shows a form with color-based indicators. Left: How a person with normal vision sees a form with color-based indicators. Right: How a deuteranomalous person sees the same form.) (Image source)

JavaScript

Leon Revill show us how we can extend existing native DOM elements with Web Components. This is extremely helpful and useful as we can not only save a lot of time by using prebuilt templates for custom elements but also get all the optimizations and defaults (semantics, accessibility, browser functionality) for free and still can build our own behavior on top of it. At the very least, if we could use Custom Elements at all, but that’s a different story.
Gerardo Rodriguez shows how we can easily fail to optimize websites for performance with Service Workers and the Fetch API and how this can result in a quota exception in browsers. Luckily, he found out the reason of this and by setting the proper CORS headers, Gerardo finally solved the mystery of single-cached opaque responses and tells us how to avoid the issues.
Filepond is a nice open-source JavaScript file uploader. Rik Schennink shares the challenges faced building it.
Andrea Giammarchi about the problem of bundling JavaScript with Babel and why transpiling code isn’t the best solution anymore. Instead, we should think about how to serve different bundles depending on the browser support to decrease the bundle size and improve performance.
Justin Fuller shares three great new features coming to JavaScript soon that will help us write code that is easier to understand, such as operational chaining, nullish coalescing, or the pipeline operator.
Addy Osmani and Mathias Bynens wrote a primer introduction on how we can use JavaScript modules on the web today.

CSS

An article series that covers how we can fake an auto-placement grid with gaps in Internet Explorer.
CSS Grid is nice, but I often hear that people can’t use it because IE11 doesn’t support it well. But that’s not exactly true as IE11 has a prior version of CSS Grid available that we can easily transpile with autoprefixer. Daniel Tonon explains the CSS Grid differences and which features we can and cannot use and will continue with even more tips.
For many people, CSS Grid is still very new, and it’s very capable and helps us solve a lot of problems when creating grid-based layouts in CSS. But in the current version, there are a couple of things that are still not possible. CSS Grid level 2 will bring us sub-grids and Rachel Andrew explains what you need that for.
Is CSS-in-JS good? Is it just bad? Why we constantly fall into the trap of arguing when there are no clear winners and how we can do better by acknowledging evolution and seeing things in context.

Work & Life

Why the concept of patience and the strive to build something to last should gain more attention in business. Some thoughts that came into my mind when reading another article and it seems many people like the idea behind this.
Ethan Marcotte on how he approaches to choose clients and why he thinks it’s important to only choose clients that you can ethically support. But this also shows how difficult this can be sometimes, as recent discussions about Microsoft’s business cooperations with legal entities show.

Smashing Editorial
(il)