8000 [New Feature] Discourage CSS rules for images setting width:auto or width:100% · Issue #194 · WPTT/theme-sniffer · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.
This repository was 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

Description

@joyously

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: EnhancementThis is an enhancement of the existing features or a new feature to the plugin.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0