Skip to content

Commit

Permalink
Merge pull request #13 from TYPO3incubator/frontend-grid-fixes
Browse files Browse the repository at this point in the history
Frontend Grid bugfixes
  • Loading branch information
o-ba authored Apr 12, 2024
2 parents 2879d50 + 22ce43a commit d29d26d
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions local_packages/psi/Resources/Private/Scss/Base/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,39 @@

.row {
display: flex;
flex-flow: row wrap;
flex-wrap: wrap;
gap: var(--gutter);
}

.col {
flex: 0 0 auto;
min-height: 0;
min-width: 0;
width: 100%;
flex-basis: auto;
box-sizing: border-box;
padding: 0 var(--gutter / 2);

@include breakpoint-up(md){
padding: 0 var(--gutter);
}
padding: 0 calc(var(--gutter) / 2);

.no-gutter {
padding: 0;
}
}
}


// generating columns
@for $i from 1 through map-get($grid-config, columns) {

.col-#{$i}{
flex-basis: calc((100% - #{map-get($grid-config, gutter)}) / #{map-get($grid-config, columns)} * #{$i});
flex-basis: calc((100% - #{map-get($grid-config, gutter)} * 2 ) / #{map-get($grid-config, columns)} * #{$i});
}
}

// generating responsive columns
@each $bp, $value in $breakpoints {
@for $i from 1 through map-get($grid-config, columns) {
.col-#{$bp}-#{$i}{
flex-basis: calc((100% - #{map-get($grid-config, gutter)}) / #{map-get($grid-config, columns)} * #{$i});
}
@include breakpoint-up(#{$bp}) {
@for $i from 1 through map-get($grid-config, columns) {
.col-#{$bp}-#{$i}{
flex-basis: calc((100% - #{map-get($grid-config, gutter)} * 2 ) / #{map-get($grid-config, columns)} * #{$i});
}
}
}
}

0 comments on commit d29d26d

Please sign in to comment.