Web Development

Web Development Latest News

css-tricks.com

Do This to Improve Image Loading on Your Website

In the video embedded below, Jen Simmons explains how to improve image loading by using width and height attributes. The issue is that there’s a lot of jank when an image is first loaded because an img will naturally have a height of 0 before the image asset has been successfully downloaded by the browser. …

css-tricks.com

monica.css

Monica Dinculescu: I don’t want every possible padding and margin and colour and flexbox configuration in the world. I just want the ones that I know I end up using in every project. So here is monica.css: my very own CSS framework, which I copy paste at the beginning of every CSS file and take it …

css-tricks.com

Same HTML, Different CSS

Ahmad Shadeed covers the idea of a card component that has a fixed set of semantic HTML with some BEMy classes on it. There is a title, author, image, and tags. Then he redesigns the card into five totally different designs without touching any of the HTML just the CSS. If this is an ah-ha …

css-tricks.com

Solving Sticky Hover States with @media (hover: hover)

Mezo Istvan does a good job of covering the problem and a solution to it in a blog post on Medium.
If you tap on something that has a :hover state but you don’t leave the page then, on a mobile device, there is a chance that :hover state “sticks.” You’ll see this with stuff like jump-links used as tabs or buttons that trigger on-page functionality.

css-tricks.com

Web Component for a Code Block

We’ll get to that, but first, a long-winded introduction. I’m still not in a confident place knowing a good time to use native web components. The templating isn’t particularly robust, so that doesn’t draw me in. There is no state management, and I like having standard ways of handling that. If I’m using another library …

css-tricks.com

Moving from Vanilla JavaScript to a Reusable Vue Component

I recently wrote an article explaining how you can create a countdown timer using HTML, CSS and JavaScript. Now, let’s look at how we can make that a reusable component by porting it into Vue using basic features that the framework provides. Why do this at all? Well there are few reasons, but two stand out in particular: Keeping UI in sync with the timer state: If you look …

css-tricks.com

Blame the implementation, not the technique

I’m not sure we’ve gotten much better at this since Tim Kadlec wrote this in 2012: Stop me if you’ve heard this one before. “Responsive design is bad for performance.”“User agent detection is bad. Don’t segment the web.”“Hybrid apps don’t work as well as native apps.”“CSS preprocessors shouldn’t be used because they create bloated CSS.” …

css-tricks.com

Listen to your web pages

A clever idea from Tom Hicks combining MutationObserver (which can “observe” changes to elements like when their attributes, text, or children change) and the Web Audio API for creating sounds. Plop this code into the console on a page where you’d like to listen to essentially any DOM change to hear it doing stuff.

css-tricks.com

“CSS4” Update

Since I first chimed in on the CSS4¹ thing, there’s been tons of more discussion on it. I’m going to round up my favorite thoughts from others here. There is an overwhelming amount of talk about this, so I’m going to distill it here down as far as I can, hopefully making it easier to …

css-tricks.com

Creating a Details Element That Opens But Never Closes

The <details> and <summary> elements in HTML are useful for making content toggles for bits of text. By default, you see the <summary> element with a toggle triangle (▶︎) next to it. Click that to expand the rest of the text inside the <details> element. But let’s say you want to be able to click …

css-tricks.com

While You Weren’t Looking, CSS Gradients Got Better

One thing that caught my eye on the list of features for Lea Verou’s conic-gradient() polyfill was the last item: Supports double position syntax (two positions for the same color stop, as a shortcut for two consecutive color stops with the same color) Surprisingly, I recently discovered most people aren’t even aware that double position …

css-tricks.com

Why JavaScript is Eating HTML

Web development is always changing. One trend in particular has become very popular lately, and it fundamentally goes against the conventional wisdom about how a web page should be made. It is exciting for some but frustrating for others, and the reasons for both are difficult to explain. A web page is traditionally made up …

css-tricks.com

A Headless CMS for You and Your Web Development Agency

Storyblok is a headless but component-based CMS with a built-in live-preview. You can use it for building fast and reliable websites and power native apps with your favorite technology. Let us start with the basics and what a headless CMS is: A headless content management system is a back-end only content management system (CMS) built from …

css-tricks.com

2020 Stack

In an article with the most clickbaity article ever, Joe Honton does a nice job of talking about the evolving landscape of web development. “Full-stack” perhaps had its day as a useful term, but since front-end development touches so many parts of the stack now, it’s not a particularly useful term. Joe himself did a …

css-tricks.com

Toward Responsive Elements

Hot news from Brian Kardell, regarding what we’ve been referring to as “container queries,” the most hotly requested feature in CSS: There does seem to be some general agreement on at least one part of what I am going to call instead “Responsive Design for Components” and that is that flipping the problem on its …

css-tricks.com

Building an Images Gallery using PixiJS and WebGL

Sometimes, we have to go a little further than HTML, CSS, and JavaScript to create the UI we need, and instead use other resources, like SVG, WebGL, canvas, and others. For example, the most amazing effects can be created with WebGL, because it’s a JavaScript API designed to render interactive 2D and 3D graphics within any compatible web browser, allowing GPU-accelerated image …

css-tricks.com

Neumorphism.io

I was sort of making fun of neumorphism the other day. I don’t actually care that much. I mostly just think it only works on some flat colored backgrounds, mostly really light colors, and somehow that feels weirdly limiting. (nope, sure, sure, nope 🤷‍♂️). Anyway, I think this “generator” from Adam Giebl (Adam Gieblio maybe?) …

css-tricks.com

The Hooks of React Router

React Router 5 embraces the power of hooks and has introduced four different hooks to help with routing. You will find this article useful if you are looking for a quick primer on the new patterns of React Router. But before we look at hooks, we will start off with a new route rendering pattern.

css-tricks.com

SFTP & Database Access on WordPress.com

Wait what? That’s right, direct access to the files and data storage that power your site on WordPress.com, just like you have if you self-host a WordPress site. You can read their announcement here. Note this is for Business and eCommerce plans only.

css-tricks.com

Design Systems Blogathon

It was fun watching a bunch of back and forth blogging between a bunch of smart people quoting a bunch of smart people last week. If you missed it, you might wanna start at the end and work backward. I only have one tidbit to add. I don’t do much with design systems. I work …

css-tricks.com

Building the Web We Want

On the Microsoft Edge team, we’re committed to an open web and helping to drive innovation forward, which is why we’ve kicked off a new initiative in collaboration with Google, Mozilla, Samsung Internet, Igalia and — most importantly — the web community, called The Web We Want. The Web We Want is an open initiative for web developers and …

css-tricks.com

The Case of the Stolen Domain Names

Back in 2011, the domain name for this site, css-tricks.com, was stolen. “Domain Hijacking,” they call it. It wasn’t just this site, but around 12 others in the design and development space. To this day, none of us really know how it happened and who was behind it, although I believe all the domains are …