Search
10 Days of React Challenges (Beginner): Use React State to Update the DOM
10.5.2019
A common theme in modern front-end JavaScript libraries/frameworks is that they can help you manage the data in your applications.
Once you update something, React can immediate
Getting To Know The MutationObserver API
8.5.2019
MutationObserver watches the DOM, specifically the places you tell it to, like:
document.querySelector('#watch-this');
...and it can tell you (trigger a callback) when stuff happens — like when a child is added, removed, changed, or a number of other things.
I used it just the other day...
Simulating Mouse Movement
15.4.2019
If you've ever had to display an interactive animation during a live talk or a class, then you may know that it's not always easy to interact with your slides and while talking.
This happened to me when I needed to show this particles demo to my students. I didn't want to have to stay next to...
Creating a Custom Element from Scratch
20.3.2019
In the last article, we got our hands dirty with Web Components by creating an HTML template that is in the document but not rendered until we need it.
Next up, we’re going to continue our quest to create a custom element version of the dialog component below which currently only uses...
Stackbit
12.3.2019
This is not a sponsored post. I requested a beta access for this site called Stackbit a while back, got my invite the other day, and thought it was a darn fine idea that's relevant to us web nerds — particularly those of us who spin up a lot of JAMstack sites.
I'm a big fan of the whole idea...
Do CSS Custom Properties Beat Sass Loops?
2.3.2019
I reckon that a lot of our uses of Sass maps can be replaced with CSS Custom properties – but hear me out for a sec.
When designing components we often need to use the same structure of a component but change its background or text color based on a theme. For example, in an alert, we might need...
Did you know that CSS Custom Properties can handle images too?
27.2.2019
So you might be aware of CSS Custom Properties that let you set a variable, such as a theme color, and then apply it to multiple classes like this:
:root {
--theme: #777;
}
.alert {
background: var(—-theme);
}
.button {
background: var(—-theme);
}
Well, I had seen this pattern so often...
Control Icons with Font Size
27.2.2019
Here’s a nifty trick from Andy Bell that now seems a little obvious in hindsight: if you set an SVG to have a width and height of 1em then you can change the size of it with the font-size property.
Try and change the font-size on the body element below to see the icon scale with the text:
...
Mac Dark Mode from Command Line
30.1.2019
One of the best professional decisions I ever made was switching to a dark text editor theme. I suffered from horrible headaches for years, partially caused by late night coding sessions with blindingly bright computer screens. Recently Apple implemented a dark OS theme which helps my eyes,...
Slide an Image to Reveal Text with CSS Animations
29.1.2019
I want to take a closer look at the CSS animation property and walk through an effect that I used on my own portfolio website: making text appear from behind a moving object. Here’s an isolated example if you’d like to see the final product.
Here’s what we're going to work with:
See the...
prefers-color-scheme: CSS Media Query
28.1.2019
One device and app feature I’ve come to appreciate is the ability to change between light and dark modes. If you’ve ever done late night coding or reading, you know how amazing a dark theme can be for preventing eye strain and the headaches that result. macOS recently implemented...
Styling a Web Component
8.1.2019
This confused me for a bit here so I'm writing it out while it's fresh in mind. Just because you're using a web component doesn't mean the styles of it are entirely isolated. You might have content within a web component that is styled normally along with the rest of your website. Like this:
See...
WordCamp US 2018
4.1.2019
I recently attended and had the chance to speak at WordCamp US 2018 in Nashville. I had a great time. I love conferences that bring people together around a tight theme because it's very likely you'll have something to talk about with every person there. Plus, I rather like WordPress and...
Styling a Select Like It’s 2019
31.12.2018
It's rather heartwarming to know you can style a <select> in a rather cross-browser friendly way that doesn't hurt accessibility. Kudos for documenting this Scott!
See the Pen Styled <select&rt; by Chris Coyier (@chriscoyier) on CodePen.
Direct Link to Article —...
Gradient Borders in CSS
28.12.2018
Let's say you need a gradient border around an element. My mind goes like this:
There is no simple obvious CSS API for this.
I'll just make a wrapper element with a linear-gradient background, then an inner element will block out most of that background, except a thin line of padding around...
Gulp for WordPress: Creating the Tasks
27.12.2018
This is the second post in a two-part series about creating a Gulp workflow for WordPress theme development. Part one focused on the initial installation, setup, and organization of Gulp in a WordPress theme project. This post goes deep into the tasks Gulp will run by breaking down what each task...
Gulp for WordPress: Initial Setup
26.12.2018
This is the first part of a two-part series on creating a Gulp workflow for WordPress theme development. This first part covers a lot of ground for the initial setup, including Gulp installation and an outline of the tasks we want it to run. If you're interested in how the tasks are created, then...
An Initial Implementation of clip-path: path();
24.12.2018
One thing that has long surprised (and saddened) me is that the clip-path property, as awesome as it is, only takes a few values. The circle() and ellipse() functions are nice, but hiding overflows and rounding with border-radius generally helps there already. Perhaps the most useful value...
The Fragmented, But Evolving State of CSS-in-JS
20.12.2018
TLDR: The CSS-in-JS community has converged on a consistent API.
Not so long ago, a Facebook engineer compiled a list of the available CSS-in-JS methodologies. It wasn’t short:
aphrodite, babel-plugin-css-in-js, babel-plugin-pre-style, bloody-react-styled, classy, csjs, css-constructor, css-light...
Reversing an Easing Curve
17.12.2018
Let’s take a look at a carousel I worked on where items slide in and out of view with CSS animations. To get each item to slide in and out of view nicely I used a cubic-bezier for the animation-timing-function property, instead of using a standard easing keyword.
See the Pen Carousel with reversed...