-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(picture): add picture component - FRONT-3868 #2789
Conversation
... | ||
] | ||
- "picture_class" (optional) (string) (default: '') | ||
- "image_class" (optional) (string) (default: '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
our templates have extra_classes and extra_attributes by "default" forthe root element, why aren't we using them here..?
<source srcset="{{ _source.src|default('') }}" media="{{ _source.media|default('') }}" type="{{ _source.type|default('') }}"> | ||
{% endfor %} | ||
{% endif %} | ||
<img class="{{ _image_class }}" src="{{ _picture.img.src|default('') }}" alt="{{ _picture.img.alt|default('') }}" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we should add some checks here before rendering stuff, all these attributes might not have any value and we would render them empty.
It also feels that this data structure gets too structured in order to have a single object, the img object is nested into the picture one, but ok let's keep it like this.
Add component to handle the display of images by using the html picture tag