public function validate($data) {
        if (empty($data)) {
            return true;
        }

        $scss = new core_scss();
        try {
            $scss->compile($data);
        } catch (Leafo\ScssPhp\Exception\ParserException $e) {
            return get_string('scssinvalid', 'admin', $e->getMessage());
        } catch (Leafo\ScssPhp\Exception\CompilerException $e) {
            // Silently ignore this - it could be a scss variable defined from somewhere
            // else which we are not examining here.
            return true;
        }

        return true;
    }