PHPackages                             rllngr/kirby-scssizer - 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. rllngr/kirby-scssizer

ActiveKirby-plugin

rllngr/kirby-scssizer
=====================

Kirby plugin — SCSS compiler powered by scssphp, no Node.js or Ruby required

1.0.1(yesterday)03↑2900%MITPHPPHP &gt;=8.1

Since Apr 3Pushed yesterdayCompare

[ Source](https://github.com/RLLNGR/kirby-scssizer)[ Packagist](https://packagist.org/packages/rllngr/kirby-scssizer)[ Docs](https://github.com/RLLNGR/kirby-scssizer)[ RSS](/packages/rllngr-kirby-scssizer/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

kirby-SCSSizer
==============

[](#kirby-scssizer)

A Kirby CMS plugin that compiles SCSS to CSS on the fly — no Node.js or Ruby required. Part of the **rllngr** plugin set.

Features
--------

[](#features)

- Compiles SCSS to CSS automatically on every request (only when source has changed)
- Two modes: explicit file mapping or per-template compilation
- Expanded output in debug mode, compressed in production — no config needed
- Change detection across all imported partials (`@use`, `@forward`, `@import`)
- SCSS variables injectable from `config.php`
- Built-in Kirby snippet and page method — place it anywhere in your templates
- Powered by [scssphp](https://github.com/scssphp/scssphp) (pure PHP, no external dependencies)

Requirements
------------

[](#requirements)

- Kirby 3.9+
- PHP 8.1+

Installation
------------

[](#installation)

**Via Composer** (recommended — installs automatically into `site/plugins/`):

```
composer require rllngr/kirby-scssizer
```

**Manually** — download or clone into `site/plugins/kirby-scssizer`, then run `composer install` inside the folder.

Configuration
-------------

[](#configuration)

In `site/config/config.php`:

```
return [
    'rllngr.kirby-scssizer' => [

        // Explicit file pairs: SCSS source => CSS output (paths relative to Kirby root)
        'files' => [
            'assets/scss/main.scss' => 'assets/css/main.css',
        ],

        // Per-template mode: compiles {scssDir}/{template}.scss → {cssDir}/{template}.css
        'templates' => [
            'scssDir' => 'assets/scss',
            'cssDir'  => 'assets/css',
            'default' => 'default', // fallback when no template-specific file exists
        ],

        // Additional @use / @import search paths
        'importPaths' => [],

        // SCSS variables to inject (without the leading $)
        'variables' => [
            'color-primary' => '#3490dc',
        ],

        // 'expanded' | 'compressed' | null (null = auto from Kirby debug flag)
        'outputStyle' => null,

        // true | false | null (null = auto: enabled in debug, disabled in production)
        'autoCompile' => null,
    ],
];
```

Usage
-----

[](#usage)

### Explicit files

[](#explicit-files)

Declare your source/output pairs in `files`. Compilation is triggered automatically — use Kirby's `css()` helper to include the output:

```
