Skip to content

Instantly share code, notes, and snippets.

@eightyfive
Last active January 25, 2021 16:01
Show Gist options
  • Save eightyfive/3f835915441c2b84890282302ad44d7f to your computer and use it in GitHub Desktop.
Save eightyfive/3f835915441c2b84890282302ad44d7f to your computer and use it in GitHub Desktop.
Flexbox `dial` positioning system
// dial.css
[class^="col-"],
[class*=" col-"] {
display: flex;
flex-direction: column;
}
[class^="row-"],
[class*=" row-"] {
display: flex;
flex-direction: row;
}
.col-1,
.row-1 {
justify-content: flex-start;
align-items: flex-start;
}
.col-2,
.row-2 {
justify-content: flex-start;
align-items: center;
}
.col-3,
.row-3 {
justify-content: flex-start;
align-items: flex-end;
}
.col-4,
.row-4 {
justify-content: center;
align-items: flex-start;
}
.col-5,
.row-5 {
justify-content: center;
align-items: center;
}
.col-6,
.row-6 {
justify-content: center;
align-items: flex-end;
}
.col-7,
.row-7 {
justify-content: flex-end;
align-items: flex-start;
}
.col-8,
.row-8 {
justify-content: flex-end;
align-items: center;
}
.col-9,
.row-9 {
justify-content: flex-end;
align-items: flex-end;
}
.col-28 {
justify-content: space-between;
}
.row-46 {
justify-content: space-between;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment