View Source LiveInspect.Theme behaviour (live_inspect v0.1.1)

Behavior to implement custom styling for the inspector.

Link to this section Summary

Callbacks

Returns a map of attributes to add to the <th> elements that contain list indices and map keys.

Returns a map of attributes to add to the root inspector <div>.

Returns contents of the CSS <style> to render inline on the page.

Returns a map of attributes to add to <table> elements.

Returns a map of attributes to add to the <td> elements that contain inspected values.

Link to this section Callbacks

@callback key_attrs(key :: any(), value :: any()) :: map()

Returns a map of attributes to add to the <th> elements that contain list indices and map keys.

The key argument is the map key or integer list index (rendered here), and value is the inspected value.

@callback root_attrs() :: map()

Returns a map of attributes to add to the root inspector <div>.

@callback style() :: String.t() | nil

Returns contents of the CSS <style> to render inline on the page.

The styles will only be injected once within a given LiveView, immediately before the first invocation of the inspector on the page.

Return nil to bypass this.

@callback table_attrs() :: map()

Returns a map of attributes to add to <table> elements.

@callback value_attrs(key :: any(), value :: any()) :: map()

Returns a map of attributes to add to the <td> elements that contain inspected values.

The key argument is the map key or integer list index, and value is the inspected value (rendered here).