Giter Site home page Giter Site logo

panique / laravel-sass Goto Github PK

View Code? Open in Web Editor NEW
71.0 71.0 26.0 17 KB

Automatic SASS-to-CSS compiling for Laravel 4 (and any other framework too), config-free, in pure PHP, works with latest SASS 3.2 .scss syntax, imports and mixins

Home Page: http://www.dev-metal.com/how-to-use-sass-in-laravel/

PHP 100.00%

laravel-sass's People

Contributors

bitdeli-chef avatar panique avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-sass's Issues

need gzip support

Its will be aswome if there will be a kind of gzip support $gzip = true / false

[issue] import from other files does not work yet

I cannot use the mixins, variables and whatever I try to import from another file. I'm trying to mix bootstrap with my code to create semantic HTML, but I always have a compiler error telling me something imported is not working.

The public/scss/application.scss file is:

@import 'bootstrap/mixins';

#content-container {
    @include container-fixed();
}

And inside public/scss/bootstrap/_mixins.scss I have

// Centered container element
@mixin container-fixed() {
  margin-right: auto;
  margin-left: auto;
  padding-left:  ($grid-gutter-width / 2);
  padding-right: ($grid-gutter-width / 2);
  @include clearfix();
}

But it throws the following error:

Exception

Undefined mixin container-fixed: failed at `@include container-fixed();` line: 4

Am I doing something wrong or is this an issue?

[better instalation instructions] I have found a better way to install laravel-sass

after te composer step, instead of messing with public/index.php which is a very bad idea, it's better to make a service provider named SassServiceProvider (I am not sure if service provider were meant to do this, but this works) and there:

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use SassCompiler;

class SassServiceProvider extends ServiceProvider
{
	/**
	 * Bootstrap services.
	 *
	 * @return void
	 */
	public function boot()
	{
		if(config('app.debug') == true){
			SassCompiler::run("../resources/sass/", "css/");
		}
	}

	/**
	 * Register services.
	 *
	 * @return void
	 */
	public function register()
	{
		//
	}
}

also remember to register the service provider in config/app.php

with this, you are sure you will only do stuff when you are not in development, and you are not messing with laravel's core.

the only bad thing about this solution is that SassCompiler::run() first argument needs to have the ../resources/ at the beginning which is not so bad after all.

Sass is compiled even if scss file is unchanged

The sass files are compiled on every page load in development which is very slow. Can you accept one of the pull requests that checks filemtime before compiling?

I'm currently doing this manually but it seems like it should be a standard feature.

if (App::environment() == 'local' and
    filemtime(public_path().'/scss/app.scss') > filemtime(public_path().'/css/app.css')) {
    SassCompiler::run('scss/', 'css/');
}

CSS are not compress

When SCSS code are converet to CSS its not compress, it will be a good option to set $compress = false/true

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.