Skip to content

Configure plugin via define or json #222

Closed

Description

@richard-unterberg

Hey guys, thanks for this awesome plugin. Using it daily in our wordpress instances.

It´s already possible to use define('WP_SCSS_ALWAYS_RECOMPILE', true); to force recompilation of files. Would be handy if we can define constants like "Base Location" or the "Paths" mounted in the parent / child theme files directly. So it becomes possible to save plugin configurations over git, etc

Configuration file (JSON) would be a neat alternative too.
If I find the time I will dig into this, but this can take a while.
Any shortcuts to this?

Thanks ✌️

Activity

  1. ermincelikovic commented on Dec 18, 2022

    @ermincelikovic

    What I do at the moment is following:

    add_action( 'after_setup_theme', function() {
        $settings = array(
            "base_compiling_folder" => "Current Theme",
            "scss_dir" => "/assets/scss/",
            "css_dir" => "/assets/css/",
            "compiling_options" => "Leafo\ScssPhp\Formatter\Crunched",
            "sourcemap_options" => "SOURCE_MAP_FILE",
            "errors" => "show-logged-in"
        );
    
        update_option("wpscss_options", $settings);
    });
    

    Of course, you can change the action based on your needs.

  2. shadoath commented on Jan 16, 2023

    @shadoath
    Collaborator

    @richard-unterberg If you find the time we welcome a PR to improve this project.

    @ermincelikovic thank you for adding the way to handle this.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions