Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion _config.local.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
title: CSS Reference
description: A free visual guide to the most popular CSS properties.
subtitle: "A free visual guide to the most popular CSS properties"
description: "CSS Reference is a free visual guide to CSS. It features the most popular properties, and explains them with illustrated and animated examples."
share: "CSS Reference: a free visual guide to the most popular CSS properties."
url: http://localhost:4000
markdown: kramdown
Expand Down
3 changes: 2 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
title: CSS Reference
description: A free visual guide to the most popular CSS properties.
subtitle: "A free visual guide to the most popular CSS properties"
description: "CSS Reference is a free visual guide to CSS. It features the most popular properties, and explains them with illustrated and animated examples."
share: "CSS Reference: a free visual guide to the most popular CSS properties."
url: http://cssreference.io
markdown: kramdown
Expand Down
6 changes: 3 additions & 3 deletions _includes/collections/animations.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _includes/collections/box-model.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _includes/collections/flexbox.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _includes/collections/positioning.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _includes/collections/transitions.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _includes/collections/typography.html

Large diffs are not rendered by default.

21 changes: 8 additions & 13 deletions _includes/google-fonts.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
<script async type="text/javascript">
WebFontConfig = {
google: { families: [ 'Source+Sans+Pro:400,700,400italic,700italic:latin', 'Source+Code+Pro::latin' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
</script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-82634666-3', 'auto');
ga('send', 'pageview');
</script>
10 changes: 5 additions & 5 deletions _includes/lists/main-list.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _includes/lists/menu-list.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions _includes/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
</a>
</header>
<nav class="menu-collections">
<p><strong>Collections</strong></p>
<ul>
<li><a class="menu-collection-link{% if page.template == 'index' %} menu-collection-link--active{% endif %}" href="{{site.url}}/">All</a></li>
<li><a class="menu-collection-link{% if page.collection_name == 'Animations' %} menu-collection-link--active{% endif %}" href="{{site.url}}/animations/">Animations</a></li>
<li><a class="menu-collection-link{% if page.collection_name == 'Box model' %} menu-collection-link--active{% endif %}" href="{{site.url}}/box-model/">Box model</a></li>
<li><a class="menu-collection-link{% if page.collection_name == 'Flexbox' %} menu-collection-link--active{% endif %}" href="{{site.url}}/flexbox/">Flexbox</a></li>
Expand Down Expand Up @@ -83,13 +83,13 @@

<footer class="footer">
<p class="footer-title">
<strong>{{site.description}}</strong> <small>Created by <a href="https://twitter.com/jgthms">@jgthms</a></small>
<strong>{{site.subtitle}}</strong> <small>Created by <a href="https://twitter.com/jgthms">@jgthms</a></small>
</p>
<div class="footer-facebook">
<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fcssreference%2F&width=100&layout=button_count&action=like&size=small&show_faces=false&share=false&height=20&appId=1212191075486670" width="100" height="20" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
<iframe class="footer-iframe" data-src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fcssreference%2F&width=100&layout=button_count&action=like&size=small&show_faces=false&share=false&height=20&appId=1212191075486670" width="100" height="20" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
</div>
<div class="footer-github">
<iframe src="https://ghbtns.com/github-btn.html?user=jgthms&repo=css-reference&type=star&count=true" frameborder="0" scrolling="0" width="100px" height="20px"></iframe>
<iframe class="footer-iframe" data-src="https://ghbtns.com/github-btn.html?user=jgthms&repo=css-reference&type=star&count=true" frameborder="0" scrolling="0" width="100px" height="20px"></iframe>
</div>
<!-- <p class="footer-share footer-share--contribute">
<strong class="footer-share-label">Contribute</strong>
Expand Down
1 change: 1 addition & 0 deletions _layouts/collection.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<title>{{page.collection_name}} - {{site.title}}</title>
<meta name="description" content="Learn how {{page.collection_name}} works in CSS.">
<link rel="stylesheet" type="text/css" href="{{site.url}}/css/website.css">

<meta property="og:url" content="{{site.url}}{{page.url}}">
Expand Down
1 change: 1 addition & 0 deletions _layouts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<title>{{page.property_name}} - {{site.title}}</title>
<meta name="description" content="Learn how {{page.property_name}} works in CSS.">
<link rel="stylesheet" type="text/css" href="{{site.url}}/css/website.css">

<meta property="og:url" content="{{site.url}}{{page.url}}">
Expand Down
2 changes: 1 addition & 1 deletion css/website.css

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# this is an empty front matter
template: index
---

<!DOCTYPE html>
Expand All @@ -8,7 +8,9 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<title>{{site.title}} - {{site.description}}</title>
<title>{{site.title}} - {{site.subtitle}}</title>
<meta name="description" content="{{site.description}}">

<link rel="stylesheet" type="text/css" href="{{site.url}}/css/website.css">

<meta property="og:url" content="{{site.url}}">
Expand Down
8 changes: 8 additions & 0 deletions javascript/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ document.addEventListener('DOMContentLoaded', function() {
var $root = document.documentElement;
var template = $root.dataset.template;

// Load iframes
var $footerIframes = document.querySelectorAll('.footer-iframe');

Array.prototype.forEach.call($footerIframes, function($iframe) {
var src = $iframe.dataset.src;
$iframe.src = src;
});

// Menu: Search
var $searchInput = document.getElementById('menu-search-input');
var $menuList = document.getElementById('menu-list');
Expand Down
13 changes: 12 additions & 1 deletion property/align-content/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<section id="align-content" class="property">
<header class="property-header">
<nav class="property-links">
<a class="property-links-direct" href="{{site.url}}/property/align-content/" data-property-name="align-content" data-tooltip="Single page for this property" target="_blank">Link</a>
<a class="property-links-direct" href="{{site.url}}/property/align-content/" data-property-name="align-content" data-tooltip="Single page for this property" target="_blank">Pop out</a>
<a class="property-share" data-tooltip="Share on Twitter or Facebook" data-property-name="align-content">Share</a>
<a target="_blank" href="https://developer.mozilla.org/en/docs/Web/CSS/align-content" data-tooltip="See on Mozilla Developer Network" rel="external">MDN</a>
</nav>
Expand Down Expand Up @@ -37,6 +37,16 @@ <h2 class="property-name">
<div class="example-description">
<p>Each line will stretch to <em>fill</em> the remaining space.</p>
<p>In this case, the container is <code>300px</code> high. All boxes are <code>50px</code> high, apart from the second one who is <code>100px</code> high.</p>
<ul>
<li>The first line is <strong>100px</strong> high</li>
<li>The second line is <strong>50px</strong> high</li>
<li>The remaing space is <strong>150px</strong></li>
</ul>
<p>This remaining space is distributed equally amongst the two lines:</p>
<ul>
<li>The first line is now <strong>175px</strong> high</li>
<li>The second line is now <strong>125px</strong> high</li>
</ul>

</div>
</header>
Expand All @@ -48,6 +58,7 @@ <h2 class="property-name">
</div>
</aside>
<style type="text/css">#align-content-stretch{ align-content:stretch;}</style>
<style type="text/css">#align-content-stretch .box--red { height: 175px; }#align-content-stretch .box--green { height: 125px;top: 175px; }</style>
</section>
<section class="example">
<header class="example-header">
Expand Down
4 changes: 2 additions & 2 deletions property/align-items/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<section id="align-items" class="property">
<header class="property-header">
<nav class="property-links">
<a class="property-links-direct" href="{{site.url}}/property/align-items/" data-property-name="align-items" data-tooltip="Single page for this property" target="_blank">Link</a>
<a class="property-links-direct" href="{{site.url}}/property/align-items/" data-property-name="align-items" data-tooltip="Single page for this property" target="_blank">Pop out</a>
<a class="property-share" data-tooltip="Share on Twitter or Facebook" data-property-name="align-items">Share</a>
<a target="_blank" href="https://developer.mozilla.org/en/docs/Web/CSS/align-items" data-tooltip="See on Mozilla Developer Network" rel="external">MDN</a>
</nav>
Expand Down Expand Up @@ -58,7 +58,7 @@ <h2 class="property-name">
</p>
<div class="example-description">
<p>The flexbox items are aligned at the <strong>end</strong> of the <strong>cross axis</strong>.</p>
<p>By default, the cross axis is vertical. This means the flexbox items will be aligned <em>vertically</em> at the _bottom.</p>
<p>By default, the cross axis is vertical. This means the flexbox items will be aligned <em>vertically</em> at the <em>bottom</em>.</p>

</div>
</header>
Expand Down
35 changes: 29 additions & 6 deletions property/align-self/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<section id="align-self" class="property">
<header class="property-header">
<nav class="property-links">
<a class="property-links-direct" href="{{site.url}}/property/align-self/" data-property-name="align-self" data-tooltip="Single page for this property" target="_blank">Link</a>
<a class="property-links-direct" href="{{site.url}}/property/align-self/" data-property-name="align-self" data-tooltip="Single page for this property" target="_blank">Pop out</a>
<a class="property-share" data-tooltip="Share on Twitter or Facebook" data-property-name="align-self">Share</a>
<a target="_blank" href="https://developer.mozilla.org/en/docs/Web/CSS/align-self" data-tooltip="See on Mozilla Developer Network" rel="external">MDN</a>
</nav>
Expand All @@ -26,6 +26,29 @@ <h2 class="property-name">
<style type="text/css">.align-self .square { height: 50px;margin: 0 2px;width: calc(20% - 4px); }.align-self .square:nth-child(2) { background: #05ffb0;color: #310736; }.align-self .square:nth-child(4) { height: 75px; }.align-self .line { left: 2px;position: absolute;right: 2px; }.align-self .line--default { top: 50%; }.align-self .line--default:before { content: "Items"; }.align-self .line--red:before { content: "Self"; }</style>


<section class="example">
<header class="example-header">
<p class="example-name">
<code class="example-default" data-tooltip="This is the property's default value">default</code>


<code class="example-value" data-tooltip="Click to copy" data-clipboard-text="align-self: auto;">align-self: auto;</code>
</p>
<div class="example-description">
<p>The target will use the value of <code>align-items</code>.</p>

</div>
</header>

<aside class="example-preview">
<div class="example-browser"><i></i><i></i><i></i></div>
<div class="example-output">
<div class="example-output-div align-self " id="align-self-auto"><p class="square square--plum">1</p><p class="square target">Target</p><p class="square square--plum">3</p><p class="square square--plum">4</p><p class="square square--plum">5</p><div class="line line--default"></div><div class="line line--red"></div></div>
</div>
</aside>
<style type="text/css">#align-self-auto{ align-self:auto;}</style>
<style type="text/css">#align-self-auto .target { align-self: auto; }</style>
</section>
<section class="example">
<header class="example-header">
<p class="example-name">
Expand All @@ -34,7 +57,7 @@ <h2 class="property-name">
<code class="example-value" data-tooltip="Click to copy" data-clipboard-text="align-self: flex-start;">align-self: flex-start;</code>
</p>
<div class="example-description">
<p>If the container has <code>align-items: center</code> and the <strong>target</strong> has <code>align-items: flex-start</code>, only the target will be at the start of the cross axis.</p>
<p>If the container has <code>align-items: center</code> and the <strong>target</strong> has <code>align-self: flex-start</code>, only the target will be at the start of the cross axis.</p>
<p>By default, this means it will be aligned <strong>vertically</strong> at the <strong>top</strong>.</p>

</div>
Expand All @@ -57,7 +80,7 @@ <h2 class="property-name">
<code class="example-value" data-tooltip="Click to copy" data-clipboard-text="align-self: flex-end;">align-self: flex-end;</code>
</p>
<div class="example-description">
<p>If the container has <code>align-items: center</code> and the <strong>target</strong> has <code>align-items: flex-end</code>, only the target will be at the end of the cross axis.</p>
<p>If the container has <code>align-items: center</code> and the <strong>target</strong> has <code>align-self: flex-end</code>, only the target will be at the end of the cross axis.</p>
<p>By default, this means it will be aligned <strong>vertically</strong> at the <strong>bottom</strong>.</p>

</div>
Expand All @@ -80,7 +103,7 @@ <h2 class="property-name">
<code class="example-value" data-tooltip="Click to copy" data-clipboard-text="align-self: center;">align-self: center;</code>
</p>
<div class="example-description">
<p>If the container has <code>align-items: flex-start</code> and the <strong>target</strong> has <code>align-items: center</code>, only the target will be at the center of the cross axis.</p>
<p>If the container has <code>align-items: flex-start</code> and the <strong>target</strong> has <code>align-self: center</code>, only the target will be at the center of the cross axis.</p>
<p>By default, this means it will be <strong>vertically centered</strong>.</p>

</div>
Expand All @@ -104,7 +127,7 @@ <h2 class="property-name">
<code class="example-value" data-tooltip="Click to copy" data-clipboard-text="align-self: baseline;">align-self: baseline;</code>
</p>
<div class="example-description">
<p>If the container has <code>align-items: center</code> and the <strong>target</strong> has <code>align-items: baseline</code>, only the target will be at the baseline of the cross axis.</p>
<p>If the container has <code>align-items: center</code> and the <strong>target</strong> has <code>align-self: baseline</code>, only the target will be at the baseline of the cross axis.</p>
<p>By default, this means it will be aligned along the basline of the text.</p>

</div>
Expand All @@ -127,7 +150,7 @@ <h2 class="property-name">
<code class="example-value" data-tooltip="Click to copy" data-clipboard-text="align-self: stretch;">align-self: stretch;</code>
</p>
<div class="example-description">
<p>If the container has <code>align-items: center</code> and the <strong>target</strong> has <code>align-items: stretch</code>, only the target will stretch along the whole cross axis.</p>
<p>If the container has <code>align-items: center</code> and the <strong>target</strong> has <code>align-self: stretch</code>, only the target will stretch along the whole cross axis.</p>

</div>
</header>
Expand Down
2 changes: 1 addition & 1 deletion property/animation-delay/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<section id="animation-delay" class="property">
<header class="property-header">
<nav class="property-links">
<a class="property-links-direct" href="{{site.url}}/property/animation-delay/" data-property-name="animation-delay" data-tooltip="Single page for this property" target="_blank">Link</a>
<a class="property-links-direct" href="{{site.url}}/property/animation-delay/" data-property-name="animation-delay" data-tooltip="Single page for this property" target="_blank">Pop out</a>
<a class="property-share" data-tooltip="Share on Twitter or Facebook" data-property-name="animation-delay">Share</a>
<a target="_blank" href="https://developer.mozilla.org/en/docs/Web/CSS/animation-delay" data-tooltip="See on Mozilla Developer Network" rel="external">MDN</a>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion property/animation-direction/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<section id="animation-direction" class="property">
<header class="property-header">
<nav class="property-links">
<a class="property-links-direct" href="{{site.url}}/property/animation-direction/" data-property-name="animation-direction" data-tooltip="Single page for this property" target="_blank">Link</a>
<a class="property-links-direct" href="{{site.url}}/property/animation-direction/" data-property-name="animation-direction" data-tooltip="Single page for this property" target="_blank">Pop out</a>
<a class="property-share" data-tooltip="Share on Twitter or Facebook" data-property-name="animation-direction">Share</a>
<a target="_blank" href="https://developer.mozilla.org/en/docs/Web/CSS/animation-direction" data-tooltip="See on Mozilla Developer Network" rel="external">MDN</a>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion property/animation-duration/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<section id="animation-duration" class="property">
<header class="property-header">
<nav class="property-links">
<a class="property-links-direct" href="{{site.url}}/property/animation-duration/" data-property-name="animation-duration" data-tooltip="Single page for this property" target="_blank">Link</a>
<a class="property-links-direct" href="{{site.url}}/property/animation-duration/" data-property-name="animation-duration" data-tooltip="Single page for this property" target="_blank">Pop out</a>
<a class="property-share" data-tooltip="Share on Twitter or Facebook" data-property-name="animation-duration">Share</a>
<a target="_blank" href="https://developer.mozilla.org/en/docs/Web/CSS/animation-duration" data-tooltip="See on Mozilla Developer Network" rel="external">MDN</a>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion property/animation-fill-mode/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<section id="animation-fill-mode" class="property">
<header class="property-header">
<nav class="property-links">
<a class="property-links-direct" href="{{site.url}}/property/animation-fill-mode/" data-property-name="animation-fill-mode" data-tooltip="Single page for this property" target="_blank">Link</a>
<a class="property-links-direct" href="{{site.url}}/property/animation-fill-mode/" data-property-name="animation-fill-mode" data-tooltip="Single page for this property" target="_blank">Pop out</a>
<a class="property-share" data-tooltip="Share on Twitter or Facebook" data-property-name="animation-fill-mode">Share</a>
<a target="_blank" href="https://developer.mozilla.org/en/docs/Web/CSS/animation-fill-mode" data-tooltip="See on Mozilla Developer Network" rel="external">MDN</a>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion property/animation-iteration-count/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<section id="animation-iteration-count" class="property">
<header class="property-header">
<nav class="property-links">
<a class="property-links-direct" href="{{site.url}}/property/animation-iteration-count/" data-property-name="animation-iteration-count" data-tooltip="Single page for this property" target="_blank">Link</a>
<a class="property-links-direct" href="{{site.url}}/property/animation-iteration-count/" data-property-name="animation-iteration-count" data-tooltip="Single page for this property" target="_blank">Pop out</a>
<a class="property-share" data-tooltip="Share on Twitter or Facebook" data-property-name="animation-iteration-count">Share</a>
<a target="_blank" href="https://developer.mozilla.org/en/docs/Web/CSS/animation-iteration-count" data-tooltip="See on Mozilla Developer Network" rel="external">MDN</a>
</nav>
Expand Down
Loading