Design Deals for the Week

Post pobrano z: Design Deals for the Week

Every week, we’ll give you an overview of the best deals for designers, make sure you don’t miss any by subscribing to our deals feed. You can also follow the recently launched website Type Deals if you are looking for free fonts or font deals.

All In One: 50+ Fonts Collection

The All in One Bundle is packed with 50+ unique fonts. With styles ranging from modern to elegant, this bundle includes OpenType features and multilingual support. You’ll get a variety of font styles from calligraphy to display along with hundreds of glyphs. Find the perfect combination for your next printed project whether it’s logo design, wedding invitations, or birth announcements.

$9 instead of $800 – Get it now!

Retro Sports Art Bundle 8 in 1

The Retro Sports Art Bundle offers 8 unique retro collections in one deeply discounted deal. These sets in .png and .eps formats are great for a variety of creative projects including posters, flyers, T-shirt designs, menus, and more! And with the extended license, feel free to make as many as you’d like for personal or commercial use.

$9 instead of $350 – Get it now!

Watercolor Clipart Bundle of 1220 Design Elements

The Watercolor Clipart Bundle sports more than 1220 beautiful design elements from 10 collections. This bundle is packed with hand-painted watercolor and ink illustrations covering themes like flowers, spring, Halloween, animals, Christmas, tropical, and more. The extended license gives you the freedom to create unlimited personal and commercial projects.

$9 instead of $250 – Get it now!

Photoshop Creator’s Bundle: 7 Creators in 1

With The Photoshop Creator’s Bundle, you’ll get a wide range of styles to design your photos and images in the easiest way in just a few minutes. Watercolor, sketch, engrave, halftone, art poster, wet plate, or Lomography film photo – you’ll get all of them. This is a perfect chance to grab so many useful products in one graphic tool super bundle.

$9 instead of $40 – Get it now!

Create Anything That You Can Imagine With Litho, The Multipurpose Elementor WordPress Theme

Post pobrano z: Create Anything That You Can Imagine With Litho, The Multipurpose Elementor WordPress Theme

WordPress has made the creation of websites much easier and quickly became the top solution for publishing online. In fact, over 37% of the Internet is powered by WordPress nowadays. However, it can still be a bit difficult to create themes that look just like you want using WordPress only.

Enter page-builders, which are specific plugins that allow designers to create visually appealing websites without coding, thus opening a whole new world of design for WordPress creators. Truth to be told, many page-builders are not so good and produce clunky code, but Elementor is the perfect combination of good UX and nice front-end rendering. However, not so many themes are ready to work well with Elementor. This is not the case of Theemza’s latest release: Litho.

Litho: A Multipurpose Theme Built To Work With Elementor

The Litho WordPress theme addresses exactly this issue. It gives you a great tool to have as much freedom as possible to design your website without technical limitations. Litho was created by Themezaa, an agency with a proven record of building solid WordPress themes, making them one of the top theme creators on ThemeForest.

36 ready-to-use homepage demos & lots of pre-built pages

To help you getting started faster with your design, the Litho theme puts you on track with plenty of homepage demos and pre-built pages that are the perfect starting point for quality design work.

I cannot emphasize the importance of this feature enough, having lost countless hours setting up the basic structure for projects, when I could have done it using templates like these. The templates are fully customizable, so they won’t limit your creativity, but they are truly game-changers in terms of execution time.

Seamless integration of popular plugins

Modern WordPress websites often take advantage of the most popular plugins, whether it’s to integrate a store, add translations, contact forms, or subscription forms. The Litho WordPress theme is ready to work with any of the most used plugins, another huge time-saver if you know how time-consuming it can get to integrate these plugins in your theme manually.

Perfect for use with Elementor

Elementor is the most popular WordPress page-builder for a good reason, it is extremely easy to use and powerful. Litho gives you access to all the features of Elementor: drag-and-drop design and ready-to-use components. On top of that, Litho provides you with over 200 custom elements developped just to make your life easier.

E-Commerce, Portfolio, One-page Website,… you can do it all

