Skip to content

Commit

Permalink
Merge pull request #532 from hannu/change-css-order
Browse files Browse the repository at this point in the history
Change CSS order to prevent leakages when not using encapsulation
  • Loading branch information
cyberixae committed Mar 27, 2015
2 parents fe143b9 + ca29c30 commit 019c4cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 7 additions & 3 deletions lib/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<meta charset="UTF-8">
<link rel="icon" href="assets/img/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" data-noreload href="{{{appRoot}}}/css/app.css">
<link rel="stylesheet" type="text/css" href="{{{appRoot}}}/styleguide_at_rules.css">
<script>
(function() {
'use strict';
Expand All @@ -16,17 +14,23 @@
],
head = document.querySelector('head');

function addCssLink(href) {
function addCssLink(href, options) {
var link = document.createElement('link');
link.setAttribute('rel', 'stylesheet');
link.setAttribute('type', 'text/css');
link.setAttribute('href', href);
if (options && options.noReload) {
link.setAttribute('data-noreload', true);
}
head.appendChild(link);
}

if (typeof head.createShadowRoot !== 'function') {
userStyleFiles.forEach(addCssLink);
}

addCssLink('{{{appRoot}}}/styleguide_at_rules.css');
addCssLink('{{{appRoot}}}/css/app.css', {noReload: true});
}());
</script>
<script type="text/ng-template" id="userStyles.html">
Expand Down
5 changes: 4 additions & 1 deletion lib/app/sass/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ h4.sg,
h5.sg {
@include default-font;
font-family: $primary-font;
font-weight: inherit;
font-weight: normal;
font-style: normal;
line-height: 1.2;
margin: 1.414em 0 .5em;
color: #444;
Expand Down Expand Up @@ -398,6 +399,7 @@ $mobile: new-breakpoint(max-width 768px);

h1 {
font-family: $secondary-font;
font-style: normal;
font-size: 1.8em;
font-weight: 100;
line-height: $header-height;
Expand Down Expand Up @@ -516,6 +518,7 @@ $mobile: new-breakpoint(max-width 768px);

.sg.side-nav-toggle {
font-family: $secondary-font;
font-style: normal;

position: absolute;
top: 2.0em;
Expand Down

0 comments on commit 019c4cb

Please sign in to comment.