lia-DynFlex for LiaScript: Resizable Multi-Column Layouts

lia-DynFlex for LiaScript: Resizable Multi-Column Layouts

Standard LiaScript columns have fixed widths. The lia-DynFlex community plugin by MINT-the-GAP adds interactive, resizable flex containers to any course: drag the divider between columns to set the perfect balance, and the layout is saved in localStorage for returning visits. Quiz elements, images, and any other Markdown content work inside each column.


Quick Start

<!--
import: https://raw.githubusercontent.com/MINT-the-GAP/lia-DynFlex/main/README.md
-->

No macros needed — just apply the dynFlex class to a <section> and flex-child to each child <div>.


Basic Column Layout

<section class="dynFlex">

<div class="flex-child">

### Column A

Your content here — text, images, code, anything.

</div>

<div class="flex-child">

### Column B

Another section of content.

</div>

<div class="flex-child">

### Column C

A third panel.

</div>

</section>

Drag the resize handles between columns to redistribute space. The layout snaps back on mobile (< 420 px) to a single-column stack.


Multi-Column Quiz Layout

DynFlex handles LiaScript quiz elements automatically. Separate quiz items with blank lines so each gets its own check button:

<section class="dynFlex">

<div class="flex-child">

**Group A — Arithmetic**

$a)\;\;$ $3 + 4 =$ [[ 7 ]]

$b)\;\;$ $6 \times 8 =$ [[ 48 ]]

$c)\;\;$ $100 - 37 =$ [[ 63 ]]

</div>

<div class="flex-child">

**Group B — Geometry**

Area of a rectangle with $l=5$ and $w=3$: [[ 15 ]]

Perimeter of a square with $s=4$: [[ 16 ]]

</div>

</section>

Configuration Options

Use data-* attributes on the container for fine-grained control:

AttributeDefaultDescription
data-gap20pxGap between flex items
data-hit22pxWidth of the resize handle hit area
data-basis25%Default width basis for flex items
data-min10%Minimum width percentage
data-max100%Maximum width percentage
data-storelocalStorage key for persisting widths
<section class="dynFlex" data-gap="30" data-basis="33" data-store="worksheet-layout">

<div class="flex-child">Left panel</div>
<div class="flex-child">Center panel</div>
<div class="flex-child">Right panel</div>

</section>

Example: Side-by-Side Text and Image

<!--
import: https://raw.githubusercontent.com/MINT-the-GAP/lia-DynFlex/main/README.md
-->

# Photosynthesis

<section class="dynFlex" data-store="photo-lesson">

<div class="flex-child">

## Explanation

Photosynthesis converts light energy into chemical energy stored in glucose.
The overall equation is:

$$6\,CO_2 + 6\,H_2O + \text{light} \rightarrow C_6H_{12}O_6 + 6\,O_2$$

The process takes place in the **chloroplasts** and has two main stages:
the light-dependent reactions and the Calvin cycle.

</div>

<div class="flex-child">

## Quiz

Which molecule stores the energy produced in photosynthesis?

[( )] Carbon dioxide
[(X)] Glucose
[( )] Water
[( )] Oxygen

Where does photosynthesis take place?

[[chloroplasts]]

</div>

</section>

Try it live — drag the divider between the columns and watch the layout resize smoothly:


Full Template Demo


Use Cases

Side-by-side explanation and quiz — Put the explanatory text in the left column and the quiz in the right; students can resize to show more of either.

Two-language display — Show the same content in two languages side by side for language learners or bilingual classrooms.

Image and annotation — Place a diagram in one column and labeling tasks in the other.

Instructor vs. student view — Use different widths to highlight the key information while keeping context visible.


Technical Facts

Runs in browserYes — CSS + script plugin
Server requiredNo
MacrosNone — CSS classes only (dynFlex, flex-child)
Drag-to-resizeYes
PersistenceYes — localStorage via data-store
ResponsiveYes — single column below 420 px
Quiz supportYes — multiple check buttons per column
Theme integrationYes — uses LiaScript accent colors
Community templateYes (MINT-the-GAP)
LicenseMIT
MaintainedVersion 0.0.1

Try It

Try in LiaScript Open in LiveEditor View on GitHub

Related Posts

lia-canvas-ocr for LiaScript: Handwriting Recognition in Math Quizzes

Let students hand-write math answers on a canvas with lia-canvas-ocr — the browser-based LaTeX OCR engine recognizes handwriting and fills quiz fields automatically, no server needed.

Read More

lia-annotation for LiaScript: Live Drawing Overlay for Classroom Presentations

Add a freehand drawing overlay to every LiaScript slide with lia-annotation — pen, eraser, undo/redo, and optional LaTeX OCR for handwritten quiz answers, all in presentation mode.

Read More

lia-freeze-v2 for LiaScript: Quiz Submission and Teacher Review Links

Let students freeze their LiaScript quiz answers into a shareable URL with lia-freeze-v2 — the teacher opens the link, sees exactly what the student answered, and the page is locked for review.

Read More