object-position
property
#1791
Replies: 2 comments 1 reply
-
In general I want a property if we want all possible values. Cant we say top-left or something is the only meaningful value for this property, which works in most cases and people dont really need to change it. If so we should not add a property, and simply use the right value when generating HTML. Whats the use case for allowing all possible values? |
Beta Was this translation helpful? Give feedback.
-
I agree that there are several cases where positioning the background to top left makes sense. For example, below the cloud background's position is correct even for vertically larger viewports: However, the same property causes problems in backgrounds that are not meant to be positioned at top left. For example below the desert comes in the middle which could have been solved by positioning bottom left: Although this is only one example, many can be created for other positions. (Left/Right - Gradient or flames coming from a direction.) Finding out which is the correct default value in this case will fail as it will ruin one design or the other, whichever default position is chosen. |
Beta Was this translation helpful? Give feedback.
-
object-position
determines where the content of an element (like an image or video) is positioned within its container.An implementation of
object-position
in fastn should look like this (We can omitobject-
prefix and just useposition
just like we have omitted it in the case ofobject-fit
cause for element position we are usingtop
,left
andanchor
anyways):MDN: object-position
cc: @amitu @xypnox
Beta Was this translation helpful? Give feedback.
All reactions