connectthink / wp-scss Goto Github PK
View Code? Open in Web Editor NEWWordpress Plugin that compiles sass using scssphp
Home Page: http://wordpress.org/plugins/wp-scss/
Wordpress Plugin that compiles sass using scssphp
Home Page: http://wordpress.org/plugins/wp-scss/
The generated CSS file puts all CSS comments at the top rather then inline. Is there anyway to keep the comments with the corresponding CSS?
Thanks!
Hello,
I just download the plug-in and am very excited to start working with it. One hitch I ran into was the support for Bourbon appears to be somewhat old. I downloaded the latest version of Bourbon, but ran into some SASS compiling errors. I was able to fix them so far by using Bourbon v3.2.4, but the Bourbon team is now on v4.2.0 stable and actively working on v5.0.
I imagine that your support is limited by the PHP-based SASS compiler used behind the scenes, but didn't know if there was an update there.
Thanks!
Just curious why the compiler is such an old version? Looks like the v0.0.12 being used here was released in July 2014 and leafo/scssphp is up to v0.6.3 as of this January. That's over 25 release behind.
Did something creep in along the way that does not play well with WordPress or this plugin?
When updating the plugin in WordPress from version 1.1.9 to 1.2.2., the site crashes and gives Fatal Error.
Alright, so the plugin is installed, my directories are created, and the settings have been set (screenshots below). I'm getting an error, which you'll see in the shots as well.
I may continue playing with this, and if there's a substantial change in behavior, I'll update this issue.
This plugin doesn't appear to work at all. No css files appear in my css directory. No error messages appear on screen. The only file that gets created is stylesheets/csscssload_partial_stylesheets.css which is an empty file (0 bytes). I also notice that functions.php has not been updated to enqueue anything.
I have also tried updating phpscss as suggested in #39
The method I used to try to update phpscss was as follows:
This didn't make any difference.
My theme is Divi from elegantthemes.com and I am using a Child Theme created by https://wordpress.org/plugins/child-theme-configurator/
My directory tree underneath /wp-content/themes/Divi-child is as follows:
I am attaching my files so hopefully you can rule out errors in my scss files.
Divi-child/styles.css
/*
Theme Name: Divi Child
Theme URI: http://www.elegantthemes.com/gallery/divi/
Template: Divi
Author: Elegant Themes
Author URI: http://www.elegantthemes.com
Description: Smart. Flexible. Beautiful. Divi is the most powerful theme in our collection.
Tags: responsive-layout,one-column,two-columns,three-columns,four-columns,left-sidebar,right-sidebar,custom-background,custom-colors,featured-images,full-width-template,post-formats,rtl-language-support,theme-options,threaded-comments,translation-ready
Version: 2.7.1.1460076929
Updated: 2016-04-08 00:55:29
*/
--- End of file ---
Divi-child/functions.php
Hi,
It's appear that wp-scss desn't support the random function.
Where to manally register this new function in the plugin ?
thanks
Is there a way to generate and integrate a sourcemap in the compiled css? Not having the .scss line number for the style in question in Developer Tools is a deal-breaker to my workflow.
Great plugin otherwise! Sourcemaps integration would make this thing perfect!
So I'm currently this plugin on Pantheon(it's a nice platform for WP sites) and I get a compile error.
/wp-plugins/wp-scss/cache/
"File Permission Error, permission denied. Please make the cache directory writable."
Is the cache directory generated by the plugin? Or does it generate it somewhere else?
I tried changing the permission settings of the folder above to writable and it's not working.
I would like to hardcode the WP-SCSS Settings without altering plugin files. I don't want them to be user/admin editable. Can't quite wrap my head around how to do this.
Thanks
J
Hi!
I was wondering if there is a possibility to use WP-SCSS from theme and not as a standalone plugin?
Just upgraded to Wordpress 4.0, and my site is no longer responsive - it just rescales to page width. I'm using the Bones theme.
However if I deactivate WP-SCSS, the site is then responsive again. Any help appreciated
When i try to use Bootstrap 4,
I receive a parsing error for the _variables.scss line 63
$spacers: ( 0: ( x: 0, y: 0 ), 1: ( x: $spacer-x, y: $spacer-y ), 2: ( x: ($spacer-x * 1.5), y: ($spacer-y * 1.5) ), 3: ( x: ($spacer-x * 3), y: ($spacer-y * 3) ) ) !default;
Internet tells I should use the last version of scssphp, but i can't do the changes in the plugin :/
Thx in advance :)
I've started to write this issue report 6 times now in 4 days, but every time I do, I think of some other test I can run to ensure it's just me and that I'm not wasting anyone's time. So, now that that's been said...
This issue began after I ran WP-CLI's doctor check on a newly-launched website. WP-SCSS plugin version 1.2.2 and 1.2.1. Haven't had time to check other versions.
$ wp doctor check --all
Running checks 76 % [==================================================================================================================================> ] 0:03 / 0:05PHP Fatal error: Uncaught Error: Call to a member function needs_compiling() on null in /srv/users/REDACTED/apps/production/public/wp-content/plugins/wp-scss/wp-scss.php:167
Stack trace:
#0 /srv/users/REDACTED/apps/production/public/wp-includes/class-wp-hook.php(298): wp_scss_needs_compiling('')
#1 /srv/users/REDACTED/apps/production/public/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
#2 /srv/users/REDACTED/apps/production/public/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#3 /srv/users/REDACTED/apps/production/public/wp-includes/general-template.php(2574): do_action('wp_head')
#4 /srv/users/REDACTED/apps/production/public/wp-content/themes/REDACTED/header.php(14): wp_head()
#5 /srv/users/REDACTED/apps/production/public/wp-includes/template.php(684): require_once('/srv/users/serv...')
#6 /srv/users/REDACTED/apps/production/public/wp-includes/template.php(643): load_template('/srv/users/serv...', true)
#7 /srv/users/REDACTED/apps/production/public/wp-includes/genera in /srv/users/REDACTED/apps/production/public/wp-content/plugins/wp-scss/wp-scss.php on line 167
Fatal error: Uncaught Error: Call to a member function needs_compiling() on null in /srv/users/REDACTED/apps/production/public/wp-content/plugins/wp-scss/wp-scss.php:167
Stack trace:
#0 /srv/users/REDACTED/apps/production/public/wp-includes/class-wp-hook.php(298): wp_scss_needs_compiling('')
#1 /srv/users/REDACTED/apps/production/public/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
#2 /srv/users/REDACTED/apps/production/public/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#3 /srv/users/REDACTED/apps/production/public/wp-includes/general-template.php(2574): do_action('wp_head')
#4 /srv/users/REDACTED/apps/production/public/wp-content/themes/REDACTED/header.php(14): wp_head()
#5 /srv/users/REDACTED/apps/production/public/wp-includes/template.php(684): require_once('/srv/users/serv...')
#6 /srv/users/REDACTED/apps/production/public/wp-includes/template.php(643): load_template('/srv/users/serv...', true)
#7 /srv/users/REDACTED/apps/production/public/wp-includes/genera in /srv/users/REDACTED/apps/production/public/wp-content/plugins/wp-scss/wp-scss.php on line 167
<!DOCTYPE html>
[OTHER HEAD OUTPUT HERE]
<link rel="alternate" type="text/xml+oembed" href="https://www.REDACTED.com/wp-api/oembed/1.0/embed?url=https%3A%2F%2Fwww.REDACTED.com%2F&format=xml" />
[DOCTOR CHECK ENDS ABRUPTLY HERE]
Here's the output from wp_head()
...
WP_Hook Object
(
[callbacks] => Array
(
[1] => Array
(
[_wp_render_title_tag] => Array
(
[function] => _wp_render_title_tag
[accepted_args] => 1
)
[wp_enqueue_scripts] => Array
(
[function] => wp_enqueue_scripts
[accepted_args] => 1
)
[noindex] => Array
(
[function] => noindex
[accepted_args] => 1
)
[wp_post_preview_js] => Array
(
[function] => wp_post_preview_js
[accepted_args] => 1
)
[eventorganiser_cgmp_workaround] => Array
(
[function] => eventorganiser_cgmp_workaround
[accepted_args] => 1
)
)
[2] => Array
(
[wp_resource_hints] => Array
(
[function] => wp_resource_hints
[accepted_args] => 1
)
)
[8] => Array
(
[wp_print_styles] => Array
(
[function] => wp_print_styles
[accepted_args] => 1
)
)
[9] => Array
(
[wp_print_head_scripts] => Array
(
[function] => wp_print_head_scripts
[accepted_args] => 1
)
)
[10] => Array
(
[adjacent_posts_rel_link_wp_head] => Array
(
[function] => adjacent_posts_rel_link_wp_head
[accepted_args] => 0
)
[locale_stylesheet] => Array
(
[function] => locale_stylesheet
[accepted_args] => 1
)
[rel_canonical] => Array
(
[function] => rel_canonical
[accepted_args] => 1
)
[wp_shortlink_wp_head] => Array
(
[function] => wp_shortlink_wp_head
[accepted_args] => 0
)
[_custom_logo_header_styles] => Array
(
[function] => _custom_logo_header_styles
[accepted_args] => 1
)
[wp_oembed_add_discovery_links] => Array
(
[function] => wp_oembed_add_discovery_links
[accepted_args] => 1
)
[wp_oembed_add_host_js] => Array
(
[function] => wp_oembed_add_host_js
[accepted_args] => 1
)
[wp_scss_needs_compiling] => Array
(
[function] => wp_scss_needs_compiling
[accepted_args] => 1
)
[GFForms::load_admin_bar_styles] => Array
(
[function] => Array
(
[0] => GFForms
[1] => load_admin_bar_styles
)
[accepted_args] => 1
)
[wp_admin_bar_header] => Array
(
[function] => wp_admin_bar_header
[accepted_args] => 1
)
[_admin_bar_bump_cb] => Array
(
[function] => _admin_bar_bump_cb
[accepted_args] => 1
)
)
[99] => Array
(
[wp_site_icon] => Array
(
[function] => wp_site_icon
[accepted_args] => 1
)
)
[101] => Array
(
[wp_custom_css_cb] => Array
(
[function] => wp_custom_css_cb
[accepted_args] => 1
)
)
)
[iterations:WP_Hook:private] => Array
(
)
[current_priority:WP_Hook:private] => Array
(
)
[nesting_level:WP_Hook:private] => 0
[doing_action:WP_Hook:private] =>
)
My guess is an argument isn't being passed. Plugin works fine, BTW. That makes it even more baffling.
Hi, I'm trying to pass some fields set in the WP options page to the SCSS using the wp_scss_variables filter.
The issue is they are image paths ( for background image changing ) and the compiler seems to strip out characters such as .png, .jpg, // and so on.
Can I turn off this "sensitization"?
Thanks. Otherwise it's a good plugin if you are not using Gulp or Grunt.
fixed my issue. It wasn't related to your software.
Has anyone else experienced issues compiling Foundation 6 using wp-scss. Getting compiling errors that seem to change from time to time. It looks like issues with variables in flex grid and gris scss files.
It looks like scssphp has had this issue reported but no sign of life over there.
Anyone come up with a fix?
Great idea but it feels a bit unstable and gives compile errors on stuff that would compile offline, seems sporadical aswell.
For example, if i put a mixin in one file and try to use it in another (both files are @import:ed) it seems to not find the mixin. If i move it to the same file as where i try to use, it works.
Any ideas?
This error happened after I updated the plugin and saved an .scss file:
Fatal error: Class 'scss_formatter' not found in activeoahu.dev\wp-content\plugins\wp-scss\scssphp\src\Compiler.php on line 189
Most of my pages don't load anymore due to this error that looks to originate with the WP-SCSS plugin. I haven't been able to find anything online about this issue, but if you can point me in the right direction I can hopefully figure it out.
Any help would be appreciated.
Thanks!
-Mike
I installed the plugin and upon adding the directories I get this error (I've replaced my URL with [BASE_URL]:
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct([BASE_URL]/wp-content/themes/15SPRK001-sparksite-wp/scss/foundation.scss): failed to open dir: Not a directory' in [BASE_URL]/wp-content/plugins/wp-scss/class/class-wp-scss.php:139 Stack trace: #0 [BASE_URL]/wp-content/plugins/wp-scss/class/class-wp-scss.php(139): RecursiveDirectoryIterator->__construct('/home/indclient...') #1 [BASE_URL]/wp-content/plugins/wp-scss/wp-scss.php(153): Wp_Scss->needs_compiling() #2 [BASE_URL]/wp-settings.php(215): include_once('/home/indclient...') #3 [BASE_URL]/wp-config.php(96): require_once('/home/indclient...') #4 [BASE_URL]/wp-load.php(29): require_once('/home/indclient...') #5 [BASE_URL]/wp-admin/admin.php(31): require_once('/home/indclient...') #6 /home/indclient/sample in [BASE_URL]/wp-content/plugins/wp-scss/class/class-wp-scss.php on line 139
The SCSS is just ZURB's Foundation framework and complies fine on my machine. I'm just not understanding the error, thanks!
Hi
I am receiving this message, I copied the permissions model from other installation but in this particular site I can't solve it:
/wp-plugins/wp-scss/cache/
"File Permission Error, permission denied. Please make the cache directory writable."
Thanks in advance for your help.
Hi,
Would it be possible to tag the releases either in Github or Wordpress' SVN repo? I would like to pull v1.1.8 using composer rather than "dev-master" and getting potential breaky updates.
Thanks for your work, this is helping me with a new project, specifically the ability to define SASS variables with Wordpress.
Marc
Breaking out issue reported by @raulillana in issue #8
Changes in a subfolder in the scss directory do not trigger compilation.
Hi,
I had some trouble compiling some advanced scss code. After manually updating the phpscss version included in this plugin to the latest available (0.1.7) it works perfectly.
Please update the phpscss version which ships with this great plugin, such that it is not required any more to update it manually.
Latest version available here: https://github.com/leafo/scssphp/releases/tag/v0.1.7
In case someone wants to verify the problem with the currently included version: Try to compile the font face mixin defined in this article: http://clubmate.fi/scss-font-face-mixin/
Can we get the plugin updated to the latest? I can manually overwrite the plugin files with what's here on github and it works great, but it is a pain to have to manually update on every single site.
I'm running WAMP server with WordPress 4.3.1. I've installed underscores as my theme, sassified. My Scss Location is set to /sass/ and my CSS location is set to /
For some reason, making changes to the partials and saving them is not causing WP-SCSS to recompile. I looked in my sass folder for a log file but did not see one. Any ideas why it's not recompiling?
Thanks in advance for any help!
So, it looks like I can't make lists that are key:value pairs. Ex.
$primary-nav: (
padding-top: .2em,
margin-top: .2em,
line-height: 1.3,
);
Just checking if this is the case for you as well.
I've tried this plugin on two websites now so far, and it's worked wonderfully, except for one thing: if I set the CSS location to /
— that is, the theme folder — then it won't work (my SCSS location is set to /scss/
). As soon as I change the CSS location to a subdirectory like /css/
it starts generating there. This means I have to have two stylesheets, one style.css
in the theme folder to set the WP theme data, and another in /css/master.css
to hold the SCSS-generated files.
As I said, I've tried this on two different servers and the same issue presents. Am I doing something wrong?
oyejorge/less.php has $parser->ModifyVars. I can't find the equivalent for leafo/scssphp, any ideas?
I need to create the variables from the WP database (get_option) for use in scss files.
Any help is greatly appreciated.
Thanks
I'm unable to save the Error Display setting in Admin. It keeps reverting to "Show in Header".
At the same time, the output page shows this error a large number of times:
"Warning: fwrite() expects parameter 1 to be resource, string given in [...]/wp-content/plugins/wp-scss/scssphp/scss.inc.php on line 818"
Actual compilation is working fine, as far as I can see.
Hi and thanks for this great plugin !
I've a problem. When I change something in my scss and save it, I have to reload the page a big number of times and wait 5 minutes to see the changes...
Could you help me ?
Thanks !
Hey,
From the research I made, your solution is by far the easier one.
however, for some reason, nothing works for me.
In my theme:
root:
css -> style.css
scss -> style.scss
settings for scss and css location are '/scss/' and '/css/'.
style.scss
$pink : #7e40e4;
style.css
.bg {background:$pink}
doesnt work, what am i missing?
Thanks
Is there any way to remove comments from output .css?
Hi,
In the WP-SCSS plugin I dropped in the latest leafo "scss.inc.php" which now supports setVariables
I need to use php variables, something like this:
functions.php
$tcolor_scss = '#000000';
$scssc->setVariables(array(
'tcolor' => $tcolor_scss,
));
test.scss input:
p {color: $tcolor; }
test.css output:
p {color: ; }
I can echo it to the screen but can't get the plugin to compile it.
functions.php
$tcolor_scss_var = '#000000';
$scssc->setVariables(array(
'tcolor' => $tcolor_scss_var,
));
echo $scssc->compile('@import "test.scss"' );
Screen output: p{color:#000;}
Any help would be greatly appreciated.
Thanks
As we all know, when using a child theme we have to use a template header in the style.css(https://codex.wordpress.org/Child_Themes).
I believe that when compiling, the plugin is not having that in mind and overwriting the child header.
Would be great if this can be kept in mind to not create the issue of users' child themes breaking.
Is there a way to change the path locations outside the theme folder while using a child theme?
I tried in functions file something like
$wpscss_compiler = new Wp_Scss(
get_template_directory().'/assets/css/',
get_template_directory().'/',
'scss_formatter'
);
$wpscss_compiler->compile();
Close NVM this works was something wrong with the sass that was generated by some other script I have and it was giving a compile error.
Inside compile()
, if the cache is not writable, then the resulting error message hardcodes what looks like an obsolete path to the cache directory. Is there any reason not to use $cache
in this message?
Hi,
I have a quick question, we have a deployment system that updates the scss files on our server. We have noticed that doing this sometimes the CSS is not generated therefore want to be able to trigger this plugin to run post deployment.
The easiest thing I can see to do is for our deployment system to hit a URL that then triggers the plugin but I am unsure how to achieve this. Any guidance you could give would be ace!
Thanks.
Getting a '2' in the page output, after updating the plugin just now:
2<!doctype html>
Deactivating the plugin, the 2 is gone.
I discovered this small issue while trying to compile bootstrap, the glyphicon are broken because of that.
I suppose this is an issue with scssphp, so maybe this isn't the right place to report the bug... Still it can help someone trying to lokk into the issue.
Great plugin btw, thx a lot !
In Compressed & nested mode do not delete comments like this:
/==============================
= comment =
==============================/
only comments in one line
// comment
Possible to fix it?
When using the plugin to compile the main stylesheet, it seems that output compression should preserve the first comment in order not to break WP theme recognition.
You can solve this error by simply updating the WP-SCSS settings in admin panel.
This error occurs after plugin update and after changing scss.
The reason is there are new Compiling Modes, and the old Compiling Modes are invalid now for the new version. The update process should ensure that the settings for the Compiling Mode also set to an valid mode.
In my case I've updated from 1.9 to 1.2.2
I may be misunderstanding what this plugin does, so I apologize if so.
Is it possible to write via php to an scss file and have it compiled and output?
Basically trying to find a way to use the WP Customizer colors to create some gradients and buttons using Sass mixins.
Thanks!
i'm trying to use a lighten() function with a variable, like this:
background-color: lighten($color:, 10%);
but it results in a compiling error:
"expecting color: failed at `background-color: lighten($color:, 10%);`
i've searched someone who had the same error, and i found this: http://stackoverflow.com/questions/20489656/foundation-5-scss-compilation-via-scssphp
it suggests to updates scssphp to 0.0.9.
i've updated my scssphp version inside the plugin, but the error still shows.
Because WP-SCSS is based on scssphp, so I am not going to duplicate the content, instead, please refer to the case Numer of precision and layout #508 for details.
How about to add autoprefixer functionality? I think it will be very useful.
https://github.com/vladkens/autoprefixer-php
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.