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

How do you get the SCSS to compile? #164

Open
taserak opened this issue Feb 10, 2021 · 5 comments
Open

How do you get the SCSS to compile? #164

taserak opened this issue Feb 10, 2021 · 5 comments

Comments

@taserak
Copy link

taserak commented Feb 10, 2021

I used to use
define('WP_SCSS_ALWAYS_RECOMPILE', true);

to force it, but is that the only/expected way?
Is there a compile button somewhere?

@mhbapcc
Copy link
Contributor

mhbapcc commented Feb 11, 2021

No, unfortunately there is no button for recompiling. I prefer to always recompile for logged in admins (or a specific user/admin), like this...

function wpscss_compile_options() {
    if ( !empty( $user = wp_get_current_user() ) ) {
        if ( !is_admin() && $user->user_login == 'SPECIFIC_ADMIN' ) {
            define( 'WP_SCSS_ALWAYS_RECOMPILE', true );
        }
    }
}
add_action( 'init', 'wpscss_compile_options' );

Additionally, you'll save time if you don't have to press a button every time.

@shadoath
Copy link
Collaborator

Introduced an option in the WP-SCSS settings to enable always recompile without needing to define WP_SCSS_ALWAYS_RECOMPILE. Now available in version 2.1.1

@mandrasch
Copy link

mandrasch commented Feb 8, 2022

Introduced an option in the WP-SCSS settings to enable always recompile without needing to define WP_SCSS_ALWAYS_RECOMPILE. Now available in version 2.1.1

Hi, just a quick question regard this: To trigger a recompile I have to check this box (and afterwards I can un-check it)? Do I understand this correctly?

(If this is correct - a short helptext "Activate this and reload the page to trigger a re-compile" would have helped me understand this option better. I looked for a "recompile" or "clear cache" button)

Thanks for providing this as open source! 👍

@shadoath
Copy link
Collaborator

shadoath commented Feb 8, 2022

@mandrasch Yes, you do understand it correctly. With that flag turned on it will recompile the SCSS into CSS on every page load. This should only be used in development.

If you have the Development skills, open a PR with the changes in the options.php file for the new wording.

Thank you for your gratitude, it provides fuel for me to keep working on this.

@mandrasch
Copy link

mandrasch commented Feb 13, 2022

@mandrasch Yes, you do understand it correctly. With that flag turned on it will recompile the SCSS into CSS on every page load. This should only be used in development.

If you have the Development skills, open a PR with the changes in the options.php file for the new wording.

Thank you for your gratitude, it provides fuel for me to keep working on this.

Thought about this and imho a "Clear compiled files"-button would be more descriptive and easier to use? This would also avoid that users mistakenly leave "Always recompile" flag activated on production sites? 🤔

I could try a PR if you think this would be a good option.

(From what I saw you implemented a timestamp compare check https://github.com/ConnectThink/WP-SCSS/blob/master/class/class-wp-scss.php#L190. So if the corresponding files in via https://github.com/ConnectThink/WP-SCSS/blob/master/class/class-wp-scss.php#L87 aren't there, it should recompile. I guess the easiest option would be a "delete all css files from the output folder", but users must be aware that they shouldn't put other custom css files in the output directory)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants