January 28, 2015

Filed under: HTML and CSS,Sciter — Andrew @ 10:53 am

In Sciter <frame> element may have content-style attribute defined.

That content-style attribute takes URL of style sheet that gets applied on top of existing styles of the document:

<frame src="some-child.htm" content-style="content.css" />

That content.css gets appended to the list of other styles of the some-child.htm as if that document has <link rel="stylesheet" type="text/css" href="content.css"> at the end:

<html>
<head>
  <style>
    ... local styles ...
  </style>
</head>
<body>
   ... local content ...
</body>
 <link rel="stylesheet" type="text/css" href="content.css">
</html>

So when host document wants:

  1. to customize rendering of child document in the frame
  2. and/or inject some scripting behaviors in it

it can provide its own content.css file without the need of that child element modification.

Sciter SDK built-in document browser is an example of content-style usage:

{sciter-sdk]/doc/main.htm defines content frame as:

<frame #content src="content/preface.htm" content-style="styles/content.css"/>

so each document loaded into the frame gets {sciter-sdk}/doc/styles/content.css applied to its content

Sciter article on CodeProject

January 7, 2015

Filed under: How-to,Sciter — Andrew @ 10:30 am

Sciter clock

I’ve published Sciter technology introduction article on CodeProject with the brief description of samples included in SDK.