-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
285 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace BladeStyle\Contracts; | ||
|
||
interface CssMinifier | ||
{ | ||
/** | ||
* Minify css string. | ||
* | ||
* @return string | ||
*/ | ||
public function minify(string $css); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace BladeStyle\Engines; | ||
|
||
use BladeStyle\Contracts\CssMinifier; | ||
|
||
class MinifierEngine | ||
{ | ||
/** | ||
* Minifier. | ||
* | ||
* @var \BladeStyle\Contracts\CssMinifier | ||
*/ | ||
protected $minifier; | ||
|
||
/** | ||
* Create new MinifierEngine instance. | ||
* | ||
* @param CssMinifier $minifier | ||
*/ | ||
public function __construct(CssMinifier $minifier) | ||
{ | ||
$this->minifier = $minifier; | ||
} | ||
|
||
/** | ||
* Set minifier. | ||
* | ||
* @param CssMinifier $minifier | ||
* @return void | ||
*/ | ||
public function setMinifier(CssMinifier $minifier) | ||
{ | ||
$this->minifier = $minifier; | ||
} | ||
|
||
/** | ||
* Minify css string | ||
* | ||
* @return string | ||
*/ | ||
public function minify(string $css) | ||
{ | ||
return $this->minifier->minify($css); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace BladeStyle\Engines; | ||
|
||
use BladeStyle\Components\StylesComponent; | ||
use Illuminate\Support\Str; | ||
use BladeStyle\Support\Style; | ||
use Facade\Ignition\Views\Engines\CompilerEngine; | ||
|
||
class StyleCompilerEngine extends CompilerEngine | ||
{ | ||
/** | ||
* Get the evaluated contents of the view. | ||
* | ||
* @param string $path | ||
* @param array $data | ||
* @return string | ||
*/ | ||
public function get($path, array $data = []) | ||
{ | ||
return Style::include( | ||
parent::get($path, $data) | ||
); | ||
} | ||
} |
Oops, something went wrong.