From 603a84128b3a976915877aed2ce07ed0ae96aff8 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Wed, 24 Mar 2021 12:19:21 +0100 Subject: [PATCH] embed: Make embedded media responsive --- config/settings/base.py | 2 ++ mpicms/static/css/custom.css | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/config/settings/base.py b/config/settings/base.py index 569a13b..7549731 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -229,6 +229,8 @@ WAGTAILMODELTRANSLATION_TRANSLATE_SLUGS = False WAGTAILMODELTRANSLATION_LOCALE_PICKER_DEFAULT = ('de', 'en') +WAGTAILEMBEDS_RESPONSIVE_HTML = True + # WAGTAIL WAGTAIL_SITE_NAME = 'MPI CMS' # WAGTAIL_USER_EDIT_FORM = 'mpicms.users.forms.CustomUserEditForm' diff --git a/mpicms/static/css/custom.css b/mpicms/static/css/custom.css index aa2ddd6..3dadad0 100644 --- a/mpicms/static/css/custom.css +++ b/mpicms/static/css/custom.css @@ -745,3 +745,19 @@ div.codehilite:not(:last-child) { list-style: none; margin: 0; } + +/* wagtail embed responsive objects */ + +.responsive-object { + position: relative; +} + +.responsive-object iframe, +.responsive-object object, +.responsive-object embed { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +}