Skip to content

Commit d2c59eb

Browse files
committed
First real demo.
1 parent 20d0091 commit d2c59eb

File tree

11 files changed

+263
-576
lines changed

11 files changed

+263
-576
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

README.md

+61-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,66 @@
1-
# Element Query demos
1+
# Container Query demos
22

3-
*As yet unproposed*, the Element Queries CSS module allows developers to style elements based on their size and shape.
3+
*As yet unproposed*, the Container Queries CSS Module allows developers to style elements based on their size and shape.
44

5-
This repository catalogs Element Query implementations realized through JavaScript.
5+
This repository catalogs container query implementations realized through JavaScript.
6+
7+
## Demos
8+
9+
**[Whitworth](http://responsiveimagescg.github.io/ALA-Whitworth-Demo/demo1/index.html)**<br>
10+
Illustrates how container queries could be used for both modular layout, and finessing smaller responsive design details (in this case, the position of the “add to cart” button).
11+
12+
## Quick Setup
13+
14+
These demos can only be viewed via HTTP—you can’t open the index files in your browser, if you’ve cloned the repo and want to tinker with these pages locally. You have two options for running this locally without wading through a bunch of Apache nonsense:
15+
16+
### PHP Server
17+
OSX ships with PHP, which makes it _very_ easy to spin up a quick server. Naviate to the repo’s root directory in your terminal and enter the following:
18+
19+
```shell
20+
$ php -S localhost:7777
21+
```
22+
23+
You should see something like:
24+
25+
```shell
26+
Listening on http://localhost:7777
27+
Document root is /Users/wilto/Sites/ricg/eq-demos
28+
Press Ctrl-C to quit.
29+
```
30+
31+
Then open http://localhost:7777/demos/(demo-name) in your browser
32+
33+
### NodeJS
34+
35+
If you don’t have it installed already, you’ll need to install Node from https://nodejs.org/ (or `brew install node`, if you use Homebrew).
36+
37+
Once you have Node installed, navigate to the repo’s root directory in your terminal and enter the following:
38+
39+
```shell
40+
$ npm install
41+
```
42+
43+
This will install the node server’s dependencies. Once complete, enter:
44+
45+
```shell
46+
$ node server.js
47+
```
48+
49+
You should see something like:
50+
51+
```shell
52+
Listening on http://localhost:7777
53+
Document root is /Users/wilto/Sites/ricg/eq-demos
54+
Press Ctrl-C to quit.
55+
```
56+
57+
Then open http://localhost:7777/demos/(demo-name) in your browser
58+
59+
## Demo Syntax
60+
61+
Only `.element:media( min-width ) {} ` and `.element:media( max-width ) {} ` are available so far.
62+
63+
The container query pseudo-polyfill used here is a modified version of <a href="https://github.com/Mr0grog/element-query">element-query</a>.
664

765
## Motivation
866

demos/whitworth/index.html

+10-9
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Element Query Demo</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77

8-
<link rel="stylesheet" type="text/css" href="../../styles.css">
8+
<link rel="stylesheet" type="text/css" href="theme.css">
99
<link rel="stylesheet" type="text/css" href="styles.css">
1010

1111
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro|Source+Code+Pro|Pathway+Gothic+One' rel='stylesheet' type='text/css'>
@@ -20,15 +20,16 @@ <h1 class="logo-hed">Whitworth Tools</h1>
2020
</header>
2121
<div class="demo">
2222

23-
<div class="col-b secondary">
23+
<div class="col-b featured">
2424
<h2 class="page-hed">Featured Item</h2>
25+
2526
<div class="mod">
2627
<div class="mod-header">
2728
<h3 class="hed">Bocoup Mfg. Corp. <strong>Hammer</strong></h3>
2829
<p class="meta">Triumph/Norton/<abbr title="Birmingham Small Arms Company">BSA</abbr></p>
2930
</div>
3031

31-
<img src="img/hammer.jpg" alt="A hammer">
32+
<img src="../img/hammer.jpg" alt="A hammer">
3233

3334
<div class="mod-desc">
3435
<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
@@ -58,7 +59,7 @@ <h2 class="page-hed">New Items</h2>
5859
<h2 class="hed">ALA Toolworks <strong>Wrench Set</strong></h2>
5960
<p class="meta">Triumph/Norton/<abbr title="Birmingham Small Arms Company">BSA</abbr></p>
6061
</div>
61-
<img src="img/wrenches.jpg" alt="A set of Whitworth wrenches">
62+
<img src="../img/wrenches.jpg" alt="A set of Whitworth wrenches">
6263

6364
<div class="mod-desc">
6465
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse
@@ -81,7 +82,7 @@ <h2 class="hed">ALA Toolworks <strong>Wrench Set</strong></h2>
8182
<h2 class="hed">Bocoup Mfg. Corp. <strong>Socket Set</strong></h2>
8283
<p class="meta">Triumph/Norton/<abbr title="Birmingham Small Arms Company">BSA</abbr></p>
8384
</div>
84-
<img src="img/sockets.jpg" alt="a set of Whitworth sockets">
85+
<img src="../img/sockets.jpg" alt="a set of Whitworth sockets">
8586

8687
<div class="mod-desc">
8788
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
@@ -104,7 +105,7 @@ <h2 class="hed">Bocoup Mfg. Corp. <strong>Socket Set</strong></h2>
104105
<h2 class="hed">ALA Toolworks <strong>Tap &amp; Die Set</strong></h2>
105106
<p class="meta">Triumph/Norton/<abbr title="Birmingham Small Arms Company">BSA</abbr></p>
106107
</div>
107-
<img src="img/tapanddie.jpg" alt="A Whitworth tap and die set">
108+
<img src="../img/tapanddie.jpg" alt="A Whitworth tap and die set">
108109

109110
<div class="mod-desc">
110111
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo.</p>
@@ -129,7 +130,7 @@ <h2 class="hed">ALA Toolworks <strong>Tap &amp; Die Set</strong></h2>
129130
<h2 class="hed">ALA Toolworks <strong>Thread Gauges</strong></h2>
130131
<p class="meta">Triumph/Norton/<abbr title="Birmingham Small Arms Company">BSA</abbr></p>
131132
</div>
132-
<img src="img/threads.jpg" alt="A set of Whitworth thread gauges">
133+
<img src="../img/threads.jpg" alt="A set of Whitworth thread gauges">
133134

134135
<div class="mod-desc">
135136
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo.</p>
@@ -151,7 +152,7 @@ <h2 class="hed">ALA Toolworks <strong>Thread Gauges</strong></h2>
151152
<h2 class="hed">Bocoup Mfg. Corp. <strong>Socket Set</strong></h2>
152153
<p class="meta">Triumph/Norton/<abbr title="Birmingham Small Arms Company">BSA</abbr></p>
153154
</div>
154-
<img src="img/sockets.jpg" alt="a set of Whitworth sockets">
155+
<img src="../img/sockets.jpg" alt="a set of Whitworth sockets">
155156

156157
<div class="mod-desc">
157158
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
@@ -174,7 +175,7 @@ <h2 class="hed">Bocoup Mfg. Corp. <strong>Socket Set</strong></h2>
174175
<h2 class="hed">ALA Toolworks <strong>Wrench Set</strong></h2>
175176
<p class="meta">Triumph/Norton/<abbr title="Birmingham Small Arms Company">BSA</abbr></p>
176177
</div>
177-
<img src="img/wrenches.jpg" alt="A set of Whitworth wrenches">
178+
<img src="../img/wrenches.jpg" alt="A set of Whitworth wrenches">
178179

179180
<div class="mod-desc">
180181
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse

demos/whitworth/mod.html

-23
This file was deleted.

0 commit comments

Comments
 (0)