There are only few things more frustrating than not being able to activate a new feature on your website. If you are a freelance designer that wants to add an online shop to sell your illustrations, you shouldn’t be blocked by a WordPress theme that doesn’t have full support for WooCommerce. The Litho Elementor WordPress theme is ready for any layout or function that you may need.

SEO & Mobile Friendly

Mobile browsing increases by the day and shouldn’t be left aside, as it would mean losing potential visitors. Themezaa’s Litho theme did everything right to make your website responsive and mobile-friendly, including providing you with a selection of possible styles for the mobile version of your site.

It’s also coded in a way that ensures good compatibility with search engines, letting you focus on getting links rather than over-optimizing your website for search.

About Litho Author – ThemeZaa

ThemeZaa is powered by LinkSture, a digital media agency offering creative services in website design & eCommerce development with various technologies like WordPress, WooCommerce, Magento, Shopify, ASP.NET, and Android & iOS mobile application development using Flutter and React native. ThemeZaa is Power Elite Author at Envato, has earned a 5-star rating from users because of their responsive and on-time support.

ThemeZaa offers a variety of top-notch HTML/CSS website and marketing templates and WordPress, Magento, Shopify themes to help make your website a success, including:

Hongo

Hongo is a creative & modern design and multi-purpose, fast loading and highly flexible WordPress theme which is specially curated for creating WooCommerce store, company website, and blogs.

Pofo

Pofo is an innovative, pixel-perfect, extremely flexible and highly customizable Bootstrap responsive multi-purpose corporate, portfolio and blog WordPress theme with 25+ unique home page demos, 150+ stylish elements and 200+ useful templates.

Conclusion

As you can see, Litho is one of the most flexible and well tought-out themes that you can use if you regularly create websites, or if you want to create a website fast and flexibly. You can purchase it from ThemeForest or discover more features on the Themezaa demo page for Litho.

Learn How To Pick Your WordPress Plugins Safely

Post pobrano z: Learn How To Pick Your WordPress Plugins Safely

If you design websites with WordPress, you are at risk to develop “pluginitis”, especially if you are not very technical and can’t dig into code. The first symptom of “pluginitis” is a bloated website that has a hard time loading. If you seem to have developed it, you should check the installed plugins on that website and start crying if there are more than 20.

Quantity is not the only issue that can arise with plugins, quality can also become a big problem. A single buggy plugin or incompatibility between two plugins can break your entire site down. Even if it doesn’t break it, it can slow it down to an extent that makes it barely usable.

What can you do to assess the quality of a WordPress plugin?

As you can see in the introduction above, assessing the quality of a WordPress plugin before installing it is very important, but how can you do it?

In short, there a few things that can be done quickly to check if the plugin might break or harm your website, as you can see in this article about WordPress plugin assessment. This can be done for most plugins that add small functionality. However, if you are about to install a plugin that will add a core feature to your website, you want to look carefuly at every detail possible.

To get a reliable overview of WordPress plugins, their functionalities, support, and team, among other things, you should have a systematic approach and look at each plugin in detail. For that purpose, a useful WordPress plugin assessment checklist was released by WordPress Expert, a consultancy from Switzerland. The checklist walks you through the process of analyzing the plugins and comparing them, so you don’t end up making a wrong decision for your website.

How to integrate video in web design properly

Post pobrano z: How to integrate video in web design properly

In recent years, video has emerged as the most successful internet marketing medium. Furthermore, it is a vital web design item that you must use in your website using Video to make an eye-catching and visual dynamic. Isn’t it true that it’s easier said than done? Several reasons have led to the increased use of video in web design.

With the availability of video editing tools, quicker internet connections, and greater browser performance, web designers all around the world may now include video in their designs. If utilized correctly, a video backdrop on your website may also help you catch the attention of your website visitors!

If a website contains video, the typical visitor would spend 88 percent more time on it? And that isn’t all. Including video marketing in your website may increase click-through rates, average order value, conversion, and revenue. So how can you put videos on your website? Amongst the trendiest website design trends that appear to be around to stay is video backgrounds. Marketers adore video backdrops because they make websites appear more contemporary and add a feeling of creativity that static background photos just cannot match.

Furthermore, the growing availability of free stock videos and falling video production costs have made high-quality motion content more accessible than ever before. Above all, designers have come to realize the impact that video has on the spectator.

Motion, movement, and animation are all sure to captivate a digital audience far more successfully than static features. Below are some pointers for incorporating video on the web:

Extensive brand video integration

Many businesses have begun to incorporate completely integrated videos, including multiple segments, into their websites. Some films give in-depth lessons on certain items, while others may illustrate the brand’s specific lifestyle. Successful brand films are excellent for generating extremely engaging experiences that encourage audiences to form a personal bond with a particular product.

This design showcases the product in the best ways imaginable. It begins with a lovely parallax effect with a slight video texture, which causes the user to pause and read the opening text. As a consequence, the visual aspects of the website complement those of the product.

Welcoming background videos

Background movies with overlay text are a popular method to add a little animation to a website and are by far one of the most commonly utilized strategies. Background films might be merely ornamental or express important aspects of a company’s brand. And the more unique or stunning the film, the more likely your viewers will be piqued and desire to investigate your website. Only keep in mind your background video is muted for a quiet visit.

Despite background movies are an extremely successful user retention tactic, not all motion content must be filmed. Animation is still utilized often in web design and may accomplish comparable results. Dropbox is a great example of a website that uses animation rather than background video.

Once you initially visit the site, a short cartoon animation plays before becoming a still image. It demonstrates some of the technologies that may be used in conjunction with Dropbox — a computer and a tablet — as well as the brand logo synchronizing on the laptop screen. It provides a fair overview of the company’s services while also aesthetically stimulating visitors.

Video mouse-over effect

For years, the mouse-over effect has been utilized to encourage visitors to click on drop-down menus and star ratings on websites. Many websites now employ the mouse-over effect to activate videos. This approach draws the visitor’s attention, surprising them when a once static image begins moving.

It compels the audience to focus on the video and urges them to keep watching. Users can opt-out of typical click-to-play videos since they have the option of playing the video. In contrast, the hover effect offers companies a few extra seconds to pique the audience’s attention before they decide whether to stay or leave.

Furthermore, instead of just cumbersome YouTube embedded videos, the effect enables more seamless integration of video into the homepage. The main disadvantage of the mouse over effect is that it does not translate well to mobile sites, so keep this in mind if you’re creating a mobile version for a customer.

Interactive storytelling

Storytelling is an excellent method for companies to engage emotionally with their target group, and interactive videos are expanding the number of ways to convey a story. Users may visit the website for the items or merely out of curiosity, but they remain and return because the tale takes them on an experience.

Each portion of the tale connects Weber’s goods to the wider barbecue culture. The sequence of films appeals to passionate grillers, inviting them to “Continue the Journey” to discover more about the goods and business. When a member of the audience can connect to an event represented in the films, they begin to feel a part of the barbecue culture Weber is fostering through the site.

Interactive product exploration

One last popular application of video in web design is to allow consumers to get up close and personal with items. Whereas interactive storytelling wins the heart of the customer, interactive product discovery wins the head of the consumer. When used together, these two tactics are a highly efficient way of persuading visitors to buy an item!

This type of video interaction provides for a clear representation of the product and its benefits. It also illustrates the superiority of web-based videos over television ads. The audience is left with the feeling that they used the goods instead of watching an advertisement.

Choosing a Video Hosting Site

Essentially, by opting to embed videos on your website, you are delegating all server load concerns and file format modifications to someone with the necessary time and resources. Vimeo and YouTube are the most popular for this, but there are other players out there. However, as you are undoubtedly aware, to embed a video on your website, you must first upload it to a third-party video hosting provider. And you have a lot of options.

There is no perfect or the worst video host model; it is simply an issue of finding the perfect combination of functionality and pricing. So, the essential aspects to consider before selecting the best video hosting service have been summarized.

Quick steps to integrate a video on a web page:

Edit your HTML

Enter the page, article, or part of your website where you want to embed the video into edit mode. Locate the location in the code where you want the video to appear and move your pointer there.

Copy your embed code

After that, copy your embed code. Later in the post, you’ll discover where to locate embed codes for YouTube, Vimeo, Facebook, Instagram, and more, so if you’re not sure where to find the embed code, go ahead to learn more.

Paste the embed code into your HTML

Simply copy and paste the code into the location in your HTML that you discovered in the first step. You may now save or publish your work. The video should show exactly where you put the code inline.

You may need to modify the code depending on where you are embedding your video and how your website is set up. For further information, please contact your webmaster.

“Just in Time” CSS

Post pobrano z: “Just in Time” CSS

I believe acss.io is the first usage of “Atomic CSS” where the point of it is to be a compiler. You write CSS like this:

<div class="C(#333) P(20px)">
  text
</div>

And it will generate CSS like:

.C\(\#333\) {
  color: #333;
}
.P\(20px\) {
  padding: 20px;
}

(Or something like that.)

The point is that it only generates the CSS that you actually need, because you asked for it, and no more. The result is far less CSS than you’d see in an average stylesheet.

That compilation process is what has come to be known as “Just in Time” CSS.

The popular Tailwind framework supports it. It kind of flips the mental model of Tailwind on its head, to me. Rather than providing a huge pile of CSS utility classes to use — then “purging” what is unused — it only creates what it needs to begin with.

I’d say “Just in Time” is a concept that is catching on. I just saw Assembler CSS and it leans into it big time. Rather than classes, you do stuff like:

<div x-style="grid; gap:1rem; grid-rows:1; grid-cols:1; sm|grid-cols:3">
  <button x-style="^button:red">Submit</button>
</div>

I’m pretty torn on this stuff. Some part of me likes how you can get styling done without ever leaving your templates. And I especially like the extremely minimal CSS output since CSS is a blocking resource. Another part of me doesn’t like that it’s a limited abstraction of CSS itself, so you’re at the mercy of the tool to support things that CSS can do natively. It also makes HTML a bit harder to look at — although I certainly got over that with JSX inline event handlers and such.


The post “Just in Time” CSS appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

Fun Times Styling Checkbox States

Post pobrano z: Fun Times Styling Checkbox States

We might leave a text input unstyled. We might leave a link unstyled. Even a button. But checkboxes… we don’t leave them alone. That’s why styling checkboxes never gets old.

Although designing checkboxes is not that complicated, we also don’t have to settle for simple background color changes, or adding and removing borders, to indicate state changes. We also don’t have to pull out any fancy design skills — that we don’t possess — to make this work. I’ll show you how.

Basics

In the following demos, the checkboxes pretty much have the same three-stack layout — at the bottom is a checkbox, and on top of it are two stacked elements, or pseudo-elements. The checkbox is indicated as checked or unchecked depending on which of the two is visible.

If you look at the CSS code in the pens you’ll notice all the layouts — including the one for the checkboxes — are grids. You can use other layouts that feel right for your use case (and learn more in the CSS-Tricks Grid Guide). Additional notes on code and design alternatives are at the end of the source code inside the pens.

In addition, any elements stacked on top of the checkbox have pointer-events: none so they don’t prevent users from clicking or tapping the checkbox.

Let’s now get to the first method.

Idea 1: Blended backgrounds as a state

Blending in CSS is a versatile technique. Manipulating colors relative to two or more elements or backgrounds can be handy in contexts you might not have thought of.

One such instance is the checkbox.

CodePen Embed Fallback
<input id="un" type="checkbox"> <label for="un">un</label>
<!-- more checkboxes --> 
input[type=checkbox]::before,
input[type=checkbox]::after {
  mix-blend-mode: hard-light;
  pointer-events: none;
  /* more style */
}
input[type=checkbox]::before {
  background: green;
  content: '✓';
  color: white;
  /* more style */
}
input[type=checkbox]::after {
  background: blue;
  content: '⨯';
  /* more style */
}
input[type=checkbox]:checked::after {
  mix-blend-mode: unset;
  color: transparent;
}

In this demo, I’ve styled the checkbox’s pseudo-elements green and blue, stacked them up, and gave them each a mix-blend-mode value. This means the background of each element blends with its backdrop.

I used the hard-light value, which emulates the result of either multiply or screen depending on if the top color is darker or lighter. You can learn in depth about different blend modes over at MDN.

When the box is checked, the ::after pseudo-element’s mix blend mode value is unset, resulting in a different visual.

Idea 2: Make a 3D animation

Animating a block of color is fun. Make them seem 3D and it’s even better. CSS has the means to render elements along an emulated 3D space. So using that, we make a 3D box and rotate it to indicate the checkbox state change.

CodePen Embed Fallback
<div class="c-checkbox">
  <input type="checkbox" id="un">
  <!-- cube design -->
  <div><i></i><i></i><i></i><i></i></div>
</div>
<label for="un">un</label>
<!-- more checkboxes -->
.c-checkbox > div {
  transition: transform .6s cubic-bezier(.8, .5, .2, 1.4);
  transform-style: preserve-3d;
  pointer-events: none;
  /* more style */
}
/* front face */
.c-checkbox > div > i:first-child {
  background: #ddd;
  transform:  translateZ( -10px );
}
/* back face */
.c-checkbox > div > i:last-child {
  background: blue;
  transform:  translateZ( 10px );
}
/* side faces */
.c-checkbox > div > i:nth-of-type(2),
.c-checkbox > div > i:nth-of-type(3) {
  transform: rotateX(90deg)rotateY(90deg);
  position: relative;
  height: 20px;
  top: 10px;
}
.c-checkbox > div > i:nth-of-type(2) {
  background: navy;
  right: 20px;
}
.c-checkbox > div > i:nth-of-type(3) {
  background: darkslategray;
  left: 20px;
}

The <div> after the checkbox becomes a container of a 3D space — its child elements can be placed along the x, y and z axes — after it’s given transform-style: preserve-3d;.

Using the transform property, we place two <i> elements (grey and blue colored) with some distance between them across the z-axis. Two more are wedged between them, covering their left and right sides. It’s like a cardboard box that’s covered except at the top and bottom.

When the checkbox is checked, this grey and blue box is rotated sideways to face the other side. Since I’ve already added a transition to the <div>, its rotation is animated.

input:checked + div { 
  transform: rotateY( 180deg ); 
}

Idea 3: Playing with border radius

Changing a checked box’s border radius? Not that fun. Changing also the border radius of other boxes near it? Now we have something.

CodePen Embed Fallback
<input type="checkbox" id="un"> <label for="un">un</label>
<!-- more rows of checkboxes -->
input {
  background: #ddd;
  border-radius: 20px;
  /* more style */
}
input:not(:first-of-type)::before {
  content: '';    
  transform: translateY(-60px); /* move up a row */
  pointer-events: none;
}
input:checked + * + input::before,
input:last-of-type:checked {
  border-radius: 20px;
  background: blue;
}
input:checked + * + input:checked + * + input::before {
  border-top-left-radius: unset !important;
  border-top-right-radius: unset !important;
}
input:checked::before {
  border-bottom-left-radius: unset !important;
  border-bottom-right-radius: unset !important;
}
/* between the second-last and last boxes */ 
input:nth-of-type(4):checked + * + input:checked {
  border-top-left-radius: unset;
  border-top-right-radius: unset;
}

If you’d just interacted with the demo before, you’ll notice that when you click or tap a checkbox, it not only can change its own borders but also the borders of the boxes after and before it.

Now, we don’t have selectors that can select elements prior, only the ones after. So what we did to control the appearance of a preceding box is use the pseudo-element of a checkbox to style the box before it. With exception of the first box, every other box gets a pseudo-element that’s moved to the top of the box before it.

Let’s say boxes A, B and C are one after another. If I click B, I can change the appearance of A by styling B’s pseudo-element, B by styling C’s pseudo-element, and C by styling D’s pseudo-element.

From B, the pseudo-elements of B, C and D are accessible — as long as the next element selector can be used between them in the layout.

The four corners of each checkbox are initially rounded when checked and unchecked. But if a box is checked, the following box’s top corners and preceding box’s bottom corners are straightened (by overriding and removing their border radii).

Idea 4: Using a CSS mask

Toggles, switches… they are also checkboxes as far as the code goes. So we can style the boxes as toggles for this one, and it’s done with a CSS mask, which Chris has written about before. But in a nutshell, it’s a technique where we use an image to filter out portions of its backdrop.

CodePen Embed Fallback
<input type="checkbox">
<div class="skin one"></div>
<div class="skin two"></div>
.one.skin {
  background: no-repeat center -40px url('photo-1584107662774-8d575e8f3550?w=350&q=100');
}
.two.skin {
  background: no-repeat center -110px url('photo-1531430550463-9658d67c492d?w=350&q=100');
  --mask: radial-gradient(circle at 45px 45px , rgba(0,0,0,0) 40px, rgba(0,0,0,1) 40px);
  mask-image: var(--mask); -webkit-mask-image: var(--mask);
}

Two skins (displaying landscape photos) are on top of a checkbox. The topmost one gets a mask-image that’s in the shape of a typical toggle switch — a transparent circle at the left, and the rest is a fully opaque color. Through the transparent circle we see the photo below while the rest of the mask image shows the photo at the top.

When a checkbox is clicked, the transparent circle is moved to the right, so we see the image at the top through the circle while the rest shows the photo at the bottom.

input:checked ~ .two.skin {
  --mask: radial-gradient(circle at 305px 45px, rgba(0,0,0,1) 40px, rgba(0,0,0,0) 40px);
  mask-image: var(--mask); -webkit-mask-image: var(--mask);
}

Idea 5: Using box shadow

Let’s end with the simplest — but what I consider to be the most effective — method of them all: an animated inset box-shadow.

CodePen Embed Fallback
<input id="un" type="checkbox"> <label for="un">un</label>
input {
  transition: box-shadow .3s;
  background: lightgrey;
  /* more style */
}
input:checked { 
  box-shadow: inset 0 0 0 20px blue;
}

There are some CSS properties that can be animated by default and one of them is box-shadow. This type of subtle animation goes well with a minimalist theme.


That’s it! I hope this sparks some inspiration the next time you find yourself working with checkboxes. CSS gives us so many possibilities to indicate state changes, so have a little fun and please share if you have any interesting ideas.


The post Fun Times Styling Checkbox States appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

Grainy Gradients

Post pobrano z: Grainy Gradients

Browse through Dribbble or Behance, and you’ll find designers using a simple technique to add texture to an image: noise. Adding noise makes otherwise solid colors or smooth gradients, such as shadows, more realistic. But despite designers’ affinity for texture, noise is rarely used in web design.

In this article, we’ll generate colorful noise to add texture to a gradient with only a small amount of CSS and SVG. Alright, let’s make some noise!

Illustration by Hank Washington on Behance
Illustration by Jordan Kay on Dribbble

Interactive playground

Check it out here. The quickest way to understand what’s happening is to play with the parameters that make up the layers.

The trick: SVG noise and CSS gradients

The core technique in this article is built on top of a Stack Overflow answer by Chris Pachl to the question: Can you add noise to a CSS gradient?

The trick is to use an SVG filter to create the noise, then apply that noise as a background. Layer it underneath a gradient, boost the brightness and contrast, and that’s it — you have gradient that gradually dithers away.

The key ingredients

Here’s what we’re working with under the hood:

  • SVG turbulence: This is our noise filter.
  • Background with gradient and SVG: Next, we drop that filter into CSS as a background image that combines the filter with a CSS gradient.
  • Boost brightness and contrast: Then we turn to CSS filter to increase the brightness and contrast of the noise.
  • Blend gradients: Finally, we optionally use mix-blend-mode to further filter out colors and blend gradients together.

Let’s go into detail on each of these parts.

Using SVG turbulence

Within the realm of SVG, we can define filters, and one such filter lets us create Perlin noise. It’s called <feTurbulence> and we can define attributes, such as whether it is “turbulence” or “noise” and how fine or coarse it is. Bence Szabó explains it in much more detail as he demonstrates how it can be used to create patterns.

<svg viewBox="0 0 200 200" xmlns='http://www.w3.org/2000/svg'>
  <filter id='noiseFilter'>
    <feTurbulence 
      type='fractalNoise' 
      baseFrequency='0.65' 
      numOctaves='3' 
      stitchTiles='stitch' />
  </filter>

  <rect width='100%' height='100%' filter='url(#noiseFilter)' />
</svg>

