This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

rafau
rafau

Hi, i recently found out about OctoberCMS, and it is already awesome!

I've got just one question: does october do auto compilation of less files (like bootstrap provides) and make it to simple css production file ?

Astucieux
Astucieux

In October, a PHP version of the less compiler is included in the \vendor\oyejorge directory.

Cpt.Meatball
Cpt.Meatball

October does come with a built-in less-compiler. There is a catch though, it does not compile the newest bootstrap versions and it does not check for changes in includes (@import). For a recompile on a change in an import, you can add ; somewhere in your first file. It does not generate any errors, and the compiler will see it as a change and recompile the less to css.

Add this to your head and you'll be writing less in no time.

 <link href="{{ [
        'assets/less/theme.less'
    ]|theme }}" rel="stylesheet">

Keep in mind that you can add multiple less files like:

 <link href="{{ [
        'assets/less/theme.less',
        'assets/less/layout/main.less',
        '....',
    ]|theme }}" rel="stylesheet">

Last updated

humpback
humpback

Hi i am using blank bootstrap theme as starter. If you're changing the variables.less, theme.less, are you allowed to add somthing like this?

<link href="{{ [
            'assets/less/app.less',
            'assets/less/site/theme.less',
            'assets/vendor/bootstrap/less/theme.less',
            'assets/vendor/bootstrap/less/variables.less'
        ]|theme }}" rel="stylesheet">

Last updated

Cpt.Meatball
Cpt.Meatball

Yeah, seems about right.

kh_october13612
kh_october13612

Is it possible to do something like this ?

    <link href="{{ [
        'assets/less/app.less',
        'assets/less/site/theme.less',
        'assets/vendor/bootstrap/less/theme.less',
        '@nice-blue: #5B83AD; @color: #4D926F'
    ]|theme }}" rel="stylesheet">

Last updated

pratyushpundir6424
pratyushpundir6424

My 2 cents here, Gulp/Grunt might be a bit more flexible and you won't have to worry about imports not being watched.

JeffGoldblum
JeffGoldblum

@kh_october13612, I don't believe so - the asset combiner only accepts paths to files as arguments.

@pratyushpundir6424 October now supports watching imports, along with compilation of SCSS files as long as you enable

    /*
    |--------------------------------------------------------------------------
    | Check import timestamps when combining assets
    |--------------------------------------------------------------------------
    |
    | If deep hashing is enabled, the combiner cache will be reset when a change
    | is detected on imported files, in addition to those referenced directly.
    | This will cause slower page performance. If set to null, assets are
    | minified, when debug mode (app.debug) is disabled.
    |
    */

    'enableAssetDeepHashing' => true,

in config/cms.php

pratyushpundir6424
pratyushpundir6424

@LukeTowers - Oooh nice! Thanks for sharing. Completely missed reading that docBlock in config.

vs16509
vs16509

Laravel has elixir for compile assets without problems. )))

Very simple setup for gulpfile.js:

var elixir = require('laravel-elixir');

elixir(function(mix){
  mix.less('./themes/itmoko/assets/less/vendor.less', './themes/itmoko/assets/css/vendor.css');
  mix.less('./themes/itmoko/assets/less/theme.less', './themes/itmoko/assets/css/theme.css');
});

Last updated

Algad
Algad

In my personal case I compile less files with Grunt. You can aslo use "koala" less compiler.

1-11 of 11

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.