Skip to content

Commit 2c5baef

Browse files
committed
Merge pull request #26 from codeschool/svg_icons
Set up SVG icon system
2 parents 20ea1cf + bc2e848 commit 2c5baef

23 files changed

Lines changed: 129 additions & 18 deletions

Gruntfile.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = function(grunt) {
2+
3+
grunt.loadNpmTasks('grunt-svgstore');
4+
5+
grunt.initConfig({
6+
7+
svgstore: {
8+
'default': {
9+
options: {
10+
cleanup: ['fill'],
11+
includeTitleElement: false
12+
},
13+
files: {
14+
'public/images/icons/icons.svg': ['public/images/icons/icon-*.svg']
15+
}
16+
}
17+
}
18+
19+
});
20+
21+
grunt.registerTask('default', ['svgstore']);
22+
23+
};

app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ app.use(function(err, req, res, next) {
6868
module.exports = app;
6969

7070
// Set absolute paths for partials
71-
app.locals.basedir = path.join(__dirname, 'views');
71+
app.locals.basedir = path.join(__dirname, '');

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
"express": "~4.11.1",
1818
"express-session": "^1.10.2",
1919
"feedparser": "^0.19.2",
20+
"grunt": "^0.4.5",
21+
"grunt-svgstore": "^0.5.0",
2022
"jade": "~1.9.1",
2123
"mailchimp-api": "^2.0.7",
2224
"morgan": "~1.5.1",
Lines changed: 1 addition & 0 deletions
Loading

public/images/icons/icons.svg

Lines changed: 1 addition & 0 deletions
Loading

public/stylesheets/application.css

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,16 @@ td, th {
345345
margin: 0;
346346
padding: 0; }
347347

348+
.srt {
349+
border: 0;
350+
clip: rect(0 0 0 0);
351+
height: 1px;
352+
margin: -1px;
353+
overflow: hidden;
354+
padding: 0;
355+
position: absolute;
356+
width: 1px; }
357+
348358
@font-face {
349359
font-family: 'OpenSans';
350360
font-style: normal;
@@ -410,9 +420,10 @@ a {
410420
a:active, a:focus, a:hover {
411421
color: #caa019; }
412422

413-
img {
423+
img, svg {
414424
height: auto;
415-
max-width: 100%; }
425+
max-width: 100%;
426+
vertical-align: middle; }
416427

417428
.bucket--flag {
418429
display: table; }
@@ -426,7 +437,7 @@ img {
426437
.bucket-media {
427438
float: left;
428439
margin-right: 1.25em; }
429-
.bucket-media > img {
440+
.bucket-media > img, .bucket-media svg {
430441
display: block;
431442
max-width: none; }
432443

@@ -442,7 +453,7 @@ img {
442453
.bucket-media {
443454
float: left;
444455
margin-right: 1.25em; }
445-
.bucket-media > img {
456+
.bucket-media > img, .bucket-media svg {
446457
display: block;
447458
max-width: none; }
448459

@@ -799,6 +810,9 @@ img {
799810
.header-nav-item--btn:active, .header-nav-item--btn:focus, .header-nav-item--btn:hover {
800811
border: 0; }
801812

813+
.icon {
814+
fill: currentColor; }
815+
802816
.label {
803817
color: #6d7c79;
804818
display: block;

public/stylesheets/application.min.css

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

public/stylesheets/application.sass

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
// -------------------------------------
3535
3636
@import 'structures/header'
37+
@import 'structures/icon'
3738
@import 'structures/label'
3839

3940
// -------------------------------------

public/stylesheets/components/_bucket.sass

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@
4949
float: left
5050
margin-right: $b-space
5151

52-
> img
52+
> img, svg
5353
display: block
5454
max-width: none

public/stylesheets/foundation/_base.sass

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ a
6767

6868
// ----- Images ----- //
6969
70-
img
70+
img, svg
7171
height: auto
7272
max-width: 100%
73+
vertical-align: middle

0 commit comments

Comments
 (0)