Warning, /frameworks/syntax-highlighting/autotests/input/highlight.mapcss is written in an unsupported language. File is not indexed.
0001 /* 0002 * SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org> 0003 * SPDX-License-Identifier: MIT 0004 */ 0005 0006 // samples taken from kosmindoormap MapCSS parser unit tests 0007 0008 @import url("included.mapcss"); 0009 0010 // union selector 0011 area[railway=platform], 0012 relation[type=multipolygon][railway=platform] 0013 { 0014 color: #ff550022; 0015 fill-color: #80f0e0d0; 0016 } 0017 0018 // chained selector 0019 area[railway=platform] node[sign] 0020 { 0021 fill-color: #ff0000; 0022 opacity: 0.5; 0023 } 0024 0025 // condition with colon-separated keys 0026 node[building:part][building:part=elevator] 0027 { 0028 opacity: 1; 0029 color: building:color; 0030 } 0031 0032 // text properties 0033 * { 0034 text: ref; 0035 text-color: #ff00ff; 0036 } 0037 0038 // line properties 0039 line { 0040 dashes: 3,5; 0041 linecap: round; 0042 linejoin: bevel; 0043 casing-width: 1; 0044 casing-color: #444444; 0045 casing-dashes: 1,1; 0046 } 0047 0048 // zoom ranges 0049 node|z12-13 {} 0050 node|z10 {} 0051 node|z-10 {} 0052 node|z10- {} 0053 node|z12-13[name] {} 0054 node|z14-[name] {} 0055 0056 // numeric comparison conditions 0057 * [layer>1], 0058 * [layer<2], 0059 * [layer>=3], 0060 * [layer<=4] {} 0061 0062 // object types as tag or property values 0063 area[indoor=area] { 0064 text-position: line; 0065 width: width; 0066 } 0067 0068 // units 0069 * { 0070 font-size: 16pt; 0071 width: 42px; 0072 casing-width: 2m; 0073 } 0074 0075 // negative numbers 0076 * { 0077 width: -10.42; 0078 } 0079 0080 0081 // colors 0082 * { 0083 text-color: #aabbcc; 0084 fill-color: #80ccbbaa; 0085 casing-color: #123; 0086 shield-color: rgb(1.0, 0.5, 0.25); 0087 shield-casing-color: rgba(0.75, 1.0, 0.25, 0.5); 0088 color: "red"; 0089 } 0090 0091 // set tag 0092 node[shop=bakery] { 0093 set mx:important; 0094 } 0095 0096 // set tag to a specific value 0097 area[shop=bakery] { 0098 set mx:importance = "high"; 0099 set mx:importance = 20; 0100 } 0101 0102 // set class 0103 node[shop=bakery], 0104 node[shop=pastry] 0105 { 0106 set .importantShops; 0107 } 0108 0109 // class selectors 0110 node.importantShops { color: "red"; } 0111 way.importantShops|z20- { color: "green"; } 0112 *.importantShops[access=no] { color: "blue"; } 0113 0114 // layer selectors (see https://wiki.openstreetmap.org/wiki/MapCSS/0.2/Proposal_layer_selector) 0115 way[highway]::road { 0116 width: 8; 0117 color: #ffffff; 0118 casing-width: 2; 0119 casing-color: #a0a0a0; 0120 } 0121 way[railway=tram]::tram { 0122 width: 2; 0123 color: #303030; 0124 z-index: 1; 0125 } 0126 // default layer selector 0127 node::default { 0128 icon-image: "bla"; 0129 } 0130 0131 //quoted values in conditions 0132 line|z16-[highway=service][service="drive-through"] { 0133 set .service; 0134 width: 1.5m; 0135 }