GoFiler Legato Script Reference
Legato v 1.5d Application v 5.25a
|
Table of Contents | < < Previous | Next >> |
Chapter Eleven — SGML Functions (continued)
CSS properties can be accessed directly from an SGML Object as parameters or they can be accessed from mid-level routines that can process and manage CSS data. The CSS functions treat the data within an element as a CSS declaration or an array of CSS property-value pairs.
An important consideration for CSS processing is the use of shorthand notation. The SGML Object always prefers to write in CSS shorthand while properties are always stored in their most basic form. For example:
font: bold 9pt Courier New, Courier, Monospace
will be store as:
font-weight: bold
font-size: 9pt
font-family: Courier New, Courier, Monospace
When writing, the shorthand version will be rendered.
With this group of functions, there are two methods of accessing and changing CSS: via a declaration string or using property arrays. A an example of a declaration string:
margin: 0; font: bold 9pt Courier New, Courier, Monospace; border: Red 1pt solid
As array entries (assume ‘a’ is a single-dimension string array):
a["margin-top"] = "0";
a["margin-right"] = "0";
a["margin-bottom"] = "0";
a["margin-left"] = "0";
a["font-wieght"] = "bold";
a["font-size"] = "9pt";
a["font-family"] = "Courier New, Courier, Monospace";
a["border-top-color"] = "Red";
a["border-top-width"] = "1pt";
a["border-top-style"] = "solid";
a["border-right-color"] = "Red";
a["border-right-width"] = "1pt";
a["border-right-style"] = "solid";
a["border-bottom-color"] = "Red";
a["border-bottom-width"] = "1pt";
a["border-bottom-style"] = "solid";
a["border-left-color"] = "Red";
a["border-left-width"] = "1pt";
a["border-left-style"] = "solid";
The ordering of the array can be arbitrary. Property/key name case is always lower. Values are always represented in string form. Use the SGMLStringToValue, SGMLValueToString and related functions to convert to and from PVALUE form.
Unlike low-level SGML functions, mid level CSS functions are sensitive to data errors and will remove erroneous or unsupported data.
Mid Level Functions:
Related Low-Level CSS Functions (covered in other sections):
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.