vladkens / autoprefixer-php

Provides PHP integration with Node.js application
MIT License
74 stars 14 forks source link

This request has no response data available #15

Open Darex1991 opened 6 years ago

Darex1991 commented 6 years ago

Hi, I had a small problem with this plugin. I'm using this in a layout:

  <link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>style.php" />

and in style.php:

<?php
require 'vendor/autoload.php';
$autoprefixer = new Autoprefixer();
$css      = 'a { transition: transform 1s, color: red }';
$prefixed = $autoprefixer->compile($css);
echo $prefixed;
screen shot 2018-02-20 at 23 13 07

What I'm doing wrong? I want to use this plugin with scss but I had the same results... And I tried also this configuration:

<?php

require 'vendor/autoload.php';

use Leafo\ScssPhp\Compiler;

header('Content-Type: text/css');
$autoprefixer = new Autoprefixer();
$scss = new Compiler();
$scss->setImportPaths("styles/");
$scss->setFormatter("Leafo\ScssPhp\Formatter\Crunched");

$scssFile = $scss->compile('@import "style.scss"');
$prefixed = $autoprefixer->compile($scssFile);
echo $prefixed;