Last active
October 4, 2016 16:24
-
-
Save pdc/75d25bf018fb7bb098138cf7b13c388b to your computer and use it in GitHub Desktop.
Thing list using Flexbox
This file contains hidden or 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
body { | |
margin: 0; | |
padding: 0; | |
font-family: "Source Sans Pro", "Helvetica Neue", "Arial", "Helvetica", sans-serif; | |
line-height: 1.25; | |
color: rgba(0, 0, 0, 0.8); | |
} | |
.thing-icon { | |
margin-right: 4px; | |
width: 16px; | |
text-align: center; | |
} | |
.thing-gloss { | |
display: none; | |
} | |
.f-box { | |
margin: 20px; | |
box-shadow: rgba(0, 17, 34, 0.25) 0 2px 4px, rgba(17, 17, 0, 0.25) 1px 1px 3px; | |
} | |
.f-hd { | |
margin: 0; | |
padding: 10px 10px 0; | |
font-size: 2em; | |
font-weight: 400; | |
color: #B0A; | |
} | |
.thing-list { | |
margin: 1.25em 0 0.625em; | |
padding: 0.25em; | |
border-top: 1px solid #B0A; | |
} | |
.thing { | |
display: flex; | |
margin: 0.5em 10px; | |
flex-flow: row nowrap; | |
justify-content: space-between; | |
align-items: baseline; | |
align-content: flex-start; | |
} | |
.thing-name, | |
.thing-info { | |
} | |
.thing-name { | |
flex: 1 1 auto; | |
width: auto; | |
} | |
.thing-info { | |
flex: 0 1 auto; | |
width: 180px; | |
color: rgba(0, 0, 0, 0.5); | |
display: flex; | |
justify-contents: space-between; | |
} | |
.thing-logical { | |
flex: 1 0 auto; | |
} | |
.thing-size { | |
flex: 1 0 auto; | |
text-align: right; | |
} | |
@media (max-width: 560px) { | |
.thing { | |
flex-flow: column nowrap; | |
align-items: flex-start; | |
} | |
.thing-name { | |
width: 100%; | |
flex: 1 1 auto; | |
} | |
.thing-info { | |
flex: 1 1 auto; | |
padding-top: 0.25em; | |
font-size: 13px; | |
} | |
.thing-logical { | |
padding-left: 20px; | |
} | |
} |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=UTF-8> | |
<title>Flex it</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700" rel="stylesheet"> | |
<link rel=stylesheet href=flext.css> | |
<script src="https://use.fontawesome.com/9219be5fd9.js"></script> | |
</head> | |
<body> | |
<header> | |
<span>Flexit</span> | |
<span>Yeah</span> | |
</header> | |
<section class="f-box"> | |
<h1 class="f-hd">Some things</h1> | |
<div class="thing-list"> | |
<div class="thing"> | |
<span class="thing-name"><i class="fa fa-file-code-o thing-icon"><span class="thing-gloss">[XML] </span></i>alphabetthing-final-rev4.xml</span> | |
<span class="thing-info"> | |
<span class="thing-logical">manifest</span> | |
<span class="thing-size">23K</span> | |
</span> | |
</div> | |
<div class="thing"> | |
<span class="thing-name"><i class="fa fa-file-text-o thing-icon"><span class="thing-gloss">[HTML] </span></i>spamfalloon.html</span> | |
<span class="thing-info"> | |
<span class="thing-logical">report</span> | |
<span class="thing-size">96M</span> | |
</span> | |
</div> | |
<div class="thing"> | |
<span class="thing-name"><i class="fa fa-file-text-o thing-icon"><span class="thing-gloss">[TEXT] </span></i>defenetration-2016-10-04-001.log</span> | |
<span class="thing-info"> | |
<span class="thing-logical">defenestration log</span> | |
<span class="thing-size">2.6K</span> | |
</span> | |
</div> | |
<div class="thing"> | |
<span class="thing-name"><i class="fa fa-file-text-o thing-icon"><span class="thing-gloss">[TEXT] </span></i>aggregation-2016-10-04-10-30-56.log</span> | |
<span class="thing-info"> | |
<span class="thing-logical">aggregation log</span> | |
<span class="thing-size">1.2G</span> | |
</span> | |
</div> | |
</div> | |
</section> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note to self: https://philipwalton.github.io/solved-by-flexbox/demos/grids/