Group Abstract Group Abstract

Message Boards Message Boards

0
|
19.4K Views
|
4 Replies
|
6 Total Likes
View groups...
Share
Share this post:

How to link CSS file to deployed Wolfram Cloud webpage

Posted 10 years ago
Attachments:
4 Replies

there is a better solution documented under ExportForm

In[11]:= css = CloudDeploy[ExportForm["body {background:red}", {"String", "text/css"}]]
Out[11]= CloudObject["https://www.wolframcloud.com/objects/efed42fb-fd69-42c1-985d-e141b0d698cf"]

In[13]:= Lookup[URLRead[css, "Headers"], "content-type"]
Out[13]= "text/css;charset=utf-8"

There is no good way to do this yet (I am working on a suggestion to get this designed/implemented).

But here is a possible way to do it (undocumented and may stop working at any time):

CopyFile[CloudObject["file.css"], CloudObject["file.css"], "MIMEType" -> "text/css"]

Basically this copies the file to itself and uses the "MIMEType" option that CopyFile happens to support.

POSTED BY: Arnoud Buzing

Arnoud, Thank you for this (temp) solution. This allows us to put a company style into the app we designed.

Kind regards, Pieter

Note: The documentation on HTML explains there is a Export[] function with a setting "CSS" -> "file.css". I could no get it work. Please advise?

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard