Skip to content

Commit

Permalink
text replaces content + parameters' order of the property filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Mouvedia committed Nov 3, 2012
1 parent 62ea920 commit 5084f87
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
attr: no;
background: no;
contained: yes;
content: content;
contentAlignX: left;
contentAlignY: top;
count; Ⓡ
Expand Down Expand Up @@ -66,6 +65,7 @@
overflow: visible;
selectable: yes;
tab: 8;
text: content;
tracking: 0;
transform: no;
whitespace: collapse;
Expand Down
2 changes: 1 addition & 1 deletion properties.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
attr: (no) | @value { <name>:<string>; �; };
background: (no) | <object>, �;
contained: (yes) | no;
content: no | (content) | <string>;
contentAlignX: (left) | right | center/middle | justify | even | <number>;
contentAlignY: (top) | bottom | center/middle | justify | even | <number>;
direction: (ltr) | rtl | ttb | btt;
Expand Down Expand Up @@ -47,6 +46,7 @@
overflow: (visible) | hidden | @{<string>, last} | @{<string>, all};�
selectable: (yes) | no;
tab: <N>;
text: no | (content) | <string>;
tracking: <N>;
transform: (no) | capitalize | uppercase | lowercase;
whitespace: (collapse) | preserve;
Expand Down
19 changes: 9 additions & 10 deletions specification.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
FILE INFORMATION:
=================
Last changed: 2012/10/28
Last changed: 2012/11/04
HSS version: 1.0
Revision: 1.48
Revision: 1.49
****************************************************************-->

Expand Down Expand Up @@ -985,24 +985,23 @@ <h4 class="title"><span class="number"><a href="#n1.5.5" id="n1.5.5">1.5.5</a></
</div>
<div class="sub yet">
<h4 class="title"><span class="number"><a href="#n1.5.6" id="n1.5.6">1.5.6</a></span> Property filters</h4>
<p>Conditions are used to test whether an element is matched based on its properties.</p>
<p>The computed values are tested against, not the declared ones. For example if you set the height of a container to 50%, the value will be dynamically returned in points. To distinguish properties from keywords or object names <a href="#n1.6.3.b">type conversion functions</a> are necessary.</p>
<p>Conditions are used to test whether an element is matched based on its properties. The computed values are tested against, not the declared ones. For example if you set the height of a container to 50%, the value will be dynamically returned in points. The properties are on the left side of the comparator, the values on the right.</p>
<pre><span class="comment">//matches all elements whose content text is <em>select me</em></span>
<span class="selector">*</span>:(<span class="property">content</span> = "select me") { }
<span class="comment">//matches all elements with a background</span>
<span class="selector">*</span>:(<span class="property">background</span>) { }
<span class="comment">//which is equivalent to</span>
<span class="selector">*</span>:(<span class="property">background</span> != kwd(no)) { }
<span class="selector">*</span>:(<span class="property">background</span> != no) { }
<span class="comment">//similarly, this matches invisible elements</span>
<span class="selector">*</span>:(<span class="modifier">!</span><span class="property">visible</span>) { }
<span class="comment">//which is equivalent to</span>
<span class="selector">*</span>:(<span class="property">visible</span> = kwd(no)) { }
<span class="selector">*</span>:(<span class="property">visible</span> = no) { }
<span class="comment">//matches all elements which are using a font object named <em>serif</em></span>
<span class="selector">*</span>:(<span class="property">font</span> = obj(serif)) { }
<span class="selector">*</span>:(<span class="property">font</span> = serif) { }
<span class="comment">//matches all elements that are taller than 300 and not wider than 400</span>
<span class="selector">*</span>:(<span class="property">height</span> &gt; <span class="number">300</span> &amp; <span class="property">width</span> &lt; <span class="number">400</span>) { }
<span class="comment">//matches all elements which surface is square shaped</span>
<span class="selector">*</span>:(<span class="property">height</span> = <span class="property">width</span>) { }</pre>
<span class="selector">*</span>:(<span class="property">height</span> = ref(<span class="property">width</span>)) { }</pre>
<p><em>Note:</em> If recursion occurences are detected the condition(s) will be evaluated in one pass thus the value(s) returned will always be the same.</p>
</div>
<div class="sub yet">
Expand Down Expand Up @@ -1078,13 +1077,13 @@ <h4 class="title"><span class="number"><a href="#n1.5.9" id="n1.5.9">1.5.9</a></
<p>In HSS it is possible to create your own set of macros using the <code>#macro</code> instruction. They can also be imported from an external file, as any other part of your HSS code, which enables the creation of custom libraries.</p>
<pre>
<span class="comment">//used to style the first element out of the ones which have a black background</span>
<span class="instruction">#macro</span> firstBlack { :(background = kwd(black)):first }
<span class="instruction">#macro</span> firstBlack { :(background = black):first }
<span class="comment">//this creates an alias for :startsWith()</span>
<span class="instruction">#macro</span> sw(myArg) { :startsWith(myArg) }
<span class="comment">//creates a macro which selects the first or the last element</span>
<span class="instruction">#macro</span> limit { :first, :last }
<span class="comment">//macros are reusable inside other macros' definitions</span>
<span class="instruction">#macro</span> wideLimit { :(width > height):::limit }
<span class="instruction">#macro</span> wideLimit { :(width > ref(height)):::limit }
<span class="comment">//flags are accepted as well</span>
<span class="instruction">#macro</span> dock { ::target::hover }

Expand Down

0 comments on commit 5084f87

Please sign in to comment.