Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

July 17 2018

20:39

CSS-in-JS: FTW || WTF?

I enjoyed Bruce Lawson's talk on this holiest of wars. It's funny and lighthearted while being well researched and fairly portraying the good arguments on both sides.

The post CSS-in-JS: FTW || WTF? appeared first on CSS-Tricks.

17:28

25 Best Marketplace WordPress Themes

Do you want to take your online store to the next level? These best marketplace WordPress themes will help you easily build huge marketplace websites like Amazon, eBay or Envato.

They come packed with all the necessary features for launching your marketplace site, for any kind of niche you choose. The vendors will be able to easily add a shop, products, complete received orders, track shop earnings and withdraw them using the front-end forms. You will be able to charge them commissions for each sale and watch your business grow.

Here are our top picks for the best marketplace WordPress themes!

Martfury – WooCommerce MarketplaceWordPress Theme

Martfury is a WooCommerce marketplace WordPress theme that you can use to create a multi-vendor marketplace for different types of stores, such as online shops selling electronics, furniture, clothing, hi-tech items, accessories, and more. You can create a similar website to Amazon, Envato or eBay! 

1 Martfury - WooCommerce Marketplace WordPress Theme

Makery – Marketplace WordPress Theme

Makery is another perfect theme for building any martkeplace website. It comes with all the needed built-in features for creating unlimited shops, multiple carts, shop commissions and more. It is powered by  WooCommerce. 

2 Makery - Marketplace WordPress Theme

Marketify – Digital Marketplace WordPress Theme

Powered by Easy Digital Downloads, this theme lets you create a variety of digital marketplaces for selling all kinds of digital products, such as eBooks, fonts, graphics, photos, and more.

3 Marketify - Digital Marketplace WordPress Theme

Multimarket – WooCommerce MarketplaceTheme

Multimarket is a marketplace website theme, integrated with WooCommerce and the Dokan Multivendor Plugin. Turn your conventional online shop into a professional marketplace with multiple vendors.

4 Multimarket - WooCommerce Marketplace Theme

Wow – Furniture Marketplace Theme

Wow is a WooCommerce theme that is very easy to customize and set up. It is the perfect theme for building a marketplace for selling furniture online.

5 Wow - Furniture Marketplace Theme

Market – Marketplace WordPress Theme

This marketplace WordPress theme can be customized via the Live Customizer. It is fully responsive, integrated with the Easy Digital Downloads free plugin, and has many different pre-made templates to choose from.

6 Market - Marketplace WordPress Theme

LeCrafts – WooCommerce Marketplace Themes

LeCrafts is a fully customizable WordPress theme that will help you design your online store, marketplace or even portfolio and/or blog! It is highly versatile, comes packed with 7 predefined homepage layouts, 6 predefined portfolio layouts and more and it is powered by WPBakery page builder.

7 LeCrafts - WooCommerce Marketplace Themes

Stocky – A Stock Photography MarketplaceTheme

Stocky is the perfect theme for launching your stock photos website. You can create your online marketplace in minutes and accept multiple vendors.

v8 Stocky - A Stock Photography Marketplace Theme

MarketHub – Marketplace WordPress Theme

MarketHub is another WordPress theme that offers digital marketplace solutions build with WooCommerce and the WC Vendors plugin. You can create your professional marketplace in just one day.

9 MarketHub - Marketplace WordPress Theme

Baggies – WooCommerce Marketplace Themes

Baggies is a fully customizable, WooCommerce-powered marketplace theme. It is packed with 13+ pre-made templates for homepage layouts, portfolio pages, and more. Visual Composer is integrated with this theme, so live customization will be extremely easy to make.

10 Baggies - WooCommerce Marketplace Themes

Restored MarketPlace – MarketPlace WordPress Theme

Restored Marketplace offers a complete marketplace solution for digital downloads, all in one powerful theme built with the Easy Digital Downloads plugin. Use this theme to sell anything digital including stock photos, plugins, eBooks, software, audio files, videos, and more.

11 Restored MarketPlace - MarketPlace WordPress Theme

Dash – Handmade Furniture Marketplace Theme

Dash is another modern and clean-coded furniture marketplace WordPress theme with a responsive design. Use it to launch your furniture shop and expand it with multiple vendors while you charge them commissions.

12 Dash - Handmade Furniture Marketplace Theme

Marketica – eCommerce and Marketplace – WooCommerce WordPress Theme

Marketica is a great WordPress theme for turning your store into a vendor marketplace. It has complex editing capabilities and all the needed features for running a marketplace website.

13 Marketica - eCommerce and Marketplace - WooCommerce WordPress Theme

Chicky – WordPress Fashion Marketplace Theme

Chicky is a fashion WordPress theme with a stylish design. Use this complex theme for launching your fashion marketplace website and attracting clients and vendors. Comes with plenty of demo pages to choose from.

14 Chicky - WordPress Fashion Marketplace Theme

Rigid – WooCommerce Theme for Enhanced Shops and Multi-Vendor Marketplaces

Use this WooCommerce-powered marketplace theme to build your multi-vendor e-shop. It offers you all the right tools for launching your marketplace today, without any coding knowledge and minimum costs.

15 Rigid - WooCommerce Theme for Enhanced Shops and Multi Vendor Marketplaces

SecretSho – Fashion MarketPlace WordPress Theme (Mobile Layout Included)

This is a WordPress theme for your a fashion/clothing website that needs marketplace features. It has a modern mobile layout, plenty of templates to choose from and powerful themes features and customization options.

16 SecretSho - Fashion MarketPlace WordPress Theme (Mobile Layout Included)

Catalog | Buy Sell / Marketplace Responsive WordPress Theme

