ri > Sass::Tree

🌳 Sass::Tree

🚀 Quick Reference

Use Case Command Description
🔄 Convert dynamic Sass tree to static Sass tree Sass::Tree::Visitors::Perform Resolves dynamic directives (e.g., @for, mixin calls) into a static tree with final rules and properties.
📐 Convert static Sass tree to static CSS tree Sass::Tree::Visitors::Cssize Flattens nested rules and properties to match the structure of generated CSS.
📄 Generate CSS string from static CSS tree Sass::Tree::Visitors::ToCss Produces the final CSS output as a string.
🏗️ Access node types for the Sass parse tree Sass::Tree Namespace containing all node classes (e.g., RuleNode, PropNode, MixinDefNode).

📝 Description

A namespace for nodes in the Sass parse tree.

The Sass parse tree has three states: dynamic, static Sass, and static CSS.

When it's first parsed, a Sass document is in the dynamic state. It has nodes for mixin definitions and @for loops and so forth, in addition to nodes for CSS rules and properties. Nodes that only appear in this state are called dynamic nodes.

🔧 Tree::Visitors::Perform creates a static Sass tree, which is different. It still has nodes for CSS rules and properties but it doesn't have any dynamic-generation-related nodes. The nodes in this state are in a similar structure to the Sass document: rules and properties are nested beneath one another, although the Tree::RuleNode selectors are already in their final state. Nodes that can be in this state or in the dynamic state are called static nodes; nodes that can only be in this state are called solely static nodes.

🔧 Tree::Visitors::Cssize is then used to create a static CSS tree. This is like a static Sass tree, but the structure exactly mirrors that of the generated CSS. Rules and properties can't be nested beneath one another in this state.

Finally, 🔧 Tree::Visitors::ToCss can be called on a static CSS tree to get the actual CSS code as a string.

Sass::Tree
🌳 Sass::Tree 🚀 Quick Reference 📝 Description

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-28 22:43 @216.73.217.46
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format