Skip to content

Commit 58d4bac

Browse files
committed
fix(client:css): fix vanilla CSS, remove deprecated inject:css task
1 parent 3b3e4b5 commit 58d4bac

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

templates/app/client/app/app(css).css

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
<% if (filters.bootstrap) { %>
1+
<%_ if (filters.bootstrap) { -%>
2+
@import '~bootstrap/dist/css/bootstrap.css';
3+
<%_ if(filters.oauth) { -%>
4+
@import '~bootstrap-social/bootstrap-social.css';
5+
<%_ }} -%>
26
/**
37
* Bootstrap Fonts
48
*/
@@ -10,7 +14,10 @@
1014
url('/assets/fonts/bootstrap/glyphicons-halflings-regular.woff') format('woff'),
1115
url('/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf') format('truetype'),
1216
url('/assets/fonts/bootstrap/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
13-
}<% } %>
17+
}
18+
19+
<%_ } -%>
20+
@import '~font-awesome/css/font-awesome.css';
1421

1522
/**
1623
*Font Awesome Fonts
@@ -44,3 +51,12 @@
4451
max-width: 730px;
4552
}
4653
}<% } %>
54+
55+
/* Component styles are injected through gulp */
56+
/* inject:css */
57+
@import 'admin/admin.css';
58+
@import 'main/main.css';
59+
@import '../components/footer/footer.css';
60+
@import '../components/modal/modal.css';
61+
@import '../components/oauth-buttons/oauth-buttons.css';
62+
/* endinject */

templates/app/gulpfile.babel.js

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -199,32 +199,19 @@ gulp.task('env:prod', () => {
199199
********************/
200200

201201
gulp.task('inject', cb => {
202-
runSequence(['inject:css'<% if(!filters.css) { %>, 'inject:<%= styleExt %>'<% } %>], cb);
202+
runSequence(['inject:<%= styleExt %>'], cb);
203203
});
204204

205-
gulp.task('inject:css', () => {
206-
return gulp.src(paths.client.mainView)
207-
.pipe(plugins.inject(
208-
gulp.src(`${clientPath}/{app,components}/**/*.css`, {read: false})
209-
.pipe(plugins.sort()),
210-
{
211-
starttag: '<!-- injector:css -->',
212-
endtag: '<!-- endinjector -->',
213-
transform: (filepath) => '<link rel="stylesheet" href="' + filepath.replace(`/${clientPath}/`, '').replace('/.tmp/', '') + '">'
214-
}))
215-
.pipe(gulp.dest(clientPath));
216-
});<% if(!filters.css) { %>
217-
218205
gulp.task('inject:<%= styleExt %>', () => {
219206
return gulp.src(paths.client.mainStyle)
220207
.pipe(plugins.inject(
221208
gulp.src(_.union(paths.client.styles, ['!' + paths.client.mainStyle]), {read: false})
222209
.pipe(plugins.sort()),
223210
{
224-
<%_ if(filters.stylus) { _%>
225-
starttag: '/* inject:styl */',
211+
<%_ if(filters.stylus || filters.css) { -%>
212+
starttag: '/* inject:<%= styleExt %> */',
226213
endtag: '/* endinject */',
227-
<%_ } _%>
214+
<%_ } -%>
228215
transform: (filepath) => {
229216
let newPath = filepath
230217
.replace(`/${clientPath}/app/`, '')
@@ -235,7 +222,7 @@ gulp.task('inject:<%= styleExt %>', () => {
235222
}
236223
}))
237224
.pipe(gulp.dest(`${clientPath}/app`));
238-
});<% } %>
225+
});
239226

240227
gulp.task('webpack:dev', function() {
241228
const webpackDevConfig = makeWebpackConfig({ DEV: true });

0 commit comments

Comments
 (0)