Skip to content

Latest commit

 

History

History
77 lines (56 loc) · 1.58 KB

0.3.1-0.4.0.md

File metadata and controls

77 lines (56 loc) · 1.58 KB

Migrating from Sai v0.3.2 to v0.4.0

Breaking Changes

Named Colors Moved to Sai-Mei

Most named colors have been moved from Sai to the new Sai-Mei gem. Only the 16 standard ANSI colors remain in Sai:

  • black/bright_black
  • red/bright_red
  • green/bright_green
  • yellow/bright_yellow
  • blue/bright_blue
  • magenta/bright_magenta
  • cyan/bright_cyan
  • white/bright_white

Restoring Named Colors

To restore access to previously available named colors, install the Sai-Mei gem:

# In your Gemfile
gem 'sai'
gem 'sai-mei'

Then choose which color palettes you want to use:

# Restore CSS color names (most similar to Sai v0.3.2)
Sai::Mei.css.install

# Use Tailwind colors
Sai::Mei.tailwind.install

# Use xterm 256-color palette
Sai::Mei.xterm.install

Example Migration

# Before (Sai v0.3.2)
Sai.azure.on_cornflower_blue.decorate("Hello!")

# After (Sai v0.4.0)
require 'sai/mei'
Sai::Mei.css.install

Sai.azure.on_cornflower_blue.decorate("Hello!")  # Same code works after installing colors

Additional Features

Sai-Mei provides more flexibility in managing color palettes:

# Install specific colors
Sai::Mei.css
  .only(:azure, :cornflower_blue)
  .install

# Exclude specific colors
Sai::Mei.css
  .excluding(:fuchsia, :salmon)
  .install

# Rename colors during installation
Sai::Mei.css
  .rename(azure: :sky, cornflower_blue: :ocean)
  .install

See the Sai-Mei documentation for complete details on available palettes and features.