PHPackages                             rickry/laravel-sass - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rickry/laravel-sass

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rickry/laravel-sass
===================

Compiles your Sass .scss files to .css every time you run your app (in development)

12PHP

Since Oct 18Pushed 6y ago1 watchersCompare

[ Source](https://github.com/rickry/laravel-sass)[ Packagist](https://packagist.org/packages/rickry/laravel-sass)[ RSS](/packages/rickry-laravel-sass/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-sass
============

[](#laravel-sass)

Automatic Sass-to-CSS compiling for Laravel 4 (and any other framework by the way) while being in development. Every time you run your app (hitting index.php) laravel-sass will automatically compile all .scss files in your scss folder to .css files in your css folder. Support latest version of Sass (scss syntax) and mixins. Boom!

Installation &amp; Usage
------------------------

[](#installation--usage)

Add this to your composer.json, please note that this is a **require-dev**, not a normal **require**. This devides real dependencies from ones you only need for local development.

```
"require-dev": {
    "rickry/laravel-sass": "1.0"
}
```

Add this line into your `public/index.php` in Laravel, right **before** `$app->run();`.

```
SassCompiler::run("../resources/sass/", "css/");
```

The first parameter is the relative path to your scss folder (create one) and the second parameter is the relative path to your css folder. Usually it totally makes sense to create those folders in the public folder. Make sure PHP can write into the css folder by giving the folder `sudo chmod -R 777 public/css` (when being in /var/www). **Note:** 777 is just for development, in a production server there's no need to give that folder any write-rights.

Install or update your Composer dependencies to add laravel-sass by doing `composer install` or `composer update`. Composer automatically installs everything in require-dev by default.

**IMPORTANT:** When you later deploy your application and don't want to install the require-dev stuff, then do `composer install --no-dev` (or `composer update --no-dev`).

Optional feature
----------------

[](#optional-feature)

There's an optional third parameter for `SassCompiler::run()` that expects one of the strings explained on [http://leafo.net/scssphp/docs/#output\_formatting](http://leafo.net/scssphp/docs/#output_formatting). This defines the desired output. `scss_formatter` is the standard laravel-sass uses, choose `scss_formatter_compressed` if you need a minimized css file. `scss_formatter_nested` is for nested output, optimized for readability.

Testing
-------

[](#testing)

To test if everything works okay, simply add this to the head of `app/views/hello.php`: `` and put a file called style.scss in your scss folder. Now run the app and play around with the (s)css rules in your style.scss, after each refresh you should see the changes instantly!

How @import works
-----------------

[](#how-import-works)

The `@import` of sass rules from other files works now perfectly. Make sure to import the files like it should be: If the file is called \_colors.scss and is in the basic scss folder:

```
@import 'colors';

```

If the file is called \_colors.scss and is in the subfolder `modules` of the basic scss folder:

```
@import 'modules/colors';

```

Read the official docs for more.

When deploying ...
------------------

[](#when-deploying-)

.. then make sure you comment out this line again: `SassCompiler::run("../resources/sass/", "css/");`. Future releases of this tool will have a development/production switch/recognizer.

To use the very latest features of Sass:
----------------------------------------

[](#to-use-the-very-latest-features-of-sass)

Currently php-sass fetches v0.0.14 (August 2014) of *leafo/scssphp* as a compiler. For latest features you might want a newer version, so have a look here  and edit the composer.json accordingly.

Used scripts
------------

[](#used-scripts)

This tool uses the excellent [scssphp Sass compiler](http://leafo.net/scssphp/). scssphp supports the latest SCSS syntax (3.2.12).

License
-------

[](#license)

Licensed under [MIT](http://www.opensource.org/licenses/mit-license.php). Totally free for private or commercial projects.

Support
-------

[](#support)

If you think this script is useful, then think about supporting the project by renting your next server at [Host1Plus](https://affiliates.host1plus.com/ref/devmetal/36f4d828.html) or [DigitalOcean](https://www.digitalocean.com/?refcode=40d978532a20).

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/066d0a90eb5cb27ea2c28bb3e6c4283e8a392ec7dc6744d813bb0d84b49b657f?d=identicon)[Rickry](/maintainers/Rickry)

---

Top Contributors

[![AshFieldJumper](https://avatars.githubusercontent.com/u/19998639?v=4)](https://github.com/AshFieldJumper "AshFieldJumper (5 commits)")

### Embed Badge

![Health badge](/badges/rickry-laravel-sass/health.svg)

```
[![Health](https://phpackages.com/badges/rickry-laravel-sass/health.svg)](https://phpackages.com/packages/rickry-laravel-sass)
```

###  Alternatives

[spatie/laravel-analytics

A Laravel package to retrieve Google Analytics data.

3.2k5.7M57](/packages/spatie-laravel-analytics)[spatie/period

Complex period comparisons

1.7k4.0M10](/packages/spatie-period)[contributte/di

Extra contrib to nette/di

465.8M18](/packages/contributte-di)[slince/composer-registry-manager

Composer mirrors manager

56314.9k](/packages/slince-composer-registry-manager)[hyva-themes/magento2-graphql-tokens

Adds Customer and Cart tokens to CustomerData sections

242.6M2](/packages/hyva-themes-magento2-graphql-tokens)[kenepa/banner

Displays a informative banner to users

9430.1k2](/packages/kenepa-banner)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
