Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more control over scss compiler #375

Merged
merged 2 commits into from
Jan 28, 2023
Merged

Conversation

justinkruit
Copy link
Member

@justinkruit justinkruit commented Jan 28, 2023

This will add more control for the user over the SCSS compiler. You'll be able to disable the environment check (don't always compile in development or local) or disable the compiler completely.

Priority of checking:

  1. If filter has been added
  2. If a constant has been set
  3. Fall back to false

Below the new filters, constants, and how to use them.

Disabling the compiler

  • Filter: bootscore_scss_disable_compiler
    • add_filter('bootscore_scss_disable_compiler', '__return_true');
  • Constant: BOOTSCORE_SCSS_DISABLE_COMPILER
    • define('BOOTSCORE_SCSS_DISABLE_COMPILER', true);

Disabling the environment check

  • Filter: bootscore_scss_skip_environment_check
    • add_filter('bootscore_scss_skip_environment_check', '__return_true');
  • Constant: BOOTSCORE_SCSS_SKIP_ENVIRONMENT_CHECK
    • define('BOOTSCORE_SCSS_SKIP_ENVIRONMENT_CHECK', true);

Fun additional thing:
Run the following command in the folder of the theme, and compile your styling without the need of the PHP Compiler. Note that it's formatted for Windows, and probably need to make small path changes for other platforms.

sass .\scss\main.scss .\css\main.css -w -I ..\bootscore-main\scss\ --no-source-map

Closes #181
Closes #180
Closes #252

@crftwrk crftwrk added scss documentation Improvements or additions to documentation labels Jan 28, 2023
Copy link
Member

@crftwrk crftwrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation scss
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Compiling SCSS takes +30s Bootstrap rtl Disable scssphp in wp-config.php
2 participants