Module: Tailwindcss::Helpers

Extended by:
Helpers
Included in:
Helpers
Defined in:
lib/tailwindcss/helpers.rb

Instance Method Summary collapse

Instance Method Details

#ab(value) ⇒ Object



10
11
12
# File 'lib/tailwindcss/helpers.rb', line 10

def ab(value)
  ArbitraryValue.new(value)
end

#color_scheme_token(token, weight = 500) ⇒ Object

Parameters:

  • token (String)

    A value your Tailwindcss.theme.color_scheme keys

  • weight (Integer) (defaults to: 500)

    A value between 100 and 900



16
17
18
# File 'lib/tailwindcss/helpers.rb', line 16

def color_scheme_token(token, weight = 500)
  color_token(Tailwindcss.theme.color_scheme[token.to_sym], weight)
end

#color_token(color_token, weight = 500) ⇒ Object

Parameters:

  • color_token (String)

    A value your of any of tailwinds color tokens

  • weight (Integer) (defaults to: 500)

    A value between 100 and 900



22
23
24
# File 'lib/tailwindcss/helpers.rb', line 22

def color_token(color_token, weight = 500)
  "#{color_token}-#{weight}"
end

#tailwind(**style_attributes) ⇒ Object Also known as: tw



5
6
7
# File 'lib/tailwindcss/helpers.rb', line 5

def tailwind(**style_attributes)
  Style.new(**style_attributes).to_s
end