npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@times-design-system/theme-ios

v2.9.3

Published

Times Design System theme package - iOS xcassets theme files

Readme

@times-design-system/theme-ios

Times Design System theme package for iOS with Swift color definitions, typography tokens, and Xcode asset catalog support.

Installation

yarn add @times-design-system/theme-ios

Contents

Swift Color Files

Pre-generated Swift files for iOS color assets:

src/Colors/
├── DarkCoreColors.swift
├── LightCoreColors.swift
├── DarkBrandColors.swift
├── LightBrandColors.swift
├── DarkChannelsColors.swift
├── LightChannelsColors.swift
└── ... (30+ color definition files)

Xcode Asset Catalog

Complete color asset catalog ready for Xcode projects:

src/TDS[Theme]/Colors/[ColorName].colorset/
├── Contents.json          # RGBA + dark mode appearance
└── ... (2,700+ color definitions)

Spacing and Typography

src/
├── TDSSpacing.swift       # Spacing token definitions (CGFloat)
└── TDSTypography.swift    # Typography token definitions

Usage

In Your Xcode Project

  1. Copy the generated files to your iOS project:
cp -r node_modules/@times-design-system/theme-ios/src/* YourProject/DesignTokens/
  1. Add to Xcode by dragging the folders into your project navigator

  2. Use in Swift code:

import UIKit

class MyViewController: UIViewController {
  override func viewDidLoad() {
    super.viewDidLoad()

    // Use color tokens
    view.backgroundColor = UIColor(named: "SurfaceCanvas")

    // Use brand colors
    button.backgroundColor = UIColor(named: "BrandHome500")

    // Use spacing
    label.text = "Hello"
    label.font = UIFont.systemFont(ofSize: CGFloat.TdsSpacing100)
  }
}

Swift Color Definitions

Each color file contains semantic and brand color definitions:

class DarkCoreColors: TDSColors {
  override val surfaceCanvas = UIColor(hex: 0xFF000000)
  override val surfaceLevel1 = UIColor(hex: 0xFF0D0D0D)
  override val textPrimary = UIColor(hex: 0xFFFFFFFF)
  override val textSecondary = UIColor(hex: 0xFFD9D9D9)
  // ... 200+ color properties
}

Using with SwiftUI

import SwiftUI

struct ContentView: View {
  var body: some View {
    VStack {
      Text("Heading")
        .font(.system(size: 2.25 * 16)) // Use TdsTypography.swift values
        .foregroundColor(Color(UIColor(named: "TextPrimary")!))

      Text("Body text")
        .font(.system(.body))
        .padding(CGFloat.TdsSpacing100)
        .background(Color(UIColor(named: "SurfaceCanvas")!))
    }
  }
}

Token Categories

Colors (2,700+)

Semantic Colors

SurfaceCanvas, SurfaceLevel1-4, SurfaceInverse
TextPrimary, TextSecondary, TextTertiary
BorderPrimary, BorderSecondary
InteractivePrimary, InteractiveSecondary

Brand & Channel Colors

BrandHome500, BrandBusiness500, BrandSport500
BrandMoney500, BrandComment500, etc.
ChannelWorld500, ChannelUk500, etc.

Feedback Colors

FeedbackError, FeedbackSuccess, FeedbackWarning, FeedbackInfo
InputBorder*, InputFill*, InputText*

Spacing (20 values)

CGFloat.TdsSpacing025    // 0.25rem (4pt)
CGFloat.TdsSpacing050    // 0.5rem (8pt)
CGFloat.TdsSpacing100    // 1rem (16pt)
CGFloat.TdsSpacing200    // 1.5rem (24pt)
// ... up to TdsSpacing400

Typography

// Font sizes
TdsTypography.fontSize025    // 0.75rem
TdsTypography.fontSize100    // 2.25rem

// Line heights
TdsTypography.lineHeightTight
TdsTypography.lineHeightNormal

// Font families
TdsTypography.fontFamilySans
TdsTypography.fontFamilySerif

Dark Mode Support

All colors are automatically configured with dynamic appearance support:

// Automatically switches between light and dark
let color = UIColor(named: "TextPrimary")

// In SwiftUI
Color(UIColor(named: "SurfaceCanvas")!)

The colors use Xcode's dynamic appearance feature to switch based on:

  • System appearance settings
  • Trait collection (light/dark)

File Structure

dist/
├── TDSCoreColors.swift              # Core color definitions
├── TDSSpacing.swift                 # Spacing tokens
├── TDSTypography.swift              # Typography tokens
└── TDS[Theme]/Colors/               # Xcode asset catalogs
    ├── TDSBrandColors.colorset/
    ├── TDSSemanticColors.colorset/
    └── ... (2,700+ color sets)

Compatibility

  • iOS: 12.0+
  • Swift: 5.0+
  • Xcode: 12.0+
  • macOS: 10.15+
  • tvOS: 12.0+
  • watchOS: 5.0+

Building

To rebuild after token changes:

npm run build

This generates:

  • Swift color class definitions
  • Xcode asset catalog with Contents.json files
  • Dynamic appearance setup for dark mode

License

ISC

Palette Tokens (Pre-resolved Colors)

tokens.brand.primary; // Color ramp with 19 steps (100-1000)
tokens.channels.comment; // Channel-specific colors
tokens.dataVisualisation.data01; // Data visualization colors

Semantic Tokens

tokens.semanticColor.surface.default; // "rgba(255, 255, 255, 1.00)"
tokens.semanticColor.text.primary; // "rgba(26, 26, 26, 1.00)"
tokens.semanticColor.interactive.primary; // Brand color for interactive elements

Browser Support

All CSS custom properties (--tds-*) are supported in modern browsers (Chrome, Firefox, Safari, Edge).

For older browsers, use the JavaScript tokens with fallback values:

const fontSize = tokens.Foundation.fontSize100 || '2.25rem';

Building

To rebuild the package after modifying tokens:

npm run build

This will:

  1. Clean the dist/ directory
  2. Build ESM and CJS JavaScript modules
  3. Copy CSS variables to dist/

Publishing

npm publish

The package is configured with public access and will publish to the public npm registry.

License

ISC