CSS is now embedded in simulator.js

This commit is contained in:
Youen Toupin 2021-10-12 23:53:52 +02:00
parent 777ba63322
commit 4895ac2bb4
5 changed files with 22 additions and 3 deletions

View File

@ -30,6 +30,9 @@ function runSimulation(parameters: SimulationParameters): Simulator.SimulationRe
}
document.addEventListener('DOMContentLoaded', function() {
// Load CSS
document.getElementsByTagName('head')[0].innerHTML += (<any>window)['simulator.css'];
let container = document.getElementById('simulator');
// Insert HTML code in the container

View File

@ -26,3 +26,19 @@
@import "app.scss";
}
// Integration in a wordpress page
body.page {
#simulator {
width: 100%;
max-width: 100%;
button.delete {
padding: 0;
}
.select:not(.is-multiple):not(.is-loading)::after {
border: none; // wordpress has its own icon for select elements
}
}
}

View File

@ -84,3 +84,4 @@ let intermediateDir = toolsDir + "/../.intermediate";
embedHtml(srcDir+'/simulator.html', intermediateDir+'/simulator.html.ts');
embedSvg(dataDir+'/climate-zones-map.svg', intermediateDir+'/climate-zones-map.svg.ts');
embedCsv(dataDir+'/climate-zones-data.csv', intermediateDir+'/climate-zones-data.ts');
embedCss(intermediateDir+'/simulator.css', intermediateDir+'/simulator.css.ts');

View File

@ -7,8 +7,8 @@ let content = ['./*.html'];
let css = ['../.intermediate/simulator.css'];
let options = {
output: '../www/simulator.css',
whitelist: ['is-multiple', 'is-loading', 'is-narrow', 'is-active', 'climate-zone', 'grid-recharge', 'is-max-desktop', 'is-max-widescreen', 'line'],
output: '../.intermediate/simulator.css',
whitelist: ['is-multiple', 'is-loading', 'is-narrow', 'is-active', 'climate-zone', 'grid-recharge', 'is-max-desktop', 'is-max-widescreen', 'line', 'page'],
minify: false,
info: false
};

View File

@ -3,7 +3,6 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="simulator.css">
<style>
html, body {