Catalog is a buy/sell marketplace WordPress theme you can use to buy and sell different types of goods. This theme is based on Bootstrap and coded with HTML5, CSS and jQuery.

17 Catalog | Buy Sell : Marketplace Responsive WordPress Theme

AntiqueMall – Antique Store MarketplaceWordPress Theme

AntiqueMall is a marketplace WordPress theme created for selling antique objects online. It looks elegant, professional, and it’s very flexible and easy to use.

18 AntiqueMall - Antique Store Marketplace WordPress Theme

eMarket – The eCommerce & Multi-purpose MarketPlace WordPress Theme (Mobile Layouts Included)

eMarket is a modern eCommerce WordPress theme for building professional e-commerce sites with marketplace capabilities. It has the multi-vendor options and is integrated with plugins like WC Vendors and Dokan.

19 eMarket - The eCommerce & Multi-purpose MarketPlace WordPress Theme (Mobile Layouts Included)

Appointment Booking, Marketplace, Directory WordPress Theme – Medican

Medican is a multipurpose WordPress theme for building all kinds of websites, including large marketplaces. It is easily adaptable to any kind of niche, from medical to fashion, and more. It also comes with an integrated directory.

20 Appointment Booking, Marketplace, Directory WordPress Theme - Medican

OneMall – Multipurpose eCommerce & MarketPlace WordPress Theme (Mobile Layouts Included)

OneMall is a clean eCommerce and marketplace WordPress theme with multiple features. Use it for building the best marketplaces online. Comes with different homepage designs to choose from, a visual page builder, RTL support, and more, all via a fully responsive layout.

21 OneMall - Multipurpose eCommerce & MarketPlace WordPress Theme (Mobile Layouts Included)

TopDeal – Multipurpose Marketplace WordPress Theme (Mobile Layouts Included)

TopDeal is an eCommerce WordPress theme powered by WordPress, WooCommerce and compatible with WC Vendors and the Dokan plugin. Use this versatile theme with ease, as it comes with various pre-made homepage designs, page styles and theme options.

22 TopDeal - Multipurpose Marketplace WordPress Theme (Mobile Layouts Included)

Siezz – Modern Multipurpose MarketPlaceWordPress Theme (Mobile Layout Included)

This is a clean and responsive WooCommerce WordPress theme for building online marketplaces packed with the latest features and suitable for any kind of products.

23 Siezz - Modern Multipurpose MarketPlace WordPress Theme (Mobile Layout Included)

Olam – WordPress Easy Digital Downloads Theme, Digital Marketplace, Bookings

Olam is the theme you need to build an online store or marketplace for selling digital goods. Start selling your digital goods online with this feature rich theme packed with many extensions and customization options.

24 Olam - WordPress Easy Digital Downloads Theme, Digital Marketplace, Bookings

Motor – Vehicle Marketplace Responsive WP Theme

Motor is a responsive vehicle marketplace WP theme for selling cars online. You can also use it to sell real estate, boats, ships, trucks, machinery and more, as it is easily adaptable.

25 Motor - Vehicle Marketplace Responsive WP Theme

The post 25 Best Marketplace WordPress Themes appeared first on Line25.

17:10
Newsletters Designers And Developers Should Be Subscribing To
14:15

So You Want to Persuade Users? Make Things Simple!

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:002018-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:

  1. Reciprocity
    People are obliged to give something back in exchange for receiving something.
  2. Scarcity
    People want more of those things they can have less of.
  3. Authority
    People follow the lead of credible, knowledgeable experts.
  4. Consistency
    People like to be consistent with the things they have previously said or done.
  5. Liking
    People prefer to say yes to those that they like.
  6. 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.”

  1. 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.
  2. Toll-free Number (Credibility)
    Established and legitimate organization.
  3. 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.”
  4. 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).
  5. Extrinsic Reward
    An Apple watch for $25 — that’s a bonus here!
  6. Visual Cueing
    The person in focus (stereotypical breadwinner) has his gaze directly focused at the form below, leading the user to the next step.
  7. Foot In The Door
    This quote won’t cost anything — zip, nada.
  8. 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.
  9. 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)
  10. Control
    The user has a choice of devices.
  11. Extrinsic Rewards
    More rewards to be earned.
  12. 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).
  13. Credibility
    The company reinforces longevity and protector of America.
  14. Authority
    Licensed Coverage Coach (not just a sales agent).
  15. 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

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)
14:00

20+ Desktop Computer Mockup Templates

Looking for a high-quality desktop computer mockup to showcase your design? Look no further. In this post, we’re featuring the best desktop mockup templates for both Mac and Windows desktop devices.

Microsoft’s new Surface Studio workstations are widely popular among creative professionals. This makes the device a great choice for showcasing your creative designs to clients and in your portfolio. We’ve found a few stylish Surface Studio mockups, as well as a variety of other Mac and Windows desktop computer mockups.

Surface Studio Computer Mockup

This beautiful Surface Studio mockup template comes in 6 different variations. It includes a fully customizable PSD file featuring organized layers and smart objects. You can use this mockup to showcase your creative artworks, website designs, graphic designs, and much more. It’s also great for crafting a website header as well.

  • Price: Envato Elements Subscription

6 Surface Studio Mockups

This bundle of Microsoft Surface Studio mockups also comes in PSD format. It includes 6 mockup templates featuring the desktop computer in several different angles, allowing you to present your designs in many different ways. The template can be easily customized using smart objects and you can move around the device accessories as you like.

  • Price: Envato Elements Subscription

Microsoft Surface Studio Mockups v.2

Another stylish Surface Studio computer mockup featuring a minimalist design. This mockup template includes 3 different versions of the mockup with changeable backgrounds, adjustable shadows, and movable accessories. This template is perfect for showcasing designs on a website or social media graphics.

  • Price: Envato Elements Subscription

