Skip to content

Commit 6da2245

Browse files
Codpen links. More links to FF download. (arcadio feedback)
1 parent c265a7b commit 6da2245

10 files changed

+92
-18
lines changed

.vscode/cSpell.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// cSpell Settings
2+
{
3+
// Version of the setting file. Always 0.1
4+
"version": "0.1",
5+
// language - current active spelling language
6+
"language": "en",
7+
// words - list of words to be always considered correct
8+
"words": [
9+
"Codepen"
10+
],
11+
// flagWords - list of words to be always considered incorrect
12+
// This is useful for offensive words and common spelling errors.
13+
// For example "hte" should be "the"
14+
"flagWords": []
15+
}

src/components/CodepenLink.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
4+
const style = {
5+
display: 'block',
6+
fontSize: '14px',
7+
marginTop: '1rem',
8+
};
9+
10+
const linkStyle = {
11+
color: 'black',
12+
textDecoration: 'underline',
13+
};
14+
15+
const CodepenLink = props => (
16+
<span style={style}>
17+
<a style={linkStyle} href={props.link} target="_blank" rel="noopener noreferrer">
18+
View on Codepen
19+
</a>
20+
</span>
21+
);
22+
23+
CodepenLink.propTypes = {
24+
link: PropTypes.string.isRequired,
25+
};
26+
27+
export default CodepenLink;
28+

src/pages/02-first-grid.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import Main from '../components/layout/Main';
33
import CodeBlock from '../components/CodeBlock';
44
import DevHomework from '../components/layout/DevHomework';
5+
import CodepenLink from '../components/CodepenLink';
56

67
const Tutorial = () => (
78
<div>
@@ -92,6 +93,8 @@ grid-gap: 1rem;
9293
<div className="item" />
9394
<div className="item" />
9495
</div>
96+
97+
<CodepenLink link="https://codepen.io/mozilladevelopers/pen/veXQmp" />
9598
</div>
9699
);
97100

@@ -107,10 +110,14 @@ const Homework = () => (
107110
<p>
108111
Having a good set of developer tools when working with CSS Grid Layout is essential. Firefox
109112
has some fantastic features that are specifically built to help you create and design grids.
110-
Intrigued?
113+
Intrigued?{' '}
114+
<a href="https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly">
115+
Download Firefox Nightly
116+
</a>{' '}
117+
to get the browser with the best CSS Grid Layout tools.
111118
</p>
112119

113-
<p>Click to the next section to learn about Firefox's CSS Grid Layout Panel.</p>
120+
<p>Click to the next section to learn about Firefox's new CSS Grid Layout panel.</p>
114121
</DevHomework>
115122
);
116123

src/pages/04-fr-unit.js

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import Main from '../components/layout/Main';
33
import CodeBlock from '../components/CodeBlock';
44
import DevHomework from '../components/layout/DevHomework';
5+
import CodepenLink from '../components/CodepenLink';
56

67
const Tutorial = () => (
78
<div>
@@ -56,6 +57,9 @@ const Tutorial = () => (
5657
<div className="item" />
5758
<div className="item" />
5859
</div>
60+
61+
<CodepenLink link="https://codepen.io/mozilladevelopers/pen/eGdQRN" />
62+
5963
</div>
6064
);
6165

src/pages/05-mixing-units.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import Main from '../components/layout/Main';
33
import CodeBlock from '../components/CodeBlock';
44
import DevHomework from '../components/layout/DevHomework';
5+
import CodepenLink from '../components/CodepenLink';
56

67
const Tutorial = () => (
78
<div>
@@ -10,8 +11,7 @@ const Tutorial = () => (
1011
<p>
1112
When declaring track sizes, you can use fixed sizes with units such as px and em. You can also
1213
use flexible sizes such as percentages or the fr unit. The real magic of CSS Grid Layout,
13-
however, is the ability to mix these units. The best way to understand is with an
14-
example:
14+
however, is the ability to mix these units. The best way to understand is with an example:
1515
</p>
1616
<CodeBlock>
1717
{`
@@ -58,6 +58,9 @@ const Tutorial = () => (
5858
<div className="item" />
5959
<div className="item" />
6060
</div>
61+
62+
<CodepenLink link="https://codepen.io/mozilladevelopers/pen/JrReJE" />
63+
6164
</div>
6265
);
6366

@@ -77,7 +80,7 @@ grid-template-columns: 100px 30% 2fr 1fr;
7780
Do you see what happened? Instead of 3 columns, you now have a 3rd column that is{' '}
7881
<code>2fr</code> and occupies 2/3 of the remaining space, and a 4th column that is{' '}
7982
<code>1fr</code> and occupies the final 1/3 of the remaining space. Continue to play around in
80-
DevTools and try different units and combinations.
83+
Firefox DevTools and try different units and combinations.
8184
</p>
8285

8386
<p>When you are ready, continue on to learn about how to position items on the grid.</p>

src/pages/06-position-items.js

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import Main from '../components/layout/Main';
33
import CodeBlock from '../components/CodeBlock';
44
import DevHomework from '../components/layout/DevHomework';
5+
import CodepenLink from '../components/CodepenLink';
56

67
// images
78
import numbers from '../components/img/terms/numbers.svg';
@@ -97,6 +98,9 @@ const Tutorial = () => (
9798
<div className="item item5">5</div>
9899
<div className="item item5">6</div>
99100
</div>
101+
102+
<CodepenLink link="https://codepen.io/mozilladevelopers/pen/veXQZp" />
103+
100104
</div>
101105
);
102106

src/pages/07-basic-layout.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import Main from '../components/layout/Main';
33
import CodeBlock from '../components/CodeBlock';
44
import DevHomework from '../components/layout/DevHomework';
5+
import CodepenLink from '../components/CodepenLink';
56

67
const Tutorial = () => (
78
<div>
@@ -84,6 +85,9 @@ const Tutorial = () => (
8485
<div className="item content-3-7">Content-3</div>
8586
<div className="item footer-7">footer</div>
8687
</div>
88+
89+
<CodepenLink link="https://codepen.io/mozilladevelopers/pen/GMjwvG" />
90+
8791
</div>
8892
);
8993

@@ -93,7 +97,10 @@ const Homework = () => (
9397
This is the perfect time to test out the 'display line numbers' setting on the Firefox CSS
9498
Grid Layout Panel. Inspect the result above and select the layout panel. Here you can activate
9599
the overlay grid and check the box to 'display line numbers'. Handy right? This tool makes it
96-
very easy to visualize your grid when positioning items.
100+
very easy to visualize your grid when positioning items. Don't have Firefox?{' '}
101+
<a href="https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly">
102+
Download Firefox Nightly
103+
</a>.
97104
</p>
98105
</DevHomework>
99106
);

src/pages/08-template-areas.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import Main from '../components/layout/Main';
33
import CodeBlock from '../components/CodeBlock';
44
import DevHomework from '../components/layout/DevHomework';
5+
import CodepenLink from '../components/CodepenLink';
56

67
const Tutorial = () => (
78
<div>
@@ -31,8 +32,8 @@ const Tutorial = () => (
3132
`}
3233
</CodeBlock>
3334
<p>
34-
Here we have defined three columns and four rows. Instead of placing each individual item, we can
35-
define the entire layout using the <code>grid-template-areas</code> property. We can then
35+
Here we have defined three columns and four rows. Instead of placing each individual item, we
36+
can define the entire layout using the <code>grid-template-areas</code> property. We can then
3637
assign those areas to each grid item using the <code>grid-area</code> property.
3738
</p>
3839
<p>Our HTML:</p>
@@ -85,6 +86,8 @@ const Tutorial = () => (
8586
<div className="item content-3-8">Content-3</div>
8687
<div className="item footer-8">footer</div>
8788
</div>
89+
90+
<CodepenLink link="https://codepen.io/mozilladevelopers/pen/Xejyed" />
8891
</div>
8992
);
9093

@@ -93,7 +96,10 @@ const Homework = () => (
9396
<p>
9497
Did you know that FireFox DevTools can display the area names? Try it out! Inspect the grid
9598
above and open the layout panel. From here you can toggle the overlay grid and the 'Display
96-
Area Names' feature.
99+
Area Names' feature. Don't have Firefox?{' '}
100+
<a href="https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly">
101+
Download Firefox Nightly
102+
</a>.
97103
</p>
98104
</DevHomework>
99105
);

src/pages/09-named-lines.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ import React from 'react';
22
import Main from '../components/layout/Main';
33
import CodeBlock from '../components/CodeBlock';
44
import DevHomework from '../components/layout/DevHomework';
5+
import CodepenLink from '../components/CodepenLink';
56

67
const Tutorial = () => (
78
<div>
89
<h2>Named Lines</h2>
910

1011
<p>
1112
In a previous example, we learned how to place an item on the grid by providing the {' '}
12-
<code>grid-column</code> and <code>grid-row properties</code> with specific grid lines.
13-
We can also name some or all of those grid lines when defining a grid. This allows us to
14-
use those names instead of grid lines. To name a grid line, simply add the name in square brackets:
13+
<code>grid-column</code> and <code>grid-row properties</code> with specific grid lines. We can
14+
also name some or all of those grid lines when defining a grid. This allows us to use those
15+
names instead of grid lines. To name a grid line, simply add the name in square brackets:
1516
</p>
1617

1718
<p>To name a grid line, we simply provide the name in square brackets:</p>
@@ -102,6 +103,7 @@ const Tutorial = () => (
102103
<div className="item content-3-9">Content-3</div>
103104
<div className="item footer-9">footer</div>
104105
</div>
106+
<CodepenLink link="https://codepen.io/mozilladevelopers/pen/dVpQVV" />
105107
</div>
106108
);
107109

@@ -112,7 +114,10 @@ const Homework = () => (
112114
example is on a white background, and the default purple may not be the best color to use.
113115
When selecting an overlay grid to display, you will see a circle next to the grid name that
114116
indicates the color of the overlay. Click on that circle, and you can customize the color to
115-
whatever you'd like. Try a different color, such as red.
117+
whatever you'd like. Try a different color, such as red. Don't have Firefox?{' '}
118+
<a href="https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly">
119+
Download Firefox Nightly
120+
</a>.
116121
</p>
117122
</DevHomework>
118123
);

src/styles/_shame.scss

-5
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,3 @@
1717
.gallery {
1818
@include gallery(4 of 12);
1919
}
20-
21-
.meh {
22-
height: 200px;
23-
background-color: red;
24-
}

0 commit comments

Comments
 (0)