Skip to content

Commit 4e49aa3

Browse files
authored
Merge pull request #84 from the-collab-lab/mf-global-colors-btn
[MF] Creates global color, btn, font styling
2 parents f186cd5 + 808f00d commit 4e49aa3

File tree

3 files changed

+59
-45
lines changed

3 files changed

+59
-45
lines changed

src/components/Dialog.css

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.Dialog {
22
--button-alignment: 'center';
33

4-
border-radius: 20px;
4+
border-radius: 15px;
55
max-width: min(68ch, 95vw);
66
padding: 0;
77
animation:
@@ -39,29 +39,22 @@
3939
}
4040
}
4141

42-
.Dialog .c-button {
42+
.Dialog button {
4343
min-width: 25ch;
4444
min-height: 5ch;
4545
cursor: pointer;
4646
font-size: 1em;
4747
font-weight: 500;
4848
border-radius: 8px;
49-
border: 1px solid #aaa;
5049
padding: 0.8em 1.6em;
5150
}
5251

53-
c-button-cancel:hover {
54-
background-color: #918f8f;
52+
.Dialog--button-group :first-child {
53+
background-color: var(--btn-bg-color-cancel);
5554
}
5655

57-
.c-button-confirm {
58-
background-color: #4caf50;
59-
border-radius: 8px;
60-
border: 1px solid #0f0f0f;
61-
}
62-
63-
.c-button-confirm:hover {
64-
background-color: rgb(69, 167, 72);
56+
.Dialog--button-group :first-child:hover {
57+
background-color: var(--btn-bg-color-cancel-hover);
6558
}
6659

6760
.Dialog--button-group > * {
@@ -70,7 +63,7 @@ c-button-cancel:hover {
7063

7164
@keyframes slideInFromRight {
7265
from {
73-
transform: translateX(100%);
66+
transform: translateX(200%);
7467
}
7568
to {
7669
transform: translateX(0);

src/index.css

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,24 @@
99
--color-pastel-blue: hsla(215, 100%, 73%, 1);
1010
--color-red: hsl(0, 68%, 42%);
1111

12+
--color-branding: #5a23b3;
1213
--color-accent: var(--color-pastel-blue);
1314
--color-bg: var(--color-black);
1415
--color-border: hsla(220, 13%, 32%, 1);
1516
--color-error: var(--color-red);
1617
--color-text: var(--color-white);
18+
--color-btn-bg-cancel: #cdcdcd;
19+
--color-btn-bg-confirm-hover: #3f0f7f;
20+
--color-btn-bg-cancel-hover: #989797;
21+
--color-btn-bg-delete-hover: #a80000;
22+
23+
/* Button Styling Variables */
24+
--btn-bg-color-confirm: var(--color-branding);
25+
--btn-bg-color-confirm-hover: var(--color-btn-bg-confirm-hover);
26+
--btn-bg-color-cancel: var(--color-btn-bg-cancel);
27+
--btn-bg-color-cancel-hover: var(--color-btn-bg-cancel-hover);
28+
--btn-bg-color-delete: var(--color-red);
29+
--btn-bg-color-delete-hover: var(--color-btn-bg-delete-hover);
1730
}
1831

1932
@media screen and (prefers-color-scheme: light) {
@@ -73,6 +86,7 @@ body {
7386
font-size: 1.8rem;
7487
line-height: 1.4;
7588
margin: 0;
89+
margin-left: 10px;
7690

7791
-webkit-font-smoothing: antialiased;
7892
-moz-osx-font-smoothing: grayscale;
@@ -107,7 +121,36 @@ code {
107121
--color-bg: var(--color-gray-light);
108122
}
109123

110-
h5 {
111-
margin-top: 0px;
112-
margin-bottom: 0px;
124+
/* GLOBAL STYLES FOR HTML ELEMENTS */
125+
126+
h1 {
127+
font-family: 'Righteous', sans-serif;
128+
}
129+
130+
h5,
131+
p {
132+
margin: 0;
133+
padding: 0;
134+
}
135+
136+
ul {
137+
list-style-type: none;
138+
padding: 0;
139+
}
140+
141+
button {
142+
background-color: var(--btn-bg-color-confirm);
143+
border: 0;
144+
border-radius: 20px;
145+
color: var(--color-bg);
146+
cursor: pointer;
147+
font-size: 1.6rem;
148+
font-family: 'Righteous', sans-serif;
149+
font-weight: 700;
150+
padding: 0.5em 1em;
151+
margin: 0.5em 0;
152+
}
153+
154+
button:hover {
155+
background-color: var(--btn-bg-color-confirm-hover);
113156
}

src/views/ManageList.jsx

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { useState } from 'react';
2-
import { Navigate, useNavigate } from 'react-router-dom';
3-
import { Dialog, SortedItemsMap, AddItem } from '../components';
4-
52
import { addItem, shareList } from '../api';
6-
import './List.css';
3+
import { AddItem, Dialog, SortedItemsMap } from '../components';
74
import { filteredData } from '../utils';
5+
import './List.css';
86

97
export function ManageList({ data, listPath, currentUserId }) {
108
const [searchString, setSearchString] = useState('');
@@ -152,18 +150,8 @@ export function ManageList({ data, listPath, currentUserId }) {
152150
/>
153151
</label>
154152
<div className="Dialog--button-group">
155-
<button
156-
className="c-button c-button-cancel"
157-
onClick={handleShareCancelClick}
158-
>
159-
Cancel
160-
</button>
161-
<button
162-
className="c-button c-button-confirm"
163-
onClick={handleShareConfirmClick}
164-
>
165-
Confirm
166-
</button>
153+
<button onClick={handleShareCancelClick}>Cancel</button>
154+
<button onClick={handleShareConfirmClick}>Confirm</button>
167155
</div>
168156
</div>
169157
</Dialog>
@@ -177,18 +165,8 @@ export function ManageList({ data, listPath, currentUserId }) {
177165
<div className="List-modal-inner">
178166
<AddItem formData={formData} setFormData={setFormData} />
179167
<div className="Dialog--button-group">
180-
<button
181-
className="c-button c-button-cancel"
182-
onClick={handleAddItemCancelClick}
183-
>
184-
Cancel
185-
</button>
186-
<button
187-
className="c-button c-button-confirm"
188-
onClick={handleAddItemConfirmClick}
189-
>
190-
Add Item
191-
</button>
168+
<button onClick={handleAddItemCancelClick}>Cancel</button>
169+
<button onClick={handleAddItemConfirmClick}>Add Item</button>
192170
</div>
193171
</div>
194172
</div>

0 commit comments

Comments
 (0)