Giter Site home page Giter Site logo

scss's People

Contributors

christianwilling avatar christianwillingbgpemedia avatar jo-nas avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cristianoap

scss's Issues

Stopped working?

Is it just me, or did this plugin just simply stopped working?

I had been working on a project and everything worked fine. Now i started working on a new project, i install the plugin and it simply does not work.

<link href="{{ [ 'assets/scss/base.scss' ]|theme }}" rel="stylesheet"> ( the file is there, no problem ) generates a stylesheet in combine, like always, but when try to open that in dev inspect i get a 500 error.

Relative paths for images

Hello,
I get the feeling that there some issues with relative paths for the images inside the scss.

How I include main main scss file
<link href="{{ ['assets/scss/main.scss']|theme }}" rel="stylesheet">

One of my sub scss files has the following declaration:
background-image: url('../img/header_slider_1.png');

The system tells me though:
http://domain.com/img/header_slider_1.png 404 (Not Found)

While the image is in:
domain.com/public/themes/rainlab-vanilla/assets/img
the scss file is in
domain.com/public/themes/rainlab-vanilla/assets/scss
and which includes some files in the sub foldersm, the folder structure is:
image

FatalErrorException after update to 1.1.4

FatalErrorException in Plugin.php line 3:
October\Rain\Support\ClassLoader::main(): Failed opening required '/var/www/vhosts/xxxxxxxxx.com/public/plugins/willing/scssvendor/autoload.php' (include_path='.:/opt/plesk/php/7.0/share/pear')

Undefined variable $theme-folder

The newest version dropped this error on me:

An exception has been thrown during the rendering of a template ("Undefined variable $theme-folder: line: 2").

unhandled error occurred

Class 'Willing\Scss\Classes\ScssFilter' not found
/var/www/vhosts/xxxx.com/public/plugins/willing/scss/Plugin.php line 44

TYPE
Twig Template

EXCEPTION
Symfony\Component\Debug\Exception\FatalThrowableError


        \System\Classes\CombineAssets::registerCallback(function($combiner) use (&$files){
            if ($combiner->useMinify) {
                $combiner->registerFilter('scss', new \October\Rain\Support\Filters\StylesheetMinify);
            }
            //init the filter class with the reverrence to the hash files
            $filter = new \Willing\Scss\Classes\ScssFilter($files);

            //set the output formate
            $filter->setFormatter('Leafo\ScssPhp\Formatter\Expanded');

            //set some helpfull variables
            $filter->setVariables([

Changing scss file is not cause assets recombine

I wrote this in layout file

<link href="{{ [
            'assets/styles/normalize.css/normalize.css',
            'assets/styles/animate.css/animate.css',
            'assets/styles/font-awesome/font-awesome.css',
            'assets/styles/app.scss'
        ] | theme }}" rel="stylesheet">

If I change something in css-file or scss from list above and update some project page - the changes displays, if I change file imported from app.scss - no.
I think changing of imported scss files is not cause assets recombine

app.scss

@import "layout/variables";
@import "layout/functions";
@import "layout/mixins";
@import "layout/reset";
@import "layout/keyframes";

[Feature] Make October theme setting variables available in this plugin

Is there interest to make October theme setting variables available in this plugin and would you accept such a pull request?

I prefer to ask before I'm working, I did something similar for another CMS:

<?
/**
 * Compile SCSS with injected variables
 * @see http://sass-lang.com/guide
 * @author Pascal Garber <[email protected]>
 */
require __DIR__."/vendor/autoload.php";
class Css
{

    private $scss = null;

    function __construct()
    {
        $this->scss = new Leafo\ScssPhp\Compiler();
    }

    /**
     * Generates a SASS string with all variables
     *
     * @param $varArray Array of all variables which should be available in SCSS
     * @return SCSS string with variables
     */
    private function setVariables($varArray)
    {
        $scss_variables_string = '';
        // Variablen-Array durchlaufen und..
        foreach($varArray as $variablePrefix => $vars)
        {
            // Alle Variablen in $var unter SASS verfuegbar machen
            foreach($vars as $key => $value)
            {
                // nur wenn es kein index wert ist
                if(!is_numeric($key))
                {
                    if(is_numeric($value) || is_string($value))
                    {
                        // is Number or String
                        $scss_variables_string.= '$'.$variablePrefix.'_'.$key.': '.$value.";\n";
                    }
                }
            }
            $scss_variables_string .= "\n";
        }
        return $scss_variables_string; 
    }

    /**
     * Generates a SASS string with imports
     *
     * @param $importsArray Array of all SCSS files with should be imported
     * @return SCSS string with imports
     */
    private function setImports($importsArray)
    {
        $scss_imports_string = '';
        foreach($importsArray as $index => $importPath)
        {
            $scss_imports_string .= "@import '".$importPath."';\n";
        }
        return $scss_imports_string; 
    }

    /**
     * Compile SCSS to CSS string with all variables and imports
     *
     * @param $name Name of the style for more information
     * @param $varArray Array of all variables which should be available in SCSS
     * @param $importsArrayArray of all SCSS files with should be imported
     * @return CSS string
     */
    public function compile($name, $varArray, $importsArray)
    {
        /**
         * Variables for SASS
         */
        $scss_variables_string = $this->setVariables($varArray);

        /**
         * .scss imports
         */
        $scss_imports_string = $this->setImports($importsArray);

        /**
         * Generates a comment for more information
         */
        $css_result = "/**\n * Compiled with SCSS\n * \n * @name $name\n * @see http://sass-lang.com/guide/\n */\n\n";

        /**
         * Generates a comment to the see available variables
         */
        $css_result.= "/*\n\nAvailable variables:\n================\n".$scss_variables_string."\n*/\n\n";

        /**
         * Generates a comment to the see imports
         */
        $css_result.= "/*\n\nVerwendete Imports:\n================\n".$scss_imports_string."\n*/\n\n";

        /**
         * Compiled CSS
         */
        // echo ($scss_variables_string."\n".$scss_imports_string);
        $css_result .= $this->scss->compile($scss_variables_string."\n".$scss_imports_string);
        return $css_result;
    }
}
?>

Best wishes,
Pascal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.