LiveStyle.Manifest.ClassEntry (LiveStyle v0.13.1)
View SourceEntry structure for style classes.
There are two variants:
- Static classes: have declarations
- Dynamic classes: have all_props
Summary
Functions
Gets all_props from a dynamic class entry. Raises if called on a static entry.
Gets the atomic classes from an entry.
Gets the class string from an entry.
Gets the declarations from a static class entry. Raises if called on a dynamic entry.
Returns true if this is a dynamic class entry.
Creates a new dynamic class entry.
Creates a new static class entry.
Types
Functions
@spec all_props(dynamic_entry()) :: [atom()]
Gets all_props from a dynamic class entry. Raises if called on a static entry.
Gets the atomic classes from an entry.
Gets the class string from an entry.
@spec declarations(static_entry()) :: keyword()
Gets the declarations from a static class entry. Raises if called on a dynamic entry.
Returns true if this is a dynamic class entry.
@spec new_dynamic(String.t(), list(), [atom()]) :: dynamic_entry()
Creates a new dynamic class entry.
Parameters
class_string- The space-separated class namesatomic_classes- List of atomic class definitionsall_props- All properties this dynamic class can set
Examples
ClassEntry.new_dynamic("x1abc", [...], [:opacity])
@spec new_static(String.t(), list(), keyword()) :: static_entry()
Creates a new static class entry.
Parameters
class_string- The space-separated class namesatomic_classes- List of atomic class definitionsdeclarations- The original style declarations
Examples
ClassEntry.new_static("x1abc x2def", [...], [display: "flex"])