Surface Studio Computer Mockup Bundle

This is a massive bundle of Microsoft Surface Studio mockups featuring 39 different angles and views of the device. It includes mockups of the device in many positions to let you use them in various presentation situations. The templates are available in 4000 x 4000 px resolution PSD files.

  • Price: Envato Elements Subscription

Desktop Mockup Creator

This is a mockup generator kit that allows you to create your own mockup scenes and hero image scenes. The kit comes with lots of customizable and movable elements and device mockups, which you can arrange however you like to create unique mockup templates to use with your design works.

  • Price: Envato Elements Subscription

Computer Mockup – 14 Poses

A collection of 14 iMac and MacBook mockup templates. This bundle features several unique and photorealistic mockup templates featuring the Apple desktop computers. They are available in 3500 x 2300 px resolution PSD files with a depth of field effect for giving your designs more focus.

  • Price: Envato Elements Subscription

6 Responsive Device Mockups

A set of 6 device mockups featuring a family of Apple devices including an iMac, MacBook, iPhone, and an iPad. The pack includes 6 separate mockups for each device in 3000 x 2000 px resolution. You can also easily customize the templates using smart objects.

  • Price: Envato Elements Subscription

Mac and Thunderbolt Display Mockups

This mockup templates pack includes the new Apple Thunderbolt Display along with iMac mockups. It includes mockups in 2 styles: Photorealistic and flat design. Both versions of mockups include 4 templates in different angles. The mockups are fully customizable with smart objects and feature changeable backgrounds as well.

  • Price: Envato Elements Subscription

iScreen iMac Mockup

A collection of simple and minimal iMac mockup templates. This collection includes 5 different mockups featuring different views of the Apple desktop computer. You’ll also be able to choose from 6 different background options and customize the templates however you like.

  • Price: Envato Elements Subscription

Mac Clean Style Desktop Mockup

A clean and a creative iMac computer mockups. It includes 2 different styles of desktop computer mockups that you can use to showcase your designs, website screenshots, and app screens on presentations.

  • Price: Envato Elements Subscription

PSD Web Showcase Mockup

This iMac mockup template allows you to showcase your website and app designs in multiple views using the same image. It’s available in 5200 x 2880 px resolution and supports advanced customization with the ability to add or remove shadows, change backgrounds, and drag and drop mockups to create your own scenes.

  • Price: Envato Elements Subscription

iMac Desktop Computer Mockup

A creative iMac mockup template you can use with your minimal and modern design presentations. This template is available in 10 variations with different angles of the desktop computer. The template comes in a 5000 x 3333 px resolution PSD file.

  • Price: Envato Elements Subscription

Surface Studio Zoom In Mockup

This is a unique mockup template of the Microsoft Surface Studio that allows you to showcase apps and website designs with zoomed-in sections. It’s ideal for showing off features and special elements of your designs using the desktop computer mockup. The pack includes 6 different mockup templates.

  • Price: $7

Isometric Surface Studio Mockup

Another stylish Surface Studio mockup featuring isometric views of the design. This bundle comes with several different mockup templates showing different color versions of the computer. The templates can be easily customized using smart objects.

  • Price: $15

Creative Desk Scene Creator

A creative mockup scene creator kit that you can use to create your own unique mockup scenes. This bundle includes lots of elements for creating stylish mockups and allows you to create both desktop computer and laptop mockups as well.

  • Price: $14

Basic Surface Studio Mockup

This is a simple and a basic Surface Studio mockup that you can use with various kinds of design showcases, portfolios, and presentations. It’s perfect for showcasing website designs, app screens, and much more.

  • Price: $5

5 iMac Mockup PSD Templates

This bundle comes with 5 high-quality iMac mockup templates featuring different angles of the devices. The templates feature a creative work environment which makes them perfect for your portfolio showcases and presentations.

  • Price: $18

Clean iMac Mockup White Background

Another iMac mockup template featuring a minimalist background. This template comes fully equipped with smart objects for easier editing and in a 4000 x 2662 px PSD file.

  • Price: $8

23 Desktop Screen Display Mockups

This bundle features 23 different desktop computer mockups you can use with various design presentations and showcases. The templates feature 7 different views of the devices and include an editable logo on the device as well.

  • Price: $7

White iMac Desktop Mockup Template

This iMac mockup template features a creative and study environment. It’s ideal for showcasing website and app screens. The template is available in 5k resolution and can be easily customized to your preference.

  • Price: $8

Responsive Desktop Mockup for Presentations

Another mockup template featuring the iMac Retina 5k. This template features a changeable background and includes separated iPad, MacBook, and iPhone device mockups as well.

  • Price: $20

Creative Device Mockup Templates

This Apple devices mockup is also ideal for crafting a website header or a hero image. The template features all of the Apple device mockups in one file. You can customize each device mockup to place your screens using smart objects.

  • Price: $13

Keep browsing for more mockups with our MacBook mockups and iPhone mockups collections.

13:38

Render Children in React Using Fragment or Array Components

What comes to your mind when React 16 comes up? Context? Error Boundary? Those are on point. React 16 came with those goodies and much more, but In this post, we'll be looking at the rendering power it also introduced — namely, the ability to render children using Fragments and Array Components.

These are new and really exciting concepts that came out of the React 16 release, so let’s look at them closer and get to know them.

Fragments

It used to be that React components could only return a single element. If you have ever tried to return more than one element, you know that you’ll will be greeted with this error: Syntax error: Adjacent JSX elements must be wrapped in an enclosing tag. The way out of that is to make use of a wrapper div or span element that acts as the enclosing tag.

