BitstylesPhoenix

Hex pm Hex docs License CircleCI

Basic helpers for bitstyles for elixir phoenix projects. Currently made for version 1.5.0 of bitstyles. Future versions might still work, since the common interface is just CSS classes. Feel free to drop PRs if you notice any inconsistencies with new versions.

Requirements

bitstyles must be installed separately into the asset generation. The helpers in this project just output classes for working with bitstyles.

Installation

The package can be installed by adding bitstyles_phoenix to your list of dependencies in mix.exs:

def deps do
  [
    {:bitstyles_phoenix, "~> 0.6.0"}
  ]
end

To make use of the various ui_* helpers in the project, just add a use statement to the phoenix application view_helpers:

  defp view_helpers do
    quote do
      # Use all HTML functionality (forms, tags, etc)
      use Phoenix.HTML
      use BitstylesPhoenix.Components

      # Import basic rendering functionality (render, render_layout, etc)
      import Phoenix.View

      ...
    end
  end

Getting started

Check out the top level BitstylesPhoenix module for usage examples, for the ui_* helpers.

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/bitstyles_phoenix.

Configuration


config :bitstyles_phoenix,
  trim_e2e_classes: true # In case you want to disable the trimming in certain environments
  translate_errors: {ExampleWeb.ErrorHelper, :translate_errors, []} # In case you want to translate errors via gettext etc.

Developing bitstyles_phoenix

To live update the documentation when you change the lib folder you can do:

mix docs && fswatch -o lib | xargs -n1 -I {} mix docs