/DartSassPublishPlugin

A Swift Publish plugin that compiles Sass files into CSS files using Dart swift-sas

Primary LanguageSwift

DartSassPublishPlugin

This Publish plugin compiles Sass files (.scss, .sass) into CSS files. It uses Swift Sass under the hood, which embeds the Dart Sass compiler, the primary implementation of the Sass engine.

Usage

The plugin compiles all the Sass files in a given directory:

try SomeSite().publish(using: [
    ...
    .installPlugin(.compileSass(from: "Sources/SomeSite/Theme/Stylesheets", to: "Resources/Stylesheets")),
    .copyResources(),
    ...
])

Then import the generated CSS files in your HTML code:

HTML(
    .head(
        .stylesheet("/Stylesheets/styles.css"),
    ),
    .body {
        ...
    }
)

Contributing

If you find any issues or there is any missing feature you need, please feel free to create a Pull Request.