|
2136 | 2136 | }
|
2137 | 2137 | ]
|
2138 | 2138 | 'shared-names':
|
2139 |
| - # Shared names are keywords that can be used as selector or property names. |
2140 |
| - # If the following conditions are met, the keyword is considered a selector: |
2141 |
| - 'begin': '''(?xi) |
2142 |
| - # Selector match must be preceded by one of the following: |
2143 |
| - (?<= |
2144 |
| - ^ # Start of line |
2145 |
| - | (^|[^\\:])\\s # Whitespace, after the start of a line or any character except a colon |
2146 |
| - | [{}] # Opening or closing brace (condensed property list syntax) |
2147 |
| - | \\*/ # Comment end |
2148 |
| - | \\\\(?:[0-9a-fA-F]{1,6}|.) # Escape sequence |
2149 |
| - ) |
| 2139 | + # Shared names are keywords that are listed in both selector and property name contexts. |
| 2140 | + 'patterns': [ |
| 2141 | + # The following are considered selectors by default: |
| 2142 | + { |
| 2143 | + 'begin': '''(?xi) |
| 2144 | + # Selector match must be preceded by one of the following: |
| 2145 | + (?<= |
| 2146 | + ^ # Start of line |
| 2147 | + | (^|[^\\:])\\s # Whitespace, after the start of a line or any character except a colon |
| 2148 | + | [{}] # Opening or closing brace (condensed property list syntax) |
| 2149 | + | \\*/ # Comment end |
| 2150 | + | \\\\(?:[0-9a-fA-F]{1,6}|.) # Escape sequence |
| 2151 | + ) |
2150 | 2152 |
|
2151 |
| - (?= |
2152 |
| - # Selector must match: |
2153 |
| - (?: |
2154 |
| - # HTML elements |
2155 |
| - content|font|header|image|label|mark|marquee|mask|nav|ruby|shadow|span|style |
2156 |
| - # SVG elements |
2157 |
| - |color-profile|cursor|filter|line|text |
| 2153 | + (?= |
| 2154 | + # Selector must match: |
| 2155 | + (?: |
| 2156 | + # HTML elements |
| 2157 | + header|image|label|marquee|mask|nav|ruby|shadow|span|style |
| 2158 | + # SVG elements |
| 2159 | + |color-profile|line|text |
| 2160 | + ) |
| 2161 | +
|
| 2162 | + # Selector must NOT be followed by any any of the following: |
| 2163 | + (?! |
| 2164 | + .*; # Any characters followed by a semicolon (denotes a property) |
| 2165 | + | [^{]*} # Any characters, except an opening brace, followed by a closing bracket (denotes a property) |
| 2166 | + | - # A dash (denotes a property name) |
| 2167 | + ) |
| 2168 | + ) |
| 2169 | + ''' |
| 2170 | + 'end': '''(?xi) |
| 2171 | + # Selector match ends with one of the following: |
| 2172 | + (?= |
| 2173 | + \\s # Whitespace |
| 2174 | + | \\/\\* # Comment |
| 2175 | + | , # Comma |
| 2176 | + | { # Opening property list brace |
| 2177 | + | $ # End of line |
| 2178 | + ) |
| 2179 | + ''' |
| 2180 | + 'patterns': [ |
| 2181 | + { |
| 2182 | + 'include': '#selector' |
| 2183 | + } |
| 2184 | + ] |
| 2185 | + } |
| 2186 | + # The following are considered property names by default when attached to a colon: |
| 2187 | + { |
| 2188 | + 'begin': '''(?xi) |
| 2189 | + # Selector match must be preceded by one of the following: |
| 2190 | + (?<= |
| 2191 | + ^ # Start of line |
| 2192 | + | (^|[^\\:])\\s # Whitespace, after the start of a line or any character except a colon |
| 2193 | + | [{}] # Opening or closing brace (condensed property list syntax) |
| 2194 | + | \\*/ # Comment end |
| 2195 | + | \\\\(?:[0-9a-fA-F]{1,6}|.) # Escape sequence |
2158 | 2196 | )
|
2159 | 2197 |
|
2160 |
| - # Selector must NOT be followed by any any of the following: |
2161 |
| - (?! |
2162 |
| - .*; # Any characters followed by a semicolon (denotes a property) |
2163 |
| - | .*} # Any characters followed by a closing bracket (denotes a property) |
2164 |
| - | - # A dash (denotes a property name) |
2165 |
| - # | \\s*\\: # A colon, unless it's with one of the following: |
2166 |
| - # (?! |
2167 |
| - # # A opening bracket before an closing bracket |
2168 |
| - # [^}]*{ |
2169 |
| - # # A pseudo-class selectors |
2170 |
| - # | active|any-link|checked|disabled|empty|enabled|first |
2171 |
| - # | (?:first|last|only)-(?:child|of-type)|focus|focus-visible|focus-within|fullscreen|host|hover |
2172 |
| - # | in-range|indeterminate|invalid|link|out-of-range |
2173 |
| - # | read-only|read-write|required|root|scope|target|unresolved |
2174 |
| - # | valid|visited |
| 2198 | + (?= |
| 2199 | + # Selector must match: |
| 2200 | + (?: |
| 2201 | + # HTML elements |
| 2202 | + content|font|mark |
| 2203 | + # SVG elements |
| 2204 | + |cursor|filter |
| 2205 | + ) |
2175 | 2206 |
|
2176 |
| - # # A functional pseudo-class selectors |
2177 |
| - # | (?: dir|lang |
2178 |
| - # | not|has|matches|where|is |
2179 |
| - # | nth-(?:last-)?(?:child|of-type) |
2180 |
| - # )\\( |
| 2207 | + # Selector must NOT be followed by any any of the following: |
| 2208 | + (?! |
| 2209 | + .*; # Any characters followed by a semicolon (denotes a property) |
| 2210 | + | [^{]*} # Any characters, except an opening brace, followed by a closing bracket (denotes a property) |
| 2211 | + | - # A dash (denotes a property name) |
| 2212 | + | \\: # A colon, unless it's with one of the following: |
| 2213 | + (?! |
| 2214 | + # A opening bracket before an closing bracket |
| 2215 | + [^}]*{ |
| 2216 | + # A pseudo-class selectors |
| 2217 | + | active|any-link|checked|disabled|empty|enabled|first |
| 2218 | + | (?:first|last|only)-(?:child|of-type)|focus|focus-visible|focus-within|fullscreen|host|hover |
| 2219 | + | in-range|indeterminate|invalid|link|out-of-range |
| 2220 | + | read-only|read-write|required|root|scope|target|unresolved |
| 2221 | + | valid|visited |
2181 | 2222 |
|
2182 |
| - # # A single-colon pseudo-element selectors |
2183 |
| - # | after |
2184 |
| - # | before |
2185 |
| - # | first-letter |
2186 |
| - # | first-line |
2187 |
| - # | (?: |
2188 |
| - # \\- |
2189 |
| - # (?: |
2190 |
| - # ah|apple|atsc|epub|hp|khtml|moz |
2191 |
| - # | ms|o|rim|ro|tc|wap|webkit|xv |
2192 |
| - # ) |
2193 |
| - # | (?: |
2194 |
| - # mso|prince |
2195 |
| - # ) |
2196 |
| - # ) |
2197 |
| - # -[a-z-]+ |
2198 |
| - # ) |
| 2223 | + # A functional pseudo-class selectors |
| 2224 | + | (?: dir|lang |
| 2225 | + | not|has|matches|where|is |
| 2226 | + | nth-(?:last-)?(?:child|of-type) |
| 2227 | + )\\( |
| 2228 | +
|
| 2229 | + # A single-colon pseudo-element selectors |
| 2230 | + | after |
| 2231 | + | before |
| 2232 | + | first-letter |
| 2233 | + | first-line |
| 2234 | + | (?: |
| 2235 | + \\- |
| 2236 | + (?: |
| 2237 | + ah|apple|atsc|epub|hp|khtml|moz |
| 2238 | + | ms|o|rim|ro|tc|wap|webkit|xv |
| 2239 | + ) |
| 2240 | + | (?: |
| 2241 | + mso|prince |
| 2242 | + ) |
| 2243 | + ) |
| 2244 | + -[a-z-]+ |
| 2245 | + ) |
| 2246 | + ) |
2199 | 2247 | )
|
2200 |
| - ) |
2201 |
| - ''' |
2202 |
| - 'end': '''(?xi) |
2203 |
| - # Selector match ends with one of the following: |
2204 |
| - (?= |
2205 |
| - \\s # Whitespace |
2206 |
| - | \\/\\* # Comment |
2207 |
| - | , # Comma |
2208 |
| - | { # Opening property list brace |
2209 |
| - | $ # End of line |
2210 |
| - ) |
2211 |
| - ''' |
2212 |
| - 'patterns': [ |
2213 |
| - { |
2214 |
| - 'include': '#selector' |
| 2248 | + ''' |
| 2249 | + 'end': '''(?xi) |
| 2250 | + # Selector match ends with one of the following: |
| 2251 | + (?= |
| 2252 | + \\s # Whitespace |
| 2253 | + | \\/\\* # Comment |
| 2254 | + | , # Comma |
| 2255 | + | { # Opening property list brace |
| 2256 | + | $ # End of line |
| 2257 | + ) |
| 2258 | + ''' |
| 2259 | + 'patterns': [ |
| 2260 | + { |
| 2261 | + 'include': '#selector' |
| 2262 | + } |
| 2263 | + ] |
2215 | 2264 | }
|
2216 | 2265 | ]
|
2217 | 2266 | 'string':
|
|
0 commit comments