Skip to content

Commit 17f154b

Browse files
committed
Budled css. Alertify css fix
1 parent ab2dda0 commit 17f154b

File tree

8 files changed

+55
-42
lines changed

8 files changed

+55
-42
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/bower_components
22
/node_modules
33
/dist
4-
openNote.bundle.js
4+
openNote.bundle.*
55
openNote.appcache
6+
webpack_files

Gruntfile.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,9 @@ module.exports = function(grunt) {
108108
master: ["index.html"]
109109
},
110110
src: [
111-
"openNote.bundle.js",
112-
"node_modules/bootstrap/dist/**/*.*",
113-
"node_modules/codemirror/**/*.css",
114-
"node_modules/alertify/**/*.css",
115-
"openNote/**/*.*",
116-
"!**/*.js", // JS Files handled webpack
117-
"!**/*.less"
111+
"openNote.bundle.*",
112+
"webpack_files/**/*.*",
113+
"openNote/**/*.html",
118114
],
119115
dest: "openNote.appcache"
120116
}

build/webpack.common.config.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
const glob = require("glob");
2+
const ExtractTextPlugin = require("extract-text-webpack-plugin");
23

34
module.exports = {
4-
entry: glob.sync("./openNote/**/*.js"),//Emulate loading all them sequentually via script tags as one did in 2015
5+
entry: glob.sync("./openNote/**/*.js"), //Emulate loading all them sequentually via script tags as one did in 2015
56
output: {
67
filename: "./openNote.bundle.js"
78
},
@@ -12,11 +13,24 @@ module.exports = {
1213
},
1314
devtool: "#eval-source-map",
1415
module: {
15-
rules: [
16+
rules: [{
17+
test: /\.css$/,
18+
use: ExtractTextPlugin.extract({
19+
fallback: "style-loader",//css-loader and style-loader used
20+
use: "css-loader"
21+
})
22+
},
1623
{
17-
test: /\.exec\.js$/,//So we dont have to use concat too
24+
test: /\.exec\.js$/, //So we dont have to use concat too
1825
use: ["script-loader"]
26+
},
27+
{
28+
test: /\.(png|woff|woff2|eot|ttf|svg)$/,//Need url-loader and file-loader for this
29+
loader: "url-loader?limit=100000&name=./webpack_files/[hash].[ext]"
1930
}
2031
]
2132
},
33+
plugins: [
34+
new ExtractTextPlugin("openNote.bundle.css"),
35+
]
2236
};

build/webpack.prod.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const Uglify = require("uglifyjs-webpack-plugin");
33
let baseConfig = require("./webpack.common.config.js");
44

55
baseConfig.devtool = "#source-map";//Helps with size
6-
baseConfig.plugins = (module.exports.plugins || []).concat([
6+
baseConfig.plugins = (baseConfig.plugins || []).concat([
77
new webpack.DefinePlugin({
88
"process.env": {
99
NODE_ENV: "\"production\""

index.html

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,7 @@
1212
<title>OpenNote</title>
1313

1414
<!-- Style -->
15-
<link rel="stylesheet" type="text/css" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
16-
<link rel="stylesheet" href="node_modules/alertify/themes/alertify.core.css">
17-
<link rel="stylesheet" href="node_modules/codemirror/lib/codemirror.css">
18-
<link rel="stylesheet" href="node_modules/codemirror/theme/material.css">
19-
20-
<!-- Theme -->
21-
<link rel="stylesheet" type="text/css" href="openNote/style/invert/light/alertify.css">
22-
<link rel="stylesheet" type="text/css" href="openNote/style/invert/light/style.css">
23-
24-
<link rel="stylesheet" type="text/css" href="openNote/style/animations.css">
15+
<link rel="stylesheet" type="text/css" href="openNote.bundle.css">
2516

2617
<!-- Scripts -->
2718
<script src="openNote.bundle.js"></script>

openNote/openNote.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,15 @@ import "script-loader!../node_modules/angular-route/angular-route.min.js";
99
import "script-loader!../node_modules/angular-sanitize/angular-sanitize.min.js";
1010
import "script-loader!../node_modules/alertify/lib/alertify.min.js";
1111

12-
1312
//Style
13+
import "../node_modules/bootstrap/dist/css/bootstrap.min.css";
14+
import "../node_modules/alertify/themes/alertify.core.css";
15+
import "../node_modules/codemirror/lib/codemirror.css";
16+
import "../node_modules/codemirror/theme/material.css";
17+
import "../openNote/style/invert/light/alertify.css";
18+
import "../openNote/style/invert/light/style.css";
19+
import "../openNote/style/animations.css";
20+
1421

1522
/**
1623
* @author - Jake Liscom

openNote/style/invert/alertify.less

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
* Twitter Bootstrap Look and Feel
33
* Based on http://twitter.github.com/bootstrap/
44
*/
5-
5+
66
/** offset all the other colors */
77
@offset: #000000;
8-
8+
99
.alertify,
1010
.alertify-log {
1111
font-family: inherit;
@@ -33,7 +33,7 @@
3333
}
3434
.alertify-text {
3535
color: negation(#CCC, @offset);
36-
36+
3737
padding: 8px;
3838
border: 1px solid negation(#CCC, @offset);
3939
}
@@ -61,27 +61,26 @@
6161
.alertify-button:active {
6262
position: relative;
6363
}
64-
.alertify-button-cancel,
65-
.alertify-button-cancel:hover,
66-
.alertify-button-cancel:focus,
67-
.alertify-button-cancel:active {
68-
color: negation(#CCC, @offset);
69-
}
70-
.alertify-button-cancel:hover,
71-
.alertify-button-cancel:focus,
72-
.alertify-button-cancel:active {
73-
color: negation(#000, @offset);
74-
background: negation(#fff, @offset);
75-
}
64+
7665
.alertify-button-ok,
7766
.alertify-button-ok:hover,
7867
.alertify-button-ok:focus,
79-
.alertify-button-ok:active {
68+
.alertify-button-ok:active,
69+
.alertify-button-cancel,
70+
.alertify-button-cancel:hover,
71+
.alertify-button-cancel:focus,
72+
.alertify-button-cancel:active {
73+
border: none;
8074
color: negation(#CCC, @offset);
75+
background: negation(#000, @offset);
8176
}
8277
.alertify-button-ok:hover,
8378
.alertify-button-ok:focus,
84-
.alertify-button-ok:active {
79+
.alertify-button-ok:active,
80+
.alertify-button-cancel:hover,
81+
.alertify-button-cancel:focus,
82+
.alertify-button-cancel:active {
83+
border: none;
8584
color: negation(#000, @offset);
8685
background: negation(#fff, @offset);
8786
}
@@ -99,7 +98,7 @@
9998
.alertify-log-success {
10099
color: negation(#CCC, @offset);
101100
}
102-
101+
103102
.alertify-cover {
104103
transition: opacity 1s ease-out, width 0s;
105104
background-color: negation(#555, @offset);
@@ -111,7 +110,7 @@
111110
right:0;
112111
}
113112

114-
.alertify-cover.alertify-cover-hidden{/*For animation*/
113+
.alertify-cover.alertify-cover-hidden{/*For animation*/
115114
display: block;
116115
opacity: 0;
117116
width:0;

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
},
2121
"devDependencies": {
2222
"angular-mocks": "^1.6.6",
23+
"css-loader": "^0.28.7",
24+
"extract-text-webpack-plugin": "^3.0.2",
25+
"file-loader": "^1.1.5",
2326
"grunt": "^0.4.5",
2427
"grunt-cli": "^0.1.13",
2528
"grunt-contrib-compress": "^1.1.1",
@@ -30,6 +33,8 @@
3033
"grunt-manifest": "^0.4.0",
3134
"grunt-shell": "^0.7.0",
3235
"script-loader": "^0.7.2",
36+
"style-loader": "^0.19.0",
37+
"url-loader": "^0.6.2",
3338
"webpack": "^3.8.1",
3439
"webpack-dev-server": "^2.9.5"
3540
},

0 commit comments

Comments
 (0)