Skip to content

[Bug Report][4.2.3] Responsive gap class helpers don't modify necessary css variables for grid layout #23232

Closed

Description

@laventnc

Environment

Vuetify Version: 4.2.3
Vue Version: 3.5.43
OS: Windows 10 (current)

Steps to reproduce

  1. Open the repo link
  2. Notice the using the gc-{size} helpers causes 3 cols with size 4 to wrap

Expected Behavior

Using v-row gap should produce same results as gap helper css classes like gc

Actual Behavior

Setting gap prop correctly modifies --v-col-gap-x, while the gc-{size} helpers only set the column-gap css property.

Reproduction Link

https://play.vuetifyjs.com/#...

Other comments

There is some context on this in the vuetify subscribers discord here. Including how to resolve and what the size impacts of this change are.

Activity

  1. added
    T: enhancementFunctionality that enhances existing features
    C: VGridCovers issues involving VContainer, VLayout, VFlex
    on Oct 1, 2026
  2. rafaself commented on Oct 5, 2026

    @rafaself
    Contributor

    I think the reported behavior is valid, but I’m not sure gc-* should be expected to behave the same as the VRow gap prop.

    gc-* is a generic spacing utility that maps to column-gap, while VRow uses --v-col-gap-x not only to set the visual gap, but also to calculate each VCol's flex-basis so that columns and gaps still fit within 100% of the row.

    Because of that, making gc-* also mutate --v-col-gap-x would couple a generic CSS utility to an internal detail of VGrid.

    To me, the underlying issue is that VRow currently lacks a grid-aware responsive gap API. Something like gap-md, gap-lg, etc. (or another responsive syntax) could update the internal gap variables correctly while keeping the generic spacing utilities independent.

    So I’d consider this more of an enhancement/API gap in VGrid than a bug in the gc-* utilities.

  3. rafaself commented on Oct 5, 2026

    @rafaself
    Contributor

    In short, gc-* only changes column-gap, while VRow's gap also affects the VCol width calculation so the grid still fits within 12 columns.

  4. laventnc commented on Oct 5, 2026

    @laventnc
    Author

    In short, gc-* only changes column-gap, while VRow's gap also affects the VCol width calculation so the grid still fits within 12 columns.

    Agreed completely, having responsive gap options on VRow would be ideal.

  5. J-Sek commented on Oct 5, 2026

    @J-Sek
    Contributor

    Another workaround is to opt-in to "grid" mode (see demos linked in #22630)

  6. laventnc commented on Oct 5, 2026

    @laventnc
    Author

    Another workaround is to opt-in to "grid" mode (see demos linked in #22630)

    While I think this would be sufficient, and I personally know of a few places already that I would use it, I do feel the main problem is that when using the VRow & VCol grid system there is a gap (no pun intended) in the API once you introduce responsive spacing.

    Without responsive gap properties or the original idea of modifying the --v-col-gap-{x/y} css variables, users will likely stumble upon the same problem, but it surfaces in downstream (potentially responsive breakpoint specific) behavior like columns wrapping that should be on a single line. IMO needing to dive into the css classes to learn why this is wrapping is something that shouldn't be necessary for such a common problem:

    <v-row class="gc-2 gc-lg-4">
      <v-col cols="4" />
      <v-col cols="8" />
    </v-row>

    I believe a solution like this would be pretty easy to implement, clear to document, and inline with the existing API like cols & {breakpoint} overrides:

    <v-row gap="2" gap-lg="4">
      <v-col cols="4" />
      <v-col cols="8" />
    </v-row>
  7. added
    S: maybeFunctionality that we are considering
    on Oct 6, 2026
  8. J-Sek commented on Oct 6, 2026

    @J-Sek
    Contributor

    It would not hurt to see a quick draft..

  9. linked a pull request that will close this issuefeat(VRow): add responsive gap props #23246on Oct 6, 2026
  10. added this to the v4.3.0 milestone on Oct 6, 2026
  11. rafaself commented on Oct 7, 2026

    @rafaself
  12. removed
    S: maybeFunctionality that we are considering
    on Oct 9, 2026
  13. self-assigned this
    on Oct 9, 2026
  14. added a commit that references this issue on Oct 9, 2026
    aa892b0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C: VGridCovers issues involving VContainer, VLayout, VFlexT: enhancementFunctionality that enhances existing featureshas workaround

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions