Search

Nalezeno "css-tricks": 2942

4 Ways to Animate the Color of a Text Link on Hover


Let’s create a pure CSS effect that changes the color of a text link on hover… but slide that new color in instead of simply swapping colors. There are four different techniques we can use to do this. Let’s look at those while being mindful of important things, like accessibility, performance,...

Just Dropping Some Type Links


I've had a bunch of tabs open that just so happen to all be related to typography, so I figured I'd give myself the mental release of closing them by blogging them. How's that for a blog post format for ya: whatever random tabs you've had open for far too long. Times New Roman is popular on...

Vue.js: The Documentary


Hey how cool! A documentary about Vue! Good timing as it looks like VueConf is happening right now. (Reminder we have a site for conferences to tell you stuff like that). Sarah appears in it (about 21:13) and talks about CSS-Tricks for a second, so we're officially super famous now and I have...

What I Like About Craft CMS


Looking at the CMS scene today, there are upwards of 150 options to choose from — and that’s not including whatever home-grown custom alternatives people might be running. The term “Content Management System” is broad and most site builders fit into the CMS model. Craft CMS, a relatively new choice...

Making Things Better: Redefining the Technical Possibilities of CSS


(This is a sponsored post.) Robin recently lamented the common complaint that CSS is frustrating. There are misconceptions about what it is and what it does. There are debates about what kind of language it is. There are even different views on where it should be written. Rachel Andrew has a...

Considerations for Creating a Card Component


Here's a Card component in React: const Card = props ={ return( <div className="card"<h2{props.title}</h2<p{props.content}</p</div) } It might be pretty useful! If you end up using this thing hundreds of times, now you have the ability to refactor a little bit of HTML...

Unfortunately, clip-path: path() is Still a No-Go


I was extremely excited when I first heard that clip-path: path() was coming to Firefox. Just imagine being able to easily code a breathing box like the one below with just one HTML element and very little CSS without needing SVG or a huge list of points inside the polygon function! Chris...

Selectors Explained


Have you ever found yourself either writing a CSS selector that winds up looking confusing as heck, or seen one while reading through someone's code? That happened to me the other day. Here's what I wrote: .site-footer__nav a:hover svg ellipse:first-child { } At the end of it, I honestly couldn't...

HTML: The Inaccessible Parts


<input type="number", <input type="date", <input type="search", <select multiple, <progress, <meter, <dialog, <details<summary, <video, <div onclick, <div aria-label, <a href<divBlock Links</div</a, aria-controls...

A Follow-Up to PHP Templating


Not long ago, I posted about PHP templating in just PHP (which is basically HEREDOC syntax). I'm literally using that technique for some super basic templating I needed to do on this very WordPress site. The main pushback was that this kind of thing can be an XSS vulnerability. In my case, it's...

How to Customize the WooCommerce Cart Page on a WordPress Site


A standard e-commerce site has a few common pages. There are product pages, shop pages that list products, and let’s not forget pages for the user account, checkout flow and cart. WooCommerce makes it a trivial task to set these up on a WordPress site because it provides templates for them...

Where to Learn WordPress Theme Development


Over a decade ago, I did a little three-part video series on Designing for WordPress. Then I did other series with the same spirit, like videocasting the whole v10 redesign, a friend's website, and even writing a book. Those are getting a little long in the tooth though. You might still learn from...

Data-driven Jamstack with Sourcebit


Think of building sites with Gatsby as an hourglass shape. Gatsby itself is right in the middle. The wide funnel at the top represents the fact that Gatsby can take in data from all sorts of sources. The data could be in markdown files, from a headless CMS or some other API, from a hosted database...

Why is CSS Frustrating?


Here’s a great thread by Kevin Powell that's making the rounds. He believes so many folks see CSS as a frustrating and annoying language: That's just as unintuitive as JS starting to count at 0, but since you learned that and accept it, it's fine. The real issue isn't with CSS. If...

When CSS Blocks


Tim Kadlec: One particular pattern [for loading non-critical CSS] I’ve seen is the preload/polyfill pattern. With this approach, you load any stylesheets as preloads instead, and then use their onload events to change them back to a stylesheet once the browser has them ready. So you're...

Animated Matryoshka Dolls in CSS


Here’s a fun one. How might we create a set of those cool Matryoshka dolls where they nest inside one another... but in CSS? I toyed with this idea in my head for a little while. Then, I saw a tweet from CSS-Tricks and the article image had the dolls. I took that as a sign! It was time to...

Let’s Say You Were Going to Write a Blog Post About Dark Mode


This is not that blog post. I'm saying let's say you were. This is not a knock any other blog posts out there about Dark Mode. There are lots of good ones, and I'm a fan of any information-sharing blog post. This is more of a thought exercise on what I think it would take to write a really great...

Chameleonic Header


Nice demo from Sebastiano Guerriero. When a fixed-position header moves from overlapping differently-colored backgrounds, the colors flop out to be appropriate for that background. Sebastiano's technique is very clever, involving multiple copies of the header within each section (where the copies...

Weaving a Line Through Text in CSS


Earlier this year, I came across this demo by Florin Pop, which makes a line go either over or under the letters of a single line heading. I thought this was a cool idea, but there were a few little things about the implementation I felt I could simplify and improve at the same time. First off,...

In-Browser Performance Linting With Feature Policies


Here’s a neat idea from Tim Kadlec. He uses the Modheader extension to toggle custom headers in his browser. It also lets him see when images are too big and need to be optimized in some way. This is a great way to catch issues like this in a local environment because browsers will throw an error...

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