This repository has been archived by the owner on Apr 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 459
Phpquery css #2
Open
kevee
wants to merge
13
commits into
TobiaszCudnik:master
Choose a base branch
from
kevee:phpquery-css
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Phpquery css #2
Conversation
This file contains 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
…ngs CSS on a parent.
There's still a few things missing:
|
… color for links.
…her than depending on the css method.
…should override.o
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.