PHP code example of websemantics / lcss2php

1. Go to this page and download the library: Download websemantics/lcss2php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

websemantics / lcss2php example snippets


$files = ['/usr/etc/variables.less', '/usr/etc/_variables.scss'];

$lcss2php = new Lcss2php($files);

$variables = $lcss2php->all();

$variables = (new Lcss2php($files))->ignore(['Color', 'Dimension'])->all();

[
  "green" => "#24ce7b"
  "blue" => "#38b5e6"
  "orange" => "#f48714"
  "red" => "#f6303e"
  "brand-success" => "#24ce7b"
  "brand-info" => "#38b5e6"
  "brand-warning" => "#f48714"
  "brand-danger" => "#f6303e"
  "spacer" => "1rem"
  "spacer-x" => "1rem"
  "spacer-y" => "1rem"
]