https://github.com/r-thomson/swiftysass
A LibSass wrapper for Swift
https://github.com/r-thomson/swiftysass
libsass libsass-wrapper swift swift-library swift-package-manager
Last synced: 8 months ago
JSON representation
A LibSass wrapper for Swift
- Host: GitHub
- URL: https://github.com/r-thomson/swiftysass
- Owner: r-thomson
- License: apache-2.0
- Archived: true
- Created: 2020-04-08T01:58:04.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-11T04:34:45.000Z (over 5 years ago)
- Last Synced: 2025-09-24T00:32:44.674Z (8 months ago)
- Topics: libsass, libsass-wrapper, swift, swift-library, swift-package-manager
- Language: Swift
- Homepage:
- Size: 76.2 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# SwiftySass
A [LibSass](https://github.com/sass/libsass) wrapper for Swift. SwiftySass allows you to compile Sass code from Swift.
[](https://github.com/r-thomson/SwiftySass)
[](https://github.com/r-thomson/SwiftySass/releases)
[")](https://github.com/r-thomson/SwiftySass/actions)
**[As of October 2020, LibSass is deprecated](https://sass-lang.com/blog/libsass-is-deprecated).** I am unsure what that currently means for the future of this project. For the time being, I am not planning on continuing work on SwiftySass.
## Installation
First, you need to have LibSass installed on your system. SwifySass expects the installation to be located at `/usr/local/include/`. Using [Homebrew](https://brew.sh) is suggested:
```sh
brew install libsass
```
SwiftySass can be installed using [Swift Package Manager](https://swift.org/package-manager/). To use SwiftySass in a project, add it to the `dependencies` section in your project’s `Package.swift`:
```swift
.package(url: "https://github.com/r-thomson/SwiftySass", from: "0.3.0")
```
## Usage
```swift
import SwiftySass
// Compile from a string...
let scss = """
$primary-color: #222;
body {
color: $primary-color;
}
"""
var css = try? compileSass(fromSource: scss)
// ...or from a file
let fileURL = URL(fileURLWithPath: "./style.scss")
css = try? compileSass(fromFile: fileURL)
```