fix: allow double hyphen css selector names (#15384)

pull/15394/head
Paolo Ricciuti 6 months ago committed by GitHub
parent c2ec0d9ac2
commit 3d59e84a65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: allow double hyphen css selector names

@ -566,7 +566,7 @@ function read_attribute_value(parser) {
} }
/** /**
* https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier * https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
* @param {Parser} parser * @param {Parser} parser
*/ */
function read_identifier(parser) { function read_identifier(parser) {
@ -574,7 +574,7 @@ function read_identifier(parser) {
let identifier = ''; let identifier = '';
if (parser.match('--') || parser.match_regex(REGEX_LEADING_HYPHEN_OR_DIGIT)) { if (parser.match_regex(REGEX_LEADING_HYPHEN_OR_DIGIT)) {
e.css_expected_identifier(start); e.css_expected_identifier(start);
} }

@ -0,0 +1,7 @@
<div class="--foo"></div>
<style>
.--foo {
color: red;
}
</style>
Loading…
Cancel
Save