Skip to content

Commit 541b4d8

Browse files
committed
Cleaned up styles a bit
1 parent 5845dc6 commit 541b4d8

File tree

5 files changed

+273
-76
lines changed

5 files changed

+273
-76
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-github-stats-card-v2",
3-
"version": "1.0.3",
3+
"version": "1.0.5",
44
"license": "MIT",
55
"description": "GitHub Stats card component for React applications.",
66
"main": "dist/index.js",

src/components/Card/CardUtils.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export const pluralizer = (number, string) => {
2+
let newString = string.slice();
3+
if (number === 0 || number > 1) {
4+
newString = `${string}s`;
5+
}
6+
return newString;
7+
}
8+
9+
export const sum = (array, key) => array.reduce((acc, r) => (acc + r[key]), 0);

src/components/Card/card.scss

Lines changed: 218 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,219 @@
11

2-
.github-stats-card {max-width: 320px; margin: auto; width: 100%; padding: 0; background-color: #fff; box-sizing: border-box; font-family: Arial, sans-serif; display: flex; border: 1px solid #e9e9e9; flex-direction: column; flex-basis: 100%; font-size: 12px; line-height: 16px; box-shadow: 5px 10px 20px -10px rgba(0,0,0,.2); color: #24292e;}
3-
.github-stats-card header {display: flex; flex-wrap: wrap; justify-content: center; align-items: center; box-sizing: border-box; margin: 0; padding: 20px 0 0; background-color: #f6f8fa; color: #24292e; }
4-
.github-stats-card h3 { display: block; text-align: center; width: 100%; box-sizing: border-box; font-size: 18px; font-weight: 600; padding: 0 0 20px; margin: 0;}
5-
6-
.github-stats-card h3 a { display: inline-block; text-decoration: none; color: inherit; max-width: calc(100% - 30px); box-sizing: border-box; line-height: 24px; font-size: 18px; font-weight: 600; color: #0366d6; }
7-
/* .github-stats-card h3 img { display: flex; flex-direction: column; box-sizing: border-box; width: 30px; border-radius: 15px; margin-left: 10px; } */
8-
.github-stats-card header img { max-width: 40px; border-radius: 50%; }
9-
.github-stats-card h4 { display: flex; justify-content: center; width: 100%; padding: 10px 0; margin: 0; font-weight: normal;font-style: italic; font-size: 12px; line-height: 16px; background-color: #24292e; color: #fff;}
10-
.github-stats-card h5 {display: flex; width: 100%; background-color: #0366d6; color: #fff; justify-content: center; font-weight: 400; padding: 10px 0; margin: 0;box-sizing: border-box; font-size: 14px;}
11-
.github-stats-card h5 span {display: flex; flex-direction: row; flex-wrap: nowrap; margin: 0 5px; box-sizing: border-box; font-size: 13px; line-height: 18px; vertical-align: middle;}
12-
.github-stats-card h5 span b { margin-right: 3px; font-size: 16px;}
13-
.github-stats-card ol, ul {max-width: 100%; display: flex; flex-direction: column; align-items: center; margin: 0; padding: 0 0 10px 10px;}
14-
.github-stats-card ol {list-style: none; display: flex; width: 100%; flex-direction: row; padding-bottom: 10px; text-align: center; justify-content: space-around;}
15-
hr {display: flex; flex-direction: column; width: 100%; border: 0; border-bottom: 1px solid #efefef;}
16-
.github-stats-card ol li:first-of-type { order: 2; }
17-
.github-stats-card ol li:nth-of-type(2) { order: 1; }
18-
.github-stats-card ol li:last-of-type { order: 3; }
19-
.github-stats-card ul { list-style: none; }
20-
.github-stats-card ul li b { font-size : 13px; font-family: Menlo, Monaco, monospace; }
21-
.github-stats-card li { margin: 5px 0; color: #24292e;}
22-
.github-stats-card li small { display: block;font-size: 12px; }
23-
.github-stats-card li b { font-size: 13px; }
24-
.github-stats-card p {width: 100%; text-align: center; margin: 5px auto; color: #24292e;}
25-
.github-stats-card > div {display: flex; justify-content: center; flex-wrap: wrap; padding: 10px 15px; }
26-
27-
.github-stats-card div p { font-weight: 400; font-size: 14px; }
28-
.github-stats-card div p b { font-weight: 400; font-size: 15px; }
29-
.github-stats-card footer {display: flex; align-items: center; height: 100px; max-width: 100%; box-sizing: border-box; background-color: #f6f8fa;color: #24292e;}
30-
.github-stats-card footer img {max-width: 100px; box-sizing: border-box; display:block; margin: 0 15px 0 0;}
31-
.github-stats-card footer section {display: flex; justify-content: flex-start; flex-wrap: wrap; padding: 10px 15px;}
32-
.github-stats-card footer section p { margin: 0; padding-bottom: 2.5px; font-size: 11px; line-height: 14px; text-align: left;color: #586069; }
33-
.github-stats-card footer section p b { text-transform: uppercase;color: #586069;}
34-
.github-stats-card footer a { color: #586069; text-decoration:none; font-weight: 600;}
2+
.github-stats-card {
3+
max-width: 320px;
4+
margin: auto;
5+
width: 100%;
6+
padding: 0;
7+
background-color: #fff;
8+
box-sizing: border-box;
9+
font-family: Arial, sans-serif;
10+
display: flex;
11+
border: 1px solid #e9e9e9;
12+
flex-direction: column;
13+
flex-basis: 100%;
14+
font-size: 12px;
15+
line-height: 16px;
16+
box-shadow: 5px 10px 20px -10px rgba(0,0,0,.2);
17+
color: #24292e;
18+
19+
header {
20+
display: flex;
21+
flex-wrap: wrap;
22+
justify-content: center;
23+
align-items: center;
24+
box-sizing: border-box;
25+
margin: 0;
26+
padding: 20px 0 0;
27+
background-color: #f6f8fa;
28+
color: #24292e;
29+
30+
31+
h3 {
32+
display: block;
33+
text-align: center;
34+
width: 100%;
35+
box-sizing: border-box;
36+
font-size: 18px;
37+
font-weight: 600;
38+
padding: 0 0 20px;
39+
margin: 0;
40+
41+
a {
42+
display: inline-block;
43+
text-decoration: none;
44+
color: inherit;
45+
max-width: calc(100% - 30px);
46+
box-sizing: border-box;
47+
line-height: 24px;
48+
font-size: 18px;
49+
font-weight: 600;
50+
color: #0366d6;
51+
}
52+
}
53+
54+
h4 {
55+
display: flex;
56+
justify-content: center;
57+
width: 100%;
58+
padding: 10px 0;
59+
margin: 0;
60+
font-weight: normal;
61+
font-style: italic;
62+
font-size: 12px;
63+
line-height: 16px;
64+
background-color: #24292e;
65+
color: #fff;
66+
}
67+
68+
h5 {
69+
display: flex;
70+
width: 100%;
71+
background-color: #0366d6;
72+
color: #fff;
73+
justify-content: center;
74+
font-weight: 400;
75+
padding: 10px 0;
76+
margin: 0;
77+
box-sizing: border-box;
78+
font-size: 14px;
79+
80+
span {
81+
display: flex;
82+
flex-direction: row;
83+
flex-wrap: nowrap;
84+
margin: 0 5px;
85+
box-sizing: border-box;
86+
font-size: 13px;
87+
line-height: 18px;
88+
vertical-align: middle;
89+
90+
b { margin-right: 3px; font-size: 16px; }
91+
}
92+
}
93+
}
94+
95+
.rule {
96+
display: flex;
97+
flex-direction: column;
98+
width: calc(100% + 30px);
99+
margin: 0 -15px 10px;
100+
border: 0;
101+
border-bottom: 1px solid #efefef;
102+
}
103+
104+
ol,
105+
ul {
106+
max-width: 100%;
107+
display: flex;
108+
flex-direction: column;
109+
align-items: center;
110+
margin: 0;
111+
padding: 0 0 10px 10px;
112+
}
113+
114+
ol {
115+
list-style: none;
116+
display: flex;
117+
width: 100%;
118+
flex-direction: row;
119+
padding: 0 0 10px 0;
120+
text-align: center;
121+
justify-content: space-around;
122+
123+
li {
124+
&:first-of-type { order: 2; }
125+
&:nth-of-type(2) { order: 1; }
126+
&:last-of-type { order: 3; }
127+
}
128+
}
129+
130+
ul {
131+
list-style: none;
132+
133+
134+
li {
135+
&:last-of-type {
136+
margin-bottom: 0;
137+
}
138+
139+
b {
140+
font-size : 13px;
141+
font-family: Menlo, Monaco, monospace;
142+
}
143+
}
144+
}
145+
146+
li {
147+
margin: 5px 0;
148+
color: #24292e;
149+
150+
small {
151+
display: block;
152+
font-size: 12px;
153+
}
154+
155+
b { font-size: 13px; }
156+
}
157+
158+
p {
159+
width: 100%;
160+
text-align: center;
161+
margin: 5px auto;
162+
color: #24292e;
163+
}
164+
165+
> div {
166+
display: flex;
167+
justify-content: center;
168+
flex-wrap: wrap;
169+
padding: 10px 15px;
170+
}
171+
172+
div p {
173+
font-weight: 400;
174+
font-size: 14px;
175+
176+
b { font-weight: 400; font-size: 15px; }
177+
}
178+
179+
footer {
180+
display: flex;
181+
align-items: center;
182+
height: 100px;
183+
max-width: 100%;
184+
box-sizing: border-box;
185+
background-color: #f6f8fa;
186+
color: #24292e;
187+
188+
img {
189+
max-width: 100px;
190+
box-sizing: border-box;
191+
display:block;
192+
margin: 0 15px 0 0;
193+
}
194+
195+
section {
196+
display: flex;
197+
justify-content: flex-start;
198+
flex-wrap: wrap;
199+
padding: 10px 15px;
200+
201+
p {
202+
margin: 0;
203+
padding-bottom: 2.5px;
204+
font-size: 11px;
205+
line-height: 14px;
206+
text-align: left;
207+
color: #586069;
208+
209+
b { text-transform: uppercase; color: #586069; }
210+
}
211+
}
212+
213+
a {
214+
color: #586069;
215+
text-decoration:none;
216+
font-weight: 600;
217+
}
218+
}
219+
}

0 commit comments

Comments
 (0)