So instead of doing this:

class Countries extends React.Component {
  render() {
    return (
      <li>Canada</li>
      <li>Australia</li>
      <li>Norway</li>
      <li>Mexico</li>
    )
  }
}

...you have to add either an ol or ul tag as a wrapper on those list items:

class Countries extends React.Component {
  render() {
    return (
      <ul>
        <li>Canada</li>
        <li>Australia</li>
        <li>Norway</li>
        <li>Mexico</li>
      </ul>
    )
  }
}

Most times, this may not be the initial design you had for the application, but you are left with no choice but to compromise on this ground.

React 16 solves this with Fragments. This new features allows you to wrap a list of children without adding an extra node. So, instead of adding an additional element as a wrapper like we did in the last example, we can throw <React.Fragment> in there to do the job:

class Countries extends React.Component {
  render() {
    return (
      <React.Fragment>
        <li>Canada</li>
        <li>Australia</li>
        <li>Norway</li>
        <li>Mexico</li>
      </React.Fragment>
    )
  }
}

You may think that doesn’t make much difference. But, imagine a situation where you have a component that lists different items such as fruits and other things. These items are all components, and if you are making use of old React versions, the items in these individual components will have to be wrapped in an enclosing tag. Now, however, you can make use of fragments and do away with that unnecessary markup.

Here’s a sample of what I mean:

class Items extends React.Component {
  render() {
    return (
      <React.Fragment>
        <Fruit />
        <Beverages />
        <Drinks />
      </React.Fragment>
    )
  }
}

We have three child components inside of the fragment and can now create a component for the container that wraps it. This is much more in line with being able to create components out of everything and being able to compile code with less cruft.

Fragment Shorthand

There is a shorthand syntax when working with Fragments, which you can use. Staying true to its fragment nature, the syntax is like a fragment itself, leaving only only empty brackets behind.

Going back to our last example:

class Fruit extends React.Component {
  render() {
    return (
      <>
        <li>Apple</li>
        <li>Orange</li>
        <li>Blueberry</li>
        <li>Cherry</li>
      </>
    )
  }
}

Question: Is a fragment better than a container div?

You may be looking for a good reason to use Fragments instead of the container div you have always been using. Dan Abramov answered the question on StackOverflow. To summarize:

  1. It’s a tiny bit faster and has less memory usage (no need to create an extra DOM node). This only has a real benefit on very large and/or deep trees, but application performance often suffers from death by a thousand cuts. This is one less cut.
  2. Some CSS mechanisms like flexbox and grid have a special parent-child relationship, and adding divs in the middle makes it harder to maintain the design while extracting logical components.
  3. The DOM inspector is less cluttered.

Keys in Fragments

When mapping a list of items, you still need to make use of keys the same way as before. For example, let's say we want to pass a list of items as props from a parent component to a child component. In the child component, we want to map through the list of items we have and output each item as a separate entity. Here’s how that looks:

const preload = {
  "data" : [
    {
      "name": "Reactjs",
      "url": "https://reactjs.org",
      "description": "A JavaScript library for building user interfaces",
    },
    {
      "name": "Vuejs",
      "url": "https://vuejs.org",
      "description": "The Progressive JavaScript Framework",
    },
    {
      "name": "Emberjs",
      "url": "https://www.emberjs.com",
      "description": "Ember.js is an open-source JavaScript web framework, based on the Model–view–viewmodel pattern"
    }
  ]
}

const Frameworks = (props) => {
  return (
    <React.Fragment>
      {props.items.data.map(item => (
        <React.Fragment key={item.id}>
          <h2>{item.name}</h2>
          <p>{item.url}</p>
          <p>{item.description}</p>
        </React.Fragment>
      ))}
    </React.Fragment>
  )
}

const App = () => {
  return (
    <Frameworks items={preload} />
  )
}

See the Pen React Fragment Pen by Kingsley Silas Chijioke (@kinsomicrote) on CodePen.

You can see that now, in this case, we are not making use of any divs in the Frameworks component. That’s the key difference!

Render Children Using an Array of Components

The second specific thing that came out of React 16 we want to look at is the ability to render multiple children using an array of components. This is a clear timesaver because it allows us to cram as many into a render instead of having to do it one-by-one.

Here is an example:

class Frameworks extends React.Component {
  render () {
    return (
      [
        <p>JavaScript:</p>
        <li>React</li>,
        <li>Vuejs</li>,
        <li>Angular</li>
      ]
    )
  }
}

You can also do the same with a stateless functional component:

const Frontend = () => {
  return [
    <h3>Front-End:</h3>,
    <li>Reactjs</li>,
    <li>Vuejs</li>
  ]
}

const Backend = () => {
  return [
    <h3>Back-End:</h3>,
    <li>Express</li>,
    <li>Restify</li>
  ]
}

const App = () => {
  return [
    <h2>JavaScript Tools</h2>,
    <Frontend />,
    <Backend />
  ]
}

See the Pen React Fragment 2 Pen by Kingsley Silas Chijioke (@kinsomicrote) on CodePen.

Conclusion

Like the Context API and Error Boundary feature that were introduced in React 16, rendering children components with Fragment and multiples of them with Array Components are two more awesome features you can start making use of as you build your application.

Have you started using these in a project? Let me know how in the comments so we can compare notes. 🙂

The post Render Children in React Using Fragment or Array Components appeared first on CSS-Tricks.

07:44
Blue is the warmest color, yet the most difficult to find

July 16 2018

20:00

PSA: Yes, Serverless Still Involves Servers.

You clever dog. You've rooted it out! It turns out when you build things with serverless technology you're still using servers. Pardon the patronizing tone there, I've seen one-too-many hot takes at this point where someone points this fact out and trots away triumphantly.

And yes, because serverless still involves servers, the term might be a bit disingenuous to some. You could be forgiven for thinking that serverless meant technologies like web workers, which use the client to do things you might have otherwise done on a server and is where the term serverless was headed. Alas, it is not.

What serverless really means:

  • Using other people's servers instead of running your own. You're probably already doing that, but serverless takes it to another level where you have no control over the server outside of telling it to run a bit of code.
  • You don't need to think about scaling — that's the serverless provider's problem.
  • You are only paying per execution of your code and not some fixed cost per time.
  • You only worry about your code being misused, but not the security of the server itself.
  • We're mostly talking about Cloud Functions above, but I'd argue the serverless movement involves anything that allows you to work from static hosting and leverage services to help you with functionality. For example, even putting a Google Form on a static site is within the serverless spirit.

Serverless is about outsourcing a little bit more of your project to companies that are incentivized to do it well. My hope is that someday we can have a conversation about serverless without having to tread this ground every time and spat about the term. I suspect we will. I think we're almost over the term the cloud as an industry and we'll jump this hurdle too. It's worth it when a single word successfully evokes a whole ecosystem.

Wanna know more about serverless? Here's the tag on CSS-Trick where we've talked about it a bunch.

The post PSA: Yes, Serverless Still Involves Servers. appeared first on CSS-Tricks.

15:37
Best Premium Courses To Learn PHP Programming
14:40
Helms Workshop Studio Gives Your Brand an Identity With Personality
14:00

4 Unique Placeholder Image Services for Designers

A placeholder image service is a quick and easy way to find images to insert into web projects so that a wireframe or prototype looks more real. It can help other people envision the project and help keep it moving forward.

Most designers try to do everything they can to help a client or non-visual team member see a project during the design, mockup and prototyping process. Often that means putting something together before the content itself is complete.

Here, we’re going to look at four different (and unique) placeholder image services for designers to help you move projects along as efficiently as possible. (Plus, we have a list of reasons why a tool like this might be helpful.)

Reasons to Use a Placeholder Image

Almost everyone knows about using lorem ipsum as a placeholder for text. But it can be just as important to have a similar option for images as well.

Did you know the beauty of lorem ipsum is that the randomness and character set represents average blocks of text? That’s what makes it such as popular option.

You can take that same concept and apply it to image placeholders as well. Opt for something that matches the theme of the project so that the tone is appropriate. Use similar colors – such as full-color photos, versus black and white – and fill image frames with something other than just colored boxes to make it easier for more people to envision the final product.

So why should you consider placeholder images?

  • They make it easier for all users to visualize the design
  • They provide a way to show the impact images have on the meaning of content
  • You don’t have to dig around or guess what images should go in the design; with placeholders, clients and other team members can see the image locations available
  • They make a design prototype look more polished and “finished”
  • They’re easy to implement with little code and no images to upload to your project database

1. Lorem Picsum

placeholder images

Lorem Picsum is lorem ipsum for images. (You would expect that with the name, right?)

This placeholder image tool is packed with easy features and puts awesome images right into your design, making it easy for clients and team members to more accurately visualize a project.

The best part of this tool might be all the little add ons that are right there for you to use.

  • Pick a random image for the design
  • Use a photo in grayscale
  • Use a specific image from the image database (there are hundreds to choose from)
  • Blur the image
  • Choose where to crop from

Key feature: With so many options and high-quality images, it’s almost tough to believe this is a free tool. Everything you could want in a photo placeholder is here.

How it works: Create the specifications you need, and just insert the line of code right into the design. The code snippet will pull an image from the photo database – many of these come from stock photography website Unsplash. And there’s nothing to install or download.

2. ImgPlaceholder

placeholder images

ImgPlaceholder is another highly customizable option that is based in using iconography. Each placeholder image can include icons, color and text. (The tool pulls from three different icon databases for a wide variety of options.)

This is probably the most robust and customizable non-photo option available. Pick colors, fonts, sizes, backgrounds icons and more. Add that to all the different use options available and most designers will find a way to use this tool.

Key feature: You can import these images as code snippets or actual downloads. Pick your poison.

How it works: Customize your image placeholder on the screen. A direct link, HTML, BB, and markdown code are created as you work. Copy and paste into the design. (Or download the image and upload.)

3. Place Kitten

placeholder images

Place Kitten is a silly and wonderful image placeholder tool. Pick an image size for the placeholder and a great image of a kitten appears in that place.

The photos appear rather randomly and are just a fun way to fill placeholders and spark even more conversation about your project.

Key feature: The kittens, of course!

How it works: Copy URL from the Place Kitten website, adjust the size specifications and add it to your design.

4. Placehold

placeholder images

Placehold.jp is a quick and easy placeholder image export tool. While it doesn’t come with the pretty images that other tools include, it’s easy to use and you can not the size of image areas. (This can be a major help in planning content.)

Just plug in your specifications and get a placeholder for your space. You can fill any in any text that you like and adjust colors so that placeholders match the brand style.

The tool comes with plenty of popular preprogrammed sizes for images, banners, and icons. Just pick the size you need from the drop-down menu. Image formats include JPG and PNG.

Key feature: This tool is super simple, pick a size and you are good to go. (You shouldn’t spend more than a couple of seconds creating a placeholder image.)

How it works: Select the size you need plus any customizations and copy the code into your project. The code looks for an image source URL specific to the placeholder you’ve created.

Conclusion

The image placeholder image service you choose depends on what type of configuration you want to deal with, and what kind of images you are looking for. There are plenty of options out there, this set of four services is among some of the easiest to use with unique features.

