Logical Properties and Flexbox gutters for internationalized layouts.
This Week 03 showcase documents how semantic settings-card HTML becomes a responsive
LTR/RTL interface by replacing physical CSS assumptions with Logical Properties,
parent-owned Flexbox gaps, and human audit checks.
01Problem
02CSS Concepts
03Raw HTML
04AI Prompt
05Audit
06Final Result
07Verification
01
Why physical CSS breaks translated interfaces
Directional spacing works in one language direction, but it becomes fragile when the component is reused in another writing system.
Before
A profile settings card can appear correct in English while hiding brittle CSS underneath.
Physical margins, paddings, borders, and text alignment do not understand the document's
writing direction, so the same component can feel reversed or misaligned when translated.
Modern approach
Logical Properties describe spacing through inline and block directions. Flexbox gaps let
the parent own element-to-element spacing. Together, the same class names can support an
English card and an Arabic card without duplicate RTL styles or JavaScript.
Physical spacingChild marginsFixed text alignmentDuplicate RTL CSSUnverified mirroring
02
The CSS concepts behind direction-aware components
Six coordinated ideas turn one semantic structure into a resilient translated interface.
The prompt converts the assignment rules into specific checks for Logical Properties, Flexbox gaps, directionality, and output boundaries.
Layer 1 — Lock the structure
Keep the supplied semantic HTML and class names intact.
Layer 2 — Define layout parents
Assign Flexbox responsibilities to the app, profile row, actions row, and buttons.
Layer 3 — Require parent gaps
Use gap for sibling spacing instead of margins on individual children.
Layer 4 — Enforce logical CSS
Use inline and block properties for spacing, sizing, and borders.
Layer 5 — Preserve translation behavior
Use text-align: start and let dir mirror the two cards without duplicate selectors.
Layer 6 — Demand verification
Require responsive, accessibility, overflow, reduced-motion, and code-audit checks.
AI prompt
Act as a senior CSS systems engineer. Generate a production-ready stylesheet for the supplied semantic settings-card HTML without replacing its structural class system.
Architecture requirements:
1. Preserve the supplied app-layout, settings-card, settings-card__header, settings-card__profile-section, profile-avatar, profile-info, settings-card__actions, and button class names.
2. Build the layout with Flexbox parent containers. Use gap on each Flexbox parent for element-to-element spacing instead of placing margins on individual children.
3. Use Internationalized Logical Properties for all spacing, sizing, and borders. Prefer padding-block, padding-inline, margin-block, margin-inline, border-block-end, inline-size, min-inline-size, and max-inline-size.
4. Do not use physical spacing or border declarations. The generated stylesheet must avoid physical directional property names in margins, paddings, borders, and positioning.
5. Align translated text with text-align: start so both English and Arabic content keep the correct reading edge.
6. Ensure the English card and Arabic card use the same class names and the same CSS rules. The dir attribute must be enough to mirror avatar placement, profile text flow, and action button order.
7. Make the cards responsive with flexible wrapping, shrink-safe children, controlled avatar sizing, accessible button target sizes, and no page-level horizontal overflow.
8. Include visible focus states, readable contrast, reduced-motion handling, and comments explaining the Logical Properties and Flexbox gap strategy.
9. Return only CSS. Do not add JavaScript, duplicate class names for RTL, or rewrite the HTML structure.
Return only the complete CSS stylesheet.
05
Auditing the generated internationalized CSS
The draft is accepted only after the stylesheet proves that spacing is logical, parent-owned, and mirrored by direction.