Skip to content

Commit 98b88ba

Browse files
authored
Refactor CSS styles for layout and button design
1 parent 017eca9 commit 98b88ba

1 file changed

Lines changed: 23 additions & 24 deletions

File tree

Wireframe/style.css

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ body {
3333
background: var(--paper);
3434
color: var(--ink);
3535
font: var(--font);
36+
margin: 0;
37+
padding-bottom: 100px;
3638

3739
}
3840

@@ -60,7 +62,7 @@ header p {
6062
.btn {
6163
display: inline-block;
6264
padding: 8px 14px;
63-
border: 2px solid var(--line);
65+
border: 2px solid var(--link);
6466
border-radius: 8px;
6567
background: #f7f7f7;
6668
color: var(--ink);
@@ -74,9 +76,13 @@ header p {
7476
.btn:focus-visible {
7577
outline: none;
7678
transform: translateY(-1px);
77-
box-shadow: 0 1px 0 rgba(0,0,0,.15);
79+
box-shadow: 0 1px 8px rgba(0, 0, 0, 0.15);
80+
}
81+
82+
.btn:active {
83+
transform: translateY(0); box-shadow: none;
84+
transition: all 0.2s ease;
7885
}
79-
.btn:active { transform: translateY(0); box-shadow: none; }
8086

8187

8288
img,
@@ -101,7 +107,9 @@ footer {
101107
bottom: 0;
102108
position: fixed;
103109
background-color: rgb(148, 228, 228);
104-
110+
padding: var(--space);
111+
width: 100%;
112+
box-sizing: border-box;
105113
}
106114
/* ====== Articles Grid Layout ====
107115
Setting the rules for how articles are placed in the main element.
@@ -110,38 +118,29 @@ Play with the options that come up.
110118
https://developer.chrome.com/docs/devtools/css/grid
111119
https://gridbyexample.com/learn/
112120
*/
113-
main {
114-
display: grid;
115-
grid-template-columns: 1fr 1fr;
116-
gap: var(--space);
117-
> *:first-child {
118-
grid-column: span 2;
121+
main > article: first-child {
122+
grid-column: span 2;
119123
}
120-
}
124+
121125
/* ====== Article Layout ======
122126
Setting the rules for how elements are placed in the article.
123127
Now laying out just the INSIDE of the repeated card/article design.
124128
Keeping things orderly and separate is the key to good, simple CSS.
125129
*/
126130
article {
127131
border: var(--line);
128-
padding-bottom: var(--space);
132+
padding: var(--space);
129133
text-align: left;
130134
display: grid;
131-
grid-template-columns: var(--space) 1fr var(--space);
132-
> * {
133-
grid-column: 2/3;
135+
grid-template-columns: 1fr;
136+
gap: var(--space);
134137
}
135138

136-
article > a {
137-
grid-column: auto;
138-
width: fit-content;
139+
article img {
140+
grid-column: 1 / -1;
141+
margin: calc(var(--space) * -1) calc(var(--space) * -1) 0 calc(var(--space) * -1);
139142
}
140143

141-
> img {
142-
grid-column: span 3;
143-
144-
}
145-
146-
144+
article.btn {
145+
width: fit-content;
147146
}

0 commit comments

Comments
 (0)