Archive

Archive for August, 2018

8 Design Mistakes That Spell Disaster

August 15th, 2018 No comments

Just like anything else, product design can be done well, and it can be done poorly. When a product is designed well, users don’t notice it. But when a product is designed poorly, users not only notice, but also complain.

In this article, I want to share five the most common things that lead to bad product design.

1. Adding Too Many Features to a Product

All too often designers think about features as a synonymous with value. They believe that the more features they add to the product, the more valuable it adds for the user. As a result, a lot of products are designed with too many unnecessary features which detract from the product’s primary purpose. This effect is known as feature creep—a continuous addition of new product features beyond the original scope.

Here are two tips that will help you avoid this common pitfall:

  • When designing a product, it’s important to focus on its core value. Identify what’s most important and prioritize it. Cut any feature or content that doesn’t drive towards this value.
  • Ask ‘why’ instead of ‘how.’ When starting working on a new product, the biggest question should be not how we design a particular feature but why need to design it.

2. Skipping the Prototyping Phase

‘Why we need to create a prototype when we can create a real product and test it on the market?’ By thinking in this way, designers put the maximum effort on creating a high fidelity design that they ship on the market. Unfortunately, after the market release product team often realize that some parts of the design need to be changed. And the cost of the change often will be significant because the team will need to modify the real product, not a paper or digital prototype.

Prototyping helps product teams to test product design prior to market release. Testing can be done with real users. According to the NNGroup, testing with five users identifies 85% of usability problems. That’s why the results of the testing will make it clear whether the design works for users or not.

3. Becoming too Attached to a Design

It’s not that rare when designers fall in love with a design they create. When designers become too attached to design elements, it’s difficult to redesign or get rid of them. It becomes extremely hard to comprehend the critiques—designers start to take it personally. As a result, design decisions become too biased. The effect is known as confirmation bias—when designers search for, interpret, favor, and recall information in a way that confirms their preexisting beliefs.

It is possible to minimize the effect of confirmation bias by inviting designers into user testing sessions. Nothing can be compared with a feeling when you see a real person interact with a product you’ve designed. It helps designers realize that they design for their users, not for themselves. As a result, it becomes much easier to adjust design according to the user needs.

4. Making Assumptions instead of Conducting Proper Research

Almost everybody who designs digital products had a moment when they say “I am a user too, so I know what is good or bad for users.” After that designers come up with assumptions—assumptions about what can make the user live better.

It’s great when designers have personal feelings, but it’s wrong when designers allow personal feelings take over the process. Every design decision, no matter how it was arrived at, still needs to be verified. It’s excellent when design decisions are a result of user research. It’s much better when you clearly understand what your users need and then design based on that.

5. Not Involving Users in the Design Process

No matter whether a team is refining an existing product or designing a brand new product, it’s always essential to harness users in the process of knowledge exploration. Bad design is often a result of not thinking adequately about end users’ needs.

UX practitioners should not only gather knowledge about users, but they also share this information with stakeholders. It will help to create a shared understanding of real user needs.

6. Thinking about Design as a Linear Process

Some product teams believe that product design is a linear process which starts with ideation and ends with a product release. Following this process, they establish a goal at the beginning and strive to ship a product that is designed according to the goal.

In reality, product design is a highly iterative process—to release a product with excellent user experience, designers have to try a lot of different approaches before selecting the one that will be the best for their users. They might even adjust the goal, when they see that it’s required.

7. Not Building a Collaborative Environment

In a team that has a problem with collaboration, designers and developers don’t have a shared understanding of what they want to achieve. As a result, designers and developers stay in their silos.

Focus on creating a close collaboration between design and technical team members. Instead of design and development being sequential, these two activities should go in parallel.

8. Trying to Reinvent the Wheel

‘It’s boring to do something that everyone else is doing.’ With such idea, many designers have a temptation to try and reinvent the wheel — to design something new, something that nobody tried before. But what designers forget is that there are many solutions on the market, and each demands our time. With each product that has different interactions, users need to learn it. In our fast-paced world, users often don’t have to learn how to use a new product.

Before reinventing the wheel, designers have to evaluate the effort required from the users’ side. In most cases, the effort will be significant. As a result, it’s much safer to design familiar—creating a design that will be familiar for the majority of users.

Add Realistic Chalk and Sketch Lettering Effects with Sketch’it – only $5!

Source

Categories: Designing, Others Tags:

20 Free Useful Photoshop Tutorials to Create Websites

August 14th, 2018 No comments
Useful Photoshop Tutorials

“I like the color very much, but can you change it? This is the kind of style I want for my website, with a little bit of 90’s, indie, minimalist, and elegance added to it. Can we change… like everything?” These useful Photoshop tutorials we are featuring today will teach you how to avoid such commentaries from your clients.

It’s not that easy to create a website design from scratch. Websites have a lot of tiny details which need your attention. Besides, there are always a lot of requirements from your clients. I bet you’ve heard “I will know if I like it when I see it” dozens of times. Designing a website has strict steps, such as creating a header and footer, but sometimes you need to think out of the box, as well.

Here is a list of 20 useful free Photoshop tutorials which will help you create simple websites today. It will come in handy for beginner designers who just started their way and want to improve their skills. You’re going to learn how to create a simple grid-based layout, design a stylish timeline portfolio, and build vintage-styled site. With no further ado:

1. Design a Stylish Timeline Portfolio Page Using Photoshop

2. Designing a Simple Instagram Based Portfolio in Photoshop

designing-a-simple-instagram-based-portfolio-in-photoshop

3. Create a Watercolor-Themed Website Design with Photoshop

create-a-watercolor-themed-website-design-with-photoshop

4. Designing a “Coming Soon” Page in Photoshop

designing-a-coming-soon-page-in-photoshop

5. Designing an Elegant Blog Layout in Photoshop

designing-an-elegant-blog-layout-in-photoshop

6. Design an Elegant Photography Website in Photoshop

elegant-photography-website

7. Create a Nature Inspired Painted Background in Photoshop

create-a-nature-inspired-painted-background-in-photoshop

8. Design a Forest Inspired Tumblr Theme in Photoshop

design-a-forest-inspired-tumblr-theme-in-photoshop

9. How to create a distinguishable textured web layout in Photoshop

how-to-create-a-distinguishable-textured-web-layout-in-photoshop

10. Design a clean sports web layout in magazine-style with Photoshop

design-a-clean-sports-magazine-style-web-layout-with-photoshop

11. Complete Guide to Creating a Blog Website Layout

complete-guide-to-creating-a-blog-website-layout

12. How To Create a Sleek Grid Based Website Design

how-to-create-a-sleek-grid-based-website-design

13. How to create a vintage Photoshop file

how-to-create-a-vintage-photoshop-file

14. Design a Warm, Cheerful Website Interface in Adobe Photoshop

design-a-warm-cheerful-website-interface-in-adobe-photoshop

15. Make a Stylishly Elegant Portfolio Web Design in Photoshop

make-a-stylishly-elegant-portfolio-web-design-in-photoshop

16. How to Make a Beautiful Landing Page with Photoshop

howto-landing-page-photoshop

17. Create an Elegant Portfolio Web Design in Photoshop

create-an-elegant-portfolio-web-design-in-photoshop

18. How to create a professional and clean web layout (with PSD-to-HTML conversion)

how-to-create-a-professional-and-clean-web-layout-with-psd-to-html-conversion

19. Design a Clean e-Commerce Website Interface in Photoshop

design-a-clean-e-commerce-website-interface-in-photoshop

20. Design a Textured Outdoors Website in Photoshop

design-a-textured-outdoors-website-in-photoshop

If these tutorials helped your work process flow smoother, we would highly appreciate if you shared them with your fellow graphic designers and web developers. You never know when you help a friend in need. Also, visit us every day for more snippets of advice, tips, and inspiration.

Read More at 20 Free Useful Photoshop Tutorials to Create Websites

Categories: Designing, Others Tags:

An Event Apart

August 14th, 2018 No comments

Just the other day in a Slack group I hang out in someone asked “what web design events is everyone going to and loving?” An Event Apart is always my immediate answer. I’ve gotten to speak a number of An Event Apart events, which is an incredible honor and always a good time. So from that perspective, I love it. I can tell you that it’s the most well-run conference I go to that gets all the details right.

But I’ve also attended An Event Apart as a paying attendee and loved that. There is something about An Event Apart that gets the speakers to really bring their A-game, and you get to watch that A-game over and over for a couple of days.

Upcoming Events in 2018:

About AEA

Learn from the best: An Event Apart’s speakers aren’t merely industry leaders with years of experience and deep insight. They’re also engaging, inspiring thinkers who are passionate about sharing what they’ve learned and helping you level up your skills.

And because our editorial team works closely with those speakers, you’ll find that each presentation sheds light on the next—that the event is not merely a collection of disparate talks, but a curated, cutting-edge curriculum for the modern designer, coder, and strategist. A curriculum that continues after the conference ends, with slides, articles, videos, and other resources shared freely on our website.

At An Event Apart, you won’t just learn what’s happening right now. You’ll also look ahead to what’s next. Topics people heard about on our stage before the rest of the industry knew they were coming: responsive web design, mobile-first practices, content strategy, responsive content strategy, and, now, intrinsic web design and variable fonts.

To design a better experience, attend a better-designed UX conference.

AEA Discount Code

Make sure to use AEACP to get $100 of any 2 or 3 day event!

The post An Event Apart appeared first on CSS-Tricks.

Categories: Designing, Others Tags:

The possibilities of the color-adjust property

August 14th, 2018 No comments

The Open Web continues to show up in places we would have never originally expected to find it: our phones, televisions, watches, books, video game consoles, fast food menus, gas pumps, elevators, cars—even our refrigerators.

By not making too many or too strict assumptions about how the web should be used, it remains flexible and adaptable. These qualities have allowed it to outperform closed technologies like Flash and Silverlight.

With the web’s growth comes new features to better accommodate its new form factors and use cases. One feature I’m excited about is the color-adjust property, proposed in CSS Color Module Level 4. It is an acknowledgement that the web will continue to show up on devices that have less-than-stellar displays.

There are two values for color-adjust: economy and exact. A value of exact tells the browser it shouldn’t make adjustments to the colors declared in the stylesheet:

.card { 
  background-color: #98b3c7;
  border-bottom: 0.25rem solid #7c92a3;
  color: #f3f3f3;
  color-adjust: exact;
  ...
}

The color-adjust: exact; declaration in this example forces the browser to render all colors as accurately as possible on anything with a class of card applied to it. Accurate meaning being as close as possible based on the host device’s best ability.

The description for the economy value in the specification reads as, “The user agent should make adjustments to the page’s styling as it deems necessary and prudent for the output device.” It places trust in the browser’s hands, allowing it to make adjustments to color values as it sees fit.

Best ability

Handing control over to a browser might seem a little scary at first. As an industry, we’re really great at bikeshedding the heck out of color systems. And that’s a great thing! The use of color, including proper contrast ratios, is an incredibly important aspect of design, and can oftentimes make or break a product.

But we need to understand that our platonically ideal design might not be able to be experienced in the real world as intended. Not everyone owns a device that outputs to a Retina display with a luxurious DCI-P3 color space; nor do they always have perfect vision or ideal lighting conditions. In these kinds of circumstances, it’s better to bend, not break.

We now live in a Mobile, Small, Portrait, Slow, Interlace, Monochrome, Coarse, Non-Hover, First world. Limited color displays aren’t as rare as you think, and are probably only going to get more commonplace as time goes on. I’d especially like to call attention to the rise of internet use by low income populations and emerging markets. With that comes cheaper devices with lower-quality displays.

Browser support

At the time of this article’s publishing, color-adjust has been supported since Firefox 48 (and Android Firefox 60):

This browser support data is from Caniuse, which has more detail. A number indicates that browser supports the feature at that version and up.

Desktop

Chrome Opera Firefox IE Edge Safari
19* 15* 48 No 18 6*

Mobile / Tablet

iOS Safari Opera Mobile Opera Mini Android Android Chrome Android Firefox
12 No No 67 67 60

Chrome and Safari, both WebKit browsers, require a vendor-prefixed declaration of -webkit-print-color-adjust. Curiously, -webkit-print signals that their implementation of this property is only intended for print. While the W3C documentation does mention use cases for printing, it is phrased in such a way as to not be limited to it.

People still print webpages! Paper doesn’t require a data plan, nor does its connection drop when you go underground. Just yesterday, I saw someone on the train who was using a collection of printed sites to study for their next exam. And here’s your galaxy brain moment: printed pages are just limited color displays.

I’d also be remiss if I didn’t mention situations where print styles are missing or poorly-authored, potentially forcing a printer to waste ink in an attempt to do what the stylesheet asks of it. Printer ink is hideously expensive—minding this does your (or your IT department’s) budget a solid.

Potential uses

Before we get any further, I want to state the following is all personal theorizing based off the phrasing in the W3C specification—targeting, but not limited to printing.

I think color-adjust could be one of those properties that could find a home explicitly declared in the body selector, where it can best take advantage of the Cascade:

body {
  color-adjust: economy;
  ...
}

This declaration says, “Every time I declare color in this website, use the values I specify. If you can’t, that’s cool—do what you think is best.” That’s a lot better than the browser trying to literally interpret styling instructions at all cost, potentially rendering the page as completely illegible.

You could declare color-adjust in a more specific way, say nested in a @supports at-rule inside of a print media query, but that’s unnecessary extra work. It would fail to accommodate things like High Contrast Mode and the upcoming color gamut media feature. Better to embrace the unknown and cast a wide net.

I’m also very curious to see how color-adjust could work in conjunction with other browser capabilities, say the Ambient Light Sensor API (RIP Battery Status API). It’d be neat if there were opportunities to experiment with other specialized display modes—macOS’ Night Shift, Increased Contrast, Grayscale, and Reduce Transparency options all come to mind.

A note about accessibility

I’m wondering if software (browser preference toggle or extension, bookmarklet, etc.) could be written to override what the device’s hardware reports itself as being. Much like User Agent spoofing, it could “trick” a browser into thinking it has a limited color display, using economy to force better contrast between text and background color. This would be a lot like some browser’s reading modes, only page layout would be better preserved.

That being said, I don’t think color-adjust is a silver bullet for all color-related accessibility concerns. We can’t always know the device and context our websites and web apps will show up in, including what colors color-adjust would ultimately render as. Because of this, it’s still important to mind your color contrast ratios.

Bending, not breaking

color-adjust feels like a natural extension of Jen Simmons’ Intrinsic Web Design: fluid and squishy UI, proportional sizing, media queries as needed, and simple declarations that do the heavy lifting.

The beauty of the CSS Cascade means you can gracefully create intent, then adjust as needed. color-adjust‘s documentation specifically mentions a situation where it could be useful to ensure a table’s zebra striping is is retained when printed to make it easier to read. Such a tweak can be scoped to a single selector, without having to spend time undoing it for every other component.

body {
  color-adjust: economy;
  ...
}

tr {
  color-adjust: exact;
}

The beauty of CSS’ fault tolerance means browsers that don’t understand this declaration will ignore it and continue parsing the rest of of the stylesheet. Browsers that do support it can take advantage of it, without any complicated build tool configuration or dangerous User Agent sniffing.

It is important to make our web sites and web apps design adapt to the user’s environment and circumstances, and not the other way around. Good user experiences meet the user where they are, not where we hope they’ll be.

The post The possibilities of the color-adjust property appeared first on CSS-Tricks.

Categories: Designing, Others Tags:

The Complete Anatomy Of The Gutenberg WordPress Editor

August 14th, 2018 No comments

The Complete Anatomy Of The Gutenberg WordPress Editor

The Complete Anatomy Of The Gutenberg WordPress Editor

Manish Dudharejia

2018-08-14T14:00:22+02:002018-08-15T12:09:05+00:00

It seems that Gutenberg has been a term of controversy in the world of WordPress lately. Hailed as the most significant change to WordPress 5.0 this year, the Gutenberg editor has received a mixed response from web developers and regular folk alike. All of this chaos is making it difficult to see Gutenberg for what it really is. So, I’ll try to put some of the confusion to rest once and for all.

In this article, I will cover the following:

  1. What is Gutenberg?
  2. More Than Just An Editor
  3. What Does Gutenberg Change In WordPress?
  4. Installing Gutenberg
  5. Exploring Gutenberg At Length
  6. Pros And Cons
  7. Understanding Compatibility Issues
  8. Gutenberg Is The Future
  9. Latest News And Further Resources

1. What Is Gutenberg?

Named after Johannes Gutenberg, who invented the mechanical printing press, Gutenberg was introduced to the world by Matt Mullenweg at WordCamp Europe in 2017. In essence, Gutenberg is a new WordPress editor, with dozens of cutting-edge features. It simplifies website creation and editing for the average non-technical user.

It has earned several accolades, from “WordPress’s new publishing experience” to “the future of website creation”. Some skeptics think it is the nail in the coffin for WordPress. All this babble aside, Gutenberg is going to be way more than just an editor for WordPress (which I will discuss next).

It allows website creators to build a website using blocks, which are small drag-and-drop units. Thus, it replaces the current inconsistent and distracting customization process. It also enables HTML tags such as section and figure, outputting solid HTML. At the time of writing, Gutenberg is still a plugin. However, the community is planning to merge it with WordPress 5.0 this year.

2. More Than Just An Editor

Gutenberg is more than just an editor because it allows you to handle website content in customizable chunks or blocks. You don’t need to be fluent in HTML or write shortcodes. You can control a website’s entire layout (both back end and front end) from a single console.

This new editor attempts to combine the best features from both page-builder plugins such as Divi and Visual Composer, as well as do-it-yourself platforms such as Medium, Wix and Squarespace. So, just like those page-builder plugins, you can handle multi-column layouts through a single interface.

Does this spell the end of plugins such as Divi and Beaver Builder? That’s a topic for another post, but the short answer is no. Gutenberg is unlikely to replace those plugins completely. You can continue to use them even once Gutenberg becomes the default editor.

3. What Does Gutenberg Change In WordPress?

The sole purpose of the Gutenberg editor is to provide an alternative to the current open text editor, not to mention the difficult-to-remember shortcodes, with an agile and visual user interface (UI). So, unlike the current WordPress editor, you don’t have to:

  • import images, multimedia and approved files from the media library or add HTML shortcodes;
  • copy and paste links for embeds;
  • write shortcodes for specialized assets of different plugins;
  • create featured images to be added at the top of a post or page;
  • add excerpts for subheads;
  • add widgets for content on the side of a page.

In short, Gutenberg doesn’t change how WordPress functions. It does, however, change the way website owners (or creators) interact with it. Instead of a whole lot of shortcodes and meta boxes, you will be using simple blocks.

What Are Blocks?

Consider a block as the most basic (therefore, smallest) unit of the new editor. They will be the building blocks of WordPress 5.0. In other words, everything—including content, images, quotes, galleries, cover images, audio, video, headings, embeds, custom codes, paragraphs, separators and buttons—will turn into distinct blocks. Because you can drag and drop each block, identifying these items and placing them on the page becomes a lot easier.

4. Installing Gutenberg

You can download the latest version of Gutenberg directly from the WordPress repository. You can also search for it under “Add New” plugins in your WordPress dashboard. I would recommend installing it in your staging environment. However, you’ll need the latest version of WordPress (version 4.8 or later) to install the Gutenberg editor.

  1. Sign into your WordPress admin dashboard.
  2. Go to the Plugins menu on the left side of the dashboard.
  3. Click “Plugins” to open the “Add New” menu.
  4. Type “Gutenberg” in the search box, located in the top-left corner.
  5. You will see the Gutenberg plugin in the results.
  6. Click the “Install Now” button.
  7. Click the “Activate” button to initiate the plugin.
Gutenberg Installation Steps (Large preview)

5. Exploring Gutenberg At Length

Once installed and activated, Gutenberg will show an icon in the left menu bar. When you launch it for the first time, you will see a new sample post, titled “Gutenberg Demo.” You can practice on the demo post before creating your own.


Gutenberg Demo
Gutenberg Sample Post (Large preview)

A. Add New

Go to “Posts” in the left menu bar of your WordPress dashboard. The new post will launch in Gutenberg first. You can later edit it in both the classic editor and Gutenberg.

Adding a new post in Gutenberg
Adding a new post in Gutenberg (Large preview)

B. Edit

Go to the “Posts” menu, and hover the mouse over a saved post to see the option to choose between the two editors. Although the classic editor option is available for the time being, it will most likely be removed with the launch of WordPress 5.0.

Editing a post in Gutenberg
Editing a post in Gutenberg (Large preview)

C. Switch Between Editors

You can also switch between the two editors when editing a post. Click on the dropdown menu in the upper-right corner to toggle between the visual editor mode and the text editor (i.e. code). Alternatively, you can also use the shortcut Ctrl + Shift + Alt + M to switch between editors.

Text editor:


The text editor in Gutenberg
The text editor in Gutenberg (Large preview)

Visual editor:


The visual editor in Gutenberg
The visual editor in Gutenberg (Large preview)

D. Copy All Content

This feature allows you to copy all content in the HTML version with just one click. You can open this feature in both editors by clicking on the dropdown menu in the upper-right corner of the dashboard.

The ‘Copy All Content' tool in Gutenberg
“ The ‘Copy All Content’ tool in Gutenberg (Large preview)

E. Content Structures

This feature allows you to count the number of words in an entire post. You can also see the number of headings, paragraphs and blocks with just a click. Click the information icon (i) in the upper-left area.


Content Structures
Content information in Gutenberg (Large preview)

F. Redo and Undo

You can find these options next to the information icon (i). They allow you to undo or redo the last command.


Undo and Redo command
Undo/Redo Command (Large preview)

