Skip to content

Commit 5b4da65

Browse files
committed
Update usage guide
1 parent 0d42881 commit 5b4da65

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

usage.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ <h3 class="subtema" id="shorthand-opti">Shorthand property optimisation</h3>
12431243

12441244
/* Verbose longhand properties */
12451245
color: rgba(255,255,0,255);
1246-
background-color: rgb(from lime r calc(g - 127) b);
1246+
border-color: rgb(from lime r calc(g - 127) b);
12471247

12481248
/* Shorthands with inefficient values */
12491249
border-radius: initial; /* Some compressors would remove this but that's wrong */
@@ -1253,7 +1253,7 @@ <h3 class="subtema" id="shorthand-opti">Shorthand property optimisation</h3>
12531253
}
12541254
</code></pre>
12551255
<p>are converted to</p>
1256-
<pre class="code"><code class="language-css">div,.cls{color:#ff0;background-color:green;border-radius:0;margin:2px;background:url(bkg.png) round space local}
1256+
<pre class="code"><code class="language-css">div,.cls{color:#ff0;border-color:green;border-radius:0;margin:2px;background:url(bkg.png) round space local}
12571257
</code></pre>
12581258
<p>The optimisations on shorthands can be disabled via the <code class="codeitem">Minify.Config</code>
12591259
parameter, or using the <code>--disable-shorthand</code> command line option:</p>
@@ -1345,7 +1345,7 @@ <h2>Accessing style sheet comments</h2>
13451345
<code><a href="api/latest/io.sf.carte.css4j/io/sf/carte/doc/style/css/om/AbstractStyleSheet.html#toStyleString()">toStyleString()</a></code> methods,
13461346
while other comments (located at places that cannot be easily related to a rule) are lost.</p>
13471347
<p>In css4j version 1.0, comments that were intended to apply to the previous rule may be assigned to the next one,
1348-
but this is addressed in version 2.0 where NSAC 2.0 allows a more accurate approach.</p>
1348+
but this was addressed in version 2.0 where NSAC 2.0 allows a more accurate approach.</p>
13491349
<p>Comments in the default HTML UA style sheet are not available, as the parser is instructed to ignore them when parsing.</p>
13501350
</div>
13511351
<div class="tema" id="renderinterfaces">
@@ -1371,7 +1371,7 @@ <h2>Providing device information for style computation</h2>
13711371
one or the other. The basic idea is that style databases should be relatively easy to implement for a given medium, while canvases are
13721372
probably only going to exist if there is an actual rendering engine implemented.</p>
13731373
<p>For an example implementation of a <code>DeviceFactory</code> and related classes, please check out
1374-
<code>MyDeviceFactory</code>, <code>MyStyleDatabase</code> and <code>MyCanvas</code> in EchoSVG's <a class="codeitem" href="https://github.com/css4j/echosvg/blob/master/echosvg-transcoder/src/main/java/io/sf/carte/echosvg/transcoder/util/CSSTranscodingHelper.java">CSSTranscodingHelper</a>,
1374+
<code>MyDeviceFactory</code>, <code>MyStyleDatabase</code> and <code>MyCanvas</code> in EchoSVG's <a class="codeitem" href="https://github.com/css4j/echosvg/blob/master/echosvg-transcoder-svg/src/main/java/io/sf/carte/echosvg/transcoder/util/CSSTranscodingHelper.java">CSSTranscodingHelper</a>,
13751375
or <a class="codeitem" href="https://github.com/css4j/css4j-awt/blob/master/src/io/sf/carte/doc/style/css/awt/AWTStyleDatabase.java">AWTStyleDatabase</a> in the <a href="https://github.com/css4j/css4j-awt"><code>css4j-awt</code> project</a>.</p>
13761376
</div>
13771377
<div class="tema" id="awt">
@@ -1405,8 +1405,8 @@ <h2>CSS3 support</h2>
14051405
<tr class="oddrow"><td><a href="https://www.w3.org/TR/css-backgrounds-3/">Background / Border 3</a></td><td class="yesno">Yes</td><td class="obsrv"></td></tr>
14061406
<tr class="evenrow"><td><a href="https://www.w3.org/TR/css-color-4/">Color 4</a></td><td class="yesno">Yes</td><td class="obsrv"></td></tr>
14071407
<tr class="oddrow"><td><a href="https://www.w3.org/TR/css-color-5/">Color 5</a></td><td class="yesno">Partial</td>
1408-
<td class="obsrv">Supports full level 4 but only <code>color-mix()</code> from level 5 (this is aligned with web browser
1409-
support at the time of writing).</td></tr>
1408+
<td class="obsrv">Supports full level 4 but only relative colors and <code>color-mix()</code>
1409+
from level 5 (this is aligned with web browser support baseline at the time of writing).</td></tr>
14101410
<tr class="evenrow"><td><a href="https://www.w3.org/TR/css-conditional-4/">Conditional Rules 4</a></td><td class="yesno">Yes</td><td class="obsrv"></td></tr>
14111411
<tr class="oddrow"><td><a href="https://www.w3.org/TR/css-fonts-4/">Fonts 4</a></td><td class="yesno"
14121412
>Partial</td><td class="obsrv">Has the <code>@font-face</code> and <code>@font-feature-values</code> rules,
@@ -1422,7 +1422,7 @@ <h2>CSS3 support</h2>
14221422
</em></td></tr>
14231423
<tr class="evenrow"><td><a href="https://www.w3.org/TR/css-masking-1/">Masking</a></td><td class="yesno">Partial</td><td class="obsrv">Decomposes the <code>mask</code> shorthand. <em>Not supported by the simple box model.</em></td></tr>
14241424
<tr class="oddrow"><td><a href="https://www.w3.org/TR/css-transitions-1/">Transitions</a></td><td class="yesno">Yes</td><td class="obsrv">Decomposes the <code>transition</code> shorthand.</td></tr>
1425-
<tr class="evenrow"><td><a href="https://www.w3.org/TR/css-values-4/">Values 4</a></td><td class="yesno">Yes</td><td class="obsrv">Advanced <code>attr()</code> from level 5 also has early support.</td></tr>
1425+
<tr class="evenrow"><td><a href="https://www.w3.org/TR/css-values-4/">Values 4</a></td><td class="yesno">Yes</td><td class="obsrv">Advanced <code>attr()</code> from level 5 is also supported.</td></tr>
14261426
<tr class="oddrow"><td><a href="https://www.w3.org/TR/css-variables-1/">Variables</a></td><td class="yesno">Yes</td><td class="obsrv"><code>var()</code> is supported in computed styles.</td></tr>
14271427
<tr class="evenrow"><td><a href="https://www.w3.org/TR/css-properties-values-api-1/">CSS Properties and Values API</a></td><td class="yesno">Yes</td><td class="obsrv">Full support (also in computed styles).</td></tr>
14281428
<tr class="oddrow"><td><a href="https://www.w3.org/TR/css-grid-1/">Grid / Template / Alignment</a></td>
@@ -1431,12 +1431,13 @@ <h2>CSS3 support</h2>
14311431
can be used if declared explicitly). <em>Not supported by the simple box model.</em></td></tr>
14321432
</table>
14331433
<h3 class="subtema" id="pseudoclasses">Pseudo-classes</h3>
1434-
<p>The following pseudo-classes are supported by the library:
1434+
<p>A number of pseudo-classes are supported by the library, including:
14351435
<code>first-child</code>, <code>last-child</code>, <code>only-child</code>, <code>nth-child()</code>, <code>nth-last-child()</code>, <code>first-of-type</code>,
14361436
<code>last-of-type</code>, <code>only-of-type</code>, <code>nth-of-type()</code>, <code>nth-last-of-type()</code>, <code>dir</code>, <code>lang</code>,
14371437
<code>any-link</code>, <code>link</code>, <code>visited</code>, <code>target</code>, <code>root</code>, <code>empty</code>, <code>blank</code>,
1438-
<code>disabled</code>, <code>enabled</code>, <code>read-write</code>, <code>read-only</code>, <code>is</code>, <code>where</code>, <code>has</code>,
1439-
<code>not</code>, <code>placeholder-shown</code>, <code>default</code>, <code>checked</code> and <code>indeterminate</code>.</p>
1438+
<code>disabled</code>, <code>enabled</code>, <code>read-write</code>, <code>read-only</code>, <code>is</code>, <code>where</code>, <code>has</code>, <code>not</code>,
1439+
<code>placeholder-shown</code>, <code>default</code>, <code>checked</code>, <code>indeterminate</code>,
1440+
<code>host</code>, <code>host-context</code> and <code>state</code>.</p>
14401441
<p>State pseudo-classes like <code>hover</code> are supported through the
14411442
<a class="codeitem" href="api/latest/io.sf.carte.css4j/io/sf/carte/doc/style/css/CSSCanvas.html#isActivePseudoClass(io.sf.carte.doc.style.css.CSSElement,java.lang.String)">CSSCanvas.isActivePseudoClass(CSSElement, String)</a> method.</p>
14421443
</div>

0 commit comments

Comments
 (0)