-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add custom CSS Definitions #79
Conversation
Thanks for your work on this @EPGDigital-MW! I'll review this today 🙏 |
src/Definitions/CSSDefinition.php
Outdated
|
||
use HTMLPurifier_CSSDefinition; | ||
|
||
interface CSSDefinition |
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.
Can we adjust this interface name to be PascalCase
for consistency since we have HtmlDefinition
and Html5Definition
? Once changed I'll merge! 👍
interface CSSDefinition | |
interface CssDefinition |
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 should be updated now to PascalCase, thanks
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.
Awesome thanks @EPGDigital-MW! 🙏
Released https://github.com/stevebauman/purify/releases/tag/v6.1.0, thanks again for your contribution! |
This PR adds the ability to create custom CSS definitions to be able to setup a custom CSS definition.
In my case I was finding text-align was missing start and end values, it only supported right. left, and center out of the box so I needed to add start and end
https://developer.mozilla.org/en-US/docs/Web/CSS/text-align.
I've included an example in the readme on how to implement the text-align change, taking the code from HTMLPurify, and modifying the CSS allowed enum for text-align.