G. Page and Document Settings

This allows you to change various page and document settings. You can find it in the right menu bar. You can make the following adjustments:

  • Make a post public or private.
  • Change the publishing date.
  • Select a post’s format.
  • Add or edit categories and tags.
  • Upload featured images.
  • Write an excerpt.
  • Enable and disable comments, pingbacks and trackbacks.

Page and Document Settings
Page/Document Settings (Large preview)

H. Stick to Front Page

This feature will come handy if you’re running a blog. When you turn this on in the document settings, that particular post will always appear on the front page of your blog. And just turn it off to remove it from the front page.

Making your post stick to the front page
Making your post stick to the front page (Large preview)

I. Using Blocks

As mentioned, blocks are the fundamental unit of the new Gutenberg editor. To use Gutenberg efficiently, you need to understand how to use these blocks. I will cover the main blocks one by one. Click the plus (+) button next to the redo/undo option to open the blocks menu.

Common Blocks

Common blocks allow you to add the elements required to create a rich UI.

  • Paragraph
    The paragraph block comes with a few excellent features, such as custom font sizes, drop caps, background colors and text colors, among others. You are also able to add more CSS classes here.

Gutenberg Text Editor Options
Gutenberg Text Editor Options (Large preview)
  • Image
    This element comes with a new feature that allows you to toggle between gallery and image layouts. You also get more control over images because you can set particular size dimensions, percentage size ratios, and an alternative text description for each image.

Image Settings in Gutenberg
Image Settings in Gutenberg (Large preview)
  • Other elements include:
    • quotes,
    • galleries,
    • cover images,
    • headings,
    • lists,
    • audio,
    • files,
    • subheadings,
    • video.
Formatting

As the name suggests, these blocks comprise all of the formatting tools.

  • Table
    Adding a table using custom HTML code was a tedious job. With the table block, however, the task is a lot easier. You are able to add and remove rows and columns of a table without coding.

Table Block in Gutenberg
Table Block in Gutenberg (Large preview)
  • Custom HTML
    You can use a custom HTML code in Gutenberg. And the nice part is that you can insert your code and see a preview in the block itself.
Custom HTML in Gutenberg
Custom HTML in Gutenberg (Large preview)
  • Other elements include:
    • code,
    • classic,
    • preformatted,
    • pull quote,
    • verse.
Layout

Use your imagination to create a stunning layout using this block. Each element in this block comes with excellent features.

  • Button
    You can add buttons such as “Subscribe now” and “Buy now” using this block. It has different options, including alignment and font styles. You can also set the background color and shape of the button.

Button Layout in Gutenberg
Button Layout in Gutenberg (Large preview)
  • Columns (beta)
    Creating columns in the code-based editor is time-consuming and laborious. This block allows you to add text columns. You are able to add one to six columns in a single row.

Column Layout in Gutenberg
Column Layout in Gutenberg (Large preview)
  • Other elements include:
    • read more,
    • page break,
    • separator,
    • spacer.
Widgets

These blocks allow you to add an archive, categories, the latest posts and the latest comments with just a click anywhere on the page. You are also able to adjust these elements without any coding.

  • Latest Post
    With this block element, you can show posts in a grid view or list view, organize them in categories, and order them alphabetically or according to publication date. You can also choose to display the publication date.

Latest Posts Setting in Gutenberg
Latest Posts Setting in Gutenberg (Large preview)
Embeds

You can easily access any embeds using these blocks. Whether you want to add a YouTube or Twitter link, it’s super-easy and quick. All you need to do is paste the URL in the given blank space, and Gutenberg will embed the code for you. Here is an example of inserting a YouTube link:

Embed Youtube Link in Gutenberg
Embed Youtube Link in Gutenberg (Large preview)
Reusable Blocks

Reusable blocks give developers improved usability. You can convert any block into a reusable block so that you can use it in a different location. You can edit the same and save it as a new reusable block again.

You can also see a preview of a reusable block. All reusable blocks are available under the “Shared Block” options. Most importantly, you can turn one back into a regular block anytime.

Reusable Blocks in Gutenberg
Reusable Blocks in Gutenberg (Large preview)
Most Used

Under this option, you will see the most used blocks, for quick access. Alternatively, you can use the search box to find a block by name.

J. Edit Block

To edit any block, open the dropdown menu by clicking in the upper-right corner of the block. You will see different options, including to edit as HTML, duplicate and add to the reusable blocks.


Edit Block in Gutenberg
Edit Block in Gutenberg (Large preview)
K. Insert Blocks

Using this feature, you can insert a new block anytime. When you bring your mouse over a block, you will see a plus icon (+). Click it to insert a new block.


Insert Block in Gutenberg
Inserting a block in Gutenberg (Large preview)
L. Slash Autocomplete

The Slash Autocomplete feature is available in Gutenberg 1.1.0 and later versions. Chances are you are already familiar with the similar feature in Slack. It was added to reduce the amount of pointing and clicking required to create new blocks.

When you open a new block, just press / (slash key) on your keyboard to select any of the autocomplete options. It works in the default paragraph block only, but it might become a part of other types of blocks in the future.

Slash Autocomplete in Gutenberg
Slash Autocomplete in Gutenberg (Large preview)
M. Move Blocks

Gutenberg enables you to move each block up and down. You can use the arrows (on the left side of each block) to move them vertically.


Move Block in Gutenberg
Moving a block in Gutenberg (Large preview)

6. Gutenberg Pros And Cons

Pros

  • No technical skill is required to make a custom layout for a blog post or website. It works like Medium, so people looking for that kind of style and user-friendly editing experience will love it.
  • It allows you to create a consistent and advanced design without relying much on TinyMCE.
  • Furthermore, blocks are an excellent concept. They allow non-developers to intuitively craft complex layouts. If you are new to WordPress or have no knowledge of it whatsoever, you are still going to love it.
  • The Gutenberg editor itself works well on mobile (it’s responsive). Unlike its predecessor, it allows you to make quick edits on the go. In fact, mobile-savvy developers can manage to do more than just a few quick edits.
  • The increased screen space is proving to be a less distracting user experience for many developers.
  • Hardcore developers can still create customized reusable blocks using HTML5. So, it seems like a win-win for both geeks and non-technical users.

Cons

  • For the time being, there is no Markdown support in the beta version of the WordPress editor.
  • It still doesn’t support responsive columns. You will need to do some custom coding to make this feature responsive. So, using this feature on mobile isn’t an option right now.
  • The design layout options are inadequate at the moment.
  • Compatibility issues could be a significant concern for some WordPress users.
  • You get only partial support for meta boxes. For now, it only supports Yoast SEO. So, using most custom plugins in Gutenberg is not possible. However, developers are working hard to extend meta box support.
  • Backward compatibility is going to be a primary concern for most developers. It will destroy current plugins and themes, especially ones that require integration with TinyMCE.

7. Understanding Compatibility Issues

Despite its simplicity and agility, Gutenberg might not be everyone’s cup of tea. Most WordPress developers might find it difficult to work with, especially in the beginning. They will need to retrain their reflexes to get used to the new UX.

  • Owing to the backward-compatibility issue, you will need to update many plugins and themes to ensure they are fully compatible with the new editor.
  • For the time being, blocks are more focused on content. As a result, Gutenberg lacks precision and control over the layout of custom websites.
  • Shortcodes are replaced by shortcode blocks. However, you will still be able to add shortcodes from the widget block.
  • Meta boxes will be available under a new name and a new UI. Conflicting meta boxes are likely to lead to the classic editor, instead of Gutenberg, with an alert. While this system might prove helpful, some meta boxes will not be supported in Gutenberg.
  • Custom post types are supported and remain backward-compatible in Gutenberg.
  • You won’t be able to turn off Gutenberg once it is integrated in WordPress core. However, you can disable it using the official plugin anytime.

