-
Notifications
You must be signed in to change notification settings - Fork 144
[TASK] Use delegation for DeclarationBlock
-> RuleSet
#1194
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
base: main
Are you sure you want to change the base?
Conversation
7800603
to
73956e9
Compare
src/CSSList/CSSList.php
Outdated
@@ -41,7 +41,7 @@ abstract class CSSList implements Renderable, Commentable | |||
protected $comments = []; | |||
|
|||
/** | |||
* @var array<int<0, max>, RuleSet|CSSList|Import|Charset> | |||
* @var array<int<0, max>, RuleSet|CSSList|DeclarationBlock|Import|Charset> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose we introduce an interface instead, e.g. something like CSSListItem
. (We could do this as a pre-patch to keep PRs small.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing so would also make Stan happy :)
c1c27a9
to
3a278e0
Compare
26a488e
to
c935f2c
Compare
... rather than inheritance. This will allow `DeclarationBlock` to instead extend `CSSBlockList` in order to support [CSS nesting](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_nesting). This is a slightly-breaking change, since now `CSSBlockList::getAllRuleSets()` will include the `RuleSet` property of the `DeclarationBlock` instead of the `DeclarationBlock` itself. Part of #1170.
c935f2c
to
1f908cf
Compare
Would be good to resolve #1247 before moving on with this. |
... rather than inheritance.
This will allow
DeclarationBlock
to instead extendCSSBlockList
in order to supportCSS nesting.
This is a slightly-breaking change, since now
CSSBlockList::getAllRuleSets()
will include theRuleSet
property of theDeclarationBlock
instead of theDeclarationBlock
itself.Part of #1170.