Search

Nalezeno "QR code": 1615

Faking env() to Use it Now


There is already an env() function in CSS, but it kinda came out of nowhere as an Apple thing for dealing with "The Notch" but it has made it's way to be a draft spec. The point will be for UAs or authors to declare variables that cannot be changed. Global const for CSS, sorta. That spec doesn't...

Clever code


This week, Chris Ferdinandi examined a clever JavaScript snippet, one that's written creatively with new syntax features, but is perhaps less readable and performant. It's a quick read, but his callout of our industry's fixation on cleverness is worth... calling out: ...we’ve become obsessed as...

The Power of Named Transitions in Vue


Vue offers several ways to control how an element or component visually appears when inserted into the DOM. Examples can be fading in, sliding in, or other visual effects. Almost all of this functionality is based around a single component: the transition component. A simple example of this is with...

Inline SVG… Cached


I wrote that using inline <svg> icons makes for the best icon system. I still think that's true. It's the easiest possible way to drop an icon onto a page. No network request, perfectly styleable. But inlining code has some drawbacks, one of which is that it doesn't take advantage...

Get a CSS Custom Property Value with JavaScript


Here’s a neat trick from Andy Bell where he uses CSS Custom Properties to check if a particular CSS feature is supported by using JavaScript. Basically, he's using the ability CSS has to check for browser support on a particular property, setting a custom property that returns a value of either...

Using “box shadows” and clip-path together


Let's do a little step-by-step of a situation where you can't quite do what seems to make sense, but you can still get it done with CSS trickery. In this case, it'll be applying a shadow to a shape. You make a box .tag { background: #FB8C00; color: #222; font: bold 32px system-ui; padding:...

In Defense of the Ternary Statement


Some months ago I was on Hacker News (as one does) and I ran across a (now deleted) article about not using if statements. If you’re new to this idea (like I was), you’re in a for a real treat. Just search for "if statements" on Hacker News. You'll get articles proposing that you might not need...

The Best React Extension for VS Code


When working with React, there's lots of code that gets repeated over and over....and over and over again. Eventually, you start to think, "there's got to be a better way". Don't w

Using a Mixin to Take the Math out of Responsive Font Sizes


Responsive Font Size (RFS) is an engine that automatically calculates and updates the font-size property on elements based on the dimensions of the browser viewport. If you’re thinking that sounds familiar, that’s because there is a slew of tools out there that offer various approaches for fluid...

Native Lazy Loading


IntersectionObserver has made lazy loading a lot easier and more efficient than it used to be, but to do it really right you still gotta remove the src and such, which is cumbersome. It's definitely not as easy as: <img src="celebration.jpg" loading="lazy" alt="..." /> Addy Osmani says...

Creating an Extension Pack for Visual Studio Code


Extension Packs in Visual Studio Code are extremely useful when you want to install a collection of related extensions. In this article, let's walk through the steps of creating an Extension Pack s

Fixed Headers, On-Page Links, and Overlapping Content, Oh My!


Let's take a basic on-page link: <a href="#section-two">Section Two</a> When clicked, the browser will scroll itself to the element with that ID: <section id="section-two"></section>. A browser feature as old as browsers themselves, just about. But as soon as...

Make it hard to screw up driven development


Development is complicated. Our job is an ongoing battle between getting the job done and doing that job in a safe, long-lasting way. Developers say things like, "I'm just going to do this quick and dirty first," because it's taken as fact that if you code anything quickly, it not only will...

KV Storage


localStorage is... Good! It's an incredibly easy API to use. localStorage.setItem('name', 'Chris'); let name = localStorage.getItem('name'); Bad! Philip Walton explains why: localStorage is a synchronous API that blocks the main thread, and any time you access it you potentially prevent your...

Collective #504


CodeSandbox v3 * codetalks.tv * Name It, and They Will Come * code-server * oneliners.js * VexChords Collective #504 was written by Pedro Botelho and published on Codrops

Differential Serving


There is "futuristic" JavaScript that we can write. "Stage 0" refers to ideas for the JavaScript language that are still proposals. Still, someone might turn that idea into a Babel plugin and it could compile into code that can ship to any browser. For some of these lucky proposals, Stage 0 becomes...

Scroll-Linked Animations


You scroll down to a certain point, now you want to style things in a certain way. A header becomes fixed. An animation triggers. A table of contents appears. To do anything based on scroll position, JavaScript is required right now. You watch the scroll position via a DOM event and alter...

You probably don’t need input type=“number”


Brad Frost wrote about a recent experience with a website that used <input type="number">: Last week I got a call from my bank regarding a wire transfer I had just scheduled. The customer support guy had me repeat everything back to him because there seemed to be a problem with...

Next Genpm


So many web projects use npm to pull in their dependencies, for both the front end and back. npm install and away it goes, pulling thousands of files into a node_modules folder in our projects to import/require anything. It's an important cog in the great machine of web development. While I don't...

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