A Pen by Edward Lance Lorilla on CodePen.
Created
October 9, 2017 18:08
-
-
Save edwardlorilla/7ae9f84b75679ea6392cde8cb89a3c69 to your computer and use it in GitHub Desktop.
css flexbox foundation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="container"> | |
<ul id="flex-container"> | |
<li v-for="item in flexContainer" :style="item.itemGrow"> | |
{{item.name}} | |
<input type="text" v-model="item.itemGrow['flex-grow']"> | |
</li> | |
</ul> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Vue({ | |
el: '#container', | |
data:{ | |
flexContainer: [ | |
{name: '1', itemGrow: | |
{ | |
'flex-grow': 2 | |
} | |
}, | |
{name: '2', itemGrow: | |
{ | |
'flex-grow': 2 | |
} | |
}, | |
{name: '3', itemGrow: | |
{ | |
'flex-grow': 3 | |
} | |
}, | |
{name: '4', itemGrow: | |
{ | |
'flex-grow': 4 | |
} | |
}, | |
{name: '5', itemGrow: | |
{ | |
'flex-grow': 5 | |
} | |
}, | |
{name: '6', itemGrow: | |
{ | |
'flex-grow': 6 | |
} | |
}, | |
] | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.3.4/vue.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html,body { | |
height:100%; | |
} | |
ul#flex-container { | |
display: flex; | |
list-style-type:none; | |
margin:0;padding:0; | |
} | |
ul li { | |
flex-grow: 1; | |
height:150px; | |
padding-top:45px; | |
color:#fff; | |
font-weight:bold; | |
font-size:2.2em; | |
text-align:center; | |
} | |
ul li:first-child { background: #c2d775; } | |
ul li:nth-child(2) { background: #007278; } | |
ul li:nth-child(3) { background: #c7b600; } | |
ul li:nth-child(4) { background: #a90077; } | |
ul li:nth-child(5) { background: #00a378; } | |
ul li:last-child { background: #00ea72; } | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.3.0/css/foundation.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment