petal_components
petal_components copied to clipboard
Mix task to "eject" components
Sometimes you want to use a component as a starting point and modify it heavily.
Example: I want to modify the <.card>
component.
mix petal_components:eject card
And it generates a copy of the card
component into my live
folder.
I'll implement it in the coming months - but if someone wants to contribute just comment here and go for it
I'll implement it in the coming months - but if someone wants to contribute just comment here and go for it
maybe use @callback so user could override what he want from component and keep all helpers.
defmodule Ex do
@callback h(item) :: item when item: var
def h(x), do: IO.inspect(x)
end
defmodule E do
@behaviour Ex
def h(x), do: IO.inspect(x)
end
E.h("go")
Ex.h("sas")
Hey, yeah if you can get this working that'd be great. maybe do it for one component and see if it's viable?