Skip to content

Commit 6733b99

Browse files
committed
format errors, add survey back
1 parent dd59911 commit 6733b99

File tree

8 files changed

+296
-309
lines changed

8 files changed

+296
-309
lines changed

P01-Build-A-Header-Component/content.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ function Title() {
284284
</div>
285285
)
286286
}
287-
287+
>
288288
export default Title
289289
```
290290

P07-Style-the-List/content.md

+41-43
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@ slug: styling-the-list
55

66
## The list could use some styles
77

8-
The POPOSList component displays a list of POPOSSpace components. The list is only responsible for arranging the spaces. To get things to look great you'll need to style both and get those styles to work together.
8+
The POPOSList component displays a list of POPOSSpace components. The list is only responsible for arranging the spaces. To get things to look great you'll need to style both and get those styles to work together.
99

10-
This step will only cover styling the list. There may be a few issues with the way the spaces display which will be covered in another section.
10+
This step will only cover styling the list. There may be a few issues with the way the spaces display which will be covered in another section.
1111

12-
Create a CSS file.
12+
Create a CSS file.
1313

14-
> [info]
15-
>
16-
> If you haven't already create a new file: `POPOSList.css` it should be in the same folder as the `POPOSList.js` file.
17-
>
14+
> [action]
15+
>
16+
> If you haven't already create a new file: `POPOSList.css` it should be in the same folder as the `POPOSList.js` file.
17+
>
1818
19-
Now import the CSS.
19+
Now import the CSS.
2020

21-
> [info]
22-
>
21+
> [action]
22+
>
2323
> Next import the the new CSS file into the `POPOSList.js` add the following at the top.
24-
>
24+
>
2525
> `import './POPOSList.css'`
2626
>
27-
> Now, in the `POPOSList` component add a class name:
28-
>
27+
> Now, in the `POPOSList` component add a class name:
28+
>
2929
```JS
3030
function POPOSList() {
3131
...
@@ -38,12 +38,12 @@ function POPOSList() {
3838
```
3939
>
4040
41-
Arranging the elements in a grid would be a good idea. Luckily CSS provides a `display: grid` property. This is similar to `display: flex`. Where flex is a one dimmensional arrangement grid is two dimmendsional. With flex everything would be arranged in a row or a column, with grid things are arranged in both rows and columns.
41+
Arranging the elements in a grid would be a good idea. Luckily CSS provides a `display: grid` property. This is similar to `display: flex`. Where flex is a one dimmensional arrangement grid is two dimmendsional. With flex everything would be arranged in a row or a column, with grid things are arranged in both rows and columns.
4242

43-
> [info]
43+
> [action]
4444
>
4545
> Add the following to `POPOSList.css`
46-
>
46+
>
4747
```CSS
4848
.POPOSList {
4949
display: grid;
@@ -52,18 +52,18 @@ Arranging the elements in a grid would be a good idea. Luckily CSS provides a `d
5252
```
5353
>
5454
55-
The code above declare the parent element as display grid and defines three equal sized columns. The `1fr` is 1 fraction. the `fr` unit that is a fraction of the availble space. So `1fr 1fr 1fr` could considered the same as `33.333% 33.333% 33.333%` but it reads better and is more accurate.
55+
The code above declare the parent element as display grid and defines three equal sized columns. The `1fr` is 1 fraction. the `fr` unit that is a fraction of the availble space. So `1fr 1fr 1fr` could considered the same as `33.333% 33.333% 33.333%` but it reads better and is more accurate.
5656

57-
Test this out and resize the page. There are a couple things missing.
57+
Test this out and resize the page. There are a couple things missing.
5858

5959
- The grid columns and rows need some space between them
6060
- When the page is really wide the columns are too far apart
6161
- When the page is too narrow the columns are too close together
6262

63-
> [info]
64-
>
63+
> [action]
64+
>
6565
> Add the following to the `.POPSList` rule in `POPOSList.css`
66-
>
66+
>
6767
```CSS
6868
.POPOSList {
6969
display: grid;
@@ -72,22 +72,22 @@ Test this out and resize the page. There are a couple things missing.
7272
max-width: 1200px;
7373
margin: auto;
7474
padding: 2em;
75-
}
76-
>
75+
}
76+
```
7777

7878
- `grid-gap: 2em` adds a 2em space between rows and columns in the grid
7979
- `max-width: 1200px` sets a maximum width for the element
80-
- `margin: auto` makes the margins equal on the left and right this has the effect of centering the grid container on the page.
81-
- `padding: 2em` adds some space on the left and right so the pictures don't hit the edges of the page when the window is narrow.
80+
- `margin: auto` makes the margins equal on the left and right this has the effect of centering the grid container on the page.
81+
- `padding: 2em` adds some space on the left and right so the pictures don't hit the edges of the page when the window is narrow.
8282

83-
This looks better but there are some problems when the page is narrow. Add some media queries to take care of these.
83+
This looks better but there are some problems when the page is narrow. Add some media queries to take care of these.
8484

85-
A media query is a rule that is only applied some times or under certain circumstances. You'll use media queries here to make adjustments for smaller screens, like tablets, and mobile devices.
85+
A media query is a rule that is only applied some times or under certain circumstances. You'll use media queries here to make adjustments for smaller screens, like tablets, and mobile devices.
8686

87-
> [info]
88-
>
87+
> [action]
88+
>
8989
> Add the following to `POPOSList.css`
90-
>
90+
>
9191
```CSS
9292
/* Smaller screens and tablets */
9393
@media only screen and (max-width: 960px) {
@@ -98,32 +98,30 @@ A media query is a rule that is only applied some times or under certain circums
9898
```
9999
>
100100
101-
Here the number of columns is changed to two equal columns when the screen is 960px or smaller.
101+
Here the number of columns is changed to two equal columns when the screen is 960px or smaller.
102102

103-
Test your work. resizing the page should change the display to two columns when the screen gets down to 960px and show 3 columns when the screen is wider.
103+
Test your work. resizing the page should change the display to two columns when the screen gets down to 960px and show 3 columns when the screen is wider.
104104

105-
Let's do that again.
105+
Let's do that again.
106106

107-
> [info]
108-
>
107+
> [action]
108+
>
109109
> Add the following to `POPOSList.css`
110-
>
110+
>
111111
```CSS
112112
/* Small screens mobile */
113113
@media only screen and (max-width: 700px) {
114114
.POPOSList {
115115
grid-template-columns: 1fr;
116116
}
117-
}
117+
}
118118
```
119119
>
120120
121-
Here the the layout switched to a single column when the screen is smaller than 700px.
122-
123-
test your work. The screen shoould switch between 3, 2, and 1 column as the screen narrows.
124-
125-
Think of other things you might want to change as the screen changes size?
121+
Here the the layout switched to a single column when the screen is smaller than 700px.
126122

127-
Important! In the POPOSList stylesheet you're only concerned with the list of spaces. If the changes you want to make concern the Spaces (thats' the image and text) it should be applied to the POPOSSpace.css. See the section on styling these!
123+
test your work. The screen should switch between 3, 2, and 1 column as the screen narrows.
128124

125+
Think of other things you might want to change as the screen changes size?
129126

127+
Important! In the POPOSList stylesheet you're only concerned with the list of spaces. If the changes you want to make concern the Spaces (thats' the image and text) it should be applied to the POPOSSpace.css. See the section on styling these!

P08-Styling-Spaces/content.md

+55-60
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ slug: styling-spaces
55

66
## Styling Spaces
77

8-
The POPOSSpace component displays a a single Public space in the list of public spaces on the home page. Each of these displays an image, the name of the space, it's address, and hours.
8+
The POPOSSpace component displays a a single Public space in the list of public spaces on the home page. Each of these displays an image, the name of the space, it's address, and hours.
99

1010
## Using ancestor selector
1111

12-
Styles have been divided between several style sheets. To keep these styles from conflicting you'll use the strategy of assigning the root element in a component class name that matches the component name. The Component names should be unique like class names. You should also use this class name as the ancestor for other styles applied within the component. For example:
12+
Styles have been divided between several style sheets. To keep these styles from conflicting you'll use the strategy of assigning the root element in a component class name that matches the component name. The Component names should be unique like class names. You should also use this class name as the ancestor for other styles applied within the component. For example:
1313

14-
```CSS
14+
```CSS
1515
.POPOSSpace {
1616
/* Styles for the root element */
1717
}
@@ -21,29 +21,29 @@ Styles have been divided between several style sheets. To keep these styles from
2121
}
2222
```
2323

24-
The second style above styles img tags but only if they are descendants of an element with the class name: POPOSSpace. This way the styles here don't affect img tags elsewhere on the page.
24+
The second style above styles img tags but only if they are descendants of an element with the class name: POPOSSpace. This way the styles here don't affect img tags elsewhere on the page.
2525

2626
## Styling POPOSSpace
2727

28-
Create a new stylesheet if you having. This should be a in the same folder as the `POPOSSpace.js` file.
28+
Create a new stylesheet if you having. This should be a in the same folder as the `POPOSSpace.js` file.
2929

30-
> [info]
31-
>
32-
> Create a new file named: `POPOSSpace.css`. This should be in the same folder as the `POPOSSPace.js` file.
33-
>
30+
> [action]
31+
>
32+
> Create a new file named: `POPOSSpace.css`. This should be in the same folder as the `POPOSSPace.js` file.
33+
>
3434
35-
Import the CSS and add the class name:
35+
Import the CSS and add the class name:
3636

37-
> [info]
38-
>
37+
> [action]
38+
>
3939
> Add the following at the top of `POPOSSpace.js`:
40-
>
40+
>
4141
```JS
4242
import './POPOSSpace.css'
4343
```
44-
>
45-
> Now add the class to the root element:
46-
>
44+
>
45+
> Now add the class to the root element:
46+
>
4747
```JS
4848
function POPOSSpace(props) {
4949
...
@@ -54,33 +54,31 @@ function POPOSSpace(props) {
5454
)
5555
}
5656
```
57-
>
5857

59-
Now you'll add some styles to style the elements here.
58+
Now you'll add some styles to style the elements here.
6059

61-
It would be nice if the images were flexible. The columns of the grid change size as the page changes sizes.
60+
It would be nice if the images were flexible. The columns of the grid change size as the page changes sizes.
6261

63-
> [info]
64-
>
62+
> [action]
63+
>
6564
> Add the following to: `POPOSSpace.css`:
66-
>
65+
>
6766
```CSS
6867
.POPOSSpace img {
6968
width: 100%;
7069
height: auto;
7170
}
7271
```
73-
>
7472

75-
You might have to refresh to make sure the changes to CSS show up when testing.
73+
You might have to refresh to make sure the changes to CSS show up when testing.
7674

77-
With this change the images in POPOSSpace should have a width of 100% of the available space.
75+
With this change the images in POPOSSpace should have a width of 100% of the available space.
7876

7977
## Have some fun with the title
8078

81-
Let's move the title to the upper left corner of the picture. To do this you'll use relative and absolute position.
79+
Let's move the title to the upper left corner of the picture. To do this you'll use relative and absolute position.
8280

83-
The structure of the POPOSpace is:
81+
The structure of the POPOSpace is:
8482

8583
- div.POPOSSpace
8684
- Link
@@ -90,33 +88,32 @@ The structure of the POPOSpace is:
9088
- div (address)
9189
- div (hours)
9290

93-
By making the parent component `div.POPOSSpace` position relative it will become the positioning context for any children that use absolute position. When an element uses absolute position you can position it by it's left and top edges. To figure where the top and left are the element looks up the DOM tree for an element that has `position: relative`.
91+
By making the parent component `div.POPOSSpace` position relative it will become the positioning context for any children that use absolute position. When an element uses absolute position you can position it by it's left and top edges. To figure where the top and left are the element looks up the DOM tree for an element that has `position: relative`.
9492

95-
Give it a try!
93+
Give it a try!
9694

97-
> [info]
98-
>
95+
> [action]
96+
>
9997
> Edit `POPOSSpace.css `, set the position property of the parent element to relative.
100-
>
98+
>
10199
```CSS
102100
.POPOSSpace {
103101
position: relative;
104102
}
105103
```
106-
>
107104

108-
Now add a new classname to the title element. This is in a Link component, you'll need to assign this a className.
105+
Now add a new classname to the title element. This is in a Link component, you'll need to assign this a className.
109106

110-
> [info]
107+
> [action]
108+
>
109+
> In `POPOSSpace.js` find the name in it's Link tag and add a new class name.
111110
>
112-
> In `POPOSSpace.js` find the name in it's Link tag and add a new class name.
113-
>
114111
```JS
115112
function POPOSSpace(props) {
116113
...
117114
return (
118115
...
119-
<Link
116+
<Link
120117
className="POPOSSpace-title" // add a class name!
121118
to={`/details/${id}`}>
122119
<h1>{name}</h1>
@@ -125,14 +122,13 @@ function POPOSSpace(props) {
125122
)
126123
}
127124
```
128-
>
129125

130-
Next style the new class.
126+
Next style the new class.
131127

132-
> [info]
133-
>
134-
> In `POPOSSpace.css` add some new style rules:
135-
>
128+
> [action]
129+
>
130+
> In `POPOSSpace.css` add some new style rules:
131+
>
136132
```CSS
137133
.POPOSSpace .POPOSSpace-title {
138134
display: block;
@@ -150,14 +146,14 @@ Next style the new class.
150146
}
151147
```
152148

153-
This should move the title to the upper left corner and give it some font styles.
149+
This should move the title to the upper left corner and give it some font styles.
154150

155-
Now move the address and hours to the lower right corner. It will ne easier if these elements share a common parent.
151+
Now move the address and hours to the lower right corner. It will ne easier if these elements share a common parent.
156152

157-
> [info]
158-
>
159-
> Edit `POPOSSpace.js`:
160-
>
153+
> [action]
154+
>
155+
> Edit `POPOSSpace.js`:
156+
>
161157
```JS
162158
...
163159
function POPOSSpace(props) {
@@ -173,31 +169,30 @@ function POPOSSpace(props) {
173169
)
174170
}
175171
```
176-
>
177172

178-
Now with a a parent element and a class name we can apply styles to the parent and it's children.
179173

180-
> [info]
181-
>
182-
> Edit `POPOSSpace.css` and add thw following.
183-
>
174+
Now with a a parent element and a class name we can apply styles to the parent and it's children.
175+
176+
> [action]
177+
>
178+
> Edit `POPOSSpace.css` and add thw following.
179+
>
184180
```CSS
185181
.POPOSSpace .POPOSSpace-info {
186182
position: absolute;
187183
right: 0;
188184
bottom: 0;
189185
text-align: right;
190-
}
186+
}
191187
>
192188
.POPOSSpace .POPOSSpace-info div {
193189
display: inline-block;
194190
padding: 0.25em 0.5em;
195191
background-color: rgba(255, 255, 255, 0.9);
196192
}
197193
```
198-
>
199194

200-
Here the container `.POPOSSpace-info` is declared position absolute This way we can place it where we want. In this case I put it at right 0 and bottom 0 which make it hug the lower right corner. I also aligned the text to the right.
201195

202-
The `.POPOSSpace .POPOSSpace-info div` selector applies to the two child divs. Here I added some padding and a background color.
196+
Here the container `.POPOSSpace-info` is declared position absolute This way we can place it where we want. In this case I put it at right 0 and bottom 0 which make it hug the lower right corner. I also aligned the text to the right.
203197

198+
The `.POPOSSpace .POPOSSpace-info div` selector applies to the two child divs. Here I added some padding and a background color.

0 commit comments

Comments
 (0)