Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(css_formatter): support for attribute selectors [#1285] #1286

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

faultyserver
Copy link
Contributor

@faultyserver faultyserver commented Dec 21, 2023

Summary

#1285. This implements attribute selectors and all of the sub-nodes for it.

Two notes:

  • The parser doesn't seem to currently understand $= attribute matchers, like [href$='.com']. This gets parsed as href$ being an identifier, then the rest becomes bogus. All of the other operators work as expected, though.
  • Values should also eventually be formatted consistently with quotes. This will also be subject to the quoteStyle option once that gets added later on.

Test Plan

Added a bunch of spec tests to roughly match prettier, sans the $= matcher

@github-actions github-actions bot added A-Formatter Area: formatter L-CSS Language: CSS labels Dec 21, 2023
@faultyserver faultyserver mentioned this pull request Dec 21, 2023
11 tasks
@denbezrukov
Copy link
Contributor

Oh,
I'll check the issue with the operator.

@denbezrukov
Copy link
Contributor

#1288

@faultyserver
Copy link
Contributor Author

Once that PR for the parser merges, I'll come back and re-add the appropriate tests here (there are others like the s time unit not working as well, that i've found, which that PR will also fix!)

@faultyserver faultyserver merged commit 4dac0be into faulty/css-formatter-basics Dec 22, 2023
4 checks passed
@faultyserver faultyserver deleted the faulty/css-attributes branch December 22, 2023 00:44
@Conaclos Conaclos added the A-Changelog Area: changelog label Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Formatter Area: formatter L-CSS Language: CSS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants