Skip to content

fix: make .brick-feature stack on mobile - #57

Merged
moufmouf merged 5 commits into
mainfrom
fix/brick-feature-mobile-stacking
Aug 5, 2026
Merged

moufmouf merged 5 commits into
mainfrom
fix/brick-feature-mobile-stacking

Conversation

@moufmouf

@moufmouf moufmouf commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

The bug

.brick-feature and .brick-feature.revert each apply flex-row twice:

.brick-feature {
    @apply flex lg:flex-row flex-col flex-row mt-32 p-0 lg:px-8 xl:px-0;
    /*                      ^^^^^^^^ ^^^^^^^^ */
    &.revert {
        @apply flex lg:flex-row-reverse flex-col flex-row;
        /*                              ^^^^^^^^ ^^^^^^^^ */
    }
}

The later utility wins, so flex-col never takes effect.

There's a second-order effect that makes it worse: because flex-row is already applied unconditionally, Tailwind emits no lg media query at all. The generated rule is a flat flex-direction: row, so the block is a row at every breakpoint — on phones the text and image columns are squeezed side by side instead of stacking.

Interestingly the old WordPress theme this came from has the same duplicate in the opposite order (flex-direction:row; flex-direction:column), which is why the live site stacks correctly today. So this is a regression from the port, not an inherited defect.

The fix

Reorder to flex flex-col lg:flex-row (and lg:flex-row-reverse) — the cascade the utilities were reaching for.

Verification

Generated CSS in the example build. Before — one rule, no breakpoint:

.brick-feature{…;flex-direction:row;display:flex}

After — base plus breakpoint, both variants:

.brick-feature{…;flex-direction:column;display:flex}
@media (width>=64rem){.brick-feature{…;flex-direction:row}}
.brick-feature.revert{flex-direction:column;display:flex}
@media (width>=64rem){.brick-feature.revert{flex-direction:row-reverse}}

Measured in a browser as well: at 760px both variants compute flex-direction: column and the image sits entirely below the text; at 1920px they are row and row-reverse, unchanged. So this only affects viewports below lg, where the layout is currently broken.

How to see it (a sample, added here)

There was no way to look at this component — the example page demos the atoms (buttons, inputs, chips, avatars) but none of the layout components: brick-feature, stripe, usecase, getintouch, rgpd, testimonial, hpblock and possibilities are all absent. That is a large part of why this regression survived: nothing in the repo renders the broken block.

So this PR also fills the "Prebuild components" section, which already existed but was empty, and adds the matching sidebar group. It shows four variants:

Variant Shows
Default the 1/3 – 2/3 split
.revert image leads on wide screens
.half on both columns even 50/50 split
.no-border on the image frame dropped

Each carries both .img-brick and .img-brick-mobile, so the swap at sm is visible too — a brick with only the desktop image renders nothing below 640px, which is easy to get wrong and worth having on screen.

Placeholders are inline SVG data URIs, so there are no new binaries and nothing fetched from a third-party host.

To test: npm run dev → Prebuild components (linked from the sidebar and from the bottom of the index page) → Brick Feature, then narrow the window past 1024px and again past 640px.

…and the rest of the layout components, while we were here

Auditing every class used in example/index.html against the package, the only components with any coverage were btn, chip, notification, avatar and the form controls. So this PR also fills in the other twelve:

Section What it shows
Stripes & Highlights stripe-blue / stripe-white / stripe-inline, .underline, .highlight — the decorations whose assets were missing until 3.0.2
HP Block homepage hero; .hpblock-right is hidden below xl
Possibilities tiles over the repeating pattern.png background
Features icon + title + description row
Use Case linked cards, 1/3 from lg up
Clients logo row at 50% opacity until hover
Testimonial quote, avatar, attribution
Card image / content / actions
Pricing plan card whose title overlaps the top border
Get in Touch illustration beside copy and buttons
RGPD dark band with decorative pixels
Footer columns, hairline rules, social row

Each note says what to look for when resizing, since most change layout at a breakpoint and that is what regressions break.

These live on a new page, example/prebuild-components.html, registered as a Vite input alongside the existing bot-*.html pages. index.html was already ~14k lines, and page-level sections are a different kind of thing from the foundations and atoms it documents — so it keeps the divider, a sentence and a link across, and loses 491 lines. The new page links back from both its sidebar and its header.

One thing surfaced by writing the RGPD sample: .rgpd-title sets no colour, so the heading is dark-on-dark against the band unless the consumer adds text-white. The sample does, and says so — but it may be worth fixing in the component.

Noticed while here, not changed

I scanned every @apply in src/ for utilities repeated or in conflict within the same variant. Nothing else is broken, but a few redundancies exist:

Location Note
src/components/nav.css:119 opacity-0 and absolute each twice; also flex and hidden. hidden wins, which is correct — .active reveals the submenu with block — so flex is simply dead.
src/components/nav.css:125 p-4 twice
src/components/chip.css:116 after:bg-contrast-400 twice
src/components/possibilities.css:23 items-center twice

All harmless, so I've left them out of this PR rather than mixing cosmetics into a behavioural fix. Happy to send a separate cleanup if you'd like one.

🤖 Generated with Claude Code

moufmouf and others added 4 commits August 4, 2026 18:35
Both `.brick-feature` and `.brick-feature.revert` applied `flex-row` twice:

    @apply flex lg:flex-row flex-col flex-row …;
    @apply flex lg:flex-row-reverse flex-col flex-row;

The later utility wins, so `flex-col` never took effect. Worse, because
`flex-row` was already applied unconditionally, Tailwind emitted no `lg`
media query at all — the generated rule was a flat `flex-direction: row`, so
the block was a row at every breakpoint and the text and image columns were
squeezed side by side on phones.

Reordered to `flex flex-col lg:flex-row` (and `lg:flex-row-reverse`), which is
the cascade the utilities were reaching for.

Verified in the example build. Before, one rule and no breakpoint:

    .brick-feature{…;flex-direction:row;display:flex}

After, base plus a breakpoint, for both variants:

    .brick-feature{…;flex-direction:column;display:flex}
    @media (width>=64rem){.brick-feature{…;flex-direction:row}}
    .brick-feature.revert{flex-direction:column;display:flex}
    @media (width>=64rem){.brick-feature.revert{flex-direction:row-reverse}}

Measured in a browser too: at 760px both variants compute
`flex-direction: column` and the image sits entirely below the text; at 1920px
they are `row` and `row-reverse` as before. Desktop is unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was no way to look at this component. The example page demos the atoms
(buttons, inputs, chips, avatars) but none of the layout components —
brick-feature, stripe, usecase, getintouch, rgpd, testimonial, hpblock and
possibilities are all absent — so a regression in one of them is invisible
until it reaches a consumer's site. That is how the flex-direction bug this PR
fixes went unnoticed.

Fills the "Prebuild components" section, which existed but was empty, and adds
the matching sidebar group. Four variants: default (1/3–2/3), `.revert`,
`.half` on both columns, and `.no-border` on the image. Each carries both
`.img-brick` and `.img-brick-mobile` so the swap at `sm` is visible too — a
brick with only the desktop image renders nothing below 640px, which is easy
to get wrong.

Placeholders are inline SVG data URIs: no new binaries, and nothing to fetch
from a third-party host.

Verified at 620px — all four stack, text above image, mobile image swapped in —
and at desktop width, where they are rows with the expected column splits.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Nothing section-shaped was on the example page. Auditing every class used in
example/index.html against the package, the only components with any coverage
were btn, chip, notification, avatar and the form controls. Every layout
component was absent, which is why a regression in one of them is invisible
until it reaches a consumer's site.

Adds twelve sections under "Prebuild components", alongside the brick feature:

  Stripes & Highlights   stripe-blue / stripe-white / stripe-inline,
                         .underline, .highlight — the decorations whose assets
                         the package did not ship until 3.0.2
  HP Block               homepage hero; .hpblock-right is hidden below xl
  Possibilities          tiles over the repeating pattern.png background
  Features               icon + title + description row
  Use Case               linked cards, 1/3 from lg up
  Clients                logo row, 50% opacity until hover
  Testimonial            quote, avatar, attribution
  Card                   image / content / actions
  Pricing                plan card whose title overlaps the top border
  Get in Touch           illustration beside copy and buttons
  RGPD                   dark band with decorative pixels
  Footer                 columns, hairline rules, social row