This SVG example creates a filter and renders a <rect> element that we can use for our grainy gradients. Notice that the SVG <filter> is defined separately from the <rect>, and the <rect> simply references it.

Play around with changing some of the properties of <feTurbulence>

CodePen Embed Fallback

We’re going to save this SVG as a separate file. We reference an external link to grab the SVG in the demos throughout in this article. In practice, though, you would reference a local file or your own CDN. It doesn’t work to reference the SVG by its id in CSS, for some quirky reason, but you can inline the SVG, as we show in the playground demo. We don’t do this in the demos for legibility reasons.

Creating a CSS background with SVG and a gradient

After we have the SVG file stored somewhere we can reference it by a URL or path, we can now use it in a CSS background, combined with a gradient.

.noise {
  /* ... */
  background:
    linear-gradient(to right, blue, transparent),
    url(https://grainy-gradients.vercel.app/noise.svg);
}

Order matters here. In this particular example, we want a solid color (i.e. no noise) to transition into noise and then into another color. We also want one end of the gradient to be transparent so that the noise shows through.

Like this:

CodePen Embed Fallback

However, this isn’t particularly nice because the noise is too muddled. We need to fray it and make it grainier. We can do that by…

Boosting the brightness and contrast

Adding a CSS filter makes the noise more stark, pushing the most faded colors towards white or black. The filter applies to the entire <div>, so the leftmost blue is a different blue than the pure blue we started with.

.noise {
  /* ... */
  background: 
    linear-gradient(to right, blue, transparent), 
    url(https://grainy-gradients.vercel.app/noise.svg);
  filter: contrast(170%) brightness(1000%);  
}

You can play around with how contrast and brightness affect the gradient. Boosting the brightness and contrast pushes out the muddled grays in the follow demo.

CodePen Embed Fallback

The noise is not uniform in color

If you zoom in, you’ll notice that the noise is made up of many colors. The SVG filter was colorful to begin with, and increasing the brightness and contrast emphasized certain colors. Although hardly noticeable, if this confetti is unwelcome, we can continue to filter out colors with CSS blending (i.e. mix-blend-mode and background-blend-mode ).

CSS blending

Let’s make a grainy gradient that transitions between two colors. CSS blending allows us to stack layers of color. In the next example, we’re adding another <div> to the markup, positioning it over the original gradient, then applying mix-blend-mode: multiply; to smooth things out.

<section>
  <div class="isolate">
    <div class="noise"></div>
    <div class="overlay"></div>
  </div>
</section>
.noise {
  /* ... */
  background: 
    linear-gradient(20deg, rebeccapurple, transparent), 
    url(https://grainy-gradients.vercel.app/noise.svg); 
  contrast(170%) brightness(1000%);
}
.overlay {
  /* ... */
  background: moccasin;
  mix-blend-mode: multiply;
}

We can use the CSS isolation property to create a new stacking context and choose what gets blended. If we were to leave out isolation in the next example, the gradient and overlay would blend with the background color. Try it in the Pen and comment out that line!

/* Same as before */

.isolate {
  isolation: isolate;
  /* ... */
}
CodePen Embed Fallback

Some use cases

We’ve looked at a pretty simple example of how to make a noisy gradient, but where might you use one? Let’s consider several use cases.

Light and shadows, with grain

Where do gradients naturally occur? Light and shadows, for one. We can take advantage of the CSS property mix-blend-mode to smoothly blend gradients and selectively filter the colors we want to see in the noise.

CodePen Embed Fallback

In the “shadow” example, we create a dark gradient, and invert it to create the effect in the “light” example. In both cases, mix-blend-mode allows us to blend it with other gradients.

CodePen Embed Fallback

Holographic foil

The drastic brightness and contrast boost creates a rainbow effect that’s reminiscent of holographic foil.

CodePen Embed Fallback

Taking things further

Try the playground and mess around with the different parameters to see how they affect the texture.

Beyond that, here are some ways to continue fiddling with this technique:

  • Use a different SVG: All of the gradients in this article use the same SVG, but you can toy with the parameters that generates the noise to adjust the coarseness as well as the look and feel in the playground.
  • Try different gradients: Besides linear-gradient, CSS offers four more types of gradients. Can you name them? (Here’s one.)
  • Add more layers: With CSS blending, you can stack as many any layers as you’d like and blend them down.
  • Apply different SVG filters: There are all kinds of filters, including Gaussian blur and different types of lighting. Plus, they can be referenced in a CSS filter and applied to any element in addition to SVG.

What else can you think of? Please let us know what you discover in the comments.

Browser support

We can’t escape talking about browser support here. The core of this technique is supported by all modern browsers. As you might expect, it does not work in Internet Explorer. That said, Internet Explorer does support SVG as a background in CSS (just not with the actual CSS filter property).

SVG as a CSS background image

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 Firefox IE Edge Safari
5 24 9 16 5

Mobile / Tablet

Android Chrome Android Firefox Android iOS Safari
93 92 3 4.2-4.3

CSS filter effects

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 Firefox IE Edge Safari
18* 35 No 79 6*

Mobile / Tablet

Android Chrome Android Firefox Android iOS Safari
93 92 4.4* 6.0-6.1*

I’ve also noticed that Blink-based browsers (e.g. Safari) and WebKit-based one (e.g. Chrome) implement mix-blend-mode slightly differently, so please be sure to test across browsers if using CSS blending. In my own projects, I’ve used browser-specific media queries to manually reconcile the visual differences with small tweaks to CSS.


That’s it! Now that you have a grasp of SVG filters and how to combine them with CSS filters as a background, you have yet another neat visual effect to add depth and texture to a design.


The post Grainy Gradients appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

Social Image Generator + Jetpack

Post pobrano z: Social Image Generator + Jetpack

I feel like my quest to make sure this site had pretty sweet (and automatically-generated) social media images (e.g. Open Graph) came to a close once I found Social Image Generator.

The trajectory there was that I ended up talking about it far too much on ShopTalk, to the point it became a common topic in our Discord (join via Patreon), Andy Bell pointed me at Daniel Post’s Social Image Generator and I immediately bought and installed it. I heard from Daniel over Twitter, and we ended up having long conversations about the plugin and my desires for it. Ultimately, Daniel helped me code up some custom designs and write logic to create different social media image designs depending on the information it had (for example, if we provide quote text, it uses a special design for that).

As you likely know, Automattic has been an awesome and long time sponsor for this site, and we often promote Jetpack as a part of that (as I’m a heavy user of it, it’s easy to talk about). One of Jetpack’s many features is helping out with social media. (I did a video on how we do it.) So, it occurred to me… maybe this would be a sweet feature for Jetpack. I mentioned it to the Automattic team and they were into the idea of talking to Daniel. I introduced them back in May, and now it’s September and… Jetpack Acquires WordPress Plugin Social Image Generator

“When I initially saw Social Image Generator, the functionality looked like a ideal fit with our existing social media tools,’ said James Grierson, General Manager of Jetpack. ‘I look forward to the future functionality and user experience improvements that will come out of this acquisition. The goal of our social product is to help content creators expand their audience through increased distribution and engagement. Social Image Generator will be a key component of helping us deliver this to our customers.”

Daniel will also be joining Jetpack to continue developing Social Image Generator and integrating it with Jetpack’s social media features.

Rob Pugh

Heck yeah, congrats Daniel. My dream for this thing is that, eventually, we could start building social media images via regular WordPress PHP templates. The trick is that you need something to screenshot them, like Puppeteer or Playwright. An average WordPress install doesn’t have that available, but because Jetpack is fundamentally a service that leverages the great WordPress cloud to do above-and-beyond things, this is in the realm of possibility.

WP Tavern also covered the news:

Automattic is always on the prowl for companies that are doing something interesting in the WordPress ecosystem. The Social Image Generator plugin expertly captured a new niche with an interface that feels like a natural part of WordPress and impressed our chief plugin critic, Justin Tadlock, in a recent review.

“Automattic approached me and let me know they were fans of my plugin,” Post said. “And then we started talking to see what it would be like to work together. We were actually introduced by Chris Coyier from CSS-Tricks, who uses both our products.”

Sarah Gooding

Just had to double-toot my own horn there, you understand.


The post Social Image Generator + Jetpack appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.