INNER CODE UNIT · Ruby

write_theme_attrs

Automattic/pocket-casts-android · scripts/themes/generate_xml.rb:23

def write_theme_attrs(tokens)
  output = ''
  tokens.each do |token_attrs|
    next if token_attrs[:user_input]

    key = token_attrs[:key]
    output += %(        <attr name="#{key}" format="color" />\n)
  end
  write_to_theme_file(output, 'Theme tokens')
end

def write_theme_colors(tokens, theme_name, file_marker)
  output = ''
  tokens.each do |token_attrs|
    key = token_attrs[:key]
    next if token_attrs[:user_input]

    theme = token_attrs[:themes][theme_name.to_sym]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…