-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
ENH Avoid redundant CSS in Styler.render #30876
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
Conversation
Where multiple cells have the same CSS, only make one CSS declaration.
@@ -14,7 +14,7 @@ | |||
{% block before_cellstyle %}{% endblock before_cellstyle %} | |||
{% block cellstyle %} | |||
{%- for s in cellstyle %} | |||
#T_{{uuid}}{{s.selector}} { | |||
{%- for selector in s.selectors -%}{%- if not loop.first -%},{%- endif -%}#T_{{uuid}}{{selector}}{%- endfor -%} { |
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.
It's been a while since I've looked at this, but I'm a bit confused. What is this section doing? Is it writing the css styles? Does it matter what order the selector vs the id #T_uuid
goes in?
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.
This is just a comma-separated list of id selectors. Comma is "or", the order doesn't matter.
Any interest in this? |
this seems ok to me, basically writing the 'same' style, but de-duplicated so its much smaller? @TomAugspurger |
basically writing the 'same' style, but de-duplicated so its much smaller?
Yes
|
thanks @jnothman |
Where multiple styled cells have the same CSS, only make one CSS declaration. This can reduce the output size substantially.
closes #xxxxblack pandas
git diff upstream/master -u -- "*.py" | flake8 --diff