Alow manipulating Selector
parts from consumer code
#561
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR needs a review and is open to renaming/tests/suggestions.
The proposed API is a logical continuation of #495, #485, and it covers a usecase of
fervid
project: https://github.com/phoenix-ru/fervid/blob/master/crates/fervid_css/src/transform_style_scoped.rs#L331-L337It allows appending
Selector
components with bypassing the checks in https://github.com/parcel-bundler/lightningcss/blob/master/selectors/parser.rs#L718-L725Two new helpers are added:
insert_raw
for inserting a singleComponent
at an arbitrary index;insert_raw_multiple
for inserting multipleComponent
s at an arbitrary index.It is a blocker to Vue
<style>
transformations, examples of which are here:https://github.com/phoenix-ru/fervid/blob/master/crates/fervid_css/src/lib.rs#L92-L186