Skip to content
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

Merged
merged 6 commits into from
Nov 28, 2023
Merged

Conversation

EPGDigital-MW
Copy link

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.

@stevebauman
Copy link
Owner

Thanks for your work on this @EPGDigital-MW! I'll review this today 🙏


use HTMLPurifier_CSSDefinition;

interface CSSDefinition
Copy link
Owner

@stevebauman stevebauman Nov 17, 2023

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! 👍

Suggested change
interface CSSDefinition
interface CssDefinition

Copy link
Author

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

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome thanks @EPGDigital-MW! 🙏

@stevebauman stevebauman merged commit 99ec04a into stevebauman:master Nov 28, 2023
8 checks passed
@stevebauman
Copy link
Owner

Released https://github.com/stevebauman/purify/releases/tag/v6.1.0, thanks again for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants