Skip to content

Commit

Permalink
Reduce dependence on material-icons
Browse files Browse the repository at this point in the history
Check in a subset of Material Icons we care about, removing the need for
the dependency on Material Icons from npm (which was > 350 MB).

```
$ du -d 1 -h node_modules | grep M
 28M	node_modules/@ReactiveX
2.2M	node_modules/babel-cli
2.2M	node_modules/babel-core
2.2M	node_modules/babel-generator
2.1M	node_modules/babel-helper-builder-react-jsx
2.1M	node_modules/babel-helper-define-map
2.1M	node_modules/babel-helper-regex
2.1M	node_modules/babel-plugin-transform-es2015-block-scoping
6.9M	node_modules/babel-polyfill
8.7M	node_modules/babel-register
1.0M	node_modules/babel-runtime
2.1M	node_modules/babel-template
2.3M	node_modules/babel-traverse
2.2M	node_modules/babel-types
2.4M	node_modules/cheerio
2.6M	node_modules/codemirror
4.2M	node_modules/core-js
2.9M	node_modules/electron-compile
2.8M	node_modules/electron-compilers
109M	node_modules/electron-prebuilt
3.3M	node_modules/es5-ext
1.1M	node_modules/escope
2.2M	node_modules/eslint
7.2M	node_modules/fsevents
4.3M	node_modules/less
4.4M	node_modules/lodash
2.3M	node_modules/lodash-es
1.6M	node_modules/mocha
2.7M	node_modules/react
9.3M	node_modules/source-code-pro
8.6M	node_modules/source-sans-pro
 10M	node_modules/typescript
2.5M	node_modules/zmq
292M	node_modules
```
  • Loading branch information
rgbkrk committed Apr 9, 2016
1 parent aea463c commit 4c8a840
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
*.woff filter=lfs diff=lfs merge=lfs -text
*.eot filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.ijmap filter=lfs diff=lfs merge=lfs -text
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"enchannel-zmq-backend": "^1.0.1",
"immutable": "^3.7.6",
"kernelspecs": "^1.0.1",
"material-design-icons": "^2.2.0",
"normalize.css": "^4.0.0",
"react": "^15.0.1",
"react-code-mirror": "^3.0.6",
Expand Down
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
9 changes: 9 additions & 0 deletions src/notebook/fonts/material-design-icons/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The recommended way to use the Material Icons font is by linking to the web font hosted on Google Fonts:

```html
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
```

Read more in our full usage guide:
http://google.github.io/material-design-icons/#icon-font-for-the-web
38 changes: 38 additions & 0 deletions src/notebook/fonts/material-design-icons/material-icons.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(MaterialIcons-Regular.eot); /* For IE6-8 */
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(MaterialIcons-Regular.woff2) format('woff2'),
url(MaterialIcons-Regular.woff) format('woff'),
url(MaterialIcons-Regular.ttf) format('truetype');
}

.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px; /* Preferred icon size */
display: inline-block;
width: 1em;
height: 1em;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;

/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;

/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;

/* Support for IE. */
font-feature-settings: 'liga';
}
2 changes: 1 addition & 1 deletion src/notebook/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="../../node_modules/codemirror/addon/hint/show-hint.css"/>
<link rel="stylesheet" href="../../node_modules/source-sans-pro/source-sans-pro.css"/>
<link rel="stylesheet" href="../../node_modules/source-code-pro/source-code-pro.css"/>
<link rel="stylesheet" href="../../node_modules/material-design-icons/iconfont/material-icons.css"/>
<link rel="stylesheet" href="./fonts/material-design-icons/material-icons.css"/>
<link rel="stylesheet" href="./styles/cm-composition.css"/>
<link rel="stylesheet" href="./styles/main.css"/>
</head>
Expand Down

0 comments on commit 4c8a840

Please sign in to comment.