8. Gutenberg Is The Future

Contrary to popular opinion, Gutenberg is not a replacement for the current text editor. It is a new way to build websites. I like to think of it as Facebook for WordPress.

You don’t need to be a computer geek to publish things on Facebook or any other social media platform. Gutenberg is just a way to bring this simplicity and flexibility to WordPress, so that people don’t need to code in order to create and publish websites. That’s why I think it is going to be the future, not only for WordPress, but for the web in general.

Granted, Gutenberg has a long way to go. People (including me) have had issues with its implementation, but soon we will have Gutenberg-ready themes, plugins and tools surfacing everywhere. Nevertheless, you have to start somewhere. So, you might as well be a part of this change from the beginning.

9. Latest News And Further Resources

If you are interested in riding the Gutenberg train from the beginning, here are a few links to find the latest buzz. Keep in mind that none of these websites are officially endorsed by WordPress.

For official updates and news, you can try the following:

Wrapping Up

Whether you like it or not, Gutenberg is coming to WordPress 5.0. Do try to be a part of the ongoing discussion about it on the web. It will certainly help. In fact, while you’re at it, try to speed up the development process with your skills. Meanwhile, let me know if this post has shed some light on the topic. Drop your queries and suggestions in the comments section. I would love to keep the conversation going.

Smashing Editorial(ra, il)
Categories: Others Tags:

Create Beautiful Websites Easily with YOOtheme Pro

August 14th, 2018 No comments

YOOtheme Pro is a premium site builder from YOOtheme. The culmination of over a decade of design and development for WordPress and Joomla, it’s a professional-grade solution for creating and managing beautiful websites.

Every client loves the power of a content management system, but not all clients have the same needs, challenges, or priorities. YOOtheme Pro is one of only a handful of solutions that embraces both WordPress, and Joomla, giving your clients the choice they value and opening up a wider market for professional web designers.

YOOtheme Pro gives you the flexibility to create any type of content, anywhere in your design; It provides an intuitive drag and drop interface that allows you to add, edit, rearrange, and delete content at will; Best of all it allows clients to maintain content in the same familiar CMS dashboard that they’re familiar with.

?

YOOtheme Pro for Designers

YOOtheme Pro has been built to help designers maximize the time they spend being creative. It provides beautiful presets, stunning layouts, and battle-tested design patterns that fast track your design process.

Designing your site is simple thanks to the drag and drop interface, and real-time changes in the live preview ensure you’ll always end up with exactly what you intended. YOOtheme Pro is particularly adept at producing minimal design. Adored by designers and clients alike, the simplicity of minimalism, and its proven effectiveness in UX, will be engaging for years to come; delivering timeless, robust design that outlasts short-lived trends.

When you’re happy with your site design, it’s ready to go, no fuss, no delays, and no expensive developers. You can even save sections in your library to be reused on other projects, making sure that next time it will be even easier to be launch-ready.

YOOtheme Pro for Developers

YOOtheme Pro is just as beneficial for developers as it is for designers. The code engine produces high-quality semantic code that not only meets best practices, but is ideal for search engine ranking too.

The codebase is also designed to be extensible, so you can easily build on what is output. YOOtheme Pro provides hundreds of site feature options, but for anything you can’t simply drop in, you can add custom JavaScript, or CSS and Less. The style customizer allows you to create your own master style, and you can customize the UI components on your site using YOOtheme’s open source UI kit—the aptly named UIKit. You even benefit from access to over 600 Google Fonts, which are stored locally, giving you a boost in your Google PageSpeed ranking.

All sites that YOOtheme Pro outputs are fully responsive, with a grid that responds to the viewport, meaning that your site will function perfectly on any device.

YOOtheme Pro even fully supports WooCommerce, WordPress’ most popular shop option, so you can develop e-commerce sites with ease.

YOOtheme Pro for Business

YOOtheme Pro includes over a hundred page layouts, crafted by professional designers, that allow you to select a pre-designed layout for your content and simply slot it in.

There are over 30 distinct elements that can easily be added to any YOOtheme Pro site, ranging from simple image holders, to full galleries, from social media links, to blockquotes. If they aren’t enough to meet your needs, you can add custom elements for truly unique content.

There are over 60 different master styles to choose from; switch between styles at will, and watch your site update before your eyes. Feel free to get creative, safe in the knowledge that you can revert back at any time.

The pre-made themes all come with access to carefully curated, free-to-use images, so you don’t even need to worry about gathering content for your site. Additionally, YOOtheme Pro seamlessly integrates the popular Unsplash library that provides quality, free-to-use photos. You can search through the library without having to leave YOOtheme Pro.

Get YOOtheme Pro

Starting from just €49 (approx. $57), YOOtheme Pro is one of the most comprehensive site builders on the market.

Whether you choose to develop for WordPress or Joomla, the same intuitive interface will help you build a beautiful site in minutes.

For designers and developers, there are few simpler ways to design and build modern, CMS-powered websites.

[– This is a sponsored post on behalf of YOOtheme –]

Add Realistic Chalk and Sketch Lettering Effects with Sketch’it – only $5!

Source

Categories: Designing, Others Tags:

What is the Difference Between Lean and Design Thinking?

August 14th, 2018 No comments

I get this question a lot.

The next question after that would be: aren’t they the same?

I posted this question on my twitter feed and here are some great replies. Thanks guys!

Apples and oranges. Lean and agile are methodologies for the product development process. DT is about understanding the user from step 1, whether that is in the product process, the strategy process, or any other business aspect. Much more broad than lean or agile.

— Santiago Castillo (@Casti_io) July 16, 2018

All think of the client, DT focuses on the feeling and the experience, lean more for smoother process. Perhaps in agile and lean, aesthetics don’t have as much value? Many differences, but hard to put on words. All are i.e. user centric but a bit differently

— Irina Kujanpää (@IKujanpaa) July 8, 2018

I’m not going to go into the details of each process as there are tons of great articles written on it. The value-add I can offer is to discuss these two process at a conceptual level so that we may understand when and how best to apply them.

The reason for much of the confusion is that there are a lot of similarities between the two processes. I like to describe Lean and Design Thinking as 2 sides of the same coin, but the context of use is very different. What does not help is when presentations I have seen on Lean methodology uses Design Thinking as part of their repertoire of tools.

So both take a human-centered approach to understand what customers or stakeholders require, and then redirecting the focus on delivering to what they want. Both processes use an iterative methodology as a way to learn, refine and validate our offerings to ensure that they are correct. But the similarities go as far as this.

The way I usually explain the difference is as follows:

Lean focuses on optimising a process by removing waste so that you can deliver on the best experience as possible for your customer. This assumes that this “experience” is right for your customer in the first place. Design Thinking is what you use to determine if it’s right or not.

To expand on this, Lean (as described by a good friend at IBM) is a project management methodology that allows for quick changes or improvements, with a focus on delivering the highest quality product or solution. Design Thinking asks a simple question: knowing now what our customers are looking for, what are our opportunities for our business so that we can continue to remain relevant to our customers in the future.