And maybe best of all, each of these options is free to use. Plus, there’s nothing to download or install. (These image placeholder tools couldn’t be easier to use.)

13:55

Create your own Serverless API

If you don’t already know of it, Todd Motto has this great list of public APIs. It’s awesome if you’re trying out a new framework or new layout pattern and want to hit the ground running without fussing with the content.

But what if you want or need to make your own API? Serverless can help create a nice one for data you’d like to expose for use.

Serverless really shines for this use case, and hopefully this post makes it clear why. In a non-serverless paradigm, we have to pick something like express, we have to set up endpoints, we have to give your web server secured access to your database server, you have to deploy it, etc. In contrast, here we'll be able to create an API in a few button clicks, with minor modifications.

Here’s the inspiration for this tutorial: I've been building a finder to search for new cocktails and grab random one. I originally started using ae public API but realized quickly that I found the contents limiting and wanted to shape my own.

Your browser does not support the video tag.

I’m going to use Azure for these examples but it is possible to accomplish what we're doing here with other cloud providers as well.

Make the Function

To get started, if you haven't already, create a free Azure trial account. Then go to the portal: preview.portal.azure.com.

Next, we'll hit the plus sign at the top left and select Serverless Function App from the list. We can then fill in the new name of our function and some options. It will pick up our resource group, subscription, and create a storage account from defaults. It will also use the location data from the resource group. So, happily, it's pretty easy to populate the data.

Next, we'll create a new function using HTTP Trigger, and go to the Integrate tab to perform some actions:

Your browser does not support the video tag.

What we did was:

  • Give the route template a name
  • Change the authorization level to "Anonymous"
  • Change the allowed HTTP methods to "Selected Method"
  • Select "GET" for the selected method and unchecked everything else

Now, if we get the function URL from the top right of our function, we'll get this:

https://sdras-api-demo.azurewebsites.net/api/hello

The initial boilerplate testing code that we're given is:

module.exports = function (context, req) {
  context.log('JavaScript HTTP trigger function processed a request.');

  if (req.query.name || (req.body && req.body.name)) {
    context.res = {
      // status: 200, /* Defaults to 200 */
      body: "Hello " + (req.query.name || req.body.name)
    };
  }
  else {
    context.res = {
      status: 400,
       body: "Please pass a name on the query string or in the request body"
    };
  }
  context.done();
};

Now if we go to the URL below, we’ll see this:

https://sdras-api-demo.azurewebsites.net/api/hello/?name=TacoFace
Says hello TacoFace

There’s more information in this blog post, including API unification with Function Proxies. You can also use custom domains, not covered here.

OK, now that that initial part is all set up, let’s find a place to host our data.

Storing the data with CosmosDB

There are a number of ways to store the data for our function. I wanted to use Cosmos because it has one-click integration, making for a pretty low-friction choice. Get a free account here. Once you're in the portal, we'll go to the plus sign in the top left to create a new service and this time select "CosmosDB." In this case, we chose the SQL version.

We have a few options for how to create our documents in the database. We're merely making a small example for demo purposes, so we can manually create them by going to Data Explorer in the sidebar. In there, I made a database called CocktailFinder, a collection called Cocktails, and added each document. For our Partition Key, we'll use /id.

creating a collection

In real practice, you’d probably either want to upload a JSON file by clicking the "Upload JSON" button or follow this article for how to create the files with the CLI.

We can add something in JSON format like this:

{
 "id": "1",
 "drink": "gin_and_tonic",
 "ingredients": [
   "2 ounces gin",
   "2 lime wedges",
   "3–4 ounces tonic water"
   ],
 "directions": "Add gin to a highball glass filled with ice. Squeeze in lime wedges to taste, then add them to glass. Add tonic water; stir to combine.",
 "glass": [
   "highball",
   "hurricane"
   ],
 "image": "https://images.unsplash.com/photo-1523905491727-d82018a34d75?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=52731e6d008be93fda7f5af1145eac12&auto=format&fit=crop&w=750&q=80"
}

And here is the example with all three that we’ve created, and what Cosmos adds in:

Your browser does not support the video tag.

Have the function surface the data

OK, now we’ve got some dummy data to work with, so let’s connect it to our serverless function so we can finish up our API!

If we go back to our function in the portal and click Integrate in the sidebar again, there’s a middle column that called Inputs. Here, we can click on the plus that says "+ New Inputs" and a few options come up. We’ll click the CosmosDB option and "Create."

Showing in the portal the button to create a connection with CosmosDB

A prompt will come up that asks us to provide information about our Database and Collection. If you recall, the databaseName was CocktailFinder and the collectionName was Cocktails. We also want to use the same partitionKey which was /id. We’ll use all the other defaults.

Now if we go to our function.jso, you can see that it’s now been updated with:

{
  "type": "documentDB",
  "name": "inputDocument",
  "databaseName": "CocktailFinder",
  "collectionName": "Cocktails",
  "partitionKey": "/id",
  "connection": "sdrassample_DOCUMENTDB",
  "direction": "in"
}

We’re going to use that inputDocument to update our testing function to reflect that’s what we’re trying to access. I also add in the status and log frequently, but that’s optional.

module.exports = function (context, req) {
  context.log('JavaScript HTTP trigger function processed a request.');

  if (context.bindings) {
    context.log('Get ready');
    context.res = {status: 200, body: context.bindings.inputDocument};
    context.log(context.res);
  }
  else {
    context.res = {
      status: 400,
      body: "Something went wrong"
    };
  }
  context.done();
};

Now you can see our function at work!

Your browser does not support the video tag.

CORS!

Can’t forget the CORS. Back in the portal, we’ll click on the function name and click on Platform Features. CORS is listed under the API heading.

Showing where CORS is in the dashboard

