2017 © Pedro Peláez
 

silverstripe-vendormodule silverstripe-less

Wrapper for less.php to integrate LESS into SilverStripe

image

axllent/silverstripe-less

Wrapper for less.php to integrate LESS into SilverStripe

  • Tuesday, February 6, 2018
  • by axllent
  • Repository
  • 2 Watchers
  • 6 Stars
  • 1,081 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 12 Versions
  • 1 % Grown

The README.md

Less.php module for Silverstripe

A wrapper for less.php to integrate LESS into Silverstripe., (*1)

Features

  • Integrates a fork of less.php seamlessly into Silverstripe
  • Includes flushing option (?flush) to regenerate CSS stylesheets (ie. force undetected less changes with @import)
  • Writes processed *.css files into assets/_css and automatically modifies Requirements paths
  • Allows custom global variables to be passed through to less compiling (yaml configuration)
  • Automatic compression of CSS files when in live mode (may require an initial ?flush)
  • Adds any processed editor.less files to TinyMCE (must be included in your front-end template)

Requirements

  • Silverstripe ^5

Installation

composer require axllent/silverstripe-less

Usage

You need refer to your less files by their full LESS filenames (eg:stylesheet.less)., (*2)

Note: The less.php compiler transforms relative paths like url('../images/logo.png') into url('/themes/site/images/logo.png') based on the path provided as you included the files, meaning these won't work in Silverstripe due to the exposed directory structure via (_resources/...). The two simplest solutions are:, (*3)

  1. Use a variable in your less files to provide the path to your files (ie: do not use relative paths), or:
  2. Include your files using "_resources" in the path to your less file, eg: Requirements:css('_resources/themes/site/css/stylesheet.less');

Example

In your page controller:, (*4)

<?php
use SilverStripe\CMS\Controllers\ContentController;
use SilverStripe\View\Requirements;

class PageController extends ContentController
{
    public function init()
    {
        parent::init();
        Requirements:css('themes/site/css/stylesheet.less');
    }
}

Or via template, (*5)

<% require themedCSS("layout.less") %>

The generated HTML will point automatically to the processed CSS file in assets/_css rather than the original less file location, for example, (*6)

<link rel="stylesheet" type="text/css"  href="/assets/_css/themes-site-css-stylesheet.css?m=123456789" />

Further documentation

The Versions

06/02 2018

dev-master

9999999-dev https://github.com/axllent/silverstripe-less

Wrapper for less.php to integrate LESS into SilverStripe

  Sources   Download

MIT The MIT License (MIT)

The Requires

 

css silverstripe less lessphp less.php

06/02 2018

dev-silverstripe3

dev-silverstripe3 https://github.com/axllent/silverstripe-less

Wrapper for less.php to integrate LESS into SilverStripe

  Sources   Download

MIT The MIT License (MIT)

The Requires

 

css silverstripe less lessphp less.php

17/10 2017

2.0.7

2.0.7.0 https://github.com/axllent/silverstripe-less

Wrapper for less.php to integrate LESS into SilverStripe

  Sources   Download

The MIT License (MIT)

The Requires

 

css silverstripe less lessphp less.php

04/10 2017

2.0.6

2.0.6.0 https://github.com/axllent/silverstripe-less

Wrapper for less.php to integrate LESS into SilverStripe

  Sources   Download

The MIT License (MIT)

The Requires

 

css silverstripe less lessphp less.php

04/09 2017

2.0.5

2.0.5.0 https://github.com/axllent/silverstripe-less

Wrapper for less.php to integrate LESS into SilverStripe

  Sources   Download

The MIT License (MIT)

The Requires

 

css silverstripe less lessphp less.php

29/08 2017

2.0.4

2.0.4.0 https://github.com/axllent/silverstripe-less

Wrapper for less.php to integrate LESS into SilverStripe

  Sources   Download

The MIT License (MIT)

The Requires

 

css silverstripe less lessphp less.php

04/07 2017

2.0.3

2.0.3.0 https://github.com/axllent/silverstripe-less

Wrapper for less.php to integrate LESS into SilverStripe

  Sources   Download

The MIT License (MIT)

The Requires

 

css silverstripe less lessphp less.php

24/03 2017

2.0.2

2.0.2.0 https://github.com/axllent/silverstripe-less

Wrapper for less.php to integrate LESS into SilverStripe

  Sources   Download

The MIT License (MIT)

The Requires

 

css silverstripe less lessphp less.php

08/03 2017

2.0.1

2.0.1.0 https://github.com/axllent/silverstripe-less

Wrapper for less.php to integrate LESS into SilverStripe

  Sources   Download

The MIT License (MIT)

The Requires

 

css silverstripe less lessphp less.php

03/03 2017

2.0.0

2.0.0.0 https://github.com/axllent/silverstripe-less

Wrapper for less.php to integrate LESS into SilverStripe

  Sources   Download

The MIT License (MIT)

The Requires

 

css silverstripe less lessphp less.php

30/01 2017

1.1.0

1.1.0.0 https://github.com/axllent/silverstripe-less

Wrapper for less.php to integrate LESS into SilverStripe

  Sources   Download

The MIT License (MIT)

The Requires

 

css silverstripe less lessphp less.php

05/01 2016

1.0.0

1.0.0.0 https://github.com/axllent/silverstripe-less

Wrapper for less.php to integrate LESS into SilverStripe

  Sources   Download

The MIT License (MIT)

The Requires

 

css silverstripe less lessphp less.php