Elias Elias - 3 years ago 161
CSS Question

Google apps script, can not include css

I'm newbie at google apps script. I have tried some examples, which work fine, but I've stuck with including css file.

In my code.gs I've created include function:

function include(filename) {
return HtmlService.createHtmlOutputFromFile(filename)

As well I've created css file "Sidebar.css.html", which contains some style parameters:

.branding-below {
bottom: 56px;
top: 0;

.branding-text {
left: 7px;
position: relative;
top: 3px;

.col-contain {
overflow: hidden;

.col-one {
float: left;
width: 50%;

.logo {
vertical-align: middle;

.radio-spacer {
height: 20px;

.width-100 {
width: 100%;

In my Sidebar.html I've tried to include the css:

<?!= include('Sidebar.css.html'); ?>

which apparently didn't work. Here is result:

In this link you can see the result(I dont have enough rep. to post it, sorry): http://dl1.joxi.net/drive/0005/1191/378023/150727/371cdf01c0.jpg

What can I do about it?

Answer Source

I've changed showSidebar() to:

function showSidebar() {
var ui = HtmlService.createTemplateFromFile('Sidebar').evaluate()

Which works not only correct, but even faster due to using 'IFRAME'

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download