Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1
Closed
Description
Hi, I'm unable to parse>
and+
in selectors. They seem to get lost...
I haven't attempted to fix this myself, I might do it tomorrow.
Any suggestions on where to start would be appreciated, I'm not at all familiar with the code.
Example:
ppCSS.parse(".a, .b { color: #f0f; }")ppCSS.parse(".a + .b { color: #f0f; }")ppCSS.parse(".a > .b { color: #f0f; }")
Output:
(css-stylesheet (style-rule (selectors (class-selector (ident-token"a")), (class-selector (ident-token"b")) ) (declarations (declaration color (hash-token"f0f" id)) ) ))(css-stylesheet (style-rule (selectors (class-selector (ident-token"a"))) (declarations (declaration color (hash-token"f0f" id)))))(css-stylesheet (style-rule (selectors (class-selector (ident-token"a"))) (declarations (declaration color (hash-token"f0f" id)))))
I noticed that@media
doesn't seem to be parsed correctly either.
There should probably be astyle-rule
instead of asimple-block
.
pp CSS.parse(".a { color: #f0f; }")pp CSS.parse("@media (max-width: 1px) { .a { color: #f0f; } }")
Output:
(css-stylesheet (style-rule (selectors (class-selector (ident-token"a"))) (declarations (declaration color (hash-token"f0f" id)))))(css-stylesheet (at-rule"media" (prelude (whitespace-token""), (simple-block"(" (ident-token"max-width"), (colon-token), (whitespace-token""), (dimension-token integer1 px)), (whitespace-token"") ) (simple-block"{" (whitespace-token""), (delim-token"."), (ident-token"a"), (whitespace-token""), (simple-block"{" (whitespace-token""), (ident-token"color"), (colon-token), (whitespace-token""), (hash-token"f0f" id), (semicolon-token), (whitespace-token"") ), (whitespace-token"") ) ))
Similar issues with@property
:
ppCSS.parse(<<~CSS) @property --angle { syntax: "<angle>"; inherits: false; initial-value: 10deg; }CSS
Output:
(css-stylesheet (at-rule"property" (prelude (whitespace-token""), (ident-token"--angle"), (whitespace-token"") ) (simple-block"{" (whitespace-token"\n" +""), (ident-token"syntax"), (colon-token), (whitespace-token""), (string-token"<angle>"), (semicolon-token), (whitespace-token"\n" +""), (ident-token"inherits"), (colon-token), (whitespace-token""), (ident-token"false"), (semicolon-token), (whitespace-token"\n" +""), (ident-token"initial-value"), (colon-token), (whitespace-token""), (dimension-token integer10 deg), (semicolon-token), (whitespace-token"\n") ) ))
Just noticed attribute selectors also get lost..
Input:
ppCSS.parse('.a[aria-current="page"] { color: #f0f; }')
Output:
(css-stylesheet (style-rule (selectors (class-selector (ident-token"a"))) (declarations (declaration color (hash-token"f0f" id)))))
Metadata
Metadata
Assignees
Labels
No labels