How The New York Times Games Team Delivered Accessible, Cross-Platform Dark Mode
The New York Times Games app shipped dark mode across Android, iOS and hybrid webviews by moving from hard-coded colors to semantic design tokens (e.g. "Background Primary" became "$bg-page") through a legacy-to-new color mapping. Android handled XML and Jetpack Compose screens separately. On iOS, UIKit screens needed overrideUserInterfaceStyle and traitCollectionDidChange observers, while SwiftUI screens used @Environment(\.colorScheme) with asset catalogs. Shared NYT packages such as login and avatar selection had to be updated in coordination with the app. Illustrations were reworked by hand rather than color-inverted, and a standalone badge-detail webview takes a "dark" query parameter so it follows the app's global setting.
Related posts
- Introducing Adaptive Dark Mode
WebKit mediumAdeptSafari 27.3 beta adds Adaptive Dark Mode, which automatically darkens light websites that don't declare dark mode support via color-scheme. Inside WebKit, a luminosity-inverting color matrix preserves hue, text contrast targets WCAG 4.5:1, SVGs are recolored, simple black-and-white bitmap logos are detected via pixel histograms, and canvas, masks and mix-blend-mode are left alone or disabled. Sites can opt out with `color-scheme: light only`, improve results by using SVG, CSS colors and transparent images, or ship a custom dark mode using color-scheme, prefers-color-scheme and light-dark(). Websites cannot detect the transformation, because JavaScript sees the original authored colors, which avoids adding a fingerprinting signal.
- Illuminating dark mode
Figma mediumAdept
Figma built dark mode by replacing roughly 5,100 build-time PostCSS color variables with runtime CSS custom properties based on a semantic token schema (Type | UI Element | Color role | Prominence | Interaction), so new themes only require reassigning token values. Tokens are exported in the Design Tokens Format Module spec and compiled to CSS, Swift and XML. To spread the mostly manual refactor, forty engineers covered about 80% of in-scope surfaces in a single 'Dark Mode Week'. Supporting tooling included CSS fallbacks to the legacy variables to prevent regressions, a debug theme with random saturated colors to reveal unconverted surfaces, and a CIELAB-based search tool for finding the closest matching token.
- Challenges of mixed SwiftUI and UIKit codebases in iOS Apps
Medium Engineering mediumAdeptMixing SwiftUI into Medium's 2013-era UIKit iOS app brings recurring friction: sizing SwiftUI views hosted in UIHostingController as table/collection cells, mismatched scroll APIs (offset sign differs), and duplicated components like PostPreview implemented in both frameworks. Medium keeps UIKit for app-wide navigation and SwiftUI for local feature navigation, avoids SwiftUI TextField due to focus limitations, and notes weaker SwiftUI view debugging. A scroll performance issue from wrapping UILabel with NSAttributedString in a SwiftUI list was fixed by switching to native Text with AttributedString; raising the minimum target from iOS 13 to 16 reduced version-specific code.
- Theming the Zalando Design System
Zalando Engineering mediumAdeptZalando built theming into its design system by extracting repeated values into semantic design tokens (e.g. `accent` instead of `orange`) and adding component-level tokens that reference global ones, so themes can change a button's padding without redefining global scales. Colour schemes (default, monochrome-dark, monochrome-light) are first-class within each theme to meet contrast requirements on image-derived banner backgrounds, which raises open questions about native dark mode. Tokens live in TOML files processed by Style Dictionary with custom transforms and formats that emit platform-specific artefacts for web, Android and iOS. Each theme is a partial dictionary deep-merged over the base theme. The tokenization process also simplified the design system and improved cross-platform parity.
- Lessons From Building iOS Widgets
Shopify Engineering mediumAdeptShopify rebuilt its iOS analytics widgets natively in SwiftUI rather than React Native, because app extensions have tight memory limits, WidgetKit serializes SwiftUI view hierarchies, and React Native had no official widget support. Each widget fetches data independently through Reportify/ShopifyQL while sharing session tokens with the app. iOS calls getTimeline and getSnapshot several times per update cycle, which caused redundant network calls and a token-refresh race that logged users out. A one-minute per-widget cache keyed on configuration fixed both problems. The post also covers a flexible metric decoder, a size-agnostic SwiftUI layout built on LazyVGrid and an OptionSet of layout options, and why relative timestamps were rejected for lack of customization.