<Comment>/*</Comment><br/>
<Comment> * </Comment><SPDX Tag>SPDX-FileCopyrightText:</SPDX Tag><Comment> 2022 Volker Krause <vkrause@kde.org></Comment><br/>
<Comment> * </Comment><SPDX Tag>SPDX-License-Identifier:</SPDX Tag><SPDX Value> </SPDX Value><SPDX License>MIT</SPDX License><br/>
<Comment> */</Comment><br/>
<Normal></Normal><br/>
<Comment>// samples taken from kosmindoormap MapCSS parser unit tests</Comment><br/>
<Normal></Normal><br/>
<Keyword>@import</Keyword><Normal> </Normal><Function>url</Function><Normal>(</Normal><String>"included.mapcss"</String><Normal>);</Normal><br/>
<Normal></Normal><br/>
<Comment>// union selector</Comment><br/>
<Type>area</Type><Normal>[railway=platform],</Normal><br/>
<Type>relation</Type><Normal>[type=multipolygon][railway=platform]</Normal><br/>
<Normal>{</Normal><br/>
<Normal>    </Normal><Properties>color</Properties><Normal>: </Normal><Color>#ff550022</Color><Normal>;</Normal><br/>
<Normal>    </Normal><Properties>fill-color</Properties><Normal>: </Normal><Color>#80f0e0d0</Color><Normal>;</Normal><br/>
<Normal>}</Normal><br/>
<Normal></Normal><br/>
<Comment>// chained selector</Comment><br/>
<Type>area</Type><Normal>[railway=platform] </Normal><Type>node</Type><Normal>[sign]</Normal><br/>
<Normal>{</Normal><br/>
<Normal>    </Normal><Properties>fill-color</Properties><Normal>: </Normal><Color>#ff0000</Color><Normal>;</Normal><br/>
<Normal>    </Normal><Properties>opacity</Properties><Normal>: </Normal><Float>0.5</Float><Normal>;</Normal><br/>
<Normal>}</Normal><br/>
<Normal></Normal><br/>
<Comment>// condition with colon-separated keys</Comment><br/>
<Type>node</Type><Normal>[building:part][building:part=elevator]</Normal><br/>
<Normal>{</Normal><br/>
<Normal>    </Normal><Properties>opacity</Properties><Normal>: </Normal><Decimal>1</Decimal><Normal>;</Normal><br/>
<Normal>    </Normal><Properties>color</Properties><Normal>: building:color;</Normal><br/>
<Normal>}</Normal><br/>
<Normal></Normal><br/>
<Comment>// text properties</Comment><br/>
<Type>*</Type><Normal> {</Normal><br/>
<Normal>    </Normal><Properties>text</Properties><Normal>: ref;</Normal><br/>
<Normal>    </Normal><Properties>text-color</Properties><Normal>: </Normal><Color>#ff00ff</Color><Normal>;</Normal><br/>
<Normal>}</Normal><br/>
<Normal></Normal><br/>
<Comment>// line properties</Comment><br/>
<Type>line</Type><Normal> {</Normal><br/>
<Normal>    </Normal><Properties>dashes</Properties><Normal>: </Normal><Decimal>3</Decimal><Normal>,</Normal><Decimal>5</Decimal><Normal>;</Normal><br/>
<Normal>    </Normal><Properties>linecap</Properties><Normal>: </Normal><Constant>round</Constant><Normal>;</Normal><br/>
<Normal>    </Normal><Properties>linejoin</Properties><Normal>: </Normal><Constant>bevel</Constant><Normal>;</Normal><br/>
<Normal>    </Normal><Properties>casing-width</Properties><Normal>: </Normal><Decimal>1</Decimal><Normal>;</Normal><br/>
<Normal>    </Normal><Properties>casing-color</Properties><Normal>: </Normal><Color>#444444</Color><Normal>;</Normal><br/>
<Normal>    </Normal><Properties>casing-dashes</Properties><Normal>: </Normal><Decimal>1</Decimal><Normal>,</Normal><Decimal>1</Decimal><Normal>;</Normal><br/>
<Normal>}</Normal><br/>
<Normal></Normal><br/>
<Comment>// zoom ranges</Comment><br/>
<Type>node</Type><Normal>|</Normal><Zoom>z12-13</Zoom><Normal> {}</Normal><br/>
<Type>node</Type><Normal>|</Normal><Zoom>z10</Zoom><Normal> {}</Normal><br/>
<Type>node</Type><Normal>|</Normal><Zoom>z-10</Zoom><Normal> {}</Normal><br/>
<Type>node</Type><Normal>|</Normal><Zoom>z10-</Zoom><Normal> {}</Normal><br/>
<Type>node</Type><Normal>|</Normal><Zoom>z12-13</Zoom><Normal>[name] {}</Normal><br/>
<Type>node</Type><Normal>|</Normal><Zoom>z14-</Zoom><Normal>[name] {}</Normal><br/>
<Normal></Normal><br/>
<Comment>// numeric comparison conditions</Comment><br/>
<Type>*</Type><Normal> [layer>1],</Normal><br/>
<Type>*</Type><Normal> [layer<2],</Normal><br/>
<Type>*</Type><Normal> [layer>=3],</Normal><br/>
<Type>*</Type><Normal> [layer<=4] {}</Normal><br/>
<Normal></Normal><br/>
<Comment>// object types as tag or property values</Comment><br/>
<Type>area</Type><Normal>[indoor=area] {</Normal><br/>
<Normal>    </Normal><Properties>text-position</Properties><Normal>: </Normal><Constant>line</Constant><Normal>;</Normal><br/>
<Normal>    </Normal><Properties>width</Properties><Normal>: width;</Normal><br/>
<Normal>}</Normal><br/>
<Normal></Normal><br/>
<Comment>// units</Comment><br/>
<Type>*</Type><Normal> {</Normal><br/>
<Normal>    </Normal><Properties>font-size</Properties><Normal>: </Normal><Decimal>16</Decimal><Keyword>pt</Keyword><Normal>;</Normal><br/>
<Normal>    </Normal><Properties>width</Properties><Normal>: </Normal><Decimal>42</Decimal><Keyword>px</Keyword><Normal>;</Normal><br/>
<Normal>    </Normal><Properties>casing-width</Properties><Normal>: </Normal><Decimal>2</Decimal><Keyword>m</Keyword><Normal>;</Normal><br/>
<Normal>}</Normal><br/>
<Normal></Normal><br/>
<Comment>// negative numbers</Comment><br/>
<Type>*</Type><Normal> {</Normal><br/>
<Normal>    </Normal><Properties>width</Properties><Normal>: -</Normal><Float>10.42</Float><Normal>;</Normal><br/>
<Normal>}</Normal><br/>
<Normal></Normal><br/>
<Normal></Normal><br/>
<Comment>// colors</Comment><br/>
<Type>*</Type><Normal> {</Normal><br/>
<Normal>    </Normal><Properties>text-color</Properties><Normal>: </Normal><Color>#aabbcc</Color><Normal>;</Normal><br/>
<Normal>    </Normal><Properties>fill-color</Properties><Normal>: </Normal><Color>#80ccbbaa</Color><Normal>;</Normal><br/>
<Normal>    </Normal><Properties>casing-color</Properties><Normal>: </Normal><Color>#123</Color><Normal>;</Normal><br/>
<Normal>    </Normal><Properties>shield-color</Properties><Normal>: </Normal><Function>rgb</Function><Normal>(</Normal><Float>1.0</Float><Normal>, </Normal><Float>0.5</Float><Normal>, </Normal><Float>0.25</Float><Normal>);</Normal><br/>
<Normal>    </Normal><Properties>shield-casing-color</Properties><Normal>: </Normal><Function>rgba</Function><Normal>(</Normal><Float>0.75</Float><Normal>, </Normal><Float>1.0</Float><Normal>, </Normal><Float>0.25</Float><Normal>, </Normal><Float>0.5</Float><Normal>);</Normal><br/>
<Normal>    </Normal><Properties>color</Properties><Normal>: </Normal><String>"red"</String><Normal>;</Normal><br/>
<Normal>}</Normal><br/>
<Normal></Normal><br/>
<Comment>// set tag</Comment><br/>
<Type>node</Type><Normal>[shop=bakery] {</Normal><br/>
<Normal>    </Normal><Keyword>set</Keyword><Normal> mx:important;</Normal><br/>
<Normal>}</Normal><br/>
<Normal></Normal><br/>
<Comment>// set tag to a specific value</Comment><br/>
<Type>area</Type><Normal>[shop=bakery] {</Normal><br/>
<Normal>    </Normal><Keyword>set</Keyword><Normal> mx:importance = </Normal><String>"high"</String><Normal>;</Normal><br/>
<Normal>    </Normal><Keyword>set</Keyword><Normal> mx:importance = 20;</Normal><br/>
<Normal>}</Normal><br/>
<Normal></Normal><br/>
<Comment>// set class</Comment><br/>
<Type>node</Type><Normal>[shop=bakery],</Normal><br/>
<Type>node</Type><Normal>[shop=pastry]</Normal><br/>
<Normal>{</Normal><br/>
<Normal>    </Normal><Keyword>set</Keyword><Normal> </Normal><Class>.importantShops</Class><Normal>;</Normal><br/>
<Normal>}</Normal><br/>
<Normal></Normal><br/>
<Comment>// class selectors</Comment><br/>
<Type>node</Type><Class>.importantShops</Class><Normal> { </Normal><Properties>color</Properties><Normal>: </Normal><String>"red"</String><Normal>; }</Normal><br/>
<Type>way</Type><Class>.importantShops</Class><Normal>|</Normal><Zoom>z20-</Zoom><Normal> { </Normal><Properties>color</Properties><Normal>: </Normal><String>"green"</String><Normal>; }</Normal><br/>
<Type>*</Type><Class>.importantShops</Class><Normal>[access=no] { </Normal><Properties>color</Properties><Normal>: </Normal><String>"blue"</String><Normal>; }</Normal><br/>
<Normal></Normal><br/>
<Comment>// layer selectors (see https://wiki.openstreetmap.org/wiki/MapCSS/0.2/Proposal_layer_selector)</Comment><br/>
<Type>way</Type><Normal>[highway]</Normal><Layer>::road</Layer><Normal> {</Normal><br/>
<Normal>  </Normal><Properties>width</Properties><Normal>: </Normal><Decimal>8</Decimal><Normal>;</Normal><br/>
<Normal>  </Normal><Properties>color</Properties><Normal>: </Normal><Color>#ffffff</Color><Normal>;</Normal><br/>
<Normal>  </Normal><Properties>casing-width</Properties><Normal>: </Normal><Decimal>2</Decimal><Normal>;</Normal><br/>
<Normal>  </Normal><Properties>casing-color</Properties><Normal>: </Normal><Color>#a0a0a0</Color><Normal>;</Normal><br/>
<Normal>}</Normal><br/>
<Type>way</Type><Normal>[railway=tram]</Normal><Layer>::tram</Layer><Normal> {</Normal><br/>
<Normal>  </Normal><Properties>width</Properties><Normal>: </Normal><Decimal>2</Decimal><Normal>;</Normal><br/>
<Normal>  </Normal><Properties>color</Properties><Normal>: </Normal><Color>#303030</Color><Normal>;</Normal><br/>
<Normal>  </Normal><Properties>z-index</Properties><Normal>: </Normal><Decimal>1</Decimal><Normal>;</Normal><br/>
<Normal>}</Normal><br/>
<Comment>// default layer selector</Comment><br/>
<Type>node</Type><Layer>::default</Layer><Normal> {</Normal><br/>
<Normal>    </Normal><Properties>icon-image</Properties><Normal>: </Normal><String>"bla"</String><Normal>;</Normal><br/>
<Normal>}</Normal><br/>
