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
Labels
Type: Enhancement
This is an enhancement of the existing features or a new feature to the plugin.
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 whenwidth:auto
orwidth: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
The text was updated successfully, but these errors were encountered: