Skip to content

Commit a81e5e3

Browse files
committed
Merge pull request CodeByZach#130 from HubSpot/themes-in-colors
Produce theme files in 10 colors
2 parents 2f02be7 + 5f22bd4 commit a81e5e3

File tree

142 files changed

+11373
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+11373
-10
lines changed

Gruntfile.coffee

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,36 @@ fs = require('fs')
33

44
ThemeUtils = require('./docs/lib/themes.coffee')
55

6+
themeColors =
7+
black: '#000000'
8+
white: '#ffffff'
9+
silver: '#d6d6d6'
10+
red: '#ee3148'
11+
orange: '#eb7a55'
12+
yellow: '#fcd25a'
13+
green: '#22df80'
14+
blue: '#2299dd'
15+
pink: '#e90f92'
16+
purple: '#7c60e0'
17+
618
module.exports = (grunt) ->
719
grunt.registerTask 'themes', 'Compile the pace theme files', ->
820
done = @async()
921

1022
options = grunt.config('themes')
1123

1224
grunt.file.glob options.src, (err, files) ->
13-
for file in files
14-
body = ThemeUtils.compileTheme fs.readFileSync(file).toString()
25+
for colorName, color of themeColors
26+
for file in files
27+
body = ThemeUtils.compileTheme fs.readFileSync(file).toString(), {color}
1528

16-
body = "/* This is a compiled file, you should be editing the file in the templates directory */\n" + body
29+
body = "/* This is a compiled file, you should be editing the file in the templates directory */\n" + body
1730

18-
name = Path.basename file
19-
name = name.replace '.tmpl', ''
20-
path = Path.join options.dest, name
31+
name = Path.basename file
32+
name = name.replace '.tmpl', ''
33+
path = Path.join options.dest, colorName, name
2134

22-
fs.writeFileSync path, body
35+
fs.writeFileSync path, body
2336

2437
done()
2538

install.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
{
99
"type": "style",
10-
"src": "./themes/pace-theme-{{ options.theme }}.css"
10+
"src": "./themes/{{ options.color }}/pace-theme-{{ options.theme }}.css"
1111
}
1212
]
1313
},
@@ -16,8 +16,8 @@
1616
"color": {
1717
"title": "Color",
1818
"type": "string",
19-
"format": "color",
20-
"default": "auto"
19+
"enum": ["black", "white", "silver", "red", "orange", "yellow", "green", "blue", "pink", "purple"],
20+
"default": "blue"
2121
},
2222
"theme": {
2323
"title": "Theme",
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/* This is a compiled file, you should be editing the file in the templates directory */
2+
.pace {
3+
-webkit-pointer-events: none;
4+
pointer-events: none;
5+
-webkit-user-select: none;
6+
-moz-user-select: none;
7+
user-select: none;
8+
}
9+
10+
.pace-inactive {
11+
display: none;
12+
}
13+
14+
.pace .pace-progress {
15+
background-color: #000000;
16+
position: fixed;
17+
z-index: 2000;
18+
top: 0;
19+
left: 0;
20+
height: 12px;
21+
overflow: hidden;
22+
23+
-webkit-transition: width 1s;
24+
-moz-transition: width 1s;
25+
-o-transition: width 1s;
26+
transition: width 1s;
27+
}
28+
29+
.pace .pace-progress-inner {
30+
position: absolute;
31+
top: 0;
32+
left: 0;
33+
right: -32px;
34+
bottom: 0;
35+
36+
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.2)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.2)), color-stop(0.75, rgba(255, 255, 255, 0.2)), color-stop(0.75, transparent), to(transparent));
37+
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
38+
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
39+
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
40+
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
41+
-webkit-background-size: 32px 32px;
42+
-moz-background-size: 32px 32px;
43+
-o-background-size: 32px 32px;
44+
background-size: 32px 32px;
45+
46+
-webkit-animation: pace-stripe-animation 500ms linear infinite;
47+
-moz-animation: pace-stripe-animation 500ms linear infinite;
48+
-ms-animation: pace-stripe-animation 500ms linear infinite;
49+
-o-animation: pace-stripe-animation 500ms linear infinite;
50+
animation: pace-stripe-animation 500ms linear infinite;
51+
}
52+
53+
@-webkit-keyframes pace-stripe-animation {
54+
0% { -webkit-transform: none; transform: none; }
55+
100% { -webkit-transform: translate(-32px, 0); transform: translate(-32px, 0); }
56+
}
57+
@-moz-keyframes pace-stripe-animation {
58+
0% { -moz-transform: none; transform: none; }
59+
100% { -moz-transform: translate(-32px, 0); transform: translate(-32px, 0); }
60+
}
61+
@-o-keyframes pace-stripe-animation {
62+
0% { -o-transform: none; transform: none; }
63+
100% { -o-transform: translate(-32px, 0); transform: translate(-32px, 0); }
64+
}
65+
@-ms-keyframes pace-stripe-animation {
66+
0% { -ms-transform: none; transform: none; }
67+
100% { -ms-transform: translate(-32px, 0); transform: translate(-32px, 0); }
68+
}
69+
@keyframes pace-stripe-animation {
70+
0% { transform: none; transform: none; }
71+
100% { transform: translate(-32px, 0); transform: translate(-32px, 0); }
72+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* This is a compiled file, you should be editing the file in the templates directory */
2+
.pace {
3+
-webkit-pointer-events: none;
4+
pointer-events: none;
5+
-webkit-user-select: none;
6+
-moz-user-select: none;
7+
user-select: none;
8+
}
9+
10+
.pace.pace-inactive .pace-progress {
11+
display: none;
12+
}
13+
14+
.pace .pace-progress {
15+
position: fixed;
16+
z-index: 2000;
17+
top: 0;
18+
right: 0;
19+
height: 5rem;
20+
width: 5rem;
21+
}
22+
23+
.pace .pace-progress:after {
24+
display: block;
25+
position: absolute;
26+
top: 0;
27+
right: .5rem;
28+
content: attr(data-progress-text);
29+
font-family: "Helvetica Neue", sans-serif;
30+
font-weight: 100;
31+
font-size: 5rem;
32+
line-height: 1;
33+
text-align: right;
34+
color: rgba(0, 0, 0, 0.19999999999999996);
35+
}

0 commit comments

Comments
 (0)