<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[212636] trunk/Websites/webkit.org</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/212636">212636</a></dd>
<dt>Author</dt> <dd>rego@igalia.com</dd>
<dt>Date</dt> <dd>2017-02-20 07:30:24 -0800 (Mon, 20 Feb 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unreviewed, add CSS Grid Layout examples for a blog post.
* demos/css-grid/index.html: Added.
* demos/css-grid/responsive-grid.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebsiteswebkitorgChangeLog">trunk/Websites/webkit.org/ChangeLog</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/Websites/webkit.org/demos/css-grid/</li>
<li><a href="#trunkWebsiteswebkitorgdemoscssgridindexhtml">trunk/Websites/webkit.org/demos/css-grid/index.html</a></li>
<li><a href="#trunkWebsiteswebkitorgdemoscssgridresponsivegridhtml">trunk/Websites/webkit.org/demos/css-grid/responsive-grid.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebsiteswebkitorgChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Websites/webkit.org/ChangeLog (212635 => 212636)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/webkit.org/ChangeLog        2017-02-20 13:46:44 UTC (rev 212635)
+++ trunk/Websites/webkit.org/ChangeLog        2017-02-20 15:30:24 UTC (rev 212636)
</span><span class="lines">@@ -1,3 +1,10 @@
</span><ins>+2017-02-20 Manuel Rego Casasnovas <rego@igalia.com>
+
+ Unreviewed, add CSS Grid Layout examples for a blog post.
+
+ * demos/css-grid/index.html: Added.
+ * demos/css-grid/responsive-grid.html: Added.
+
</ins><span class="cx"> 2017-02-06 Jon Davis <jond@apple.com>
</span><span class="cx">
</span><span class="cx"> Add a survey to learn how people use WebKit Nightly builds
</span></span></pre></div>
<a id="trunkWebsiteswebkitorgdemoscssgridindexhtml"></a>
<div class="addfile"><h4>Added: trunk/Websites/webkit.org/demos/css-grid/index.html (0 => 212636)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/webkit.org/demos/css-grid/index.html         (rev 0)
+++ trunk/Websites/webkit.org/demos/css-grid/index.html        2017-02-20 15:30:24 UTC (rev 212636)
</span><span class="lines">@@ -0,0 +1,182 @@
</span><ins>+<!DOCTYPE html>
+<title>CSS Grid Layout Examples</title>
+<style>
+ .grid {
+ display: inline-grid;
+ border: 0.1em solid;
+ border-radius: 0.2em;
+ font-size: 2em;
+ }
+
+ .grid > div {
+ margin: 0.05em;
+ border-width: 0.1em;
+ border-style: solid;
+ border-radius: 0.2em;
+ padding: 0.5em;
+ font-family: monospace;
+ }
+
+ .item-1 {
+ background-color: rgba(242, 46, 138, 0.8);
+ border-color: rgb(242, 46, 138);
+ }
+
+ .item-2 {
+ background-color: rgba(98, 205, 217, 0.8);
+ border-color: rgb(98, 205, 217);
+ }
+
+ .item-3 {
+ background-color: rgba(117, 191, 6 , 0.8);
+ border-color: rgb(117, 191, 6);
+ }
+
+ .item-4 {
+ background-color: rgba(242, 226, 5, 0.8);
+ border-color: rgb(242, 226, 5);
+ }
+
+ .item-5 {
+ background-color: rgba(242, 54, 12, 0.8);
+ border-color: rgb(242, 54, 12);
+ }
+
+ .item-6 {
+ background-color: rgba(166, 0, 62, 0.8);
+ border-color: rgb(166, 0, 62);
+ }
+
+ .bold {
+ font-weight: bold;
+ }
+
+ .small {
+ font-size: 50%;
+ }
+
+ .medium {
+ font-size: 75%;
+ }
+
+ .big {
+ font-size: 150%;
+ }
+
+
+ iframe {
+ width: 800px;
+ height: 600px;
+ animation: resize 8s infinite alternate;
+ }
+
+ @keyframes resize {
+ to { width: 400px; }
+ }
+</style>
+
+<h1>CSS Grid Layout Examples</h1>
+
+<h2>Grid Definition</h2>
+
+<pre>
+ display: grid;
+ grid-template-rows: 100px 100px;
+ grid-template-columns: 400px 200px 100px;
+</pre>
+
+<div class="grid" style="grid-template-rows: 100px 100px; grid-template-columns: 400px 200px 100px;">
+ <div class="item-1 big">A</div>
+ <div class="item-2 big">B</div>
+ <div class="item-3 big">C</div>
+ <div class="item-4 big">D</div>
+ <div class="item-5 big">E</div>
+ <div class="item-6 big">F</div>
+</div>
+
+<h2>Grid Areas</h2>
+
+<pre>
+ display: grid;
+ grid-template-areas: "header header"
+ "sidebar main "
+ "sidebar footer";
+</pre>
+
+<div class="grid" style='grid-template-areas: "header header"
+ "sidebar main "
+ "sidebar footer";'>
+ <div class="item-1" style="grid-area: header;">header</div>
+ <div class="item-2" style="grid-area: sidebar;">sidebar</div>
+ <div class="item-3" style="grid-area: main;">main</div>
+ <div class="item-4" style="grid-area: footer;">footer</div>
+</div>
+
+<h2>Item Placement</h2>
+
+<pre>
+ display: grid;
+ grid: repeat(4, 100px) / repeat(4, 150px);
+</pre>
+
+<div class="grid" style="grid: repeat(4, 100px) / repeat(4, 150px);">
+ <div class="item-1 small" style="grid-row: 3; grid-column: 2;">grid-row: 3;<br><br>grid-column: 2;</div>
+ <div class="item-2 medium" style="grid-row: 2 / 5; grid-column: 3 / span 2;">grid-row: 2 / 5;<br><br>grid-column:<br>3 / span 2;</div>
+</div>
+
+<h2>Alignment</h2>
+
+<h3>Grid Tracks Alignment</h3>
+
+<pre>
+ display: grid;
+ grid: 100px 100px / 150px 150px 150px;
+ height: 500px;
+ width: 650px;
+ align-content: center;
+ justify-content: space-evenly;
+</pre>
+
+<div class="grid" style="grid: 100px 100px / 150px 150px 150px; height: 500px; width: 650px; align-content: center; justify-content: space-evenly;">
+ <div class="item-1 small" style="grid-row: 1; grid-column: 1 / 3;">grid-row: 1;<br><br>grid-column: 1 / 3;</div>
+ <div class="item-2 small" style="grid-row: 1 / 3; grid-column: 3;">grid-row: 1 / 3;<br><br>grid-column: 3;</div>
+ <div class="item-3 small" style="grid-row: 2; grid-column: 1;">grid-row: 2;<br><br>grid-column: 1;</div>
+ <div class="item-4 small" style="grid-row: 2; grid-column: 2;">grid-row: 2;<br><br>grid-column: 2;</div>
+</div>
+
+<h3>Grid Items Alignment</h3>
+
+<pre>
+ display: grid;
+ grid: 200px 200px / 400px 400px;
+</pre>
+
+<div class="grid" style="grid: 200px 200px / 400px 400px;">
+ <div class="item-1 medium" style="align-self: stretch; justify-self: stretch;">align-self: stretch;<br><br>justify-self: stretch;</div>
+ <div class="item-2 medium" style="align-self: end; justify-self: start;">align-self: end;<br><br>justify-self: start;</div>
+ <div class="item-3 medium" style="grid-column: span 2; align-self: center; justify-self: center;">grid-column: span 2;<br><br>align-self: center;<br><br>justify-self: center;</div>
+</div>
+
+<h2>Responsive Design</h2>
+
+<pre>
+ display: grid;
+ grid-gap: 10px 20px;
+ grid-template-rows: 100px 1fr auto;
+ grid-template-columns: 1fr 200px;
+ grid-template-areas: "title title"
+ "content aside"
+ "footer aside";
+
+ @media (max-width: 600px) {
+ grid-gap: 0;
+ grid-template-rows: auto 1fr auto auto;
+ grid-template-columns: 1fr;
+ grid-template-areas: "title "
+ "content"
+ "aside "
+ "footer ";
+ }
+</pre>
+
+<iframe src="responsive-grid.html"></iframe>
</ins></span></pre></div>
<a id="trunkWebsiteswebkitorgdemoscssgridresponsivegridhtml"></a>
<div class="addfile"><h4>Added: trunk/Websites/webkit.org/demos/css-grid/responsive-grid.html (0 => 212636)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/webkit.org/demos/css-grid/responsive-grid.html         (rev 0)
+++ trunk/Websites/webkit.org/demos/css-grid/responsive-grid.html        2017-02-20 15:30:24 UTC (rev 212636)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+<!DOCTYPE html>
+<title>CSS Grid Layout Examples</title>
+<style>
+ .grid {
+ display: inline-grid;
+ border: 0.1em solid;
+ border-radius: 0.2em;
+ font-size: 2em;
+ }
+
+ .grid > div {
+ margin: 0.05em;
+ border-width: 0.1em;
+ border-style: solid;
+ border-radius: 0.2em;
+ padding: 0.5em;
+ font-family: monospace;
+ }
+
+ .item-1 {
+ background-color: rgba(242, 46, 138, 0.8);
+ border-color: rgb(242, 46, 138);
+ }
+
+ .item-2 {
+ background-color: rgba(98, 205, 217, 0.8);
+ border-color: rgb(98, 205, 217);
+ }
+
+ .item-3 {
+ background-color: rgba(117, 191, 6 , 0.8);
+ border-color: rgb(117, 191, 6);
+ }
+
+ .item-4 {
+ background-color: rgba(242, 226, 5, 0.8);
+ border-color: rgb(242, 226, 5);
+ }
+
+ html, body {
+ height: 100%;
+ padding: 0;
+ margin: 0;
+ }
+
+ .responsive {
+ display: grid;
+ height: 100%;
+ box-sizing: border-box;
+ grid-gap: 10px 20px;
+ grid-template-rows: 100px 1fr auto;
+ grid-template-columns: 1fr 200px;
+ grid-template-areas: "title title"
+ "content aside"
+ "footer aside";
+ }
+
+ .title {
+ grid-area: title;
+ }
+
+ .content {
+ grid-area: content;
+ }
+
+ .aside {
+ grid-area: aside;
+ }
+
+ .footer {
+ grid-area: footer;
+ }
+
+ @media (max-width: 600px) {
+ .responsive {
+ grid-gap: 0;
+ grid-template-rows: auto 1fr auto auto;
+ grid-template-columns: 1fr;
+ grid-template-areas: "title "
+ "content"
+ "aside "
+ "footer ";
+ }
+ }
+</style>
+
+<div class="grid responsive">
+ <div class="item-1 title">Title</div>
+ <div class="item-2 content">Content</div>
+ <div class="item-3 aside">Aside</div>
+ <div class="item-4 footer">Footer</div>
+</div>
</ins></span></pre>
</div>
</div>
</body>
</html>