mirror of
https://github.com/danog/sass-site.git
synced 2025-01-09 14:38:39 +01:00
554 lines
16 KiB
HTML
554 lines
16 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title>
|
|
Class: Sass::Tree::Visitors::ToCss
|
|
|
|
— Documentation by YARD 0.9.12
|
|
|
|
</title>
|
|
|
|
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
|
|
|
<link rel="stylesheet" href="../../../../assets/css/docs.css" type="text/css" charset="utf-8" />
|
|
|
|
<script type="text/javascript" charset="utf-8">
|
|
hasFrames = window.top.frames.main ? true : false;
|
|
relpath = '../../../';
|
|
framesUrl = "../../../frames.html#!Sass/Tree/Visitors/ToCss.html";
|
|
</script>
|
|
|
|
|
|
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
|
|
|
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
|
|
|
|
|
</head>
|
|
<body>
|
|
<div id="header">
|
|
<div id="menu">
|
|
|
|
<a href="../../../_index.html">Index (T)</a> »
|
|
<span class='title'><span class='object_link'><a href="../../../Sass.html" title="Sass (module)">Sass</a></span></span> » <span class='title'><span class='object_link'><a href="../../Tree.html" title="Sass::Tree (module)">Tree</a></span></span> » <span class='title'><span class='object_link'><a href="../Visitors.html" title="Sass::Tree::Visitors (module)">Visitors</a></span></span>
|
|
»
|
|
<span class="title">ToCss</span>
|
|
|
|
|
|
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
</div>
|
|
|
|
<div id="search">
|
|
|
|
<a class="full_list_link" id="class_list_link"
|
|
href="../../../class_list.html">
|
|
Class List
|
|
</a>
|
|
|
|
<a class="full_list_link" id="method_list_link"
|
|
href="../../../method_list.html">
|
|
Method List
|
|
</a>
|
|
|
|
<a class="full_list_link" id="file_list_link"
|
|
href="../../../file_list.html">
|
|
File List
|
|
</a>
|
|
|
|
</div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<iframe id="search_frame"></iframe>
|
|
|
|
<div id="content"><h1>Class: Sass::Tree::Visitors::ToCss
|
|
|
|
|
|
|
|
</h1>
|
|
|
|
<dl class="box">
|
|
|
|
<dt class="r1">Inherits:</dt>
|
|
<dd class="r1">
|
|
<span class="inheritName"><span class='object_link'><a href="Base.html" title="Sass::Tree::Visitors::Base (class)">Base</a></span></span>
|
|
|
|
<ul class="fullTree">
|
|
<li>Object</li>
|
|
|
|
<li class="next"><span class='object_link'><a href="Base.html" title="Sass::Tree::Visitors::Base (class)">Base</a></span></li>
|
|
|
|
<li class="next">Sass::Tree::Visitors::ToCss</li>
|
|
|
|
</ul>
|
|
<a href="#" class="inheritanceTree">show all</a>
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="r2 last">Defined in:</dt>
|
|
<dd class="r2 last">.ruby-sass/lib/sass/tree/visitors/to_css.rb</dd>
|
|
|
|
</dl>
|
|
<div class="clear"></div>
|
|
|
|
<h2>Overview</h2><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>A visitor for converting a Sass tree into CSS.</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
|
|
</div>
|
|
<h2>Constant Summary</h2>
|
|
|
|
|
|
|
|
|
|
|
|
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
|
<ul class="summary">
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#source_mapping-instance_method" title="#source_mapping (instance method)">#<strong>source_mapping</strong> ⇒ Object </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<span class="note title readonly">readonly</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>The source mapping for the generated CSS file.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
<h2>
|
|
Instance Method Summary
|
|
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
|
</h2>
|
|
|
|
<ul class="summary">
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(build_source_mapping = false) ⇒ ToCss </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span class="note title constructor">constructor</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>A new instance of ToCss.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#visit-instance_method" title="#visit (instance method)">#<strong>visit</strong>(node) ⇒ String </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Runs the visitor on `node`.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="Sass::Tree::Visitors::Base (class)">Base</a></span></h3>
|
|
<p class="inherited"><span class='object_link'><a href="Base.html#visit-class_method" title="Sass::Tree::Visitors::Base.visit (method)">visit</a></span></p>
|
|
<div id="constructor_details" class="method_details_list">
|
|
<h2>Constructor Details</h2>
|
|
|
|
<div class="method_details first">
|
|
<h3 class="signature first" id="initialize-instance_method">
|
|
|
|
#<strong>initialize</strong>(build_source_mapping = false) ⇒ <tt><span class='object_link'><a href="" title="Sass::Tree::Visitors::ToCss (class)">ToCss</a></span></tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Returns a new instance of ToCss</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
<p class="tag_title">Parameters:</p>
|
|
<ul class="param">
|
|
|
|
<li>
|
|
|
|
<span class='name'>build_source_mapping</span>
|
|
|
|
|
|
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
|
|
|
|
<em class="default">(defaults to: <tt>false</tt>)</em>
|
|
|
|
|
|
—
|
|
<div class='inline'>
|
|
<p>Whether to build a <span class='object_link'><a href="../../Source/Map.html" title="Sass::Source::Map (class)">Source::Map</a></span> while creating the CSS output. The
|
|
mapping will be available from <span class='object_link'><a href="#source_mapping-instance_method" title="Sass::Tree::Visitors::ToCss#source_mapping (method)">#source_mapping</a></span> after the visitor has
|
|
completed.</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
11
|
|
12
|
|
13
|
|
14
|
|
15
|
|
16
|
|
17
|
|
18
|
|
19</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/tree/visitors/to_css.rb', line 11</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_build_source_mapping'>build_source_mapping</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
|
<span class='ivar'>@tabs</span> <span class='op'>=</span> <span class='int'>0</span>
|
|
<span class='ivar'>@line</span> <span class='op'>=</span> <span class='int'>1</span>
|
|
<span class='ivar'>@offset</span> <span class='op'>=</span> <span class='int'>1</span>
|
|
<span class='ivar'>@result</span> <span class='op'>=</span> <span class='const'>String</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
<span class='ivar'>@source_mapping</span> <span class='op'>=</span> <span class='id identifier rubyid_build_source_mapping'>build_source_mapping</span> <span class='op'>?</span> <span class='const'><span class='object_link'><a href="../../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Source.html" title="Sass::Source (module)">Source</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Source/Map.html" title="Sass::Source::Map (class)">Map</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../../Source/Map.html#initialize-instance_method" title="Sass::Source::Map#initialize (method)">new</a></span></span> <span class='op'>:</span> <span class='kw'>nil</span>
|
|
<span class='ivar'>@lstrip</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
<span class='ivar'>@in_directive</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="constructor_details" class="method_details_list">
|
|
<h2>Constructor Details</h2>
|
|
|
|
<div class="method_details first">
|
|
<h3 class="signature first" id="initialize-instance_method">
|
|
|
|
#<strong>initialize</strong>(build_source_mapping = false) ⇒ <tt><span class='object_link'><a href="" title="Sass::Tree::Visitors::ToCss (class)">ToCss</a></span></tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Returns a new instance of ToCss</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
<p class="tag_title">Parameters:</p>
|
|
<ul class="param">
|
|
|
|
<li>
|
|
|
|
<span class='name'>build_source_mapping</span>
|
|
|
|
|
|
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
|
|
|
|
<em class="default">(defaults to: <tt>false</tt>)</em>
|
|
|
|
|
|
—
|
|
<div class='inline'>
|
|
<p>Whether to build a <span class='object_link'><a href="../../Source/Map.html" title="Sass::Source::Map (class)">Source::Map</a></span> while creating the CSS output. The
|
|
mapping will be available from <span class='object_link'><a href="#source_mapping-instance_method" title="Sass::Tree::Visitors::ToCss#source_mapping (method)">#source_mapping</a></span> after the visitor has
|
|
completed.</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
11
|
|
12
|
|
13
|
|
14
|
|
15
|
|
16
|
|
17
|
|
18
|
|
19</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/tree/visitors/to_css.rb', line 11</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_build_source_mapping'>build_source_mapping</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
|
<span class='ivar'>@tabs</span> <span class='op'>=</span> <span class='int'>0</span>
|
|
<span class='ivar'>@line</span> <span class='op'>=</span> <span class='int'>1</span>
|
|
<span class='ivar'>@offset</span> <span class='op'>=</span> <span class='int'>1</span>
|
|
<span class='ivar'>@result</span> <span class='op'>=</span> <span class='const'>String</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
<span class='ivar'>@source_mapping</span> <span class='op'>=</span> <span class='id identifier rubyid_build_source_mapping'>build_source_mapping</span> <span class='op'>?</span> <span class='const'><span class='object_link'><a href="../../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Source.html" title="Sass::Source (module)">Source</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Source/Map.html" title="Sass::Source::Map (class)">Map</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../../Source/Map.html#initialize-instance_method" title="Sass::Source::Map#initialize (method)">new</a></span></span> <span class='op'>:</span> <span class='kw'>nil</span>
|
|
<span class='ivar'>@lstrip</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
<span class='ivar'>@in_directive</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="instance_attr_details" class="attr_details">
|
|
<h2>Instance Attribute Details</h2>
|
|
|
|
|
|
<span id=""></span>
|
|
<div class="method_details first">
|
|
<h3 class="signature first" id="source_mapping-instance_method">
|
|
|
|
#<strong>source_mapping</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>The source mapping for the generated CSS file. This is only set if
|
|
`build_source_mapping` is passed to the constructor and
|
|
<span class='object_link'><a href="../../Engine.html#render-instance_method" title="Sass::Engine#render (method)">Engine#render</a></span> has been run.</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
6
|
|
7
|
|
8</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/tree/visitors/to_css.rb', line 6</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_source_mapping'>source_mapping</span>
|
|
<span class='ivar'>@source_mapping</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div id="instance_method_details" class="method_details_list">
|
|
<h2>Instance Method Details</h2>
|
|
|
|
|
|
<div class="method_details first">
|
|
<h3 class="signature first" id="visit-instance_method">
|
|
|
|
#<strong>visit</strong>(node) ⇒ <tt>String</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Runs the visitor on `node`.</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
<p class="tag_title">Parameters:</p>
|
|
<ul class="param">
|
|
|
|
<li>
|
|
|
|
<span class='name'>node</span>
|
|
|
|
|
|
<span class='type'>(<tt><span class='object_link'><a href="../Node.html" title="Sass::Tree::Node (class)">Sass::Tree::Node</a></span></tt>)</span>
|
|
|
|
|
|
|
|
—
|
|
<div class='inline'>
|
|
<p>The root node of the tree to convert to CSS></p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|
|
|
|
|
|
|
—
|
|
<div class='inline'>
|
|
<p>The CSS output.</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
25
|
|
26
|
|
27
|
|
28
|
|
29
|
|
30</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/tree/visitors/to_css.rb', line 25</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_visit'>visit</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
|
|
<span class='kw'>super</span>
|
|
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../SyntaxError.html" title="Sass::SyntaxError (class)">SyntaxError</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
|
<span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_modify_backtrace'>modify_backtrace</span><span class='lparen'>(</span><span class='symbol'>:filename</span> <span class='op'>=></span> <span class='id identifier rubyid_node'>node</span><span class='period'>.</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='symbol'>:line</span> <span class='op'>=></span> <span class='id identifier rubyid_node'>node</span><span class='period'>.</span><span class='id identifier rubyid_line'>line</span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_raise'>raise</span> <span class='id identifier rubyid_e'>e</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="footer">
|
|
Generated on Mon Oct 22 13:21:00 2018 by
|
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
0.9.12 (ruby-2.5.3).
|
|
</div>
|
|
<script>
|
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
|
|
|
ga('create', 'UA-535380-14', 'sass-lang.com');
|
|
ga('send', 'pageview');
|
|
</script>
|
|
|
|
</body>
|
|
</html> |