We can add any of the allowed origins here. Remember, this includes localhost.

in the CORS template, you can add in the URL

Serve it up!

Now to make sure the API is working and we can access it's data from an application, we’ll use an axios call. I have a really barebones CodePen implementation so that you can see how that might work. In Vue, we’re hooking into the created lifecycle method and making the GET request, in order to output the JSON data to the page.

See the Pen Show API Output, beginning of Vue.js integration by Sarah Drasner (@sdras) on CodePen.

From here, you have all that data to play with, and you can store whatever you like in whatever form you fancy. You can use something like Vue, React, or Angular to create interfaces with the content we stored in our database, and our serverless function creates the API for us. The sky is the limit to what we can create! 🎉

The post Create your own Serverless API appeared first on CSS-Tricks.

13:17
How to “Remote User Test”
12:31

Remote Conferences; Bridging the Gap, Clearing the Odds

A few weeks back, I saw one of my esteemed mentors decry the psychological traumas he had experienced, following series and series of refusals at certain embassies.

little girl surprised “A child concentrating hard at school” by Les Anderson on Unsplash

You would think he went for a contract he did not have the capacity for, but then, you would have been wrong. He needed to impart knowledge. He opted to do so across borders, but then, some realities were harsh.

Borders and geographical constraints can cause a lot of havoc. However, it can only do so, when the full discovery of a better way to impart knowledge across borders has not been made. Video conferencing technology has become handy at times like this. Hence, your traditional seminars, conferences, and talks can easily be achieved from anywhere, regardless of your role.

man on a couch with a computer Photo by DESIGNECOLOGIST on Unsplash
On a lighter note, these pillows are dope.

Maybe we should not be too ambitious. Maybe we could simply make this article about a one-sided ‘remoteness’, where the attendees are gathered in an offline venue, but then the speakers have a 100% flexibility to speak from anywhere.

For this kind of arrangement, the advantages are many, same as the disadvantages. Let's start with the disadvantages. For a place not having a very fast internet, the video and audio quality might be abysmal. But that is about that!

For the advantages: a herd of developers or writers are gathered, waiting for a speaker to impart knowledge. So many things would have gone wrong if the speaker was to travel from one location to another. Think about the racism, the mishaps or the thefts. What about the man-hours lost in commuting from one place to the other?

All of these are greatly minimized to a lazy trudge from your bed or kitchen to your computer. Then, the speaker has 5 minutes to the conference, and they are washing their face and checking their teeth. Now he or she is out of time and rushes up with a neatly ironed shirt, on a light brown underpants. Of course, the camera is only built to see the face of the speaker. Convenience is the word!

Visa problems are a thing here in Africa. While a public ban has not been laid on some countries, a lot of resource persons find it difficult to get visa to speak in countries they have a large following, or not.

man putting his head in his hands, looking frustrated, sitting on a pier Photo by Bruno Aguirre on Unsplash

However, this conferencing arrangement might make your dream come true, if and only if you are able to get up from that cozy bed and turn on your computer in time. You could reach more audience than you expect.

Such an easy life.

For the attendees, it is a Win. Look at it this way; your favorite speakers are just a click away from you! That sounds alluring. There are plenty reasons why your favorite speakers might not make it to you in a totally offline conference, but then everything has been simplified and he or she is simply a button and a good internet-connection away. This offers more mentorship chances and enhances progress. In sum, it makes things easier for your favorite speakers.

a person's hands at a meeting Photo by Headway on Unsplash

Are you a writer, a developer or a random conference crasher, then you should look out for the next online conference in town. You might just be surprised at the quality of speakers you would be hearing from.

Concatenate is a free conference for Nigerian developers, happening the 9th and 10th of August. The attendees will be in person and the speakers and MC will be both in person and remote from around the world. If you're near Lagos, register here!

The post Remote Conferences; Bridging the Gap, Clearing the Odds appeared first on CSS-Tricks.

11:30

The Holy Grail Of Reusable Components: Custom Elements, Shadow DOM, And 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:002018-07-16T15:44:34+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 →

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:

  1. If your project doesn’t already have a package.json, npm init will walk you through generating one.
  2. 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.
  3. 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)

July 15 2018

18:36
A special gift for the youngest Colorlovers

July 13 2018

21:14

The div that looks different in every browser

It's not that Martijn Cuppens used User Agent sniffing, CSS hacks, or anything like that to make this quirk div. This is just a plain ol' <div> using the outline property a la:

div {
  inset 100px green;
  outline-offset: -125px;
}

It looks different in different browsers because browsers literally render something differently in this strange situation.

I happened upon Reddit user spidermonk33's comment in which they animated the offset to understand it a bit more. I took that idea and made this little video to show them behaving even weirder than the snapshots.

Direct Link to ArticlePermalink

The post The div that looks different in every browser appeared first on CSS-Tricks.

21:13

Scrolling Gradient

If you want a gradient that changes as you scroll down a very long page, you can create a gradient with a bunch of color stops, apply it to the body and it will do just that.

But, what if you don't want a perfectly vertical gradient? Like you want just the top left corner to change color? Mike Riethmuller, re-using his own technique from the CSS-only scroll indicator (A-grade CSS trickery), did this by overlapping two gradients. The "top" one is fixed position and sort of leaves a hole that another taller gradient peeks through from below on scroll.

Direct Link to ArticlePermalink

The post Scrolling Gradient appeared first on CSS-Tricks.

17:05

Improve Your Conversion Rate With These Tactics

Trying to turn your marketing efforts into sales can be extremely difficult.

If you receive a large number of leads, but these leads will never be converted into sales, you will leave your sales team despondent.

At the same time, marketers do need to hand their leads over to sales fairly quickly so that the opportunities to gain clients are not lost to a competitor.

