Skip to content
Open
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
35 changes: 32 additions & 3 deletions Exercise 1/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@
}

body {
background: #f5f5f5;
color: #333;
display: grid;
font-family: 'Open Sans', sans-serif;
font-size: 16px;
grid-template-areas:
"header header header"
"nav content sidebar"
"nav footer footer";
grid-template-columns: minmax(64px, 1fr) 3fr minmax(64px, 1fr);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With what purpose did you introduce the minmax?

grid-template-rows: 120px 1fr 80px;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
grid-template-rows: 120px 1fr 80px;
grid-template-rows: min-content 1fr min-content;

height: 100vh;
line-height: 1.5;
color: #333;
background: #f5f5f5;
max-width: 1440px;
height: 100vh;
padding: 20px;

}

header,
Expand All @@ -25,3 +33,24 @@ footer {
padding: 20px;
border: #08313a 1px solid;
}

header {
grid-area: header;
}

nav {
grid-area: nav;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I wouldn't abbreviate this. While this might be a clear abbreviation, you'll and up using abbreviations that aren't clear to everyone.

}

main {
grid-area: content;
}

aside {
grid-area: sidebar;
}

footer {
grid-area: footer;
}

15 changes: 14 additions & 1 deletion Exercise 2/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@ body {
max-width: 1440px;
margin: 100px auto;
padding: 20px;
display: grid;
gap: 32px;
grid-template-columns: repeat(4, minmax(160px, 1fr));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the usage of minmax here?

grid-template-rows: repeat(2, 1fr);
grid-auto-flow: column;
}

.card {
background: #fff;
border-radius: 10px;
padding: 30px;
box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px;
margin-bottom: 10px;
grid-column: auto / span 1;
}

.card__header {
Expand Down Expand Up @@ -69,16 +74,24 @@ body {
background-image: url('./images/bg-pattern-quotation.svg');
background-repeat: no-repeat;
background-position: top 10px right 100px;
grid-column: 1 / span 2;
}

.card--bg-gray-blue {
background: hsl(217, 19%, 35%);
color: #fff;
grid-column: 3 / span 1;
}

.card--bg-black-blue {
background: hsl(219, 29%, 14%);
color: #fff;
grid-column: 2 / span 2;
}

.card:last-child {
grid-column: auto / span 1;
grid-row: 1 / -1;
}

footer {
Expand Down
17 changes: 17 additions & 0 deletions Exercise 3/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
padding: 0;
}

.container {
display: grid;
height: 1024px;
grid-template-columns: minmax(160px, 1fr) 4fr minmax(160px, 1fr);
grid-template-rows: 128px 128px 1fr 128px;
}

.box {
border-radius: 4px;
border: #000 1px solid;
Expand All @@ -13,19 +20,29 @@

.box-1 {
background-color: #f1e0c5;
grid-column: 1 / -1;
}
.box-2 {
background-color: #c9b79c;
grid-column: 2 / -2;
}
.box-3 {
background-color: #71816d;
grid-row: 2 / -2;
grid-column: 1 / span 1;
}
.box-4 {
background-color: #342a21;
grid-row: 3 / span 1;
grid-column: 2 / -2;
}
.box-5 {
background-color: #da667b;
grid-row: 2 / -2;
grid-column: -1 / -2;
Comment on lines +27 to +42

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try using span instead of these negative values. Using -1 is fine for getting the last element when the number of items is unknown, but otherwise it gets quite unclear.

}
.box-6 {
background-color: #00272b;
grid-row: -2 / -1;
grid-column: 1 / -1;
}