Here is a handy table for your conscious consumption.

I love to hear your thoughts, please do drop me a message below if you have any.

The post What is the Difference Between Lean and Design Thinking? appeared first on Design Sojourn. Please click above if you cannot see this post.

Categories: Designing, Others Tags:

2 Approaches to Design and 4 Rules for Understanding Humans

August 14th, 2018 No comments

Whenever we talk about Design Thinking’s user-centered approach to finding opportunities and understanding your customers better, someone always reminds me that one of the world’s most successful company, Apple, does not do market or user research.

Scott Anthony sums this up very well:

It feels like a classic battle — the scientific approach of a company (Procter & Gamble when run by former CEO A.G. Lafley) that launches 80 market research studies a day versus the intuitive touch of the iconic innovator of our time.

But it’s a false comparison. Both approaches rest on the belief that you need to understand your customers better than they know themselves so you can predict what they want without having to ask them to articulate what they want.

Here is my usual answer to this: what is happening here is that there are 2 approaches to design.

The first one takes a user-centered approach to design. This is where Design Thinkers or Designers spend time in the field observing and researching humans for potential insights that can inspire and innovate. This sort of approach is ideal for organizations with large diverse portfolios and multiple types of customers. It is also a great activity to use if you are offering mature market services and products.

The second approach is what I like to call the customer proxy design approach. This is when there is someone who lives and breathes the product or service in such a totality that it becomes ingrained in their DNA. He or she is then able to take it to the next level in an almost craft like manner all for the good of the consumer. This sort of approach lands really well for businesses developing a focused product range, or even a small niche player in a competitive market.

At the end of the day, it is all about that intuition or insights derived from knowing your customers better then they know themselves. But how you come up with these insights can be from either one of the two approaches.

Personally, I prefer a combination of the two approaches while tagging on my 4 golden rules of understanding humans:

1) People don’t know, what they don’t know. (To get this right, you’ll need to repeat this statement a few times while pausing deliberately at the comma!)
2) People don’t do what they say, or say what they do.
3) People know what they dislike, but often can’t articulate what they like.
4) People often can’t distinguish between their wants from needs, as well as why they need it in the first place.

When this 2 by 4 (2×4) approach is applied to our design led innovation process, we first start by combining the use of thought leadership and intuition inspired by insights. After that, we iterate and validate hard with data.

What’s your approach to design?

Via: HBR

This post was originally published on 16 April 2013. It has been edited and updated.

The post 2 Approaches to Design and 4 Rules for Understanding Humans appeared first on Design Sojourn. Please click above if you cannot see this post.

Categories: Designing, Others Tags:

25+ Creative Event Invitations To Impress Your Guests

August 13th, 2018 No comments
Event Invitations

Times comes when you, the introvert designer behind the desk has to hold a party, reunion, celebration of some sort. Okay, maybe not all designers are introverts who hate being in the center of the everyone’s attention. But when such event occur, you need to make sure everybody who needs to be invited, is invited. How do you do that? Let’s find out!

From birthdays to weddings, reunions, business openings, etc., an invitation is an essential part of any vital event. Of course, the invitations are not something you can reuse. As soon as the event is over, the invitation becomes irrelevant. However, it’s not the case to ignore this part of the preparation process. The invitation card is way better than call all your guests or send personalized emails.

Creative invitations can set a tone for the events and make it stand out. Innovation can impress your guests. This way you can also show your guests how important this event is for you and how much effort and time you put in it. At Webdesignledger, we have notice that most people don’t use invitation templates anymore for their events. They prefer to custom make them, which is great for us, as designers.

We understand that everyone’s inspiration needs a cold shower from time to time. In this list, we have handpicked over 25 creative, beautiful events invitations for your inspiration. Also, check out these 40 Funny Jokes Only Designers Will Understand from our latest blog post!

Opening Party Invitation

Wedding Invitation

Event Invitations

20 years

Event Invitations

All Aboard

Event Invitations

Invite – alt

Event Invitations

charity: ball invitations

Event Invitations

Cinco de Mayo

Event Invitations

Invite Thumb

Event Invitations

CMD promo website

Event Invitations

NIKE — We Run London 10K

Event Invitations

Shimmering Metallic Custom Boarding Pass

Event Invitations

Vatican City | Invitation cards

Event Invitations

Tickets

Event Invitations

Orbit Baby

Event Invitations

Save The Dates

Event Invitations

Live at The Distillery

Event Invitations

HANDKERCHIEF MAP INVITE

Event Invitations

Bridal Shower Invite

bridal-shower

The President’s Gala

ws-grugala-dribbble-2

Invitation

garden-party

21. Speakeasy Invitation

speakeasy_invite

DePaola Wedding Invitations

wedding-full_kit

Baby Shower Invites

baby-shower-invites

Ahoy Mateys!

best-map-invite

Sestra’s 2nd birthday

kristina_bartosova_sestra_2ndbirthday

Portland’s 15th Birthday Party | INVITE DESIGN

portland-invitation

Hey! If you found this article useful and inspiring, click those share and subscribe buttons so that you stay in touch with our daily posts. Also, if you would like to have your work featured on our blog, email us at webdesignledger.blog@gmail.com. We are always looking for amazing graphic designers to shed a light on.

Read More at 25+ Creative Event Invitations To Impress Your Guests

Categories: Designing, Others Tags:

Simple Interactive Pie Chart with CSS Variables and Houdini Magic

August 13th, 2018 No comments
Animated gif. Shows how the final pie chart behaves. We have a value label over our pie chart and three radio buttons below it. Each radio button selects a year and sets the pie chart to show the value for the selected year. When changing the year and, consequently the value, the pie chart animates from its previous state to the current one.

I got the idea for doing something of the kind when I stumbled across this interactive SVG pie chart. While the SVG code is as compact as it gets (a single element!), using strokes for creating pie chart slices is problematic as we run into rendering issues on Windows for Firefox and Edge. Plus, in 2018, we can accomplish a lot more with a lot less JavaScript!

AI got the following result down to a single HTML element for the chart and very little JavaScript. The future should completely eliminate the need for any JavaScript, but more on that later.

The final pie chart result.

Some of you may remember Lea Verou’s Missing Slice talk—my solution is based on her technique. This article dissects how it all works, showing what we can do in terms of graceful degradation and other ways this technique can be put to use.

The HTML

We use Pug to generate the HTML from a data object that contains unitless percentage values for the past three years:

- var data = { 2016: 20, 2017: 26, 2018: 29 }

We make all our elements reside in a .wrap element. Then, we loop through our data object and, for each of its properties, we create a radio input with a corresponding label. After these, we add a .pie element to the mix.

- var darr = [], val;

.wrap
  - for(var p in data) {
    - if(!val) val = data[p];
    input(id=`o${p}` name='o' type='radio' checked=val == data[p])
    label(for=`o${p}`) #{p}
    - darr.push(`${data[p]}% for year ${p}`)
  - }
  .pie(aria-label=`Value as pie chart. ${darr.join(', ')}.` 
       role='graphics-document group')

Note that we also made sure only the first radio input is checked.

Passing custom properties to the CSS

I normally don’t like putting styles in HTML but, in this particular case, it’s a very useful way to pass custom property values to the CSS and ensure that we only need to update things in one place if we need to change any of our data points—the Pug code. The CSS remains the same.

