Ronoix and CSS
Ronoix and CSS are both interesting technologies. Here, we have tried to best
integrate the two, while maintaining the syntax, format, and development process
for the two, while allowing tight integration with the CSS and Ronoix interfaces.
Syntax
Ronoix provides a simple and direct method for integrating CSS into a document.
(Note that CSS is only compatible with Ronoix data types, and not encapsulated data
types)
<ronoix version="1.0">
<load></load>
<meta>
</meta>
<content-type>Ronoix</content-type>
<contents css="ULS">
<text>This text is great for CSS</text>
</contents>
</ronoix>
This document, when ULS points to a CSS file, can be styled easily and with no
problems. Here is an example of the CSS that can style the above Ronoix document.
contents {color: red; font-family: Veranda}
contents text {font-weight: bold}
This simple amount of code will produce something along the lines of:
This text is great for CSS
Support
Support for the CSS and CSS2 specifications varies. Here is a list of the currently
supported features:
Selectors
- Standard type selectors: type
- Standard class selectors: .class
- Type and class selectors: type.class
- Grouped selectors: selector,selector,selector
- Selectors with IDs: type #ID; .class #ID; etc.
- Multiple classes: type.class.class...
- Descendant elements: selector selector selector...
(Note: Support is limited to only one ID)
- Child elements: selector > selector...
Units of Measurement
- Inches
- Centimeters
- Millimeters
- Points
- Picas
- Pixels
Proposed Units of Measure
- EX: the 'x-height' of the font of the object being referenced
- EM: the 'font-size' of the object being referenced; already in
place for fonts only
- Percentages: Based off of the inherited value of the type being
referenced
Shorthand
We highly recommend that you do not use shorthand. It is more difficult for the
parser to interpret and also is usually less specific. Using longhand to describe
these elements instead is a better solution.
- padding
- margin*
- font
* These properties are unavailable for Form-based elements. Only control elements
may use these properties.
Font Properties
- color
- font-size*
- font-weight**
- font-family
- font-style
* These properties only support an input as EM.
** This property only supports 'bold' as a value. All other values will be considered
bold except 'lighter' and 'normal'.
CSS Extensions
In order to make our algorithms compatible with the CSS2 selectors and inheritance,
we have implemented a number of features that provide readability and easy formatting
to selectors in CSS. Note that we have not tested these methods to work with other
CSS parsing algorithms, nor do we intend to. These modifications are designed to
work strictly within Ronoix code, and will most likely *NOT* work in other parsing
systems.
- Selector Fishing:
Selector fishing is the process of using various prefixes to modify the behavior
of the heirs of an element. For example:
content > text {}
and
content !text {}
will work the same. Here is a list of what can be replaced:
- Descendants:
Note that this method does not make any changes to the CSS specification,
but remains the shorthand method for descendant elements.
content text {}
- Children:
These elements must be directly linked, where one is contained within the
second.
content !text {}
- Adjacent Elements:
These elements must have the same parent, and be directly adjacent to each
other in the Ronoix code.
content +text {}
- Quoted Values:
By default, CSS2 (as well as CSS) bans the use of quoting values. For example,
under the current CSS/CSS2 specifications, the following CSS is invalid:
h1 {color: "red"}
The correct syntax would be:
h1 {color: red}
Our CSS parser is specifically designed to accept this, even though it is invalid.
Regardless, quotes are stripped from the ends of the values by default, eliminating
this problem.
- Underline Compatibility
Because Ronoix uses WinForms to render pages, there may at times be data
types that you need to
modify that are automatically generated, and are not documented in Ronoix. To access these,
simply find out what the true Type.ToString is for that object, and
reference it as follows:
Suppose you are modifying a divider. You would replace all '.'s in the divider type.tostring
with '_'s and place that as a type descriptor in your CSS. Ex.:
lookleft1_divider #menu {...}
Because this method would automatically erase all underscores in the type, we highly recommend that
you do not introduce any underscores into type descriptors that describe non-Ronoix objects.
HTML Conformance
Selectors
- BODY/HTML BODY
Our parser is fully able to apply the described selectors to the
<contents> element.
- Classes
HTML is a form of XML, and thus can include multiple descriptors of specific
elements (ex. class, id, etc.). Unfortunately, WinForms supports only one
descriptor per control. In order to compensate, the following items serve as
replacements:
- ID: Name
- Class: Tag
- Type: {control type}
Extensions
HTML has been extended hundreds, if not thousands of times, making it more complex for everyone overall. Ronoix,
because it is compatible with XML, is freely extensible. Thus, the CSS involved
describes XML, not a dependant language such as HTML.
Shortcomings
Though we are working constantly to improve our CSS parser, we still are exhibiting some difficulties:
Notices
Here is some information that should be known when writing in CSS for this parser.
- 'text-transform' applies effects directly to the text. Thus, it cannot be undone by setting the
value to 'none'. However, it cannot be inherited, and it cannot be forcefully inherited, either. Thus,
it is void to set its value to 'none'.
- The 'text-transform' descriptor uses the TextInfo.ToTitleCase() function of .Net. This may produce
undesirable results. It does not implement a language-specific feature, so languages like Dutch may become
undesirably capitalized.
- Our CSS parsers require more than two properties to work properly. If there are not two or more
properties, the system will freeze.