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
CSS selectors #355
CSS selectors #355
Conversation
Now we can really customize the layout.
Now parser, selector and all can be put in separate modules.
from gaphor.core.styling.declarations import StyleDeclarations, parse_declarations | ||
from gaphor.core.styling.selectors import SelectorError, compile_selector_list | ||
|
||
MATCH_SORT_KEY = operator.itemgetter(0, 1) |
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 like this, I wasn't familiar with using itemgetter as a sort key
This is needed if we want to support nested attributes
No need for Selector class anymore.
# Conflicts: # poetry.lock
Signed-off-by: Dan Yeaw <dan@yeaw.me>
Sourcery Code Quality Report (beta)❌ Merging this PR will decrease code quality in the affected files by 0.03 out of 10.
Here are some functions in these files that still need a tune-up:
Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! |
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.
Very nice - really impressive you got this to work. 🎉 I didn't know anything about CSS selectors or specificity before reviewing this PR, but now I know just a little bit.
With two bits of help from the cssselect2 code 😃 . |
PR Type
What kind of change does this PR introduce?
What is the current behavior?
A very limited level of styling is possible. Basically only one (wildcard) rule can be created, which is applicable for all diagram items.
Issue Number: #284
What is the new behavior?
CSS can be applied on: