Leafo\ScssPhp\Server::createErrorCSS PHP Method

createErrorCSS() protected method

Format error as a pseudo-element in CSS
protected createErrorCSS ( Exception $error ) : string
$error Exception
return string
    protected function createErrorCSS(\Exception $error)
    {
        $message = str_replace(["'", "\n"], ["\\'", "\\A"], $error->getfile() . ":\n\n" . $error->getMessage());
        return "body { display: none !important; }\n                html:after {\n                    background: white;\n                    color: black;\n                    content: '{$message}';\n                    display: block !important;\n                    font-family: mono;\n                    padding: 1em;\n                    white-space: pre;\n                }";
    }