Skip to content

refactor: grid system overhaul #21500

Merged
J-Sek merged 25 commits intonextfrom
ae-new-vgrid
Jan 30, 2026
Merged

refactor: grid system overhaul #21500
J-Sek merged 25 commits intonextfrom
ae-new-vgrid

Conversation

@AndreyYolkin
Copy link
Copy Markdown
Contributor

@AndreyYolkin AndreyYolkin commented May 29, 2025

Description

Resolves #8611, related to #18846

This PR:

  1. Swaps VCol/VRow spacing system to use gap instead of negative margin hack
  2. Introduces gap prop adding more control over spacing
  3. Deprecates dense and no-gutters props in favor of widely adopted density prop
  4. Deprecates attributes for utility classes (align, justify, order, etc.)

Docs are also updated (both examples and app itself)

Markup:

<template>
  <v-app>
    <v-main>
      <v-container>
        <v-row density="compact">
          <v-col cols="12">
            <v-sheet class="pa-2">
              v-col-12
            </v-sheet>
          </v-col>
        </v-row>
        <v-row density="comfortable">
          <v-col cols="6">
            <v-sheet class="pa-2">
              v-col-6
            </v-sheet>
          </v-col>
        </v-row>
      </v-container>
    </v-main>
  </v-app>
</template>

@AndreyYolkin AndreyYolkin self-assigned this May 29, 2025
@AndreyYolkin AndreyYolkin added the C: VGrid Covers issues involving VContainer, VLayout, VFlex label May 29, 2025
@AndreyYolkin AndreyYolkin changed the base branch from master to dev May 29, 2025 20:41
@AndreyYolkin AndreyYolkin added the T: enhancement Functionality that enhances existing features label May 29, 2025
@AndreyYolkin AndreyYolkin added this to the v3.9.0 (Zealot) milestone May 29, 2025
@KaelWD
Copy link
Copy Markdown
Member

KaelWD commented Jun 2, 2025

Swaps VCol/VRow spacing system to use gap instead of negative margin hack

This will break a lot of layouts which is why I put the issue on a major milestone not 3.9.0. Still unsure what the impact of this will be, we need to check a bunch of real examples and see if it's possible to make the required changes automatically.

@AndreyYolkin AndreyYolkin force-pushed the ae-new-vgrid branch 2 times, most recently from d7c6f09 to 29d1a1a Compare June 3, 2025 08:21
@KaelWD KaelWD force-pushed the dev branch 2 times, most recently from 6331ca7 to 564ccc8 Compare September 10, 2025 13:29
@J-Sek J-Sek force-pushed the dev branch 3 times, most recently from a7fa817 to 2e2cddb Compare October 8, 2025 15:22
@J-Sek J-Sek changed the base branch from dev to next December 21, 2025 17:07
@J-Sek J-Sek force-pushed the ae-new-vgrid branch 4 times, most recently from 42efc73 to c905f05 Compare January 27, 2026 18:09
Drop negative margins in favor of gap and gap-aware calculations
remove deprecated props and convert grid alignment, justify, and ordering to use utility classes
update documentation and tests to reflect changes
@J-Sek
Copy link
Copy Markdown
Contributor

J-Sek commented Jan 28, 2026

  • fix for auto broke it .v-row > .v-col overrides .v-row > [class*='v-col-'], maybe we will need to restore make-col, as CSS ifs nor style queries are available yet
    • once reverted, rework migration (CSS for restoring legacy grid)
  • migrate docs (ready to append on a separate branch, chilling until we fix ☝🏼 )

@KaelWD
Copy link
Copy Markdown
Member

KaelWD commented Jan 29, 2026

I cleaned it up a bit then broke it more, [class*='v-col-'] still matches .v-col-md-6 so columns with no xs size are full-width instead of 0+grow

  • proper test suite is needed, checking breakpoints in playground is tedious

@KaelWD
Copy link
Copy Markdown
Member

KaelWD commented Jan 29, 2026

<template>
  <v-container>
    <v-row>
      <v-col md="4">xs: grow, md: 4</v-col>
      <v-col>grow</v-col>
    </v-row>
    <v-row>
      <v-col cols="4" md>xs: 4, md: grow</v-col>
      <v-col>grow</v-col>
    </v-row>
    <v-row>
      <v-col cols="auto" md="4">xs: auto, md: 4</v-col>
      <v-col>grow</v-col>
    </v-row>
    <v-row>
      <v-col cols="4" md="auto">xs: 4, md: auto</v-col>
      <v-col>grow</v-col>
    </v-row>
    <v-row>
      <v-col cols="4" md="12">xs: 4, md: 12</v-col>
    </v-row>
    <v-row>
      <v-col cols="4" offset-md="4">offset-md: 4</v-col>
      <v-col>grow</v-col>
    </v-row>
  </v-container>
</template>

<style>
.v-col {
  outline: 1px solid red;
}
</style>

@J-Sek
Copy link
Copy Markdown
Contributor

J-Sek commented Jan 29, 2026

We can push it even more into parsing cols="1 of 5" or cols="1/5".

Following example already works, but is too much noise.

<v-row>
  <v-col cols="1" style="--v-row-columns: 5">1/5</v-col>
  <v-col cols="1" style="--v-row-columns: 5">1/5</v-col>
  <v-col cols="1" style="--v-row-columns: 2">1/2</v-col>
  <v-col cols="1" style="--v-row-columns: 10">1/10</v-col>
</v-row>

It can be a follow-up PR. #22572

@J-Sek
Copy link
Copy Markdown
Contributor

J-Sek commented Jan 29, 2026

The last thing that bothers me is that "auto" all over the docs examples instead of "grow". It should be fixed in master.

J-Sek
J-Sek previously approved these changes Jan 29, 2026
Copy link
Copy Markdown
Contributor

@J-Sek J-Sek left a comment

Choose a reason for hiding this comment

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

Looks ready to me. Planning to merge tomorrow morning.

@J-Sek J-Sek merged commit f6d24a9 into next Jan 30, 2026
16 checks passed
@J-Sek J-Sek deleted the ae-new-vgrid branch January 30, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: VGrid Covers issues involving VContainer, VLayout, VFlex T: enhancement Functionality that enhances existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report] New Grid System Negative Margins

3 participants