Comments (7)
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.
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.
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:
$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.
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.
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.
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.
+1 on this idea! I use the same partial structure.
from sass-build-sublimetext2.
Related Issues (20)
- [Errno 2] No such file or directory HOT 4
- Automatically compile files to css on save HOT 1
- Invalid option : --update error
- Sublime Text 3 HOT 1
- [Errno 20] Not a directory
- Error compiling SCSS inline comments HOT 1
- SystemStackError: stack level too deep HOT 1
- Expanded 'readable' Output HOT 1
- Line comments and line numbers not showing in compiled css HOT 1
- No such file or directory - &
- Want to build both compress and uncompressed.
- Cannot get a build - Path issues HOT 1
- Greedy build key binding HOT 2
- Build not found on Sublime Text3 HOT 3
- Cannot compile a class that is just one hypen, ex. ".- {}"
- Location of config files HOT 1
- SASS Error With Variable Interpolation
- Compile underscored files on save HOT 1
- Syntax Error On Build - Unknown Reason
- Error with SASS build HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sass-build-sublimetext2.