Easy SCSS and JS

Easy SCSS and JS

Wordpress plugin

Install on Wordpress

App Details

This plugin adds SCSS functionality, compresses JS for you and creates an easy way to enqueue scripts and styles as well as localize them.

How to use

Let’s assume this structure:
your theme
├── assets
│ ├── js
│ │ └── script.js
│ └── scss
│ └── style.scss
├── functions.php
└── …

You can now do this in your functions.php with styles:

<?php add_action('wp_enqueue_scripts', static function(){ /* Full version */ \EasySCSSandJS\Styles::add('my_style_handle', __DIR__ .'/assets/scss/style.scss', [],[], true); /* Shortest version */ \EasySCSSandJS\Styles::add('my_style_handle', __DIR__ .'/assets/scss/style.scss'); /* Add dependencies (example: depends on handle 'bootstrap') */ \EasySCSSandJS\Styles::add('my_style_handle', __DIR__ .'/assets/scss/style.scss', ['bootstrap']); /* Add variables */ \EasySCSSandJS\Styles::add('my_style_handle', __DIR__ .'/assets/scss/style.scss', [], [ 'my_cool_color' => '#0000ff', ]); /* Enqueue it yourself */ \EasySCSSandJS\Styles::add('my_style_handle', __DIR__ .'/assets/scss/style.scss', [], [], false); wp_enqueue_style('my_style_handle'); }); 

And this with scripts:

<?php add_action('wp_enqueue_scripts', static function(){ /* Full version */ \EasySCSSandJS\Scripts::add('my_script_handle', __DIR__ .'/assets/js/script.js', ['jquery'], [], true, true); /* Shortest version (jquery is by default a dependency) */ \EasySCSSandJS\Scripts::add('my_script_handle', __DIR__ .'/assets/js/script.js'); /* No dependencies (also no jquery) */ \EasySCSSandJS\Scripts::add('my_script_handle', __DIR__ .'/assets/js/script.js', []); /* Add dependencies (besides jquery) */ \EasySCSSandJS\Scripts::add('my_script_handle', __DIR__ .'/assets/js/script.js', ['jquery', 'other_script']); /* Add variables */ \EasySCSSandJS\Scripts::add('my_script_handle', __DIR__ .'/assets/js/script.js', ['jquery'], [ 'my_variable' => 'testing this awesome plugin', ]); /* Enqueue it yourself */ \EasySCSSandJS\Scripts::add('my_script_handle', __DIR__ .'/assets/js/script.js', ['jquery'], [], false); wp_enqueue_script('my_script_handle'); /* Add the script to the header instead of the footer */ \EasySCSSandJS\Scripts::add('my_script_handle', __DIR__ .'/assets/js/script.js', ['jquery'], [], true, false); }); 

Use variables in SCSS:

// This is recommended. It will throw a fatal error if your PHP doesn't set the variable for some reason. // If PHP does set it, it will replace $my_cool_color with the defined color in PHP. $my_cool_color: #ffffff !default; body{ background-color: $my_cool_color; // This will be blue (#0000ff) } 

Use variables in JS:

alert(my_script_handle_vars.my_variable); 

Compiled files will be saved in wp-content/uploads/compiled-scss-and-js. When that folder is cleared, everything will be regenerated.

Filters

There are filters for adding generic variables to all (or a selection) of scripts and styles or for adding extra content to files:
– easy_scss_extra_variables
– easy_scss_add_code_before_content
– easy_scss_add_code_after_content
– easy_scss_create_source_map
– easy_scss_storage_folder_name
– easy_scss_storage_folder
– easy_scss_storage_folder_url
– easy_scss_after_compilation
– easy_js_extra_variables
– easy_js_storage_folder_name
– easy_js_storage_folder
– easy_js_storage_folder_url
– easy_js_after_compilation

Pricing

Starting from $0 per month.

Check Out the Image Hover Effects Widget

By Common Ninja

Image Hover EffectsTry For Free!

App Info

Rating

Reviewers

1 reviews

Tags

easy
JS
ljpc
scss

Developed By

Lars Jansen

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Forms

Forms plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Comments

Comments plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Maps

Maps plugins for Wordpress

Security

Security plugins for Wordpress

Translation

Translation plugins for Wordpress

Ads

Ads plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Chat

Chat plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Membership

Membership plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Contact

Contact plugins for Wordpress

Comments

Comments plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Image Hover Effects for Wordpress logo

Image Hover Effects

Use image hover effects to add animations, highlight key visuals, and keep visitors engaged with dynamic image reveals.

PayPal Donate Button for Wordpress logo

PayPal Donate Button

Make it easy for supporters to contribute using PayPal or Stripe by adding a donation button that keeps giving fast, secure, and on site.

Diagrams for Wordpress logo

Diagrams

Create interactive diagrams with a diagrams widget that lets you build and customize flow charts, improve clarity, and help visitors understand complex ideas easily.

Job Application Form for Wordpress logo

Job Application Form

Collect candidate information with a job application form that organizes submissions, streamlines hiring, and helps you manage applicants efficiently.

Cookies Consent Bar for Wordpress logo

Cookies Consent Bar

Display a cookies consent bar that explains usage and supports GDPR compliance, enhancing user trust and legal clarity.

Coupon Bar for Wordpress logo

Coupon Bar

Display discounts with a coupon bar that highlights special offers, drives urgency, and helps convert visitors into paying customers.

Corner Button for Wordpress logo

Corner Button

Corner button that stays fixed on the screen to highlight promotions, improve navigation, and guide visitors toward important actions with clear visibility.

Payment Button for Wordpress logo

Payment Button

Use a payment button for secure PayPal or Stripe checkout to simplify online payments and help increase sales.

Accordion for Wordpress logo

Accordion

Add collapsible content sections to your site to organize information and help users navigate content more efficiently.

Strip Button for Wordpress logo

Strip Button

Add a Stripe Button to your website to give customers a fast, trusted checkout experience.

Consent Form for Wordpress logo

Consent Form

Create consent forms that collect signatures, save submissions, send notifications, and help you manage approvals efficiently.

LinkedIn Feed Carousel for Wordpress logo

LinkedIn Feed Carousel

Show LinkedIn posts with a LinkedIn feed carousel that auto updates, presents content in a smooth layout, and keeps visitors engaged.

More plugins

plugins You Might Like

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms