Improve responsive layouts for course/UC/topic content - #87
Conversation
|
The preview deployment for FACODI is ready. 🟢 Open Preview | Open Build Logs Last updated at: 2026-01-14 19:55:59 CET |
There was a problem hiding this comment.
Pull request overview
This PR improves responsive behavior for course, UC (curricular unit), and topic pages by ensuring that synced Markdown content and definition lists adapt properly to small screens. The changes fix overflow issues with images, tables, iframes, and code blocks on mobile devices and improve layout readability on narrow screens.
Changes:
- Added responsive CSS rules for content containers that constrain media elements and enable horizontal scrolling for tables and code blocks
- Added
facodi-rich-contentclass to synced content containers in templates to apply responsive styles - Updated Bootstrap grid classes in definition lists from
col-5/col-7tocol-12 col-sm-5/col-12 col-sm-7to stack on mobile devices
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| assets/scss/common/_custom.scss | Added responsive content styles that constrain images, videos, iframes, tables, and code blocks within .content and .facodi-rich-content classes |
| layouts/course/single.html | Added facodi-rich-content class to synced content container and updated grid classes in definition list to support mobile stacking |
| layouts/uc/single.html | Added facodi-rich-content class to synced content container and updated grid classes in definition list to support mobile stacking |
| layouts/topic/single.html | Added facodi-rich-content class to synced content container |
| static/js/loaders.js | Updated dynamically generated definition list grid classes to match the responsive template changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| table { | ||
| display: block; | ||
| width: 100%; | ||
| overflow-x: auto; | ||
| -webkit-overflow-scrolling: touch; |
There was a problem hiding this comment.
Setting display: block on tables changes their layout behavior and may cause issues with table cell alignment and borders. Consider wrapping tables in a container div with overflow properties instead, or use display: table with overflow-x: auto on a wrapper element to preserve table semantics.
| <dt class="col-12 col-sm-5">{{ i18n "course_details_institution" }}</dt> | ||
| <dd class="col-12 col-sm-7 text-muted">—</dd> | ||
| <dt class="col-12 col-sm-5">{{ i18n "course_details_school" }}</dt> | ||
| <dd class="col-12 col-sm-7 text-muted">—</dd> | ||
| <dt class="col-12 col-sm-5">{{ i18n "course_details_ects" }}</dt> | ||
| <dd class="col-12 col-sm-7 text-muted">—</dd> | ||
| <dt class="col-12 col-sm-5">{{ i18n "course_details_duration" }}</dt> | ||
| <dd class="col-12 col-sm-7 text-muted">—</dd> | ||
| <dt class="col-12 col-sm-5">{{ i18n "course_details_language" }}</dt> | ||
| <dd class="col-12 col-sm-7 text-muted">—</dd> |
There was a problem hiding this comment.
The grid classes col-12 col-sm-5 / col-12 col-sm-7 will cause the definition list terms and values to stack vertically below the sm breakpoint (576px). However, the parent column has col-lg-4, which means on medium screens (768px-991px) the aside is already narrow. Consider using col-md-* breakpoints instead of col-sm-* to better align with the aside column's breakpoint, or test thoroughly on medium-sized screens where the aside is narrow but the sm breakpoint is already active.
| <dt class="col-12 col-sm-5">{{ i18n "course_details_institution" }}</dt> | |
| <dd class="col-12 col-sm-7 text-muted">—</dd> | |
| <dt class="col-12 col-sm-5">{{ i18n "course_details_school" }}</dt> | |
| <dd class="col-12 col-sm-7 text-muted">—</dd> | |
| <dt class="col-12 col-sm-5">{{ i18n "course_details_ects" }}</dt> | |
| <dd class="col-12 col-sm-7 text-muted">—</dd> | |
| <dt class="col-12 col-sm-5">{{ i18n "course_details_duration" }}</dt> | |
| <dd class="col-12 col-sm-7 text-muted">—</dd> | |
| <dt class="col-12 col-sm-5">{{ i18n "course_details_language" }}</dt> | |
| <dd class="col-12 col-sm-7 text-muted">—</dd> | |
| <dt class="col-12 col-md-5">{{ i18n "course_details_institution" }}</dt> | |
| <dd class="col-12 col-md-7 text-muted">—</dd> | |
| <dt class="col-12 col-md-5">{{ i18n "course_details_school" }}</dt> | |
| <dd class="col-12 col-md-7 text-muted">—</dd> | |
| <dt class="col-12 col-md-5">{{ i18n "course_details_ects" }}</dt> | |
| <dd class="col-12 col-md-7 text-muted">—</dd> | |
| <dt class="col-12 col-md-5">{{ i18n "course_details_duration" }}</dt> | |
| <dd class="col-12 col-md-7 text-muted">—</dd> | |
| <dt class="col-12 col-md-5">{{ i18n "course_details_language" }}</dt> | |
| <dd class="col-12 col-md-7 text-muted">—</dd> |
| <dt class="col-12 col-sm-5">{{ i18n "uc_details_course" }}</dt> | ||
| <dd class="col-12 col-sm-7 text-muted">—</dd> | ||
| <dt class="col-12 col-sm-5">{{ i18n "uc_details_ects" }}</dt> | ||
| <dd class="col-12 col-sm-7 text-muted">—</dd> | ||
| <dt class="col-12 col-sm-5">{{ i18n "uc_details_semester" }}</dt> | ||
| <dd class="col-12 col-sm-7 text-muted">—</dd> | ||
| <dt class="col-12 col-sm-5">{{ i18n "uc_details_language" }}</dt> | ||
| <dd class="col-12 col-sm-7 text-muted">—</dd> | ||
| <dt class="col-12 col-sm-5">{{ i18n "uc_details_prerequisites" }}</dt> | ||
| <dd class="col-12 col-sm-7 text-muted">—</dd> |
There was a problem hiding this comment.
The grid classes col-12 col-sm-5 / col-12 col-sm-7 will cause the definition list terms and values to stack vertically below the sm breakpoint (576px). However, the parent column has col-xl-4, which means on large and medium screens the aside is already narrow. Consider using col-lg-* or col-md-* breakpoints instead of col-sm-* to better align with the aside column's breakpoint at xl, or test thoroughly on screens where the aside is narrow but the sm breakpoint is already active.
| <dt class="col-12 col-sm-5">{{ i18n "uc_details_course" }}</dt> | |
| <dd class="col-12 col-sm-7 text-muted">—</dd> | |
| <dt class="col-12 col-sm-5">{{ i18n "uc_details_ects" }}</dt> | |
| <dd class="col-12 col-sm-7 text-muted">—</dd> | |
| <dt class="col-12 col-sm-5">{{ i18n "uc_details_semester" }}</dt> | |
| <dd class="col-12 col-sm-7 text-muted">—</dd> | |
| <dt class="col-12 col-sm-5">{{ i18n "uc_details_language" }}</dt> | |
| <dd class="col-12 col-sm-7 text-muted">—</dd> | |
| <dt class="col-12 col-sm-5">{{ i18n "uc_details_prerequisites" }}</dt> | |
| <dd class="col-12 col-sm-7 text-muted">—</dd> | |
| <dt class="col-12 col-md-5">{{ i18n "uc_details_course" }}</dt> | |
| <dd class="col-12 col-md-7 text-muted">—</dd> | |
| <dt class="col-12 col-md-5">{{ i18n "uc_details_ects" }}</dt> | |
| <dd class="col-12 col-md-7 text-muted">—</dd> | |
| <dt class="col-12 col-md-5">{{ i18n "uc_details_semester" }}</dt> | |
| <dd class="col-12 col-md-7 text-muted">—</dd> | |
| <dt class="col-12 col-md-5">{{ i18n "uc_details_language" }}</dt> | |
| <dd class="col-12 col-md-7 text-muted">—</dd> | |
| <dt class="col-12 col-md-5">{{ i18n "uc_details_prerequisites" }}</dt> | |
| <dd class="col-12 col-md-7 text-muted">—</dd> |
|
@codex open a new pull request to apply changes based on the comments in this thread |
|
To use Codex here, create an environment for this repo. |
Motivation
Description
assets/scss/common/_custom.scssto constrain images, SVGs, videos, iframes, tables andpreblocks and enable safe overflow scrolling for tables and code blocks..facodi-rich-contenthelper and included it alongside existing.contentso synced Markdown blocks render responsively in templates.layouts/course/single.html,layouts/uc/single.htmlandlayouts/topic/single.htmlto add thefacodi-rich-contentclass to synced content containers and to usecol-12 col-sm-5/col-12 col-sm-7grid classes for definition lists to stack on small screens.static/js/loaders.jsto emit the same responsive grid classes when populating course and UC detaildlelements so client-rendered content matches the templates.Testing
hugo server -D --bind 0.0.0.0 --port 1313, but the command failed withhugo: command not found, so a local build/visual verification could not be performed in this environment.Codex Task