Search

Nalezeno "QR code": 1615

The Humble `img` Element And Core Web Vitals


Addy Osmani on images in HTML: The humble <img> element has gained some superpowers over the years. Given how central it is to image optimization on the web, let’s catch up on what it can do and how it can … The post The Humble `img` Element And Core Web Vitals appeared...

Creating Stylesheet Feature Flags With Sass !default


!default is a Sass flag that indicates conditional assignment to a variable — it assigns a value only if the variable was previously undefined or null. Consider this code snippet: $variable: 'test' !default; To the Sass compiler, this line … The post Creating Stylesheet Feature Flags With...

Advanced CSS Animation Using cubic-bezier()


When dealing with complex CSS animations, there is a tendency to create expansive @keyframes with lots of declarations. There are a couple of tricks though that I want to talk about that might help make things easier, while staying in … The post Advanced CSS Animation Using cubic-bezier()...

Making Disabled Buttons More Inclusive


Let’s talk about disabled buttons. Specifically, let’s get into why we use them and how we can do better than the traditional disabled attribute in HTML (e.g. <button disabled> ) to mark a button as disabled. There are lots of … The post Making Disabled Buttons More Inclusive...

CSS Pie Timer Re-Revisited


Kitty reflected on an ancient blog post here on CSS-Tricks on how to make an animated pie timer. The old technique is still clever. The new technique is equally clever and much easier. I particularly like the steps() animation function… The post CSS Pie Timer Re-Revisited appeared first...

Next Gen CSS: @container


Chrome is experimenting with @container, a property within the CSS Working Group Containment Level 3 spec being championed by Miriam Suzanne of Oddbird, and a group of engineers across the web platform. @container brings us the ability to … The post Next Gen CSS: @container appeared first...

Variable Aspect Ratio Card With Conic Gradients Meeting Along the Diagonal


I recently came across an interesting problem. I had to implement a grid of cards with a variable (user-set) aspect ratio that was stored in a --ratio custom property. Boxes with a certain aspect ratio are a classic problem in … The post Variable Aspect Ratio Card With Conic Gradients...

Noisy Strokes Texture with Three.js and GLSL


Learn how to code up the noisy strokes effect seen on the website of Leonard using Three.js and GLSL. The post Noisy Strokes Texture with Three.js and GLSL appeared first on Codrops

Custom State Pseudo-Classes in Chrome


There is an increasing number of “custom” features on the web platform. We have custom properties (--my-property), custom elements (<my-element>), and custom events (new CustomEvent('myEvent')). At one point, we might even get custom media … The post Custom State Pseudo-Classes...

Astro


You can’t even look at code or documentation for Astro (publicly) yet — it’s an in-progress idea — but you can watch a video of Fred showing it off to Feross. I gotta admit: it looks awesome. I’m bullish … The post Astro appeared first on CSS-Tricks. You can support...

16px or Larger Text Prevents iOS Form Zoom


This was a great “Today I Learned” for me from Josh W. Comeau. If the font-size of an <input> is 16px or larger, Safari on iOS will focus into the input normally. But as soon as the font-size is … The post 16px or Larger Text Prevents iOS Form Zoom appeared first...

Creating Colorful, Smart Shadows


A bona fide CSS trick from Kirupa Chinnathambi here. To match a colored shadow with the colors in the background-image of an element, you inherit the background in a pseudo-element, kick it behind the original, then blur and filter it. … The post Creating Colorful, Smart Shadows appeared...

Safari 14.1 Adds Support for Flexbox Gaps


Yay, it’s here! Safari 14.1 reportedly adds support for the gap property in flexbox layouts. We’ve had grid-gap support for some time, but true to its name, it’s limited to grid layouts. Now we can use gap in either type … The post Safari 14.1 Adds Support for Flexbox Gaps...

Web Languages as Compile Targets


Jim Nielsen quoting Eric Bailey: He references an example on Twitter where someone noted you can use the <details> element to “create a native HTML accordion,” to which someone responded: “this works without Bootstrap? 🤯” What’s the problem here? From … The post...

List Markers and String Styles


Lists—we’ve all worked with them in one form or another. I’m talking about HTML’s <ol> and <ul>. Much of the time, because we desire styling control, we turn off the list’s markers completely with list-style-type: none, and start … The post List Markers and String Styles...

Exploring color-contrast() for the first time.


I saw in the release notes for Safari Technical Preview 122 that it has support for a color-contrast() function in CSS. Safari is first out of the gate here. As far as I know, no other browser supports this yet … The post Exploring color-contrast() for the first time. appeared first...

Eliminating five top compatibility pain points on the web


Robert Nyman and Philip Jägenstedt: Google is working with other browser vendors and industry partners to fix the top five browser compatibility pain points for web developers. The areas of focus are CSS Flexbox, CSS Grid, position: sticky,  … The post Eliminating five...

Sticky Headers: 5 Ways to Make Them Better


Page Laubheimer says that if you’re going to do a sticky header… Keep it small. Visually contrast it with the rest of the page. If it’s going to move, keep it minimal. (I’d say, respect prefers-reduced-motion.) Consider “partially persistent … The post Sticky...

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