That's not strictly true. If you use Sass::Engine#to_tree, you can get access to the abstract syntax tree for the document and manipulate that. However, there aren't any nice APIs for this like the one you sketched out.
On Mon, Sep 20, 2010 at 8:43 AM, Chris Eppstein <ch...@eppsteins.net> wrote: > The sass engine does not support mutation like this (at this time). > > I suggest you make your changes to the string first and then parse it. > > Chris > > > On Mon, Sep 20, 2010 at 8:10 AM, gmile <iamex...@gmail.com> wrote: > >> I'm trying to make a admin tool to be able to change my style-sheets >> from withing the app, without the need of manually altering scss >> files. That's how I've ran into this problem. I need to open an SCSS, >> alter some rules in it and then save the template. Currently the >> engine docs (http://sass-lang.com/docs/yardoc/Sass/Engine.html) state >> that we are able to do as following: >> >> <pre> >> template = File.load('stylesheets/sassy.sass') >> sass_engine = Sass::Engine.new(template) >> output = sass_engine.render >> puts output >> </pre> >> >> What I want is to alter the loaded SCSS template, and only then place >> an output. Is there any methods or techniques to accomplish that? Is >> there any way to do something like >> <pre> >> template = File.load('stylesheets/sassy.sass') >> sass_engine = Sass::Engine.new(template) >> sass_engine.find('#header a').style('color', '#333') >> output = sass_engine.render >> </pre> >> >> Sorry for the question if it appears to be a noob one. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Haml" group. >> To post to this group, send email to h...@googlegroups.com. >> To unsubscribe from this group, send email to >> haml+unsubscr...@googlegroups.com <haml%2bunsubscr...@googlegroups.com>. >> For more options, visit this group at >> http://groups.google.com/group/haml?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Haml" group. > To post to this group, send email to h...@googlegroups.com. > To unsubscribe from this group, send email to > haml+unsubscr...@googlegroups.com <haml%2bunsubscr...@googlegroups.com>. > For more options, visit this group at > http://groups.google.com/group/haml?hl=en. > -- You received this message because you are subscribed to the Google Groups "Haml" group. To post to this group, send email to h...@googlegroups.com. To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/haml?hl=en.