PHPackages                             tractorcow/silverstripe-lessphp - 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. tractorcow/silverstripe-lessphp

ActiveSilverstripe-module[Utility &amp; Helpers](/categories/utility)

tractorcow/silverstripe-lessphp
===============================

Silverstripe module to allow use of LessCss to programatically generate CSS

3.0.x-dev(12y ago)5311PHP

Since Jun 27Pushed 8y ago3 watchersCompare

[ Source](https://github.com/tractorcow/silverstripe-lessphp)[ Packagist](https://packagist.org/packages/tractorcow/silverstripe-lessphp)[ RSS](/packages/tractorcow-silverstripe-lessphp/feed)WikiDiscussions 3.0 Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Less CSS module for Silverstripe
================================

[](#less-css-module-for-silverstripe)

This module creates a simple interface for developing [LESS](http://lesscss.org/) powered websites using Silverstripe.

LESS is a powerful API that allows you to develop CSS styles with real programming logic. This lets developers generate styles expressively, as opposed to repetitively, supporting maintainable and responsive designs.

LESS injects functionality such as variables, mixins, operations and functions.

This module is built on the [LessPhp](http://leafo.net/lessphp/) implementation of LESS.

Credits and Authors
-------------------

[](#credits-and-authors)

- Olivier Penhoat - Author -
- Damian Mooyman -

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

[](#requirements)

- SilverStripe 3.0 or above
- PHP 5.3

Installation Instructions
-------------------------

[](#installation-instructions)

- Extract all files into the 'lessphp' folder under your Silverstripe root, or install using composer

```
composer require "tractorcow/silverstripe-lessphp": "3.0.*@dev"
```

- Create a 'lesscss' directory within your themes folder (eg /themes/tractorcow/lesscss). This is where you should place all less scripts. Subthemes may have their own lesscss folders.
- Make sure that your css folder has write access on your development environment (or on your staging environment if you intend to build scripts there).
- To compile CSS files either run in development mode, or perform a manual flush with ?flush=all

Documentation
-------------

[](#documentation)

- LESS API reference can be found at

Examples
--------

[](#examples)

For more examples please see

### Variables and Nested Rules

[](#variables-and-nested-rules)

/themes/tractorcow/lesscss/typography.less.css

```
@color: #4D926F;

.typography
{
    p {
        color: @color;
    }
    h1 {
        color: @color;
    }
}

```

Will generate:

/themes/tractorcow/css/typgraphy.css

```
.typography p {
    color: #4D926F;
}
.typography h1 {
    color: #4D926F;
}

```

### Mixins (or macros)

[](#mixins-or-macros)

/themes/tractorcow/lesscss/layout.less.css

```
.rounded-corners(@radius: 5px)
{
    border-radius: @radius;
    -webkit-border-radius: @radius;
    -moz-border-radius: @radius;
}

#header {
    .rounded-corners;
}
#footer {
    .rounded-corners(10px);
}

```

Will generate:

/themes/tractorcow/css/layout.css

```
#header {
    border-radius: 5px;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
}
#footer {
    border-radius: 10px;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
}

```

License
-------

[](#license)

Copyright (c) 2013, Damian Mooyman, Olivier Penhoat All rights reserved.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- The name of Damian Mooyman and/or Olivier Penhoat may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4708d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f6a363b2d85dc3e82e73cc9e3a57fc15132920b166c5938ad63a54029b9f94b9?d=identicon)[tractorcow](/maintainers/tractorcow)

---

Top Contributors

[![tractorcow](https://avatars.githubusercontent.com/u/936064?v=4)](https://github.com/tractorcow "tractorcow (9 commits)")[![openhoat](https://avatars.githubusercontent.com/u/818737?v=4)](https://github.com/openhoat "openhoat (3 commits)")

---

Tags

silverstripelesscss

### Embed Badge

![Health badge](/badges/tractorcow-silverstripe-lessphp/health.svg)

```
[![Health](https://phpackages.com/badges/tractorcow-silverstripe-lessphp/health.svg)](https://phpackages.com/packages/tractorcow-silverstripe-lessphp)
```

###  Alternatives

[sheadawson/silverstripe-shortcodable

Provides a GUI for CMS users to insert Shortcodes into the HTMLEditorField + an API for developers to define Shortcodable DataObjects and Views

5018.1k5](/packages/sheadawson-silverstripe-shortcodable)

PHPackages © 2026

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