Converting leads into sales is very complex. There are lots of tactics that you can use. For example, if you are a T-Shirt business, you can use free T-Shirt templates to reach potential customers and then you can try to convert them.

Nevertheless, we have therefore drawn on information from a community of online marketers to explore tools and tactics. These will assist you to increase your conversion rate.

These tips focus on designing your website to create a maximum impact, offering content which can be downloaded by your viewers, marketing emails and outreach campaigns.

Plan your marketing campaign effectively

Before you begin selling, it’s helpful to explore how you can best present your case or engage with your clients.

Would you like your clients to watch a video about your company or product? Would it help if your clients were to read a white paper or report? How about references from previous clients showing the reliability of your work?

By exploring what you need to prepare in order to assist your clients, you will be more likely to create a positive impression.

Work on your sales repertoire

If you have a script you use to sell your products or services, you could work on improving it by keeping your clients in mind. If you don’t have this script, you could always ask one of your leading salesmen to deliver his presentation for you. You can then record and type out this presentation. Once you have done this, you’ll have a sales script.

You can then add some new ideas into your script and test them to measure their effectiveness.

When you ask your leading salespeople to share ideas and pitches with the rest of the team, you will increase the power of your sales force. You’ll also protect your business, should one of your leading people leave. This way their pitch has been recorded and shared. When your salesman leaves, he won’t be taking all his knowledge with him.

Ask your sales prospects to come to a quick decision

When you make your sales pitch to your prospects, ask them for a quick decision on whether they would like to make a purchase or not. This will help you to assess whether you need to go further with your meetings. It will also help you to establish whether or not your client has money to make a purchase. Make it plain that if your prospect agrees to a purchase, you will hold him to this decision.

In your agreement, ask your prospect to let you know if the product is a great fit or will meet his needs. Share what you are willing to spend time and energy working on the project together, but this will have to mean a commitment. You can share that you completely understand if the fit between product and client does not feel right, but you would need to know this as quickly as possible. No hard feelings.

By setting the ground rules, you determine where best to place your energy.

Optimize your offer.

When thinking through your offer, look at the benefits your user will get if they take up your offer immediately. Explore how you shape your sales pitch. Point out what could be lost if an offer is not accepted quickly.

Test what happens if you add bonuses for quick acceptance. By trying out new approaches and monitoring the results, you will explore how to maximize your conversion rate.

Introduce ‘fear of loss’ in order to motivate your prospects

If your sales prospects believe that they will miss out if they don’t act immediately they will be motivated to take action.

Adding a bonus for an immediate sale could encourage a purchase. You could also offer a discount for a limited time period.

Use onsite re-targeting

When your visitors explore your site, you can use browsers or cookies to re-target them. This means that if you visit an e-commerce store and place some items on your wish list or in your shopping basket, they will still be there when you return at a later date.

E-commerce sites can use this same strategy to boost sales via email retargeting. You could use emails to offer discounts to past customers. Customers who are browsing or exploring the site could be reminded of their interests as well as shown new products which may appeal to them. Limited discounts or specials could be presented to customers.

Use Exit-Intent popups

Exit-Intent technology enables you to target viewers who are about to leave your site. Viewers may then be offered a discount or bonus. An example would be a viewer who is offered a voucher to use when making the first purchase. You could place a time limit on your voucher.

Exit-Intent technology could be used to encourage a client to subscribe to your site (and receive a bonus or discount). This way, you could combine Exit-Intent technology with email retargeting to boost your conversion rates.

Improve follow up emails

Sometimes clients will abandon a shopping cart at the point of check out. This is often because of high hidden costs such as shipping. When you see an abandoned shopping cart, you could always encourage your clients to return by sending them vouchers for free shipping. You could also offer up a discount on the total price if a sale is made quickly.

You could also use follow up emails to introduce your existing customers to new products that may interest them. Recommendations based on previous purchases will help them to find products they enjoy.

Test your emails

If you’re working towards an email campaign with a great conversion rate, you will need to know how many people open your emails as well as how well emails convert.

From focusing on subject lines that entice viewers, to effective copy and a clear call to action, your email needs to be excellent,

In order to find out the types of emails which are most effective, use an A/B split test tool in your campaign. This will help you to find out the types of emails which work best for your different audiences.

If you are sending pop up forms via email, you can split these to determine what motivates readers to convert to subscribers.

Build more landing pages

Landing pages are very effective tools when it comes to product promotions. This is the space where you show your visitors what you have to offer. By displaying your leading products you will be able to convert customers into suppliers.

Changing your landing page for every new promotion is therefore extremely beneficial.

However, research shows that only 48% of businesses create a new landing page for each of their sales promotions. Therefore creating a new landing page will not only help to increase your conversion rate. It will also set you apart from your competition.

You can also use your new landing page to monitor leads from your offsite marketing campaigns.

Therefore whatever promotion you are carrying out, from free trials, e-books, case studies or downloads, work on creating a new landing page for each and every one.

Summary

By adding these new marketing strategies to your already existing campaigns, you will be able to increase your sales, even without a large marketing budget.

Don’t be afraid to include new test runs or trials. Experimentation may assist you to grow your email list. If you monitor the impacts of your experiments, you will learn new techniques for gaining customers.

From preparing your sales pitch to following up with existing customers through an email marketing campaign, there are multiple ways to build and continue relationships with your customers. The result will be an increased conversion rate. From here you will be able to grow your client base and increase your business.

The post Improve Your Conversion Rate With These Tactics appeared first on Line25.

13:58
8 Useful WordPress Themes for Building Great Portfolios in 2018
Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.

Don't be the product, buy the product!

Schweinderl