In Angular 2 template, always load CSS via ExtractTextPlugin (otherwise you get a bad FOUC when loading server-prerendered page)

This commit is contained in:
SteveSandersonMS
2016-03-01 00:40:37 +00:00
parent f830a5f90a
commit a5509b86e4
9 changed files with 22 additions and 32 deletions

View File

@@ -1,6 +0,0 @@
@media (max-width: 767px) {
/* On small screens, the nav menu spans the full width of the screen. Leave a space for it. */
.body-content {
padding-top: 50px;
}
}

View File

@@ -16,7 +16,6 @@ import { Counter } from '../counter/counter';
])
@ng.View({
template: require('./app.html'),
styles: [require('./app.css')],
directives: [NavMenu, router.ROUTER_DIRECTIVES]
})
export class App {

View File

@@ -1,60 +0,0 @@
.main-nav li .glyphicon {
margin-right: 10px;
}
/* Highlighting rules for nav menu items */
.main-nav li a.router-link-active,
.main-nav li a.router-link-active:hover,
.main-nav li a.router-link-active:focus {
background-color: #4189C7;
color: white;
}
/* Keep the nav menu independent of scrolling and on top of other items */
.main-nav {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1;
}
@media (min-width: 768px) {
/* On small screens, convert the nav menu to a vertical sidebar */
.main-nav {
height: 100%;
width: calc(25% - 20px);
}
.main-nav .navbar {
border-radius: 0px;
border-width: 0px;
height: 100%;
}
.main-nav .navbar-header {
float: none;
}
.main-nav .navbar-collapse {
border-top: 1px solid #444;
padding: 0px;
}
.main-nav .navbar ul {
float: none;
}
.main-nav .navbar li {
float: none;
font-size: 15px;
margin: 6px;
}
.main-nav .navbar li a {
padding: 10px 16px;
border-radius: 4px;
}
.main-nav .navbar a {
/* If a menu item's text is too long, truncate it */
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}

View File

@@ -6,8 +6,7 @@ import * as router from 'angular2/router';
})
@ng.View({
template: require('./nav-menu.html'),
directives: [router.ROUTER_DIRECTIVES],
styles: [require('./nav-menu.css')]
directives: [router.ROUTER_DIRECTIVES]
})
export class NavMenu {
}