Repository navigation
Add Input#document - #1996
Merged
ai merged 3 commits intoJan 13, 2025
Merged
Add Input#document#1996
Input#document#1996Conversation
romainmenke
commented
Dec 25, 2024
| } | ||
|
|
||
| this.document = this.css | ||
| if (opts.document) this.document = opts.document.toString() |
Contributor
Author
There was a problem hiding this comment.
I chose to use opts.document and add document to ProcessOptions.
Alternatively it could also be less exposed and only exists as a field on Input.
let root = parse('a {} b {}')
root.source.input.document = '<style>a {} b {}</style>';We would still keep this.document = this.css to make sure that there is always a value.
romainmenke
marked this pull request as ready for review
December 25, 2024 11:28
ai
reviewed
Dec 25, 2024
| * Input source with support for non-CSS documents. | ||
| * | ||
| * ```js | ||
| * const input = postcss.parse('a{}', { from: file }).input |
Member
There was a problem hiding this comment.
Let’s use HTML in example to show why we need document
ai
reviewed
Dec 25, 2024
Member
|
Looks amazing (only a few small docs changes suggested), but I prefer to merge and release it after holidays to avoid rush fixes in the middle of holiday :D |
Co-authored-by: Andrey Sitnik <[email protected]>
Contributor
Author
|
Thank you for the review 🙇 |
Member
|
Thanks! The new property was released in 8.5.0. |
Contributor
Author
|
Thank you @ai for the reviews and release 🙇 |
hanzo-dev
pushed a commit
to hanzoai/postcss
that referenced
this pull request
Sep 9, 2026
* Add `Input#document` * Update lib/postcss.d.ts Co-authored-by: Andrey Sitnik <[email protected]> * apply suggestion from code review --------- Co-authored-by: Andrey Sitnik <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fixes: #1995