Skip to content

Instantly share code, notes, and snippets.

@akhyarrh
Last active October 15, 2015 00:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akhyarrh/a88d1a8d9c8c8a562835 to your computer and use it in GitHub Desktop.
Save akhyarrh/a88d1a8d9c8c8a562835 to your computer and use it in GitHub Desktop.
Percobaan pertama dengan flexbox berfokus memahami axis dan flex-direction

Flexbox

Percobaan pertama bermain sama flexbox. Pertama-tama, fokus memahami axis dulu.

Note: Perhatikan markup HTML dan konten hasil render.

flow-direction

row

row-reverse

flow-direction

flow-direction

column

column-reverse

flow-direction

$aqua: #7FDBFF;
$navy: #001f3f;
html {
font-family: sans-serif;
font-size: 16px;
}
.bg {
&-aqua { background-color: $aqua; }
&-navy { background-color: $navy; color: #fff;}
}
div {
margin: 1rem;
}
p {
font-size: 1.5rem;
text-align: center;
flex: 1;
margin: 0;
}
@mixin flex($direction) {
display: flex;
flex-direction: $direction;
}
.row {
@include flex(row)
}
.row-reverse {
@include flex(row-reverse)
}
.column {
@include flex(column)
}
.column-reverse {
@include flex(column-reverse)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment