{"id":118646,"date":"2020-03-19T07:31:15","date_gmt":"2020-03-19T07:31:15","guid":{"rendered":"https:\/\/nl.wordpress.org\/plugins\/jvh-easy-scss-and-js\/"},"modified":"2022-09-05T06:55:27","modified_gmt":"2022-09-05T06:55:27","slug":"jvh-easy-scss-and-js","status":"publish","type":"plugin","link":"https:\/\/sq-xk.wordpress.org\/plugins\/jvh-easy-scss-and-js\/","author":18630148,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"2.5.7","stable_tag":"2.5.7","tested":"6.0.12","requires":"6.0","requires_php":"7.4","requires_plugins":"","header_name":"Easy SCSS and JS","header_author":"Lars Jansen","header_description":"This plugin adds SCSS functionality, compresses JS for you and creates an easy way to enqueue scripts and styles as well as localize them.","assets_banners_color":"b5855f","last_updated":"2022-09-05 06:55:27","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/www.ljpc.solutions","rating":5,"author_block_rating":0,"active_installs":60,"downloads":3025,"num_ratings":1,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"Lars-","date":"2020-03-19 07:31:46"},"1.0.1":{"tag":"1.0.1","author":"Lars-","date":"2020-11-09 10:19:21"},"1.0.2":{"tag":"1.0.2","author":"Lars-","date":"2020-11-09 10:31:01"},"1.0.3":{"tag":"1.0.3","author":"Lars-","date":"2021-03-05 13:08:43"},"1.0.4":{"tag":"1.0.4","author":"Lars-","date":"2021-03-05 13:16:42"},"2.0.1":{"tag":"2.0.1","author":"Lars-","date":"2021-03-16 15:34:03"},"2.1.0":{"tag":"2.1.0","author":"Lars-","date":"2021-07-19 06:23:11"},"2.1.1":{"tag":"2.1.1","author":"Lars-","date":"2021-07-19 06:57:22"},"2.1.2":{"tag":"2.1.2","author":"Lars-","date":"2021-07-19 07:23:50"},"2.1.3":{"tag":"2.1.3","author":"Lars-","date":"2021-07-19 07:39:23"},"2.1.4":{"tag":"2.1.4","author":"Lars-","date":"2021-07-19 07:44:21"},"2.2.0":{"tag":"2.2.0","author":"Lars-","date":"2021-07-20 16:35:33"},"2.3.0":{"tag":"2.3.0","author":"Lars-","date":"2021-09-16 12:07:36"},"2.4.0":{"tag":"2.4.0","author":"Lars-","date":"2021-09-29 12:15:57"},"2.5.0":{"tag":"2.5.0","author":"Lars-","date":"2021-12-14 12:43:30"},"2.5.1":{"tag":"2.5.1","author":"Lars-","date":"2022-01-07 09:23:12"},"2.5.2":{"tag":"2.5.2","author":"Lars-","date":"2022-01-13 07:38:04"},"2.5.3":{"tag":"2.5.3","author":"Lars-","date":"2022-01-24 10:07:05"},"2.5.4":{"tag":"2.5.4","author":"Lars-","date":"2022-02-28 10:39:56"},"2.5.5":{"tag":"2.5.5","author":"Lars-","date":"2022-03-03 07:01:22"},"2.5.6":{"tag":"2.5.6","author":"Lars-","date":"2022-07-28 14:24:03"},"2.5.7":{"tag":"2.5.7","author":"Lars-","date":"2022-09-05 06:55:27"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":1},"assets_icons":{"icon-128-128.jpg":{"filename":"icon-128-128.jpg","revision":2263693,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256-256.jpg":{"filename":"icon-256-256.jpg","revision":2263693,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256},"icon.svg":{"filename":"icon.svg","revision":2263693,"resolution":false,"location":"assets","locale":false}},"assets_banners":{"banner-1544x500-rtl.png":{"filename":"banner-1544x500-rtl.png","revision":2263693,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":2263693,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250-rtl.png":{"filename":"banner-772x250-rtl.png","revision":2263693,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250},"banner-772x250.png":{"filename":"banner-772x250.png","revision":2263693,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","2.0.1","2.1.0","2.1.1","2.1.2","2.1.3","2.1.4","2.2.0","2.3.0","2.4.0","2.5.0","2.5.1","2.5.2","2.5.3","2.5.4","2.5.5","2.5.6","2.5.7"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[1381,207045,1731,201422,31643],"plugin_category":[],"plugin_contributors":[144741],"plugin_business_model":[],"class_list":["post-118646","plugin","type-plugin","status-publish","hentry","plugin_tags-easy","plugin_tags-easyscss","plugin_tags-js","plugin_tags-ljpc","plugin_tags-scss","plugin_contributors-lars-2","plugin_committers-jaapjvh","plugin_committers-lars-2"],"banners":{"banner":"https:\/\/ps.w.org\/jvh-easy-scss-and-js\/assets\/banner-772x250.png?rev=2263693","banner_2x":"https:\/\/ps.w.org\/jvh-easy-scss-and-js\/assets\/banner-1544x500.png?rev=2263693","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/jvh-easy-scss-and-js\/assets\/icon.svg?rev=2263693","icon":"https:\/\/ps.w.org\/jvh-easy-scss-and-js\/assets\/icon.svg?rev=2263693","icon_2x":false,"generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This plugin adds SCSS functionality, compresses JS for you and creates an easy way to enqueue scripts and styles as well as localize them.<\/p>\n\n<h3>How to use<\/h3>\n\n<p>Let's assume this structure:\n    your theme\n    \u251c\u2500\u2500 assets\n    \u2502   \u251c\u2500\u2500 js\n    \u2502   \u2502   \u2514\u2500\u2500 script.js\n    \u2502   \u2514\u2500\u2500 scss\n    \u2502       \u2514\u2500\u2500 style.scss\n    \u251c\u2500\u2500 functions.php\n    \u2514\u2500\u2500 ...<\/p>\n\n<p>You can now do this in your functions.php with styles:<\/p>\n\n<pre><code>&lt;?php\nadd_action('wp_enqueue_scripts', static function(){\n    \/* Full version *\/\n    \\EasySCSSandJS\\Styles::add('my_style_handle', __DIR__ .'\/assets\/scss\/style.scss', [],[], true);\n\n    \/* Shortest version *\/\n    \\EasySCSSandJS\\Styles::add('my_style_handle', __DIR__ .'\/assets\/scss\/style.scss');\n\n    \/* Add dependencies (example: depends on handle 'bootstrap') *\/\n    \\EasySCSSandJS\\Styles::add('my_style_handle', __DIR__ .'\/assets\/scss\/style.scss', ['bootstrap']);\n\n    \/* Add variables *\/\n    \\EasySCSSandJS\\Styles::add('my_style_handle', __DIR__ .'\/assets\/scss\/style.scss', [], [\n        'my_cool_color' =&gt; '#0000ff',\n    ]);\n\n    \/* Enqueue it yourself *\/\n    \\EasySCSSandJS\\Styles::add('my_style_handle', __DIR__ .'\/assets\/scss\/style.scss', [], [], false);\n    wp_enqueue_style('my_style_handle');\n});\n<\/code><\/pre>\n\n<p>And this with scripts:<\/p>\n\n<pre><code>&lt;?php\nadd_action('wp_enqueue_scripts', static function(){\n    \/* Full version *\/\n    \\EasySCSSandJS\\Scripts::add('my_script_handle', __DIR__ .'\/assets\/js\/script.js', ['jquery'], [], true, true);\n\n    \/* Shortest version (jquery is by default a dependency) *\/\n    \\EasySCSSandJS\\Scripts::add('my_script_handle', __DIR__ .'\/assets\/js\/script.js');\n\n    \/* No dependencies (also no jquery) *\/\n    \\EasySCSSandJS\\Scripts::add('my_script_handle', __DIR__ .'\/assets\/js\/script.js', []);\n\n    \/* Add dependencies (besides jquery) *\/\n    \\EasySCSSandJS\\Scripts::add('my_script_handle', __DIR__ .'\/assets\/js\/script.js', ['jquery', 'other_script']);\n\n    \/* Add variables *\/\n    \\EasySCSSandJS\\Scripts::add('my_script_handle', __DIR__ .'\/assets\/js\/script.js', ['jquery'], [\n        'my_variable' =&gt; 'testing this awesome plugin',\n    ]);\n\n    \/* Enqueue it yourself *\/\n    \\EasySCSSandJS\\Scripts::add('my_script_handle', __DIR__ .'\/assets\/js\/script.js', ['jquery'], [], false);\n    wp_enqueue_script('my_script_handle');\n\n    \/* Add the script to the header instead of the footer *\/\n    \\EasySCSSandJS\\Scripts::add('my_script_handle', __DIR__ .'\/assets\/js\/script.js', ['jquery'], [], true, false);\n});\n<\/code><\/pre>\n\n<p>Use variables in SCSS:<\/p>\n\n<pre><code>\/\/ This is recommended. It will throw a fatal error if your PHP doesn't set the variable for some reason.\n\/\/ If PHP does set it, it will replace $my_cool_color with the defined color in PHP.\n$my_cool_color: #ffffff !default;\n\nbody{\n  background-color: $my_cool_color; \/\/ This will be blue (#0000ff)\n}\n<\/code><\/pre>\n\n<p>Use variables in JS:<\/p>\n\n<pre><code>alert(my_script_handle_vars.my_variable);\n<\/code><\/pre>\n\n<p>Compiled files will be saved in wp-content\/uploads\/compiled-scss-and-js. When that folder is cleared, everything will be regenerated.<\/p>\n\n<h3>Filters<\/h3>\n\n<p>There are filters for adding generic variables to all (or a selection) of scripts and styles or for adding extra content to files:\n- <code>easy_scss_extra_variables<\/code>\n- <code>easy_scss_add_code_before_content<\/code>\n- <code>easy_scss_add_code_after_content<\/code>\n- <code>easy_scss_create_source_map<\/code>\n- <code>easy_scss_storage_folder_name<\/code>\n- <code>easy_scss_storage_folder<\/code>\n- <code>easy_scss_storage_folder_url<\/code>\n- <code>easy_scss_after_compilation<\/code>\n- <code>easy_js_extra_variables<\/code>\n- <code>easy_js_storage_folder_name<\/code>\n- <code>easy_js_storage_folder<\/code>\n- <code>easy_js_storage_folder_url<\/code>\n- <code>easy_js_after_compilation<\/code><\/p>\n\n<!--section=changelog-->\n<p>v2.5.7\n- Updated scssphp to 1.11.0<\/p>\n\n<p>v2.5.6\n- Updated scssphp to 1.10.5<\/p>\n\n<p>v2.5.5\n- Updated scssphp to 1.10.2<\/p>\n\n<p>v2.5.4\n- Updated scssphp to 1.10.1<\/p>\n\n<p>v2.5.3\n- Removed legacy code<\/p>\n\n<p>v2.5.1\n- Added the easy_css_after_compilation and easy_js_after_compilation filters\n- Upgraded scssphp to 1.10.0<\/p>\n\n<p>v2.5.0\n- Added the easy_css_after_compilation and easy_js_after_compilation filters\n- Upgraded scssphp to 1.9.0<\/p>\n\n<p>v2.3.0\n- Added the ability to include URLs, which are then cached, minified and served\n- Upgraded scssphp to 1.7.0<\/p>","raw_excerpt":"This plugin adds SCSS functionality, compresses JS for you and creates an easy way to enqueue scripts and styles as well as localize them.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sq-xk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/118646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sq-xk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/sq-xk.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/sq-xk.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=118646"}],"author":[{"embeddable":true,"href":"https:\/\/sq-xk.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/jaapjvh"}],"wp:attachment":[{"href":"https:\/\/sq-xk.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=118646"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/sq-xk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=118646"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/sq-xk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=118646"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/sq-xk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=118646"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/sq-xk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=118646"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/sq-xk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=118646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}