Skip to content

Commit efb49df

Browse files
committed
Added LESS support
1 parent 6848ed7 commit efb49df

File tree

7 files changed

+179
-81
lines changed

7 files changed

+179
-81
lines changed

Gruntfile.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@ module.exports = function(grunt) {
1313
}
1414
},
1515
},
16+
less: {
17+
jgrowl: {
18+
files: {
19+
"jquery.jgrowl.css": "jquery.jgrowl.less"
20+
}
21+
}
22+
},
1623
cssmin: {
17-
minify: {
24+
jgrowl: {
1825
expand: true,
1926
src: 'jquery.jgrowl.css',
2027
ext: '.jgrowl.min.css'
@@ -33,18 +40,22 @@ module.exports = function(grunt) {
3340
}
3441
},
3542
watch: {
36-
files: ['<%= jshint.files %>'],
37-
tasks: ['jshint', 'qunit']
43+
scripts: {
44+
files: ['jquery.jgrowl.js', 'jquery.jgrowl.less'],
45+
tasks: ['jshint', 'less', 'cssmin', 'uglify'],
46+
options: {
47+
spawn: false,
48+
},
49+
},
3850
}
3951
});
4052

4153
grunt.loadNpmTasks('grunt-contrib-uglify');
4254
grunt.loadNpmTasks('grunt-contrib-cssmin');
4355
grunt.loadNpmTasks('grunt-contrib-jshint');
4456
grunt.loadNpmTasks('grunt-contrib-watch');
57+
grunt.loadNpmTasks('grunt-contrib-less');
4558

4659
grunt.registerTask('test', ['jshint']);
47-
48-
grunt.registerTask('default', ['jshint', 'uglify', 'cssmin']);
49-
60+
grunt.registerTask('default', ['jshint', 'uglify', 'less', 'cssmin']);
5061
};

jquery.jgrowl.css

100755100644
Lines changed: 58 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,83 @@
1-
2-
/** jGrowl Styling **/
31
.jGrowl {
4-
z-index: 9999;
5-
color: #fff;
6-
font-size: 12px;
7-
position: fixed;
2+
z-index: 9999;
3+
color: #ffffff;
4+
font-size: 12px;
5+
font-family: Tahoma, "Helvetica Neue", Helvetica, Arial, sans-serif;
6+
position: fixed;
87
}
9-
108
.jGrowl.top-left {
11-
left: 0px;
12-
top: 0px;
9+
left: 0px;
10+
top: 0px;
1311
}
14-
1512
.jGrowl.top-right {
16-
right: 0px;
17-
top: 0px;
13+
right: 0px;
14+
top: 0px;
1815
}
19-
2016
.jGrowl.bottom-left {
21-
left: 0px;
22-
bottom: 0px;
17+
left: 0px;
18+
bottom: 0px;
2319
}
24-
2520
.jGrowl.bottom-right {
26-
right: 0px;
27-
bottom: 0px;
21+
right: 0px;
22+
bottom: 0px;
2823
}
29-
3024
.jGrowl.center {
31-
top: 0px;
32-
width: 50%;
33-
left: 25%;
25+
top: 0px;
26+
width: 50%;
27+
left: 25%;
3428
}
35-
36-
/** Cross Browser Styling **/
3729
.jGrowl.center .jGrowl-notification,
3830
.jGrowl.center .jGrowl-closer {
39-
margin-left: auto;
40-
margin-right: auto;
31+
margin-left: auto;
32+
margin-right: auto;
4133
}
42-
43-
.jGrowl .jGrowl-notification,
44-
.jGrowl .jGrowl-closer {
45-
background-color: #000;
46-
opacity: .85;
47-
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)";
48-
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85);
49-
zoom: 1;
50-
width: 235px;
51-
padding: 10px;
52-
margin-top: 5px;
53-
margin-bottom: 5px;
54-
font-family: Tahoma, Arial, Helvetica, sans-serif;
55-
font-size: 1em;
56-
text-align: left;
57-
display: none;
58-
border-radius: 5px;
59-
}
60-
6134
.jGrowl .jGrowl-notification {
62-
min-height: 40px;
35+
background-color: #000000;
36+
opacity: 0.85;
37+
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(85);
38+
filter: progid:DXImageTransform.Microsoft.Alpha(85);
39+
zoom: 1;
40+
width: 235px;
41+
padding: 10px;
42+
margin: 10px;
43+
text-align: left;
44+
display: none;
45+
border-radius: 5px;
46+
min-height: 40px;
6347
}
64-
65-
.jGrowl .jGrowl-notification,
66-
.jGrowl .jGrowl-closer {
67-
margin: 10px;
68-
}
69-
7048
.jGrowl .jGrowl-notification .jGrowl-header {
71-
font-weight: bold;
72-
font-size: .85em;
49+
font-weight: bold;
50+
font-size: .85em;
7351
}
74-
7552
.jGrowl .jGrowl-notification .jGrowl-close {
76-
z-index: 99;
77-
float: right;
78-
font-weight: bold;
79-
font-size: 1em;
80-
cursor: pointer;
53+
z-index: 99;
54+
float: right;
55+
font-weight: bold;
56+
font-size: 1em;
57+
cursor: pointer;
8158
}
82-
8359
.jGrowl .jGrowl-closer {
84-
padding-top: 4px;
85-
padding-bottom: 4px;
86-
cursor: pointer;
87-
font-size: .9em;
88-
font-weight: bold;
89-
text-align: center;
60+
background-color: #000000;
61+
opacity: 0.85;
62+
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(85);
63+
filter: progid:DXImageTransform.Microsoft.Alpha(85);
64+
zoom: 1;
65+
width: 235px;
66+
padding: 10px;
67+
margin: 10px;
68+
text-align: left;
69+
display: none;
70+
border-radius: 5px;
71+
padding-top: 4px;
72+
padding-bottom: 4px;
73+
cursor: pointer;
74+
font-size: .9em;
75+
font-weight: bold;
76+
text-align: center;
9077
}
91-
9278
/** Hide jGrowl when printing **/
9379
@media print {
94-
.jGrowl {
95-
display: none;
96-
}
97-
}
80+
.jGrowl {
81+
display: none;
82+
}
83+
}

jquery.jgrowl.less

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
2+
@width: 235px;
3+
@height: 40px;
4+
@backgroundColor: #000;
5+
@color: #fff;
6+
@fontSize: 12px;
7+
@fontFamily: Tahoma, "Helvetica Neue", Helvetica, Arial, sans-serif;
8+
@opacity: .85;
9+
10+
11+
.jGrowl {
12+
z-index: 9999;
13+
color: @color;
14+
font-size: @fontSize;
15+
font-family: @fontFamily;
16+
position: fixed;
17+
18+
19+
&.top-left {
20+
left: 0px;
21+
top: 0px;
22+
}
23+
24+
&.top-right {
25+
right: 0px;
26+
top: 0px;
27+
}
28+
29+
&.bottom-left {
30+
left: 0px;
31+
bottom: 0px;
32+
}
33+
34+
&.bottom-right {
35+
right: 0px;
36+
bottom: 0px;
37+
}
38+
39+
&.center {
40+
top: 0px;
41+
width: 50%;
42+
left: 25%;
43+
44+
.jGrowl-notification,
45+
.jGrowl-closer {
46+
margin-left: auto;
47+
margin-right: auto;
48+
}
49+
}
50+
51+
.notification() {
52+
background-color: @backgroundColor;
53+
opacity: @opacity;
54+
// These are for older versions of Internet Explorer that don't support opacity
55+
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=(@opacity*100));
56+
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=(@opacity*100));
57+
zoom: 1;
58+
width: @width;
59+
padding: 10px;
60+
margin: 10px;
61+
text-align: left;
62+
display: none;
63+
border-radius: 5px;
64+
}
65+
66+
.jGrowl-notification {
67+
.notification;
68+
min-height: @height;
69+
70+
.jGrowl-header {
71+
font-weight: bold;
72+
font-size: .85em;
73+
}
74+
75+
.jGrowl-close {
76+
z-index: 99;
77+
float: right;
78+
font-weight: bold;
79+
font-size: 1em;
80+
cursor: pointer;
81+
}
82+
}
83+
84+
.jGrowl-closer {
85+
.notification;
86+
padding-top: 4px;
87+
padding-bottom: 4px;
88+
cursor: pointer;
89+
font-size: .9em;
90+
font-weight: bold;
91+
text-align: center;
92+
}
93+
}
94+
95+
/** Hide jGrowl when printing **/
96+
@media print {
97+
.jGrowl {
98+
display: none;
99+
}
100+
}

jquery.jgrowl.map

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

0 commit comments

Comments
 (0)