Thanks for the plugins, @bartvandebiezen. I think that it can greatly improve the workflow. I have noticed some small errors (typos) in the LESS-snippet-file.
// Your main SCSS file.
$sourceFile = $root . "/assets/scss/style.scss";
@JanStieler Thanx and thank you for the first version.
I improved the Less plugin even further. Now it works with the library from Josh Schmidt. His version compiles a newer version of Less (i.e. 1.7) and his repository seems more active, compared to leafo’s repository.
unfortunately I have just a vague idea what scss / sass is all about.
I understood, that SCSS is a script language file, that is compiled with SASS (or LESS?) to become a native CSS file.
Correct?
So, if I wanted to work with this, I need to understand SCSS first?
(…and first of all, understand CSS ;))
Yes, that is correct. But it is easier than you would think. If you understand CSS, you can start with SCSS or Less right away. Just place all the CSS you have in a new file and use the file extension .scss or .less. You are now using SCSS or Less You don’t have to do anything else but you can then slowly add SCSS or Less specific features. A simple example:
SCSS variable:
$color-primary: #f00; // For less this would be '@color-primary'.
If I understood correctly, your plugin will create any .css file if there is a .scss file in the folders.
Like style.scss to style.css and custom.scss to custom.css, right?
Just uploaded a new major addition to the SCSSPHP plugin. Now you can automatically generate critical CSS, increasing the performance of your website. It works really well with my own setup
Seems to be going all fine when working in the style.less file but I can’t get the @import rule to work, in order the organize my style in several .less files. Any idea what could cause this ?
I imported the plugin in an ongoing project so I know the problem can’t come from the less syntax…
Hi All, I am brand new to Kirby and found this plugin which I think is fantastic. Thank you to the creator. I have been trying to solve an issue for a few hours now to no avail.
My issue: I apologize in advance for the length but wanted to be thorough with my attempts.
I have been trying to get Foundation 6 to work with this plugin to no avail. Here is my folder structure.
Foundation installed via Bower
bower_components
foundation-sites
jquery
what-input
scss dir
0-plugins
_example.scss
_example2.scss
_base-dir.scss (imports ex 1 & 2) 1-base
_example.scss
_example2.scss
_base-dir.scss (imports ex 1 & 2) 2-layouts
_example.scss
_example2.scss
_base-dir.scss (imports ex 1 & 2) 3-modules
_example.scss
_example2.scss
_base-dir.scss (imports ex 1 & 2) components (Foundation default)
building-blocks
_responsive-hero-section.scss
_app.scss (all imports and includes from Foundation)
_mixins.scss
_settings.scss (Foundation defaults)
_variables.scss
default.scss (plugin default)
##Steps/Attempts
Inside default.scss I have attempted to import _app.scss and I can import any of the custom *-dir.scss files, however, if any of the files contain any Foundation references I get an error, here is an example:
Fatal error: Uncaught exception ‘Leafo\ScssPhp\Exception\CompilerException’ with message ‘Undefined mixin add-foundation-colors: line: 77’ in /Users/bbird/PhpstormProjects/cbtravel.com-kirby/site/plugins/scssphp/src/Compiler.php:3296 Stack trace: #0 /Users/bbird/PhpstormProjects/cbtravel.com-kirby/site/plugins/scssphp/src/Compiler.php(1688): Leafo\ScssPhp\Compiler->throwError(‘Undefined mixin…’) #1 /Users/bbird/PhpstormProjects/cbtravel.com-kirby/site/plugins/scssphp/src/Compiler.php(1204): Leafo\ScssPhp\Compiler->compileChild(Array, Object(Leafo\ScssPhp\Formatter\OutputBlock)) #2 /Users/bbird/PhpstormProjects/cbtravel.com-kirby/site/plugins/scssphp/src/Compiler.php(3198): Leafo\ScssPhp\Compiler->compileChildrenNoReturn(Array, Object(Leafo\ScssPhp\Formatter\OutputBlock)) #3 /Users/bbird/PhpstormProjects/cbtravel.com-kirby/site/plugins/scssphp/src/Compiler.php(1368): Leafo\ScssPhp\Compiler->importFile(‘/Users/bbird/Ph…’, Object(Leafo\ScssPhp\Formatter\OutputBlock)) #4 /Users/bbird/PhpstormProjects/cbtravel.com-kirby/si in /Users/bbird/PhpstormProjects/cbtravel.com-kirby/site/plugins/scssphp/src/Compiler.php on line 3296
Any help and insight on how I can correct this issue is greatly appreciated.