Repository navigation
fix: make .brick-feature stack on mobile - #57
Merged
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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.revertflex-direction utilities soflex-colapplies belowlg, withlg:flex-row/lg:flex-row-reverseat the breakpoint. - Add a new
example/prebuild-components.htmlpage 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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
.brick-featureand.brick-feature.reverteach applyflex-rowtwice:The later utility wins, so
flex-colnever takes effect.There's a second-order effect that makes it worse: because
flex-rowis already applied unconditionally, Tailwind emits nolgmedia query at all. The generated rule is a flatflex-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(andlg:flex-row-reverse) — the cascade the utilities were reaching for.Verification
Generated CSS in the example build. Before — one rule, no breakpoint:
After — base plus breakpoint, both variants:
Measured in a browser as well: at 760px both variants compute
flex-direction: columnand the image sits entirely below the text; at 1920px they arerowandrow-reverse, unchanged. So this only affects viewports belowlg, 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,hpblockandpossibilitiesare 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:
.revert.halfon both columns.no-borderon the imageEach carries both
.img-brickand.img-brick-mobile, so the swap atsmis 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.htmlagainst the package, the only components with any coverage werebtn,chip,notification,avatarand the form controls. So this PR also fills in the other twelve:stripe-blue/stripe-white/stripe-inline,.underline,.highlight— the decorations whose assets were missing until 3.0.2.hpblock-rightis hidden belowxlpattern.pngbackground1/3fromlgupEach 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 existingbot-*.htmlpages.index.htmlwas 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-titlesets no colour, so the heading is dark-on-dark against the band unless the consumer addstext-white. The sample does, and says so — but it may be worth fixing in the component.Noticed while here, not changed
I scanned every
@applyinsrc/for utilities repeated or in conflict within the same variant. Nothing else is broken, but a few redundancies exist:src/components/nav.css:119opacity-0andabsoluteeach twice; alsoflexandhidden.hiddenwins, which is correct —.activereveals the submenu withblock— soflexis simply dead.src/components/nav.css:125p-4twicesrc/components/chip.css:116after:bg-contrast-400twicesrc/components/possibilities.css:23items-centertwiceAll 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