View Source Beacon.RuntimeCSS behaviour (Beacon v0.2.2)
Compiles the CSS for a site using the compiler defined in Beacon.Config.css_compiler/0
Beacon supports Tailwind by default implemented by Beacon.RuntimeCSS.TailwindCompiler
,
you can use that module as template to implement any ther CSS engine as needed.
Summary
Callbacks
Executes the compilation to generate the CSS for the site using the provided :css_compiler
in Beacon.Config
.
Returns the CSS compiler config.
Functions
Returns the URL to fetch the CSS config used to generate the site stylesheet.
Callbacks
@callback compile(site :: Beacon.Types.Site.t()) :: {:ok, String.t()} | {:error, any()}
Executes the compilation to generate the CSS for the site using the provided :css_compiler
in Beacon.Config
.
@callback config(site :: Beacon.Types.Site.t()) :: String.t()
Returns the CSS compiler config.
For Tailwind that would be the content of the tailwind config file,
or return an empty string ""
if the provided engine doesn't have a config file.
Functions
@spec asset_url(Beacon.Types.Site.t()) :: String.t()
Returns the URL to fetch the CSS config used to generate the site stylesheet.