Each note says what to look for when resizing, since most of these change
layout at a breakpoint and that is exactly what regressions break.

Placeholders are inline SVG data URIs — no new binaries, and nothing fetched
from a third-party host. They are used as background-image values as well as
<img src>, so quotes and spaces are percent-encoded; unencoded, they are
invalid inside an unquoted CSS url() and silently render nothing.

One thing worth knowing, surfaced by writing the RGPD sample: .rgpd-title sets
no colour, so the heading is dark-on-dark against the band unless the consumer
adds text-white. The sample does, and says so.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
index.html was already ~14k lines before any of this, and the layout components
are a different kind of thing from the foundations and base components that
page is about — they are whole page sections, not atoms.

They now live at example/prebuild-components.html, registered as a Vite input
alongside the existing bot-*.html pages. index.html keeps the "Prebuild
components" divider where the section was, with a sentence and a link, and its
sidebar entry becomes a single link across to the new page. The new page links
back, from both its sidebar and its header.

index.html: -491 lines. The new page carries its own sidebar listing the
thirteen sections, and an intro that says to resize the window while reading,
since that is what most of these components change.

Verified in both `npm run build:example` and `vite` dev: both pages serve, the
new one has all thirteen sections and the shared stylesheet, and the links
resolve in both directions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a responsive layout regression in .brick-feature by correcting conflicting Tailwind @apply utility order so the component stacks on small screens, and adds a new Vite example page to visually exercise “prebuild” (page-level) layout components that weren’t previously demoed.

Changes:

  • Fix .brick-feature / .brick-feature.revert flex-direction utilities so flex-col applies below lg, with lg:flex-row / lg:flex-row-reverse at the breakpoint.
  • Add a new example/prebuild-components.html page demonstrating multiple layout components/variants for manual breakpoint verification.
  • Register the new example page as a Vite multi-page build input and link to it from example/index.html.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/utilities/general.css Reorders Tailwind @apply utilities to restore mobile stacking and proper lg breakpoint output for .brick-feature.
example/vite.config.js Adds prebuild-components.html as a Rollup/Vite build input for multi-page builds.
example/prebuild-components.html Introduces a dedicated example page showcasing prebuild/layout components and responsive behavior.
example/index.html Adds navigation/linking to the new prebuild components page and replaces the previously-empty section with a link-out.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread example/prebuild-components.html Resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@moufmouf
moufmouf merged commit 5a6f6e1 into main Aug 5, 2026
1 check passed
@moufmouf
moufmouf deleted the fix/brick-feature-mobile-stacking branch August 5, 2026 09:16
moufmouf added a commit that referenced this pull request Aug 6, 2026
`.client` applied `flex-basis` twice in one `@apply` — `lg:basis-1/6` and
`lg:basis-1/4`. Under Tailwind 4 the winner is decided by the utilities' order in
the generated stylesheet rather than by the order written, and `basis-1/6` came
out on top, so the row laid out at 6 per line instead of 4.

The knock-on effect is worse than the layout: `.clients .client img` is
`sm:w-full`, so each logo resolves to the width of its squeezed box and every one
renders at two thirds of its intended size.

25% is the value the original theme shipped, unconditionally and inside its
`min-width: 1024px` block.

Same class of mistake as the duplicated `flex-row` in `.brick-feature` (#57).
moufmouf added a commit that referenced this pull request Aug 6, 2026
Neither changes a byte of emitted CSS; both remove the trap that produced #57 and
the `.client` basis bug.

`.nav-submenu` listed `flex` and `hidden` in the same `@apply`, plus a second
`opacity-0` and a second `absolute`. The generated order happens to resolve to
`display: none`, which is what the open state (`display: block`) expects — but a
duplicated `display` inside one `@apply` is exactly what silently broke
`.brick-feature`.

`.possibilities` listed `items-center` twice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants