mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
make number of columns in grid layout adapt to width
This commit is contained in:
parent
3f6be9e15b
commit
10055e5058
1 changed files with 42 additions and 1 deletions
|
@ -178,19 +178,60 @@
|
|||
}
|
||||
// ------------------------------ posts-grid layout ------------------------------ //
|
||||
|
||||
@mixin onecol(){
|
||||
@media screen and (min-width: 600px) and (max-width: 800px) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
@mixin twocol(){
|
||||
@media screen and (min-width: 800px) and (max-width: 1000px) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
@mixin threecol(){
|
||||
@media screen and (min-width: 1000px) and (max-width: 1200px) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
@mixin fourcol(){
|
||||
@media screen and (min-width: 1200px) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.posts-grid {
|
||||
@include medium-large {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.post {
|
||||
@include medium-large {
|
||||
|
||||
@include onecol {
|
||||
width: 100%;
|
||||
margin-right: 0px;
|
||||
}
|
||||
@include twocol {
|
||||
width: calc((100% - 10px)/2);
|
||||
margin-right: 10px;
|
||||
&:nth-of-type(2n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
@include threecol {
|
||||
width: calc((100% - 20px)/3);
|
||||
margin-right: 10px;
|
||||
&:nth-of-type(3n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
@include fourcol {
|
||||
width: calc((100% - 30px)/4);
|
||||
margin-right: 10px;
|
||||
&:nth-of-type(4n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
margin-bottom: 10px;
|
||||
display: block;
|
||||
padding: 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue