GrantW GrantW - 2 months ago 14
Sass (Sass) Question

SASS Files in Wordpress

Is there a way to access SCSS files from the Wordpress Theme editor UI? I have tried moving it to the root, next to my style.css and also leaving it in the SASS folder.

I am building a custom theme and already had SASS running on it locally and am now going to continue development in Wordpress.

Answer

You have to add the file extension before it will show up in the editor. You can do this with the wp_theme_editor_filetypes filter.

For example:

add_filter('wp_theme_editor_filetypes', function ($types) {
    $types[] = 'scss';

    return $types;
});