AI 摘要Dark mode has become a standard user expectation, but implementing it well in statically-built sites and apps is deceptively tricky. This in-depth tutorial explains how to build a perfect, flicker-free, and customizable theming solution for React/Next.js applications.
AI 摘要The author documents their latest PC build, downsizing from a 2011-era case to a compact mini-ITX system in a Streacom DA2 case chosen over the smaller Dan A4 SFX to accommodate a powerful Intel i9-9900KS CPU and NVIDIA RTX 2080 Ti GPU. They praise the DA2's versatile bracket system and hybrid open-air design (recommending removing the top and bottom acrylic panels for airflow), while criticizing the tight-fitting side panels and intrusive power extension cable. Concluding that PC upgrades have become boring, they suggest that the main innovation in PC building going forward is packing maximum power into less than 20 liters of space.
About a year ago, I published a Rust crate called inline-python, which allows you to easily mix some Python into your Rust code using a python!{ .. } macro. In this series, I’ll go through the process of developing this crate from scratch.
AI 摘要This tutorial explores how CSS variables can be leveraged in React applications to create dynamic themes. It demonstrates how to maximize the use of CSS-in-JS tools like styled-components and challenges traditional assumptions about how media queries work.
AI 摘要The author argues that several seemingly separate discussions in the Rust community—such as writing fallible code inside iterator adapters and closures that maintain Tennant's Correspondence Principle—are all deeply interconnected. In his view, they all stem from what he considers one of the biggest design problems in Rust: the language's failure at version 1.0 to provide good support for handling common effects related to program control flow.
Styling an ordered list can be surprisingly tricky; there's no way to get at that bullet! In this tutorial, we'll see a handy trick using CSS counters that lets us style ordered lists without breaking proper semantics. Keep reading.
AI 摘要The author argues for adding Rust syntax that automatically 'Ok-wraps' the return values of functions returning Result types, a feature they have long supported despite vocal opposition from many enthusiastic users. They sketch a possible design in which a function signature includes a 'throws' clause, return expressions yield the success type directly, a new 'throw' expression handles errors, and the existing '?' operator works unchanged.
AI 摘要The author recounts creating the Rust error-handling library failure about two and a half years ago, which quickly became one of the most popular error handling libraries in Rust. Its current maintainer has now deprecated the library, a decision the author strongly supports. In the same week, the author released a new and very different error-handling library called fehler, and the article discusses both, including how failure emerged when error-chain was the dominant option.
AI 摘要The article explains the advantages of LCH colors in CSS over the familiar sRGB/HSL model: LCH gives access to about 50% more colors beyond sRGB (matching modern monitors' wider P3 gamuts), is perceptually uniform, and has a lightness component that actually corresponds to perceived lightness. The author describes how LCH (Lightness, Chroma, Hue) works, notes that major browsers are beginning to implement it, and introduces an LCH color picker built at css.land/lch. A FAQ section clarifies common misconceptions, including LCH's relationship to the Lab color space and why color(display-p3) is only a partial, short-term solution.
AI 摘要The author argues that filing CVEs for Rust and its ecosystem libraries is at best silly and at worst harmful, as it muddies the definition of what a vulnerability actually is. They contend that this practice paints an overly negative picture of Rust's security situation, which can lead people to make inaccurate comparisons with languages like C/C++.
AI 摘要The article announces the release of "use-sound", a React Hook library designed to make adding sound effects to React applications easy. The author argues that the web is a largely visual experience, in contrast to mobile apps which engage sight, sound, and touch through haptic feedback. They encourage developers to consider incorporating audio into their web projects using this new tool.
AI 摘要The article introduces `zig cc`, a new sub-command of the Zig compiler that serves as a drop-in replacement for GCC/Clang when compiling C code, while requiring only a simple 45 MiB tarball installation. Its key advantages include seamless out-of-the-box cross-compilation to various targets (such as Windows, ARM64, and MIPS, where Clang and GCC typically fail), and a sophisticated caching system that avoids unnecessary rebuilds and can eliminate the need for a build system in simple projects. The author demonstrates these capabilities by successfully building and cross-compiling real-world projects like LuaJIT and running the resulting binaries under QEMU.