This repository was archived by the owner on Apr 26, 2020. It is now read-only.
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 branch introduces CSS parsing, including the CSSParse library (https://github.com/sabberworm/PHP-CSS-Parser) which has a compatible license to be included within PHPQuery (MIT).
Aside from using the CSSparsing library, this brach allows users to call pq($el)->css('background') to retrieve css styling of elements, or css('background', 'black') to set CSS styles on elements. All changes or parsing to elements bubble down the DOM tree and compare specificity correctly.
The only thing users have to do is add CSS strings that aren't already in the document captured by "<style>" tags using phpQuery::getDocument()->addCSS('p { background: yellow; }'), as we can't infer the URL location of any given page and then make requests to retrieve CSS files directly, it's up to the user to fetch any CSS files first.
The branch also includes a default CSS file as provided by the W3C [http://www.w3.org/TR/CSS21/sample.html] for HTML4 so we can infer standard colors and backgrounds for all elements.