Use Elixir for compiling SCSS into CSS.

This commit is contained in:
James Brooks
2014-11-17 14:32:59 +00:00
parent e27fa2425f
commit 8562062fcb
11 changed files with 55 additions and 34 deletions

1
.gitignore vendored
View File

@@ -1,5 +1,6 @@
/bootstrap/compiled.php
/vendor
/node_modules
composer.phar
composer.lock
.env.*.php

28
app/helpers.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
if ( ! function_exists('elixir'))
{
/**
* Get the path to a versioned Elixir file.
*
* @param string $file
* @return string
*/
function elixir($file)
{
static $manifest = null;
if (is_null($manifest))
{
$manifest = json_decode(file_get_contents(public_path().'/build/rev-manifest.json'), true);
}
if (isset($manifest[$file]))
{
return '/build/'.$manifest[$file];
}
throw new InvalidArgumentException("File {$file} not defined in asset manifest.");
}
}

View File

@@ -81,3 +81,5 @@ App::down(function()
require app_path().'/filters.php';
require app_path().'/view-composers.php';
require app_path().'/helpers.php';

View File

@@ -10,40 +10,7 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<link href='http://fonts.googleapis.com/css?family=Raleway:400,700,300,600' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<style type='text/css'>
body {
color: #333333;
}
.masthead-container {
margin: 0 auto;
}
.masthead-container .masthead {
position: relative;
margin-bottom: 70px;
}
.masthead-container .masthead .text-container {
background-color: rgba(0,0,0,0.8);
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
padding: 1rem;
}
.masthead-container .masthead .text-container .page-name {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
float: left;
color: white;
line-height: 37px;
position: relative;
display: inline-block;
}
.masthead-container .masthead .text-container .page-name a {
color: white;
}
</style>
<link rel="stylesheet" href="{{ elixir('css/application.css') }}">
</head>
<body>
<div class='container'>

5
gulpfile.js Normal file
View File

@@ -0,0 +1,5 @@
var elixir = require('laravel-elixir');
elixir(function(mix) {
mix.sass("application.scss").version('css/application.css');
});

6
package.json Normal file
View File

@@ -0,0 +1,6 @@
{
"devDependencies": {
"gulp": "^3.8.8",
"laravel-elixir": "*"
}
}

View File

@@ -0,0 +1,3 @@
body {
color: #333333;
}

View File

@@ -0,0 +1,2 @@
body {
color: #333333; }

View File

@@ -0,0 +1,2 @@
body {
color: #333333; }

View File

@@ -0,0 +1,3 @@
{
"css/application.css": "css/application-ce1dc7c2.css"
}

View File

@@ -0,0 +1,2 @@
body {
color: #333333; }