LightningCss
module LightningCss| Assembly | Nacara.Plugin.Assets.LightningCss |
| Attributes | [<RequireQualifiedAccess>] |
Compiles the site's CSS for the browsers you name, and minifies it.
Minifying is the half you notice; the other half is Targets. Name the browsers in browserslist syntax and whatever they do not understand is rewritten - nesting flattened, color-mix() computed, prefixes added and unneeded ones dropped - so a theme can be written in modern CSS with no build step of its own.
It applies to every stylesheet the build writes. If the binary cannot be found or fails, the stylesheet ships unchanged and the build says so.
Functions and values
binaryPath (value: string option) (options: LightningCssOptions) : LightningCssOptions
binaryPath (value: string option) (options: LightningCssOptions) : LightningCssOptionsPath of an existing lightningcss binary.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |
create () : IPlugin
create () : IPluginMinify the site's CSS, with the default options.
createWith (configure: LightningCssOptions -> LightningCssOptions) : IPlugin
createWith (configure: LightningCssOptions -> LightningCssOptions) : IPluginMinify the site's CSS, configured.
| Parameter | |
|---|---|
configure | Given the defaults, the options to use. Anything it leaves alone keeps its default. |
defaults: LightningCssOptionsminifyWhileWatching (value: bool) (options: LightningCssOptions) : LightningCssOptions
minifyWhileWatching (value: bool) (options: LightningCssOptions) : LightningCssOptionsMinify while watching too.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |
registerWith (configure: LightningCssOptions -> LightningCssOptions) (site: Site) : Site
registerWith (configure: LightningCssOptions -> LightningCssOptions) (site: Site) : SiteAdd CSS minification to a site, configured.
| Parameter | |
|---|---|
configure | Given the defaults, the options to use. Anything it leaves alone keeps its default. |
site | The site being described. |
targets (value: string) (options: LightningCssOptions) : LightningCssOptions
targets (value: string) (options: LightningCssOptions) : LightningCssOptionsBrowsers to compile the CSS for, in browserslist syntax.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |