Method: TailwindTheme::Theme#css

Defined in:
lib/tailwind_theme.rb

#css(path, options = {}) ⇒ String

Get the merged Tailwind CSS classes

Default options are:

:raise => false

Parameters:

  • path (String, Symbol, Array<String, Symbol>)

    the path to the css classes or sub theme

  • options (Hash<Symbol, Object>) (defaults to: {})

    the options to use when parsing the css theme

Options Hash (options):

  • prepend (prepend)

    the classnames before merging the Tailwind Classes

  • append (append)

    the classnames before merging the Tailwind Classes

  • raise (Boolean)

    raise an ‘IndexError` if the `path` does not exist

  • object (Object)

    the object to apply the sub theme

  • attributes (Hash<String, Object>)

    the attributes to apply the sub theme. Overrides the attributes defined in ‘options`.

Returns:

  • (String)

    the merged Tailwind CSS classes

Raises:

  • (IndexError)

    if the :raise options is true and the path cannot be found

  • (ArgumentError)

    if processing an object theme and the object or attributes option is not defined



87
88
89
90
# File 'lib/tailwind_theme.rb', line 87

def css(path, options = {})
  classnames = build path, options
  merge classnames, options
end