Search

Nalezeno "css-tricks": 2942

Pseudo-Randomly Adding Illustrations with CSS


Between each post of Eric Meyer’s blog there’s this rather lovely illustration that can randomly be one of these five options: Eric made each illustration into a separate background image then switches out that image with the nth-of-type CSS property, like this: .entry:nth-of-type(2n+1)::before...

Better Form Inputs for Better Mobile User Experiences


Here’s one simple, practical way to make apps perform better on mobile devices: always configure HTML input fields with the correct type, inputmode, and autocomplete attributes. While these three attributes are often discussed in isolation, they make the most sense in the context of mobile user...

Thank You, Christopher Schmitt


It’s incredibly sad that Christopher Schmitt passed away last week¹. I keep thinking about how Christopher was one of the best dudes I knew. Just incredibly kind and thoughtful all the way through. I know everyone says that about people after they pass, but I really mean it here. I’m...

Creating Color Themes With Custom Properties, HSL, and a Little calc()


Before the advent of CSS custom properties (we might call them “variables” in this article as that’s the spirit of them), implementing multiple color schemes on the same website usually meant writing separate stylesheets. Definitely not the most maintainable thing in the world. Nowadays, though,...

Jetpack Instant Search!


Jetpack has had a search feature for a while. Flip it on, and it replaces your built-in WordPress search (which is functional, but not particularly good) with an Elasticsearch-powered solution that is faster and has better results. I’ve been using that for quite a while here on CSS-Tricks...

CSS Scrollbar With Progress Meter


Scrollbars are natural progress meters. How far the scrollbar is down or across is how much progress has been made scrolling through that element (often the entire page). But, they are more like progress indicators than meters, if you think of a meter as something that “fills up” as...

Create a Responsive CSS Motion Path? Sure We Can!


There was a discussion recently on the Animation at Work Slack: how could you make a CSS motion path responsive? What techniques would be work? This got me thinking. A CSS motion path allows us to animate elements along custom user-defined paths. Those paths follow the same structure as SVG paths....

How the Vue Composition API Replaces Vue Mixins


Looking to share code between your Vue components? If you’re familiar with Vue 2, you’ve probably used a mixin for this purpose. But the new Composition API, which is available now as a plugin for Vue 2 and an upcoming feature of Vue 3, provides a much better solution. In this article...

Using CSS to Set Text Inside a Circle


You want to set some text inside the shape of a circle with HTML and CSS? That’s crazy talk, right? Not really! Thanks to shape-outside and some pure CSS trickery it is possible to do exactly that.  However, this can be a fiddly layout option. We have to take lots of different things into...

No-Class CSS Frameworks


I linked up Water.css not long ago as an interesting sort of CSS framework. No classes. No <h2 class="is-title">. You just use semantic HTML and get styles. Is that going to “scale” very far? Probably not, but it sure is handy for styling things quickly, where — of course...

Styling in the Shadow DOM With CSS Shadow Parts 


Safari 13.1 just shipped support for CSS Shadow Parts. That means the ::part() selector is now supported in Chrome, Edge, Opera, Safari, and Firefox. We’ll see why it’s useful, but first a recap on shadow DOM encapsulation… The benefits of shadow DOM encapsulation I work at giffgaff where we have...

How to Create a CSS-Tricks Custom Scrollbar


Chris Coyier of CSS-Tricks is an amazing engineer and blogger. He’s not only creative but has always had the drive to put his thoughts to work, no matter how large. He also has a good eye for the little things that can make CSS-Tricks or your site special. One of those little things is...

When debugging, your attitude matters


Julia Evans: I was debugging some CSS last week, and I think that post is missing something important: your attitude. Now – I’m not a very good CSS developer yet. I’ve never written CSS professionally and I don’t understand a lot of basic CSS concepts (I think I finally understood for the first...

Thinking in Behaviors, Not Screen Sizes


Chase McCoy wrote a nifty post about the “gap problem” when making a grid of items. His argument might be summarized like this: how should we space elements with margins in CSS? He notes that the gap property isn’t quite ready for prime time when it comes to using it with flexbox, like this: .grid...

Tips for Writing Animation Code Efficiently


I’ve been coding web animations and helping others do the same for years now. However, I have yet to see a concise list of tips focused on how to efficiently build animations, so here you go! I will be using the GreenSock Animation Platform (GSAP). It provides a simple, readable API and solves...

CSS Foldable Display Polyfill


Foldable phones are starting to be a thing. Early days, for sure, but some are already shipping, and they definitely have web browsers on them. Stands to reason that, as web designers, we are going to want to know where that fold is so we can design screens that fit onto the top half and bottom...

Create Diagonal Layouts Like it’s 2020


Nils Binder covers the ways: 1. Use an SVG in the form of a triangle. This technique is nicely described by Erik Kennedy on CSS-Tricks. 2. Hide part of your section using clip-path. Read Diagonal Containers in CSS by Sebastiano Guerriero or Sloped edges with consistent angle...

Creating Scheduled Push Notifications


Scheduled is the key word there — that’s a fairly new thing! When a push notification is scheduled (i.e. “Take your pill” or “You’ve got a flight in 3 hours”) that means it can be shown to the user even if they’ve gone offline. That’s an improvement from the past where push notification...

The WebAIM Million—Updated


This report made a big splash last year. It’s a large chunk of research that shows just how terribly the web does with accessibility. It’s been updated this year and (drumroll…) we got a little worse. I’ll use their blockquote: The number of errors increased 2.1% between...

Learn Eleventy From Scratch


The latest edition of Andy Bell’s Piccalilli landed in my inbox this morning with a sweet offer: preorder Andy’s course on learning Eleventy from scratch at a third of the price. Why the plug? No, not sponsorships or anything like that. I just happen to hear a heckuva lot about Eleventy...

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