equalizedigital / accessibility-checker

GNU General Public License v2.0
15 stars 8 forks source link

Convert text_justified rule to a JS rule #635

Closed pattonwebz closed 1 month ago

pattonwebz commented 1 month ago

This PR shifts the text_justified php rule over to a JS equivalent so that it can determine rendered/computed styles to check against.

This is currently set up to align with the description of the PHP rule but not necessarily the code of the PHP rule.

@amberhinds @SteveJonesDev I have two questions.

Closes: #634

amberhinds commented 1 month ago

as per the user-facing description of the rule, the actual PHP code was checking all elements, though

This was my mistake. We should check everything - I can edit docs.

I agree with the recommendation to reduce the character count to 200.

SteveJonesDev commented 1 month ago

@amberhinds we'll open an issue to update the docs.

SteveJonesDev commented 1 month ago

@amberhinds, I updated the documentation for this rule: https://equalizedigital.com/accessibility-checker/justified-text/

@pattonwebz before merging can you update the summary?

'summary'   => esc_html__( 'A Text Justified warning appears in Accessibility Checker when text with more than 200 characters on your post or page is styled with justified alignment (text-align:justify). To fix this warning, remove the justified styling from the specified text elements.', 'accessibility-checker' ),
amberhinds commented 1 month ago

Thanks @SteveJonesDev!