Git Product home page Git Product logo

Comments (7)

ainglese avatar ainglese commented on July 17, 2024

i've managed to make something like what you ask

you have to change your sublime-build file:

"cmd": ["sass", "--update", "${file_path/(.+)([^a-zA-Z0-9])([a-zA-Z0-9]+)$/$1$2$3$2$3/}.scss:${file_path}.css", "--stop-on-error", "--no-cache"],

then, you have to arrange files like this:
[stylesheets]/[stylesheet].scss
[stylesheets]/_partial1.scss
[stylesheets]/_partial2.scss

and it will produce

[stylesheets].css

[stylesheet] could be everything, but notice that the folder and the main scss file must be equal; also, you must have only one "main" scss inside your [stylesheet] folder, because only the one named [stylesheet] will be build.

from sass-build-sublimetext2.

Spheerys avatar Spheerys commented on July 17, 2024

Thanks for the tip, but I have some difficulties to make it works.
Here my working tree :

/css (for generated files)
/sass (for working file)

Here my actual build cmd :

"cmd": ["sass", "--update", "$file:${file_path}/../css/${file_base_name}.css"],

I'm trying to adapt your tip to my configuration, without success :

"cmd": ["sass", "--update", "${file_path/(.+)([^a-zA-Z0-9])([a-zA-Z0-9]+)$/$1$2$3$2$3/}.scss:${file_path}/../css/${file_base_name}.css", "--stop-on-error", "--no-cache"],

What's wrong ?

from sass-build-sublimetext2.

ainglese avatar ainglese commented on July 17, 2024

i've fighted a bit too to make it work, and it's not perfect: it doesn't work well with nested folders;

try adding ", "--no-cache", "--trace"]," to your command for some insights on what's going on.

the trick is this:

suppose you have a main folder inside your sass folder, with main.scss, with a _partial1.scss and _partial2.scss;

sass/main/main.scss

sass/main/_ partial1.scss

sass/main/_ partial2.scss

when saving the _partial1.scss i get from the regex the parent folder name (main) and i use this as the file name to build (main/main.scss)

now, i used $(file_path}.css as target file in my config, because my desired output was something like this:

sources:

css/main/main.scss

css/main/_ partial1.scss

css/main/_ partial2.scss

target:

css/main.css

to make it work with your config you could try with a regex:

${file_path/(.+)([^a-zA-Z0-9])([a-zA-Z0-9]+)$/$1$2../css$2$3/}.css

$1 = /sass

$2 = /

$3 = main

$1$2../css$2$3 = /sass/../css/main.css

notice i had to use a regex group to handle the"/" because it seems the escape (/) is not working.

anyway as you see, if you have a nested folder inside "main" it will break.

Da: Spheerys [mailto:[email protected]]
Inviato: martedì 6 agosto 2013 12:00
A: jaumefontal/SASS-Build-SublimeText2
Cc: ainglese
Oggetto: Re: [SASS-Build-SublimeText2] Support of partial files (#14)

Thanks for the tip, but I have some difficulties to make it works.
Here my working tree :

/css (for generated files)
/sass (for working file)

Here my actual build cmd :

"cmd": ["sass", "--update", "$file:${file_path}/../css/${file_base_name}.css"],

I'm trying to adapt your tip to my configuration, without success :

"cmd": ["sass", "--update", "${file_path/(.+)([^a-zA-Z0-9])([a-zA-Z0-9]+)$/$1$2$3$2$3/}.scss:${file_path}/../css/${file_base_name}.css", "--stop-on-error", "--no-cache"],

What's wrong ?


Reply to this email directly or view it on GitHub #14 (comment) .Immagine rimossa dal mittente.

from sass-build-sublimetext2.

Spheerys avatar Spheerys commented on July 17, 2024

Thanks for this tip :)
I really appreciate !
However, this tip is not very flexible, neither easy to adapt.

Instead of using regex, can't we imagine another internal process which detect the changes insides the _partial files, ask for the main file (set in the SASS.sublim-build for example) and compile it with the changes in the main file AND all the partials files ?

from sass-build-sublimetext2.

ainglese avatar ainglese commented on July 17, 2024

Absolutely, mine was just an hack to make it work in my setup. I'd really like to have this feature built-in!

Il giorno 21/ago/2013, alle ore 20:28, Spheerys [email protected] ha scritto:

Thanks for this tip :)
I really appreciate !
However, this tip is not very flexible, neither easy to adapt.

Instead of using regex, can't we imagine another internal process which detect the changes insides the _partial files, ask for the main file (set in the SASS.sublim-build for example) and compile it with the changes in the main file AND all the partials files ?


Reply to this email directly or view it on GitHub.

from sass-build-sublimetext2.

funzeye avatar funzeye commented on July 17, 2024

Hey guys, I have a solution that may help your issue, check it out here:
http://hovercraftie.tumblr.com/post/61592756918/update-sass-build-plug-in-for-sublime-text-2-to-allow
Its maybe slightly inflexible in that the file names are hard-coded in the build file, but can't really see any other way around it. But if you stay consistent across your project you shouldn't have to change it too often,

from sass-build-sublimetext2.

fillippeyton avatar fillippeyton commented on July 17, 2024

+1 on this idea! I use the same partial structure.

from sass-build-sublimetext2.

Related Issues (20)

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.