You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting the height attribute on an <img> element, the height is not respected and instead overridden by the default height: auto. This is different in general behavior from setting the width attribute, as that works as expected.
This is important because users cannot fix this with additional CSS since Pico itself is overriding the attribute styles.
Current Behavior
The height is overridden and instead based on the width of the image.
Expected Behavior
The image defaults should yield to height if the attribute is set.
The img default style could include a check that there is no height attribute defined on the element. This can be fixed with a selector like img:not([height]) which has 96% browser adoption as of writing.
Since there's also the border-style added in the same rule, this might have to be separated into two styles with the max-width and height on the new selector while the old is kept for general styles.
Describe the issue
When setting the
height
attribute on an<img>
element, the height is not respected and instead overridden by the defaultheight: auto
. This is different in general behavior from setting thewidth
attribute, as that works as expected.This is important because users cannot fix this with additional CSS since Pico itself is overriding the attribute styles.
Current Behavior
The height is overridden and instead based on the width of the image.
Expected Behavior
The image defaults should yield to
height
if the attribute is set.Reproduction URL
https://codepen.io/fireisgood/pen/OJGwMLd
Environment
Chromium on Linux
Possible fix
The
img
default style could include a check that there is noheight
attribute defined on the element. This can be fixed with a selector likeimg:not([height])
which has 96% browser adoption as of writing.Since there's also the
border-style
added in the same rule, this might have to be separated into two styles with themax-width
andheight
on the new selector while the old is kept for general styles.To fix this, the line 38 of _embedded.scss would be changed to include the updated selectors.
If this sounds good, I can make a pull request of this real quick, or you can just copy over the fixed code and push it.
The text was updated successfully, but these errors were encountered: