Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

Commit b952385

Browse files
committed
Updated form styles, added code comments
1 parent 298e83c commit b952385

File tree

8 files changed

+63
-43
lines changed

8 files changed

+63
-43
lines changed

TODO

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ Todo:
1818
✔ Checkboxes @done(20-07-07 20:38)
1919
✔ Radio buttons @done(20-07-07 20:38)
2020
✔ Re-configure repository @done(20-07-07 21:59)
21+
✔ Finish up Forms @done(21-01-27 21:41)
22+
☐ Add more code comments

_colors.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
$primary-color: rgb(219,8,138) !default;
44

5-
$secondary-color: darken($primary-color, 20%) !default;
5+
$secondary-color: desaturate(darken($primary-color, 20%), 20%) !default;
66

77
$tertiary-color: rgb(167,218,212) !default;
88

@@ -12,7 +12,7 @@ $dark-background: rgb(46,65,72) !default;
1212

1313
$dark-text: rgb(46,65,72) !default;
1414

15-
$light-text: rgb(255,246,183) !default;
15+
$light-text: rgb(255,255,255) !default;
1616

1717
$success-color: rgb(18, 194, 62) !default;
1818

_content-components.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ img {
3838
border-left: .5rem solid $tertiary-color;
3939
}
4040

41-
// Focused Images
41+
// Focused Images are designed to make pictures stand out a little more
4242

4343
@media (min-width: 1100px) {
4444

4545
div.img-focused, img.img-focused, .img-focused {
4646
width: calc(100% + 6rem);
47-
margin-left: -1.5rem;
47+
margin-left: -3rem;
4848
}
4949

5050
}

_forms.scss

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
/* FORM STYLES */
22

3+
// Trigger form styles only in the content
4+
// This makes forms outside of the content, such as search forms, easier to style
5+
36
.content form, form.content {
47
margin-bottom: 1.5rem;
58
}
69

7-
input[type=text], input[type=number], input[type=password], input[type=file], textarea, select {
8-
display: block;
9-
box-sizing: border-box;
10-
font-family: $monospace-font;
11-
}
10+
// Turn every immediatechild element of the form into its own block-level element
1211

1312
form.content > *, .content form > * {
1413
padding: 1rem;
1514
display: block;
16-
background: white;
17-
border-top: 1px dotted $dark-background;
18-
15+
border-top: 1px solid $tertiary-color;
16+
}
17+
18+
// Basic styles for the most common form elements
19+
20+
input[type=text], input[type=number], input[type=password], input[type=file], textarea, select {
21+
display: block;
22+
box-sizing: border-box;
23+
font-family: $monospace-font;
1924
}
2025

21-
.content > label, .content form > label, {
26+
.content > label, .content form > label {
2227

2328
font-weight: bold;
2429

@@ -39,16 +44,17 @@ form.content > *, .content form > * {
3944

4045
}
4146

47+
// Styles for fieldsets, checkboxes, and radio boxes
48+
4249
.content fieldset, .content form fieldset {
4350
border-top: 1px solid $tertiary-color;
4451

4552
legend {
4653
font-weight: bold;
47-
padding: 0rem .3rem 0rem .3rem;
54+
padding: 0rem .5rem 0rem .5rem;
4855
}
4956
}
5057

51-
5258
input[type=checkbox], input[type=radio] {
5359
margin-right: .3rem;
5460

@@ -57,12 +63,14 @@ input[type=checkbox], input[type=radio] {
5763
}
5864
}
5965

60-
input[type=submit] {
66+
// Styles for submit and button elements
67+
68+
input[type=submit], button {
6169
background-color: $secondary-color;
6270
border: 1px solid $dark-background;
6371
color: $light-text;
6472
border-radius: .3rem;
65-
font-size: 1rem;
66-
padding: .3rem;
67-
font-family: $heading-font;
73+
font-size: 1em;
74+
padding: .5em;
75+
font-family: $monospace-font;
6876
}

_helper-classes.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
/* FLOATS */
33

4-
// Basic floats
4+
// Basic floats move things to the left or right in a content area
55

66
@media (min-width: 60rem) {
77

@@ -26,15 +26,15 @@
2626
}
2727

2828

29-
// Out-of-bounds floats
29+
// Out-of-bounds floats move things a little bit farther to the left or right, out of bounds
3030

3131
@media (min-width: 1100px) {
3232
.content .float-left.float-hard {
33-
margin-left: -1.5rem;
33+
margin-left: -3rem;
3434
}
3535

3636
.content .float-right.float-hard {
37-
margin-right: -1.5rem;
37+
margin-right: -3rem;
3838
}
3939
}
4040

_mixins.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* ICONS */
22

3+
// These icons are used for the alert and notice boxes
4+
// They are implemented as mixins to keep things organized, and to make them easily usable elsewhere
5+
36
// Error warning (filled)
47

58
@mixin icon-warning-filled {
@@ -21,7 +24,6 @@
2124

2225
}
2326

24-
2527
// Search icon (regular)
2628

2729
@mixin icon-search-regular {

_navigation.scss

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,24 @@ nav.nav-bar, nav.nav-block {
2525
}
2626
}
2727

28+
// Styles to add background colors into navigation bars. Used on dropdowns, accordions, and hamburger menus, among others
2829

29-
.nav-filled {
30-
ul {
31-
li {
32-
a {
33-
background: $light-background;
34-
color: $primary-color;
30+
.nav-filled {
31+
ul {
32+
li {
33+
a {
34+
background: $light-background;
35+
color: $primary-color;
3536

36-
&:hover {
37-
background: darken($tertiary-color, 5%);
37+
&:hover {
38+
background: darken($tertiary-color, 5%);
39+
}
3840
}
3941
}
4042
}
4143
}
42-
}
4344

45+
// The basic styles for nav bars on tablet and desktop-sized screens
4446

4547
@media (min-width: 50rem) {
4648
nav.nav-bar {
@@ -65,6 +67,8 @@ nav.nav-bar, nav.nav-block {
6567
}
6668
}
6769

70+
// Styles for aligning navigation links to the left or right
71+
6872
nav.left, nav.right {
6973

7074
ul {
@@ -86,7 +90,6 @@ nav.left, nav.right {
8690
}
8791

8892

89-
9093
nav.right {
9194

9295
ul {
@@ -100,8 +103,8 @@ nav.right {
100103
}
101104

102105

103-
104106
// Simple Vertical Navigation Block
107+
// Just add this to any nav bar to make it vertical.
105108

106109
nav.nav-block {
107110

@@ -118,10 +121,11 @@ nav.nav-block {
118121
}
119122

120123

121-
122124
// The Dropdown Navigation Bar
123125

124-
// First, let's hide the child lists from view.
126+
// This works with no JS, using a checkbox to implement the show/hide on click functionality
127+
128+
// First, let's hide the child lists from view
125129

126130
nav.dropdown {
127131
ul li ul {
@@ -142,7 +146,7 @@ nav.dropdown {
142146
flex: 1;
143147
}
144148

145-
// Hide the actual checkbox. People will click the label to reveal the dropdown
149+
// Hide the actual checkbox - People will click the label to reveal the dropdown
146150

147151
input[type=checkbox] {
148152
display: none;
@@ -170,7 +174,7 @@ nav.dropdown {
170174
}
171175
}
172176

173-
// Some styles specifically for the vertical navigation block
177+
// Some styles specifically for the using the vertical navigation block with dropdowns
174178

175179
&.nav-block {
176180
ul li ul {
@@ -179,6 +183,7 @@ nav.dropdown {
179183
}
180184
}
181185

186+
// And now, the desktop / tablet version
182187

183188
@media (min-width: 50rem) {
184189
nav.dropdown {
@@ -215,6 +220,8 @@ nav.dropdown {
215220

216221
// The Centered Navigation Bar
217222

223+
// Simply put, this aligns all the links to the middle
224+
218225
nav.centered {
219226
ul {
220227
display: flex;
@@ -246,6 +253,8 @@ nav.centered {
246253

247254
// Hamburger Navigation
248255

256+
// Works on the same principle as the drop-down menu, requires a checkbox
257+
249258
nav.hamburger {
250259

251260
input[type=checkbox] {
@@ -319,6 +328,8 @@ nav.breadcrumb {
319328

320329
// Accordion Navigation
321330

331+
// Drop-down and hamburger menus on steroids
332+
322333
nav.accordion {
323334

324335
input[type=checkbox] {

_type.scss

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,14 @@
2121
$monospace-font: 'IBM Plex Mono', monospace;
2222

2323
/* TYPE SCALING */
24-
2524

25+
// This setup allows typefaces to change size as you make the screen wider or smaller.
2626

2727
:root {
2828
font-size: calc(1rem + ((1vw - 7.68px) * 0.3472));
2929
min-height: 0vw;
3030
}
3131

32-
33-
3432
@media (min-width: 1920px) {
3533
:root {
3634
font-size: 20px;
@@ -82,7 +80,6 @@
8280

8381
/* GENERAL ALIGNMENTS */
8482

85-
8683
p,
8784
ul,
8885
ol,

0 commit comments

Comments
 (0)