-
Notifications
You must be signed in to change notification settings - Fork 25.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do you customize the number of columns in the Archive grid view? #623
Comments
It's all done through CSS. More specifically Sass and a set of mixins provided by Susy. The best tip I can give you is turn on the web developer tools of whatever browser you're using and start inspecting elements on the page (right click... tap inspect element). You'll quickly see what elements have what styles on them and then you can dig deeper into the In the case of the archive @include breakpoint($small) {
@include gallery(5 of 10);
.archive__item-teaser {
max-height: 200px;
}
}
@include breakpoint($medium) {
margin-left: 0; /* reset before mixin does its thing*/
margin-right: 0; /* reset before mixin does its thing*/
@include gallery(2.5 of 10);
.archive__item-teaser {
max-height: 120px;
}
.archive__item-excerpt {
display: block;
font-size: $type-size-6;
}
} What's going on here is, there are several breakpoints (starts with the smallest width and builds up) that use Susy's On On If you want to fit more or less items in a row you'll need to change those values. |
Thank you so much for the quick reply and helpful information! I made it to the _archives.scss file but couldn't figure out what to do when I got there. I should be able to sort it out from here. |
hi @elipousson were you able to limit the number of images that came up in a single row? I edited the .grid_item class with the following, but no luck so far:
} @include breakpoint($large) {
} @include breakpoint($x-large) {
} |
I'm trying to change the default of 4 columns to 3 columns. I thought it was a simple fix where I would change After I set I tried to edit the
} Any help would be appreciated. |
The To be honest the entire CSS for these grids is hacky at best. It should be revisited with flexbox instead and avoid floats all together. |
@benslack19
|
hey @sgofferj thanks for this example. How did you implement it? Are you editing the entire source archive.css file or writing over certain styles in the main.scss file? i'm having a hard time with the breakpoint element.. im trying to do something like this in the main.scss page to allow me to keep the minimal mistakes theme intact and just update if that makes sense. i may not understand how the breakpoints operate but i'm getting the error:
Many thanks for any guidance! i would love a 3 col grid implementation. |
@lwasser |
Hi @lwasser, I do import the "partials" at the beginning of my file though, before your code... possibly this fixes your error?
|
ahhhh @cooked thanks!! i'll try that. If you import that first, will it override other styles? I can play with this but it makes sense that this might work. |
@lwasser
|
This may be an obvious question (I haven't used Sass or Susy before trying to modify this theme) but I haven't been able to figure it out yet and didn't see any tips in the documentation.
How do you increase the width of archive items in the Archive grid view and/or limit the number of archive items that can appear in a single row?
This is the page that I am trying to customize – there are only three items displayed right now but I'm planning to add several more.
The text was updated successfully, but these errors were encountered: