Web Standards Meet User-Land: Using CSS-in-JS to Style Custom Elements

The popularity of CSS-in-JS has mostly come from the React community, and indeed many CSS-in-JS libraries are React-specific. However, Emotion, the most popular library in terms of npm downloads, is framework agnostic.

Using the shadow DOM is common when creating custom elements, but there’s no requirement to do so. Not all use cases require that level of encapsulation. While it’s also possible to style custom elements with CSS in a regular stylesheet, we’re going to look at using Emotion.

We start with an install:

npm i emotion

Emotion offers the css function:

import {css} from 'emotion';

css is a tagged template literal. It accepts standard CSS syntax but adds support for Sass-style nesting.

const buttonStyles = css`
  color: white;
  font-size: 16px;
  background-color: blue;

  &:hover {
    background-color: purple;
  }
`

Once some styles have been defined, they need to be applied. Working with custom elements can be somewhat cumbersome. Libraries — like Stencil and LitElement — compile to web components, but offer a friendlier API than what we’d get right out of the box.

So, we’re going to define styles with Emotion and take advantage of both Stencil and LitElement to make working with web components a little easier.

Applying styles for Stencil

Stencil makes use of the bleeding-edge JavaScript decorators feature. An @Component decorator is used to provide metadata about the component. By default, Stencil won’t use shadow DOM, but I like to be explicit by setting shadow: false inside the @Component decorator:

@Component({
  tag: 'fancy-button',
  shadow: false
})

Stencil uses JSX, so the styles are applied with a curly bracket ({}) syntax:

export class Button {
  render() {
    return <div><button class={buttonStyles}><slot/></button></div>
  }
}

Here’s how a simple example component would look in Stencil:

import { css, injectGlobal } from 'emotion';
import {Component} from '@stencil/core';

const buttonStyles = css`
  color: white;
  font-size: 16px;
  background-color: blue;
  &:hover {
    background-color: purple;
  }
`
@Component({
  tag: 'fancy-button',
  shadow: false
})
export class Button {
  render() {
    return <div><button class={buttonStyles}><slot/></button></div>
  }
}

Applying styles for LitElement

LitElement, on the …

How to Scale Your Web Design Business

Although web design services are always in-demand nowadays, growing a web development business isn’t always easy. Sure, there are now a plethora of tools you can use to make certain web development tasks less stressful – from content management systems to landing page builders. But as these platforms get more and more accessible, the competition continues to get tougher and tougher.

At this point, consistently producing quality work is no longer enough to get ahead. What you really need is to acquire the absolute best software and strategies that will enable you to deliver the maximum value that your customers deserve.

And that, my friend, is why we’re here.

In this post, we’ll talk about the strategies and technologies that will make your web design business stand out from the rest of the pack. That way, you can scale it and take your business to greater heights.

Let’s get started.

1. Start by Defining Your Niche

If you’ve been in business for a while, you should be able to detect a trend when it comes to the types of projects you excel in.

Are you more comfortable when working with WordPress? How about e-commerce stores?

Keep in mind that, while there’s a benefit to being flexible, embracing a specific niche and establishing it as your specialty will make you more desirable to higher-paying clients.

Why? Because they are not just paying for the grunt work involved. They’re also paying for the expertise that a particular agency can offer, which takes time, effort, and persistence to build.

Picture an e-commerce client who’s trying to pick between two different agencies. The first agency has an impressive portfolio that includes an assortment of projects, such as travel blogs, law firm websites, and a couple of online stores. The second agency, on the other hand, has a portfolio that consists mostly of e-commerce websites – some of which also mention the accolades that the particular brand has achieved.

If you’re the client, you’d also go with the second agency, even if you’ll end …

How To Parse And Pretty Print JSON With Linux Commandline Tools

JSON is a lightweight and language independent data storage format, easy to integrate with most programming languages and also easy to understand by humans, of course when properly formatted. The word JSON stands for JavaScript...

The post How To Parse And Pretty Print JSON With Linux Commandline Tools appeared first on OSTechNix.

from OSTechNix https://www.ostechnix.com/how-to-parse-and-pretty-print-json-with-linux-commandline-tools/…

50+ Best Lightroom Presets of 2019

If you’re looking to supercharge your design workflow this year, updating your Lightroom presets with a new, powerful collection is a good idea! Lightroom presets let you instantly fix, improve, and enhance your photos with a single click. And we’ve found the perfect set of presets just for you.

Having the right set of Lightroom presets can be a huge time-saver for designers. Everything from retouching portrait photos, to adding stunning visual effects, enhancing interior photos, optimizing HDR photos, adding retro effects, and much more is possible with the Lightroom presets we’ve included in this list.

What Is A Lightroom Preset?

For beginners, photo editors without a lot of time, or designers that want to create a consistent visual style for imagery, a Lightroom Preset can be a great alternative to manual editing.

A preset is a free (or paid) add-on that comes with pre-determined settings for some of the different features in Lightroom. A preset has all the settings ready to create a certain type of visual with just one click. They can save photographers, editors, and designers a lot of time while helping maintain a consistent visual style.

Need a hand getting started? Our guide on how to install and apply a Lightroom preset is a great place to begin.

Sleeklens Lightroom Presets

Sleeklens offers a huge variety of high-end Lightroom presets to handle almost any style of photography. These stackable presets will instantly turn your photos from snapshots to professional looking images in just a few clicks.

Whether you are a portrait photographer who wants to make your models look amazing or a landscape photographer who wants to bring out the detail in their images, these top-rated presets cover everything you need and more. You can also save 5% on anything at Sleeklens with the code designshack5.

Pro HDR Collection Lightroom Presets

Pro HDR Collection Lightroom Presets

This is a collection of professional Lightroom presets that allows you to give your photos an authentic HDR look and feel without much effort. The presets in this bundle are also compatible with both …

Illustrator CC 2019 review

Buy Illustrator CC 2019 or sign up to Adobe Creative Cloud now

For a long time, Adobe's software had a film hold as the producer of the design industry's standard software. However, in recent years competition has begun to stack up, with new programmes offering innovative features and approaches – and Adobe has started to fall behind. 

So where does the 2019 update leave Illustrator in the race for the best vector editing tool? The latest update to Adobe Illustrator CC dropped in October 2018, and with it came a number of new features that will be welcomed by creatives looking to speed up their workflow and save time. 

Since the previous update, Illustrator has made some good progress, notably with the introduction of a Global Editing option, and an awesome Freeform Gradients tool, which enables you to create killer gradients quickly and easily. The ability to download Adobe Fonts straight from within Illustrator is another very welcome addition. But has it done enough to keep its crown as the king of the vector editing tools? Let's take a closer look…

Freeform Gradients

Long gone are the days where you need to master the Gradient Mesh tool to make complex gradients (an awkward and clunky process): Illustrator CC 2019's Freeform Gradients tool enables you to create rich gradients much more easily. 

To use it, you first need to select the object you want to place a gradient upon. Select the Gradient tool and using the Freeform Gradient options, place points on your object to generate a radial gradient. Double clicking a point enables you to select a colour. You are then able to freely move the point around and watch in real-time as the gradients blend with each other. 

It’s incredibly satisfying and practical, albeit a little GPU-intensive on lower-end machines. This one of the most innovative tools we've seen since the arrival of the Shape Builder tool. 

Global Editing



Another feature that many have been waiting for …

How to draw your art in perspective using Adobe Illustrator

In this Illustrator tutorial I’ll show you how to set up a three-point perspective grid in Adobe Illustrator to create a gorgeous 3D gift box. You can either place existing artwork in a perspective plane or draw directly on to the grid. We’ll use both methods in this tutorial, and as a bonus I'll show you an easy way to create a reflection.

We'll start right from the beginning of the process, so even if you are a beginner Illustrator user, our step by step guide will have you creating impressive perspective in no time. 

You can get to grips with other areas of Illustrator with our roundup of the best Illustrator tutorials.

Click on the icon at the top-right of the image to enlarge it.

01. Create a new file

First create a new document by going to 'File > New'. It can be of any size; we are using 800px width and 600px height here. 

02. Open the Perspective Grid tool

Hit the Perspective Grid tool from the tools panel or press shift+P. A default two-point perspective grid and a plane switching widget will pop up in your document. 

You can use the widget to select the active grid plane. If you click the left surface of cube or press 1, its colour will change to blue indicating that left plane is active. And if you click the right surface of cube or press 3, this plane will turn orange to indicate this is now the active plane. Similarly, if you click the bottom surface or press 2, it turns green indicating horizontal plane is your active plane. 

In Perspective Grid, an active plane is the plane on which you draw an object to project the observer’s view of that portion of the scene.

03. Select the grid type

There are three types of grids available to choose from: one-point, two-point and three-point. You can select the desired grid by going to …

Jazz up your site with digital books and magazines

Would your business benefit from a digital book or magazine? Next Flipbook Maker Pro can transform PDFs and images into gorgeous digital books or magazines easily to engage any user. A lifetime license to this tool typically costs $299, but now it can be yours for 90% off at just $29.

Even if you're not super tech savvy, Next Flipbook Maker Pro for Mac is super easy to use. Just utilise the customisable templates and start creating your very own flipbooks in a flash. From there you can load the flipbook onto your website and let potential clients and users peruse away — flipping page by page just like a real book or magazine.

Aside from PDFs and images, you can also add in local video, YouTube videos, buttons, charts and more to really make things pop. When you upload the flipbook to Nextflipbook Cloud you'll get a unique URL that lets you view the book from any desktop, laptop or mobile device. And Responsive Design Mode lets you customise and update things on the fly.

Grab a lifetime license to FlipBook Maker Pro here for just $29.

Related articles:

from Creative Bloq http://www.creativebloq.com/news/jazz-up-your-site-with-digital-books-and-magazines…

45 great free handwriting fonts

If you need a handwriting font for your project, look no further. When we talk about handwriting fonts, we're not just referring to one style of typography; they can come in a variety of executions. They're in the same area as cursive fonts, but with fewer constraints and are often based on freeform illustrations.

Recently, this style of typography has been making more appearances than ever, with both print and digital platforms favouring it over more traditional offerings. Here, we've curated some of the best free fonts in a handwritten style for you to download and enjoy.

If you're a designer in need of some more options, explore our selection of professional fonts or dive into our comprehensive rundown of free fonts.

01. Shopping Script

Shopping Script font

Shopping script is free for personal use

If you're after a flowing handwritten font with its own signature style (no pun intended), Shopping Script could be the way to go. Created by Hungarian designer Roland Huse, this handwritten font set covers your basic characters and numbers (A-Z, 0-9, both upper and lower case). Download it now for free for personal use. A full version can be found on Huse's online store.

02. Ambarella

Free handwriting fonts: Ambarella

Ambarella, free for personal and commercial use, sets a modern tone

Ambarella is a beautiful free typeface from Polem Studio. Free for both personal and commercial use, the design includes various swashes, alternates and Western European characters.

03. Something Wild

Free handwriting fonts: Something Wild

Something Wild has an authentic feel

Add an authentic handwritten feel to your designs with this gorgeous handwritten type design Something Wild. Available over on Pixelbuddha, Something Wild will add a touch of personality to your designs, making it perfect for poster and flyer designs

04. No Time

Free handwriting fonts: No Time

Graphic designer Paula Painmar has no time for free handwriting fonts

Graphic designer Paula Painmar is the lady behind this quirky, tongue-in-cheek handwriting font. On her Behance page she states: "Expressive, aggressive and different. This font was created by the handwriting of a stressed designer."

05. Kristi

Free handwriting fonts: Kristi

Kristi is an

Introducing the WordPress Gutenberg editor

Gutenberg is a block-based content editor that is being introduced with the WordPress 5.0 update. Gutenberg is going to reinvent the way we write and display content on the web, bringing powerful tools to the hands of all WordPress users, from editor to developer

With the rollout of Gutenberg, WordPress is taking a huge step towards bringing easy, responsive layouts into content editing. In this article, we take a look at the game-changing new tool, and what it means for those building WordPress websites.

What is the Gutenberg editor?

Gutenberg enables users to form their content out of responsive blocks – similar to website builder tools like Squarespace – to create posts and pages that mould easily with their theme to any screen size. Theme editors can style block types to match their templates, and non-code-savvy users will find it easy to add elements like columns, cover images and social media embeds without the need for unwieldy WordPress plugins. It’s even possible to embed widgets in posts and pages. 

Gutenberg aims to negate the need for shortcodes and custom fields by standardising the content creation process. It makes publishing faster and more powerful, giving editors all-new tools to write and publish more efficiently than before. You can even write your content in other editors like Google Docs or Microsoft Word and paste into the Gutenberg editor, and it will translate your content into blocks automatically.

How does Gutenberg work?

Blocks are the foundation of the new Gutenberg editor. By splitting content up into different types – such as paragraphs, lists, images, quotes and more – blocks enable editors to insert, drag and drop, remove and swap parts of the post or page with ease. 

Compared to the previous TinyMCE editor, it may be somewhat alien to users who have never seen a block-based editor or page builder before, but after a little practice the benefits far outweigh the learning curve. So don’t lose heart if it seems daunting at first.

The default blocks

11 steps to better logos

Getting your logo just right is one of the most important aspects in creating an effective brand identity. Designing a logo should be a process of reduction (but not always simplicity), underpinned by a clarity of purpose and a conviction in execution. 

The LogoArchive project explores how designers have produced new and original logos over half a century, and conveyed an abundance of ideas through an economy of form. Read on for a closer look at the common themes that appear in the world's best logos, plus advice for how to harness these concepts in your own logo design work. 

01. Combine ideas

Try to find a common ground

When working two ideas together, look for commonalities of form. Although the awkward and the ugly do have their place in logo design, correlation, rather than dissonance, often delivers a more universally satisfactory outcome.

02. Make static forms dynamic

Repeated shapes imply movement

Use direction, pattern and repetition to give static forms a sense of motion and visual interest. This could be in the use of diagonal cuts or arrows, in the radial arrangement of objects, in the changing weight of lines, an increase in size, or a transition from one form to another.

03. Add layers

Create designs with more than meets the eye

Use line weight and negative space or the density of local objects to reveal secondary images. You can use this to build layers within a logo to create a visual hierarchy. This element of discovery and surprise has value for the audience, and the difficulty of its execution will help to differentiate it and secure memorability.

04. Study visual language

Consider your demographic. Are they specialists or the wider consumer market? Look for connections between brand activities and form. Take the time to understand your audience’s perceptions and associations.

The Idiosyncratic

Look for themes in your particular field

Study the visual language of the industry you’re working in. Does it have consistent and specific principles or symbols you can draw upon? Architecture, for example, has …