Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

[New Feature] Discourage CSS rules for images setting width:auto or width:100% #194

Open
joyously opened this issue Mar 11, 2020 · 0 comments
Labels
Type: Enhancement This is an enhancement of the existing features or a new feature to the plugin.

Comments

@joyously
Copy link

Apparently, I wrote the issue on the wrong repo, so I'm moving it to here.
Flag CSS rules for images that have the property width:auto.
There is no rule in the Handbook for this, but it falls under the general guideline to honor the user's choices.

The default value for CSS width is auto, so there is no need to specify it. When it is specified, it will override the HTML width attribute. So an img tag with a different width attribute than the source image is would be affected, and it will display as the size of the source image instead of the size the user requested.

This should also include width:100%. I've seen several of these lately, whether targeting just the widgets or gallery or all of the user content area, it messes up icons and thumbnails or any image less than full width.

Describe the solution you'd like
For CSS rules that target img as the last part of the selector, issue a warning when width:auto or width:100% is found. Suggest testing with icons or thumbnails with width attributes.

Additional context
Putting more icons or thumbnails into the unit test data might help, but a warning would be better.
See comments and examples on the original issue: WPTT/WPThemeReview#137

@joyously joyously added the Type: Enhancement This is an enhancement of the existing features or a new feature to the plugin. label Mar 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Enhancement This is an enhancement of the existing features or a new feature to the plugin.
Projects
None yet
Development

No branches or pull requests

1 participant