Skip to content

Commit

Permalink
Change CSS order to prevent leakages when not using encapsulation
Browse files Browse the repository at this point in the history
  • Loading branch information
Hannu Pelkonen committed Mar 27, 2015
1 parent 33c60ef commit a6e6584
Showing 1 changed file with 7 additions and 3 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

0 comments on commit a6e6584

Please sign in to comment.