The trick is to set a unitless percentage --p on the .pie element for every radio input that might be checked:

style
  - for(var p in data) {
    | #o#{p}:checked ~ .pie { --p: #{data[p]} }
  - }

We use this percentage for a conic-gradient() on the .pie element after making sure neither of its dimensions (including border and padding) are 0:

$d: 20rem;

.wrap { width: $d; }

.pie {
  padding: 50%;
  background: conic-gradient(#ab3e5b calc(var(--p)*1%), #ef746f 0%);
}

Note that this requires native conic-gradient() support since the polyfill doesn’t work with CSS variables. At the moment, this limits support to Blink browsers with the Experimental Web Platform features flag enabled, though things are bound to get better.

Screenshot showing the Experimental Web Platform Features flag being enabled in Chrome.
The Experimental Web Platform features flag enabled in Chrome.

We now have a working skeleton of our demo—picking a different year via the radio buttons results in a different conic-gradient()!

Animated gif. Shows how picking a different year via the radio buttons changes the chart to show the value for the selected year.
The basic functionality we’ve been after (live demo, Blink browsers with flag enabled only).

Displaying the value

The next step is to actually display the current value and we do this via a pseudo-element. Unfortunately, number-valued CSS variables cannot be used for the value of the content property, so we get around this by using the counter() hack.

.pie:after {
  counter-reset: p var(--p);
  content: counter(p) '%';
}

We’ve also tweaked the color and font-size properties so that our pseudo-element is a bit more visible:

Screenshot. Shows the chart with the value for the current year (the one selected by the checked radio button) overlayed on top.
Displaying the value on the chart (live demo, Blink browsers with flag enabled only).

Smoothing things out

We don’t want abrupt changes between values, so we smooth things out with the help of a CSS transition. Before we can transition or animate the --p variable, we need to register it in JavaScript:

CSS.registerProperty({
  name: '--p', 
  syntax: '<integer>',
  initialValue: 0, 
  inherits: true
});

Note that using instead of causes the displayed value to go to 0 during the transition as our counter needs an integer. Thanks to Lea Verou for helping me figure this out!

Also note that explicitly setting inherits is mandatory. This wasn’t the case until recently.

This is all the JavaScript we need for this demo and, in the future, we shouldn’t even need this much as we’ll be able to register custom properties from the CSS.

With that out of the way, we can add a transition on our .pie element.

.pie {
  /* same styles as before */
  transition: --p .5s;
}

And that’s it for the functionality! All done with one element, one custom variable, and a sprinkle of Houdini magic!

Animated gif. Shows how picking a different year via the radio buttons smoothly changes both the actual chart and the number value displayed on top of it to represent the value for the newly selected year.
Interactive pie chart (live demo, Blink browsers with flag enabled only).

Prettifying touches

While our demo is functional, it looks anything but pretty at this point. So, let’s take care of that while we’re at it!

Making the pie… a pie!

Since the presence of :after has increased the height of its .pie parent, we absolutely position it. And since we want our .pie element to look more like an actual pie, we make it round with border-radius: 50%.

Screenshot. Shows the chart now being perfectly round like a pie.
Rounding up our pie (live demo, Blink browsers with flag enabled only).

We also want to display the percentage value in the middle of the dark pie slice.

In order to do this, we first position it dead in the middle of the .pie element. By default, the :after pseudo-element is displayed after its parent’s content. Since .pie has no content in this case, the top-left corner of the :after pseudo-element is in the top-left corner of the parent’s content-box. Here, the content-box is a 0x0 box in the center of the padding-box. Remember that we’ve set the padding of .pie to 50%—a value that’s relative to the wrapper width for both the horizontal and the vertical direction!

This means the top-left corner of :after is in the middle of its parent, so a translate(-50%, -50%) on it shifts it to the left by half its own width and up by half its own height, making its own mid-point coincide with that of .pie.

Remember that %-valued translations are relative to the dimensions of the element they’re applied on along the corresponding axis. In other words, a %-valued translation along the x-axis is relative to the element’s width, a %-valued translation along the y-axis is relative to its height and a %-valued translation along the z-axis is relative to its depth, which is always 0 because all elements are flat two-dimensional boxes with 0 depth along the third axis.

Screenshot. Shows the chart now being perfectly round like a pie, with the percentage as text positioned right in the middle.
Positioning the value label in the middle of the pie (live demo, Blink browsers with flag enabled only).

Next, we rotate the value such that the positive half of its x-axis splits the dark slice into two equal halves and then translate it by half a pie radius along this now-rotated x-axis.

See the Pen by thebabydino (@thebabydino) on CodePen.

What we need to figure out is how much to rotate the :after pseudo-element so that its x-axis splits the dark slice into two equal halves. Let’s break that down!

Initially, the x-axis is horizontal, pointing towards the right, so in order to have it in the desired direction, we first need to rotate it so that it points up and going along the starting edge of the slice. Then it needs to rotate clockwise by half a slice.

In order to get the axis to point up, we need to rotate it by -90deg. The minus sign is due to the fact that positive values follow a clockwise direction and we’re going the other way.

See the Pen by thebabydino (@thebabydino) on CodePen.

Next, we need to rotate it by half a slice.

See the Pen by thebabydino (@thebabydino) on CodePen.

But how much is half a slice?

Well, we already know what percentage of the pie this slice represents: it’s our custom property, --p. If we divide that value by 100 and then multiply it by 360deg (or 1turn, it doesn’t matter what unit is used), we get the central angle of our dark slice.

After the -90deg rotation, we need to rotate :after by half this central angle in the clockwise (positive) direction.

This means we apply the following transform chain:

translate(-50%, -50%) rotate(calc(.5*var(--p)/100*1turn - 90deg)) translate(.25*$d);

The last translation is by a quarter of $d, which is the wrapper width and gives us the .pie diameter as well. (Since the content-box of .pie is a 0x0 box, it has no border and both its left and right padding are 50% of its wrapper parent width.) The .pie radius is half its diameter, meaning that half the radius is a quarter of the diameter ($d).

Now the value label is positioned where we want it to be:

Screenshot. Shows the chart now being perfectly round like a pie, with the percentage as text positioned right in the middle of the slice of pie it represents. It is however rotated such that its x axis is along the radial line splitting this slice into two equal halves.
Positioning the value label in the middle of the slice (live demo, Blink browsers with flag enabled only).

However, there’s still one problem: we don’t want it to be rotated, as that can look really awkward and neck-bending at certain angles. In order to fix this, we revert the rotation at the end. To make things easier for ourselves, we store the rotation angle in a CSS variable that we’ll call --a:

--a: calc(.5*var(--p)/100*1turn - 90deg);
transform: 
  translate(-50%, -50%) 
  rotate(var(--a)) 
  translate(.25*$d) 
  rotate(calc(-1*var(--a)));

Much better!

Screenshot. Shows the chart now being perfectly round like a pie, with the percentage as text positioned horizontally right in the middle of the slice of pie it represents.
Positioning the value label in the middle of the slice, now horizontal (live demo, Blink browsers with flag enabled only).

Layout

We want to have the whole assembly in the middle of the screen, so we solve this with a neat little grid trick:

body {
  display: grid;
  place-items: center center;
  margin: 0;
  min-height: 100vh
}

Alright, this puts the entire .wrap element in the middle:

Screenshot. Shows the whole assembly in the middle of the page.
Positioning the whole assembly in the middle (live demo, Blink browsers with flag enabled only).

The next step is to place the pie chart above the radio buttons. We do this with a flexbox layout on the .wrap element:

.wrap {
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: center;
  width: $d;
}
Screenshot. Shows the whole assembly in the middle of the page, with the pie chart now above the radio buttons.
Placing the pie chart above the radio buttons (live demo, Blink browsers with flag enabled only).

Styling the radio buttons

…or more accurately, we’re styling the radio button labels because the first thing that we do is hide the radio inputs:

[type='radio'] {
  position: absolute;
  left: -100vw;
}
Screenshot. Shows the whole assembly in the middle of the page, with the pie chart above the radio button labels. The radio buttons are now hidden and it's difficult to distinguish the labels from one another.
After hiding the radio buttons (live demo, Blink browsers with flag enabled only).

Since this leaves us with some very ugly labels that are very hard to distinguish from one another, let’s give each one some margin and padding so they don’t look so crammed together, plus backgrounds so that their clickable areas are clearly highlighted. We can even add box and text shadows for some 3D effects. And, of course, we can create a separate case for when their corresponding inputs are :checked.

$c: #ecf081 #b3cc57;

[type='radio'] {
   /* same as before */

  + label {
    margin: 3em .5em .5em;
    padding: .25em .5em;
    border-radius: 5px;
    box-shadow: 1px 1px nth($c, 2);
    background: nth($c, 1);
    font-size: 1.25em;
    text-shadow: 1px 1px #fff;
    cursor: pointer;
  }
	
  &:checked {
    + label {
      box-shadow: inset -1px -1px nth($c, 1);
      background: nth($c, 2);
      color: #fff;
      text-shadow: 1px 1px #000;
    }
  }
}

We’ve also blown up the font-size a bit and set a border-radius to smooth out the corners:

Screenshot. Shows the whole assembly in the middle of the page, with the pie chart above the radio button labels. The radio buttons are now hidden, but the labels have now been styled to be clearly distinguishable from one another.
After styling the radio button labels (live demo, Blink browsers with flag enabled only).

Final prettifying touches

Let’s set a background on the body, tweak the font of the whole thing and add a transition for the radio labels:

Screenshot. Shows the final result with the pie chart above the radio button labels, styled to be clearly distinguishable from one another and a sans-serif font and vivid background.
The final pie chart result (live demo, Blink browsers with flag enabled only).

Graceful degradation

While our demo now looks good in Blink browsers with the flag enabled, it looks awful in all other browsers…and that’s most browsers!

First off, let’s put our work inside a @supports block that checks for native conic-gradient() support so the browsers that support it will render the pie chart. This includes our conic-gradient(), the padding that gives the pie equal horizontal and vertical dimensions, the border-radius that makes the pie circular, and the transform chain that positions the value label in the middle of the pie slice.

.pie {	
  @supports (background: conic-gradient(tan, red)) {
    padding: 50%;
    border-radius: 50%;
    background: conic-gradient(var(--stop-list));
    --a: calc(.5*var(--p)/100*1turn - 90deg);
    --pos: rotate(var(--a)) 
           translate(#{.25*$d}) 
           rotate(calc(-1*var(--a)));
    }
  }
}

Now, let’s construct a bar chart as a fallback for all other browsers using linear-gradient(). We want our bar to stretch across the .wrap element so that the horizontal padding is still 50%, but vertically as a narrow bar. We still want the chart to be tall enough to fit the value label. This means we will go with smaller vertical padding. We will also decrease the border-radius, since 50% would give us an ellipse and what we need is a rectangle with slightly rounded corners.

The fallback will also replace conic-gradient() with a left-to-right linear-gradient(). Since both the linear-gradient() creating the fallback bar chart and the conic-gradient() creating the pie chart use the same stop list, we can store it in a CSS variable (--stop-list) so that we don’t even have it repeated in the compiled CSS.

Finally, we want the value label in the middle of the bar for the fallback since we don’t have pie slices anymore. This means we store all the post-centering positioning into a CSS variable (--pos) whose value is nothing in the no conic-gradient() support case and the transform chain:

.pie {
  padding: 1.5em 50%;
  border-radius: 5px;
  --stop-list: #ab3e5b calc(var(--p)*1%), #ef746f 0%;
  background: linear-gradient(90deg, var(--stop-list));
  /* same as before */
	
  &:after {
    transform: translate(-50%, -50%) var(--pos, #{unquote(' ')});
    /* same as before */
  }
	
  @supports (background: conic-gradient(tan, red)) {
    padding: 50%;
    border-radius: 50%;
    background: conic-gradient(var(--stop-list));
    --a: calc(.5*var(--p)/100*1turn - 90deg);
    --pos: rotate(var(--a)) 
           translate(#{.25*$d}) 
           rotate(calc(-1*var(--a)));
    }
  }
}

We also switch to using a flexbox layout on the body (since, as clever as it may be, the grid one is messed up in Edge).

body {
  display: flex;
  align-items: center;
  justify-content: center;
  /* same as before */
}

This all gives us a bar chart fallback for the browsers not supporting conic-gradient().

Screenshot. Shows the fallback for the final result in browsers not supporting conic-gradient().
The fallback for the final pie chart result (live demo).

Responsifying it all

The one problem we still have is that, if the viewport is narrower than the pie diameter, things don’t look so good anymore.

CSS variables and media queries to the rescue!

We set the diameter to a CSS variable (--d) that gets used to set the pie dimensions and the position of the value label in the middle of our slice.

.wrap {
  --d: #{$d};
  width: var(--d);
  /* same as before */

  @media (max-width: $d) { --d: 95vw }
}

Below certain viewport widths, we also decrease the font-size, the margin for our elements, and we don’t position the value label in the middle of the dark pie slice anymore, but rather in the middle of the pie itself:

.wrap {
 /* same as before */

@media (max-width: 265px) { font-size: .75em; }
}

[type='radio'] {
   /* same as before */

  + label {
    /* same as before */
    
    @media (max-width: 195px) { margin-top: .25em; }
  }
}

.pie{
   /* same as before */

  @media (max-width: 160px) { --pos: #{unquote(' ')} } 
}

This gives us our final result: a responsive pie chart in browsers supporting conic-gradient() natively. And, even though that’s sadly just Blink browsers with the Experimental Web Platform features flag enabled for now, we have a solid fallback that renders a responsive bar chart for all other browsers. We also animate between values—again, that’s just Blink browsers with the Experimental Web Platform features flag enabled at this point.

See the Pen by thebabydino (@thebabydino) on CodePen.

Bonus: radial progress!

We can also apply this concept to build a radial progress indicator like the one below (inspired by this Pen):

Animated gif. Shows how the final radial progress behaves and its fallback. We have a value label inside/ over our radial/ linear progress and a button below this progress. Clicking the button generates a new random percentage to indicate the progress. When changing the percentage value, the radial progress animates from its previous state to the current one.
The radial progress and its fallback.

The technique is pretty much the same, except we leave the value label dead in the middle and set the conic-gradient() on the :before pseudo-element. This is because we use a mask to get rid of everything, except for a thin outer ring and, if we were to set the conic-gradient() and the mask on the element itself, then the mask would also hide the value label inside and we want that visible.

On clicking the

Categories: Designing, Others Tags: