Class: ActiveMail::Tokens::ButtonStyle

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/activemail/tokens/button_style.rb

Overview

‘border` nil means “no outline”.

Class Method Summary collapse

Class Method Details

.from(tokens, variant) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/activemail/tokens/button_style.rb', line 19

def self.from(tokens, variant)
  new(
    background: tokens.color!(variant),
    color: tokens.color("#{variant}_text") || tokens.color!(:button_text),
    radius: tokens.radius!(:button),
    border: tokens.color("#{variant}_border")
  )
end