Skip to content

ENH: Use a proper CSS parser for pandas Styler objects #48868

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

Open
1 of 3 tasks
marknsikora opened this issue Sep 29, 2022 · 0 comments
Open
1 of 3 tasks

ENH: Use a proper CSS parser for pandas Styler objects #48868

marknsikora opened this issue Sep 29, 2022 · 0 comments
Labels
Enhancement Styler conditional formatting using DataFrame.style

Comments

@marknsikora
Copy link
Contributor

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

The existing pandas Styler makes use of CSS extensively but is done so with a naïve parser. This has resulted in a number of hacky workaround to get values like the literal ; passed through, see #46239, #40596, #40422, and #41619.

Using a real parser here would remove the need for workaround.

There are also other cases that are currently impossible with the existing implementation. Eg. all CSS values passes into the Excel Styler get converted to lower case with no escape hatch.

Feature Description

Rip out all custom CSS parsing code and replace with a standard parser line tinycss/tinycss2. Both packages with relatively few additional dependencies.

Alternative Solutions

Write our own more complete CSS parser.

Additional Context

No response

@marknsikora marknsikora added Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 29, 2022
@lithomas1 lithomas1 added Styler conditional formatting using DataFrame.style and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Styler conditional formatting using DataFrame.style
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants