Giter VIP home page Giter VIP logo

gulp-sass-vars's People

Contributors

drnixx avatar giowe avatar vitorluizc avatar

Stargazers

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

Watchers

 avatar  avatar

gulp-sass-vars's Issues

Build breaks with node-neat and v1.1.1

I cannot build my project anymore with the latest version of the package.

I get the following error message:
`gulp-sass-vars: Injected 1 variables to sass:
$output-bourbon-deprecation-warnings: 'false';

node_modules/source-map/lib/source-map-generator.js:277
throw new Error('Invalid mapping: ' + JSON.stringify({
^
Error: Invalid mapping: {"generated":{"line":1,"column":29271},"source":"../../../../../../node_modules/bourbon-neat/app/assets/stylesheets/grid/_span-columns.scss","original":{"line":89,"column":-353},"name":null}`

The error appears in conjuction wiht node-neat, my task looks like this:
gulp.task(css:${publication.name}, () => { return gulp.src(${config.paths.scss}/styles.scss) .pipe(gulpif(process.env.watch === 'true', plumber({errorHandler: onWatchError}))) .pipe(newer({ dest: ${config.paths.target}/css/styles.css, extra: extraFiles })) .pipe(sourcemaps.init()) .pipe(sassVars(vars)) .pipe(sass({ outputStyle: 'expanded', includePaths: ['css:' + publication.name].concat(normalize, neat), errLogToConsole: true })) .pipe(sourcemaps.write('./')) .pipe(gulp.dest(${config.paths.target}/css)) .pipe(touch()); })

If I go back to v1.1.0 everything works fine.

Extra quotes around fonts?

If I try to inject per example 'font-family': 'Garamond, serif' it gets injected as $font-family: "Garamond, serif"; which the browser then interprets as one font. Not sure how this could be worked around, is there an option to pass maybe so that parse-sass-value doesn't autoquote things? I wouldn't mind having to quote things myself.

Color values with quotes (updated npm packages)

Hi there,

I provide variables via .json like "primaryColor" : "rgb(255,179,0)".

I recently updated my packages and unfortunately the task doesn't work as expected.

[14:52:34] $primaryColor: "rgb(255,179,0)";
[14:52:34] $secondaryColor: "#232323";

In the css-file it is like color: "#232323". The quotes are wrong.

Only inject string values, any other type throws errors

IDK if it's by design, but I can't inject numbers, booleans or Objects.

2016-12-28 11_07_15-cmder

// gulpfile.js
const gulp = require("gulp");
const sass = require("gulp-sass");
const vars = require("gulp-sass-vars");

const settings = {
  url: {
    base: "http://localhost:8080/",
    img: {
      avatar: "http://localhost:8080/img/avatar.svg"
    }
  }
};

gulp.task("style:transpile", transpileStyle);

function transpileStyle() {
  gulp.src("./style.scss")
    .pipe(vars(settings))
    .pipe(sass())
    .pipe(gulp.dest("./"));
}
// style.scss
@function image($alias) {
  $images: map-get($url, 'img');

  @return url('#{map-get($images, $alias)}');
}

.avatar {
  background-image: image(avatar);
}

I've fixed this locally and will be glad to make a pull-request ๐Ÿ˜„

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.