What are Higher-Order Components in React?

If you have been in the React ecosystem for a while, there is a possibility that you have heard about Higher Order Components. Let’s look at a simple implementation while also trying to explain the core idea. From here you should get a good idea of how they work and even put them to use.

Why Higher-Order Components?

As you build React applications, you will run into situations where you want to share the same functionality across multiple components

The post What are Higher-Order Components in React? appeared first on CSS-Tricks.

Read more

Scroll to the Future

This is an interesting read on the current state of scrollbars and how to control their behavior across operating systems and browsers. The post also highlights a bunch of stuff I didn’t know about, like Element.scrollIntoView() and the scroll-behavior CSS property.

My favorite part of all though? It has to be this bit:

In the modern web, relying heavily on custom JavaScript to achieve identical behavior for all clients is no longer justified: the whole idea of “cross-browser compatibility” is …

The post Scroll to the Future appeared first on CSS-Tricks.

Read more

Kinsta

(This is a sponsored post.)

Huge thanks to Kinsta for sponsoring CSS-Tricks this week! We’re big fans of WordPress around here, and know some of you out there are too. So this might come of interest: Kinsta is WordPress hosting that runs on Google Cloud Platform. And in fact, it’s officially recommended by Google Cloud for fully-managed WordPress hosting.

What does that matter? Well, when you go with a cloud host you’re entering a new realm of reliability. For …

The post Kinsta appeared first on CSS-Tricks.

Read more

40+ Best Lightroom Wedding Presets

Designing a beautiful wedding album can be tough when you also have to go through hundreds of photos while enhancing and editing them as well. Thankfully, Photoshop introduced a solution to that painful process with Lightroom. Now, all you need are a few Lightroom presets and you can instantly enhance your wedding photos in a […]
Read more

BuddyPress 3.0 Beta 2 Released

The BuddyPress development team has released Beta 2 of BuddyPress 3.0. BuddyPress 3.0 is a major release that contains some significant changes. A new template pack called Nouveau will replace the bp-legacy template packs introduced in BuddyPress 1.7. The new template pack has been refactored to be semantic, accessible, and (more…)
Read more

VuePress Static Site Generator

VuePress is a new tool from Vue creator Even You that spins up Vue projects that are more on the side of websites based on content and markup than progressive web applications and does it with a few strokes of the command line.

We talk a lot about Vue around here, from a five-part series on getting started with it to a detailed implementation of a serverless checkout cart

But, like anything new, even the basics of getting started can …

The post VuePress Static Site Generator appeared first on CSS-Tricks.

Read more

Advanced OOP For WordPress Part 3: Unit Testing For WordPress REST API Plugins

This post is part of a series of posts on extending the WordPress REST API using advanced object-oriented PHP. In the first post, I showed you how to use three filters to modify the schema of any post type route. Using an object-oriented approach is more complex, and takes more work than using functional programming …
The post Advanced OOP For WordPress Part 3: Unit Testing For WordPress REST API Plugins appeared first on Torque.
Read more

10 Tips for a Perfect Facebook Cover Image

Almost every business and individual – from personal pages to freelance business pages – uses Facebook. It’s likely an integral part of your marketing strategy. It might even be your main professional website. So it is important that you make the most of this platform to ensure that your social media profile is polished and […]
Read more

Creating a Panning Effect for SVG

Earlier this month on the Animation at Work Slack, we had a discussion about finding a way to let users pan inside an SVG.

I made this demo below to show how I’d approach this question:

See the Pen Demo – SVG Panning by Louis Hoebregts (@Mamboleoo) on CodePen.

Here are the four steps to make the above demo work:

  1. Get mouse and touch events from the user
  2. Calculate the mouse offsets from its origin
  3. Save

The post Creating a Panning Effect for SVG appeared first on CSS-Tricks.

Read more