Do This to Improve Image Loading on Your Website


Jen Simmons explains how to improve image loading by simply 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. Then it needs...

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...

Understanding Web Accessibility Color Contrast Guidelines and Ratios


What should you do when you get a complaint about the color contrast in your web design? It might seem perfectly fine to you because you’re able to read content throughout the site, but to someone else, it might be a totally different experience. How can put yourself in that person’s shoes...

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 moment...

Logo Package Express: Making Logo Design Packaging a Breeze


Have you ever found yourself needing to upload dozens, if not hundreds of logo files to your team or clients and dreading it? Trying to finish your logo project... The post Logo Package Express: Making Logo Design Packaging a Breeze appeared first on Onextrapixel

Centering a div That Maintains Aspect-Ratio When There’s Body Margin


Andrew Welch had a little CSS challenge the other day to make an ordinary div: • centered vertically + horizontally• scales to fit the viewport w/ a margin around it• maintains an arbitrary aspect ratio• No JS There's a video in that tweet if it helps you visualize the challenge. I saw Paul...

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...

How to Build Vue Components in a WordPress Theme


The inline-template directive allows us to build rich Vue components as a progressive enhancement over existing WordPress markup. The post How to Build Vue Components in a WordPress Theme appeared first on CSS-Tricks

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...

A Complete Guide to Data Attributes


Everything you ever wanted to know about data attributes in HTML, CSS, and JavaScript. The post A Complete Guide to Data Attributes appeared first on CSS-Tricks

Collective #590


Listen to your web pages * Exploring the Web Speech API * Stage.js * The Side Effects of an Unfinished Internet Collective #590 was written by Pedro Botelho and published on Codrops

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...

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace